Widget:chibiCommander: Difference between revisions
Jump to navigation
Jump to search
Different waiting pattern |
Added MediaWiki gadget loader pattern |
||
Line 1: | Line 1: | ||
<includeonly><script> | <includeonly><script> | ||
RLQ.push([' | RLQ.push(['jquery', function () { | ||
$(document).ready(function() { | $(document).ready(function() { | ||
var rendererDiv = $('#cancan'); | var rendererDiv = $('#cancan'); | ||
Line 12: | Line 12: | ||
}); | }); | ||
window.animations.PIXILoader.init().then(function() { | mw.loader.using(['ext.gadget.md5hasher', 'ext.gadget.pixiLoader', 'ext.gadget.chibiAnimation']).then(function() { | ||
window.animations.PIXILoader.init().then(function() { | |||
// Let's make sure the correct values are shown | |||
$('.commander-sim-option').first().change(); | |||
}, function(x,y,z) { | |||
console.error("Loading Spine failed"); | |||
} | rendererDiv.removeClass("loading"); | ||
); | } | ||
); | |||
}, function(x,y,z) { | |||
console.error("Loading needed libraries failed"); | |||
rendererDiv.removeClass("loading"); | |||
}); | |||
}); | }); | ||
}]); | }]); |
Revision as of 14:51, 12 November 2019