Widget:costumeSwitcher: Difference between revisions
Jump to navigation
Jump to search
Extracted the md5 hash code |
swap_costume now waits for the gadgets to be loaded |
||
Line 1: | Line 1: | ||
<includeonly><script> | <includeonly><script> | ||
function swap_costume(element) { | function swap_costume(element) { | ||
var neededGadgets = [ 'gadget-md5hasher' ]; | |||
if (mw.user.options.get("gadget-chibiAnimation") == 1) { | |||
neededGadgets.push("ext.gadget.chibiAnimation"); | |||
} | |||
if (mw.user.options.get("gadget-live2dAnimation") == 1) { | |||
neededGadgets.push("ext.gadget.live2dAnimation"); | |||
} | |||
// Switch costume when everything is ready | |||
mw.loader.using(neededGadgets).then(function () { | |||
swap_costume_intern(element); | |||
}); | |||
} | |||
function swap_costume_intern(element) { | |||
var selectBox = $(element); | var selectBox = $(element); | ||