MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
const head = document.head; | const head = document.head; | ||
// | // Book Widget | ||
const css = document.createElement('link'); | const css = document.createElement('link'); | ||
css.rel = 'stylesheet'; | css.rel = 'stylesheet'; | ||
css.href = 'https:// | css.href = 'https://craftersone.github.io/CraftersWikiComponents/widget.css'; | ||
head.appendChild(css); | head.appendChild(css); | ||
const gadget = document.createElement('script'); | const gadget = document.createElement('script'); | ||
gadget.src = 'https:// | gadget.src = 'https://craftersone.github.io/CraftersWikiComponents/widget.js'; | ||
gadget.defer = true; | gadget.defer = true; | ||
head.appendChild(gadget); | head.appendChild(gadget); | ||
}); | }); | ||
Latest revision as of 05:55, 17 March 2026
mw.loader.using('mediawiki.util', function () {
const head = document.head;
// Book Widget
const css = document.createElement('link');
css.rel = 'stylesheet';
css.href = 'https://craftersone.github.io/CraftersWikiComponents/widget.css';
head.appendChild(css);
const gadget = document.createElement('script');
gadget.src = 'https://craftersone.github.io/CraftersWikiComponents/widget.js';
gadget.defer = true;
head.appendChild(gadget);
});