User:Fox/tabnames.js
Appearance
< User:Fox
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. |
Documentation for this user script can be added at User:Fox/tabnames. |
// Tab name fixer (copied from User:Anomie/fix-tab-text.js, target content modified)
/* A simple javascript function to change the text in various tabs at the top of the
* page. Only tested with the monobook skin.
*/
$(function(){
var fix=function(id, text){
var el=document.getElementById(id);
if(!el) return;
for(el=el.firstChild; el && el.nodeName!='A'; el=el.nextSibling);
if(!el) return;
while(el.firstChild) el.removeChild(el.firstChild);
el.appendChild(document.createTextNode(text));
}
/* Add lines as necessary. Use the Firefox DOM inspector or some such to determine
* the appropriate IDs.
*/
fix('ca-nstab-user', 'user');
fix('ca-watch', 'watch');
fix('ca-unwatch', 'unwatch');
fix('ca-protect', 'prot');
fix('ca-move', 'move');
fix('ca-history', 'hist');
fix('ca-talk', 'talk');
fix('ca-edit', 'edit');
fix('ca-addsection', '+')
fix('pt-preferences', 'prefs');
fix('pt-watchlist', 'watchlist');
fix('pt-mytalk', 'talk');
fix('pt-mycontris', 'contribs');
fix('ca-delete', 'nuke');
});
//end tab name fixer