MediaWiki:Monobook.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
mNo edit summary
No edit summary
Line 58: Line 58:
     "tagClose": "]]",
     "tagClose": "]]",
     "sampleText": "Destination"}
     "sampleText": "Destination"}
}
/* New reskin parser script, from http://uncyclopedia.org/wiki/MediaWiki:Uncyclopedia.js :
1) Add the page title and namespace exactly ("Name space:Page name") as new skin, use
spaces *NOT* underscores: ("Main Page": "", should be first line). The next parameter
is optionally an existing "MediaWiki:Skin/"-prefixed file (in which case you can skip
step 2).
2) Create MediaWiki:Skin/Name_Space:Page_Name.css and place reskin CSS content there.
*/
skin = {
    "WikiIndex:Sandbox": "SandBox.css"
}
var re = RegExp("(.*) - WikiIndex");
var matches = re.exec(document.title);
var skinName;
if (matches) {
    if (skin[matches[1]] != undefined) {
        skinName = (skin[matches[1]].length > 0) ? skin[matches[1]] : matches[1] + '.css';
        document.write('<style type="text/css">/*<![CDATA[*/ @import "/index.php?title=MediaWiki:Skin/' + skinName + '&action=raw&ctype=text/css"; /*]]>*/</style>');
    }
}
}


/* </nowiki></pre> */
/* </nowiki></pre> */
1,923

edits

Navigation menu