MediaWiki:Common.js: Difference between revisions
From OpenGK
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
(function(){ | ( function ( $ , mw ) { | ||
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'); // Get the list of categories for the page | var categories = mw.config.get('wgCategories'); // Get the list of categories for the page | ||
Line 10: | Line 9: | ||
console.log('yaa'); | console.log('yaa'); | ||
} | } | ||
} | }(); | ||
Revision as of 01:18, 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'); // Get the list of categories for the page
// Check if the page belongs to the desired category
if (categories && categories.includes('Pages using gadget HexConverter')) {
console.log('yaa');
}
}();