MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| (10 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
if ( | (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'
);
})();