v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "User:Emi/monobook.js"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(o rite, i forgot that import script was a common.js thing)
 
(32 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/** Import module *************************************************************
+
importScript('User:Emi/clock.js');
*
+
importScript('User:Emi/newpages.js');
*  Description: Includes a raw wiki page as javascript or CSS,
+
importScript('User:Emi/colorcontrib.js');
*              used for including user made modules.
+
importScript('User:Briess/hideAnnouncements.js');
*  Maintainers: wikipedia:User:AzaToth
 
*/
 
importedScripts = {}; // object keeping track of included scripts, so a script ain't included twice
 
function importScript( page ) {
 
    if( importedScripts[page] ) {
 
        return;
 
    }
 
    importedScripts[page] = true;
 
    var url = wgScriptPath
 
            + '/index.php?title='
 
            + encodeURIComponent( page.replace( / /g, '_' ) )
 
            + '&action=raw&ctype=text/javascript';
 
    var scriptElem = document.createElement( 'script' );
 
    scriptElem.setAttribute( 'src' , url );
 
    scriptElem.setAttribute( 'type' , 'text/javascript' );
 
    document.getElementsByTagName( 'head' )[0].appendChild( scriptElem );
 
}
 
 
 
function importStylesheet( page ) {
 
    var sheet = '@import "'
 
              + wgScriptPath
 
              + '/index.php?title='
 
              + encodeURIComponent( page.replace( / /g, '_' ) )
 
              + '&action=raw&ctype=text/css";'
 
    var styleElem = document.createElement( 'style' );
 
    styleElem.setAttribute( 'type' , 'text/css' );
 
    styleElem.appendChild( document.createTextNode( sheet ) );
 
    document.getElementsByTagName( 'head' )[0].appendChild( styleElem );
 
}
 
 
 
 
 
importScript('User:Emi/Scripts/Clock.js');
 

Latest revision as of 06:16, 5 May 2010

importScript('User:Emi/clock.js');
importScript('User:Emi/newpages.js');
importScript('User:Emi/colorcontrib.js');
importScript('User:Briess/hideAnnouncements.js');