User:Algebraist/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin is at User:Algebraist/monobook.css. |
// logs link in toolbar
if (wgNamespaceNumber >= 0)
addOnloadHook(function(){
if ( wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk" ) {
return;
} else
{ mw.util.addPortletLink('p-tb', mw.config.get('wgServer')+mw.config.get('wgScript')+'?title=Special:Log&page='+wgPageName,
'Page logs', 't-pagelog', 'View logs for this page', '', document.getElementById('t-upload')) }
})
// add purge tab
importScript('Wikipedia:WikiProject User scripts/Scripts/Add purge to tabs');
// various userpage tabs, copied from [[Wikipedia:WikiProject User scripts/Scripts/User tabs]]
// Please leave the following line
// [[user:Where/usertabs]]
addOnloadHook(function() {
if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1) //no subpages or history
return;
if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
var username = encodeURIComponent( wgTitle );
mw.util.addPortletLink("p-cactions","http://toolserver.org/~soxred93/count/index.php?name="+ username +"&lang=en&wiki=wikipedia" , "Edit count", "ca-editcount", "Edit count from X!'s Tool");
mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=move&user=" + username, "Moves", "ca-pagemoves", "Page moves by this user");
mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=block&page=User:" + username, "Blocks", "ca-blog", "Blocks received by this user");
mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Prefixindex&from=" + username + "&namespace=2", "Userspace", "", "List of pages in this user's userspace");
}
});
// link to new pages in sidebar, plus JS and CSS at top
addOnloadHook(function(){
addPortletLink ('p-interaction', '/wiki/Special:NewPages', 'New Pages','n-newpages', 'The list of recently created pages','',document.getElementById('n-help'));
addPortletLink ('p-personal','/wiki/User:Algebraist/monobook.css','CSS','pt-css','Your custom CSS','',document.getElementById('pt-logout'));
addPortletLink ('p-personal','/wiki/User:Algebraist/monobook.js','JavaScript','pt-js','Your custom JavaScript','',document.getElementById('pt-css'));
});
// Rename edit tab
addOnloadHook(function(){ if(document.getElementById("ca-edit")){document.getElementById("ca-edit").firstChild.innerHTML = "edit";}});
// Rename discussion tab
addOnloadHook(function(){ if(document.getElementById("ca-talk")){document.getElementById("ca-talk").firstChild.innerHTML = "talk";}});
// Move search bar below interaction
addOnloadHook(function(){
var search = document.getElementById("p-search");
var parent = search.parentNode;
var tb = document.getElementById("p-tb");
parent.insertBefore(search, tb);
});
// Rename some links
addOnloadHook(function(){ if(document.getElementById("pt-mytalk")){document.getElementById("pt-mytalk").firstChild.innerHTML = "Talk";}});
addOnloadHook(function(){ if(document.getElementById("pt-preferences")){document.getElementById("pt-preferences").firstChild.innerHTML = "Preferences";}});
addOnloadHook(function(){ if(document.getElementById("pt-watchlist")){document.getElementById("pt-watchlist").firstChild.innerHTML = "Watchlist";}});
addOnloadHook(function(){ if(document.getElementById("pt-mycontris")){document.getElementById("pt-mycontris").firstChild.innerHTML = "Contributions";}});