Jump to content

MediaWiki:Common.js: Difference between revisions

From Ditzy Wiki
imported>Ballswoman
No edit summary
No edit summary
Tag: Manual revert
 
(33 intermediate revisions by 8 users not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all user
(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';


Why are you looking here? What, are you a bitch boy? You don't wanna be like Asgore, do you?
    // 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'
 
    );
/*pls restrict this*/
})();

Latest revision as of 12:02, 12 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'
    );
})();