MediaWiki:Common.js: Difference between revisions
Appearance
imported>PikaJade m Protected "MediaWiki:Common.js": yeah no more of that thanks ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
No edit summary |
||
| (19 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
// | (function () { | ||
if (mw.config.get('wgNamespaceNumber') < 0) return; | |||
var title = mw.config.get('wgPageName'); // underscores already | |||
var cssPage = 'MediaWiki:' + title + '.css'; | |||
var jsPage = 'MediaWiki:' + title + '.js'; | |||
// Load page CSS | |||
mw.loader.load( | |||
mw.util.getUrl(cssPage, { action: 'raw', ctype: 'text/css' }), | |||
'text/css' | |||
); | |||
// Load page JS | |||
mw.loader.load( | |||
mw.util.getUrl(jsPage, { action: 'raw', ctype: 'text/javascript' }), | |||
'text/javascript' | |||
); | |||
})(); | |||
Latest revision as of 22:48, 11 March 2026
(function () {
if (mw.config.get('wgNamespaceNumber') < 0) return;
var title = mw.config.get('wgPageName'); // underscores already
var cssPage = 'MediaWiki:' + title + '.css';
var jsPage = 'MediaWiki:' + title + '.js';
// Load page CSS
mw.loader.load(
mw.util.getUrl(cssPage, { action: 'raw', ctype: 'text/css' }),
'text/css'
);
// Load page JS
mw.loader.load(
mw.util.getUrl(jsPage, { action: 'raw', ctype: 'text/javascript' }),
'text/javascript'
);
})();