MediaWiki:Gadget-script-installer.js: Difference between revisions

From Test Wiki
Jump to navigation Jump to search
en>Enterprisey
avoid another loader call
 
m 1 revision imported
(No difference)

Revision as of 18:11, 19 February 2020

/**
 * script-installer loader
 */

if( mw.config.get( "wgNamespaceNumber" ) > 0 ) {
    var jsPage = mw.config.get( "wgPageName" ).slice( -3 ) === ".js" ||
        mw.config.get( "wgPageContentModel" ) === "javascript";
    if( jsPage || document.getElementsByClassName( "scriptInstallerLink" ).length ||
            document.querySelector( "table.infobox-user-script" ) ) {
        mw.loader.load('https://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-script-installer-core.js&action=raw&ctype=text/javascript');
    }
}