MediaWiki:Monobook.js: Difference between revisions

Jump to navigation Jump to search
cleanup + removed the reskin parser hack (originally imported from Uncyclopedia) -- it's a rather nasty piece of code and you really should _not_ implement per-page CSS like that
No edit summary
(cleanup + removed the reskin parser hack (originally imported from Uncyclopedia) -- it's a rather nasty piece of code and you really should _not_ implement per-page CSS like that)
Line 52: Line 52:
ta['ca-nstab-category'] = new Array('c','View the category page');
ta['ca-nstab-category'] = new Array('c','View the category page');


{
// Redirect button in the editing toolbar on ?action=edit
//Redirect
mwCustomEditButtons[mwCustomEditButtons.length] = {
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://wikiindex.org/images/c/c8/Button_redirect.png",
'imageFile': 'http://wikiindex.org/images/c/c8/Button_redirect.png',
    "speedTip": "Redirect to another page",
'speedTip': 'Redirect to another page',
    "tagOpen": "#REDIRECT[[",
'tagOpen': '#REDIRECT[[',
    "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> */
Bureaucrats, checkuser, interwiki, Administrators
146

edits

Navigation menu