MediaWiki:Common.js: Difference between revisions
From OpenGK
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
console.log('js test'); | console.log('js test'); | ||
if (mw.config.get('wgNamespaceNumber') === 0) { | if (mw.config.get('wgNamespaceNumber') === 0) { | ||
var categories = mw.config.get('wgCategories'); | var categories = mw.config.get('wgCategories'); | ||
if (categories && categories.includes('Pages using gadget HexConverter')) { | if (categories && categories.includes('Pages using gadget HexConverter')) { | ||
console.log('yaa'); | console.log('yaa'); | ||
mw . loader . load ( '/w/index.php?title=MediaWiki:Gadget-HexConverter.js&action=raw&ctype=text/javascript' ); | |||
} | } | ||
} | } | ||
})( jQuery , mediaWiki ); | })( jQuery , mediaWiki ); |
Revision as of 01:22, 28 December 2024
/* Any JavaScript here will be loaded for all users on every page load. */
(function($, mw) {
console.log('js test');
if (mw.config.get('wgNamespaceNumber') === 0) {
var categories = mw.config.get('wgCategories');
if (categories && categories.includes('Pages using gadget HexConverter')) {
console.log('yaa');
mw . loader . load ( '/w/index.php?title=MediaWiki:Gadget-HexConverter.js&action=raw&ctype=text/javascript' );
}
}
})( jQuery , mediaWiki );