Difference between revisions of "User:Enterprisey/script-installer.js"

From Test Wiki
m (1 revision imported)
 
Line 8: Line 8:
 
     if( jsPage || document.getElementsByClassName( "scriptInstallerLink" ).length ||
 
     if( jsPage || document.getElementsByClassName( "scriptInstallerLink" ).length ||
 
             document.querySelector( "table.infobox-user-script" ) ) {
 
             document.querySelector( "table.infobox-user-script" ) ) {
         mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Enterprisey/script-installer-core.js&action=raw&ctype=text/javascript');
+
         mw.loader.load('https://testwiki.wiki/index.php?title=User:Enterprisey/script-installer-core.js&action=raw&ctype=text/javascript');
 
     }
 
     }
 
}
 
}

Latest revision as of 18:04, 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://testwiki.wiki/index.php?title=User:Enterprisey/script-installer-core.js&action=raw&ctype=text/javascript');
    }
}