/** Import module *************************************************************
*
* Description: Includes a raw wiki page as javascript or CSS,
* used for including user made modules.
* Maintainers: [[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( ' ', '_' ) )
+ '&action=raw&ctype=text/javascript';
mw.loader.load(url);
}
function importStylesheet( page ) {
var sheet = wgScriptPath
+ '/index.php?title='
+ encodeURIComponent( page.replace( ' ', '_' ) )
+ '&action=raw&ctype=text/css";'
mw.loader.load(sheet, 'text/css');
}
/* Test if an element has a certain class **************************************
*
|