From jugglingpatterns
Content deleted Content added
No edit summary |
No edit summary |
||
| (34 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
function loadModule(src) { |
|||
mw.loader.load('/load.php?modules=&only=scripts&target=js/siteswap.mjs') |
|||
const s = document.createElement('script'); |
|||
.then(function () { |
|||
s.type = 'module'; |
|||
s.src = src; |
|||
console.log(JSON.stringify(sw)); |
|||
document.head.appendChild(s); |
|||
}) |
|||
} |
|||
.catch(function (error) { |
|||
console.error("Error loading script:", error); |
|||
// deine beiden Dateien laden |
|||
}); |
|||
loadModule('/js/animation.js'); |
|||
// use by using Template:AnimateSiteswap which provides the matching html |
|||
console.log("importing animations"); |
|||
if (mw.config.get('wgNamespaceNumber') == 6 && mw.config.get('wgAction') == 'view') { |
|||
mw.loader.load('//imagemapedit.toolforge.org/ime.js'); |
|||
} |
|||
Latest revision as of 15:28, 9 January 2026
function loadModule(src) {
const s = document.createElement('script');
s.type = 'module';
s.src = src;
document.head.appendChild(s);
}
// deine beiden Dateien laden
loadModule('/js/animation.js');
// use by using Template:AnimateSiteswap which provides the matching html
console.log("importing animations");
if (mw.config.get('wgNamespaceNumber') == 6 && mw.config.get('wgAction') == 'view') {
mw.loader.load('//imagemapedit.toolforge.org/ime.js');
}