User:Dgw/changelinks.js
Appearance
< User:Dgw
(Redirected from User:Voyagerfan5761/changelinks.js)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:Dgw/changelinks. |
/* Not compatible with Internet Explorer 6 (7 not tested) */
/* This array is my default. You can override it in your own code by putting your
own version before the include line for the script.
Syntax should be self-explanatory, but each line is an ID and the text to use.
Use: { name : 'item id', text : 'replace label with this' },
for each line you define in your own configuration, if you customize it.
'''The last line should not have a comma. If it does, the script will not function.'''
Only works on ids that contain one child with the text in it.
That means it should work on any tab in the #p-cactions div above the page content,
the links in the #p-personal bar where the log out/prefs/WL/etc. links are,
and the sidebar links (interaction, navigation, toolbox).
It is possible to rename tabs generated by other scripts, but the tabs must
have unique IDs and must be inserted by a script before this one in your user JS.
It is advised, especially if you wish to rename other scripts' tabs, that you add
this to the end of your user JS page. */
if( window.idsToRename === undefined ) {
// To temporarily disable the script, overwrite the array with idsToRename = false;
// on a line below your own definition, or just before this script's include if you
// have no custom configuration.
var idsToRename = new Array(
{ name : 'ca-nstab-help', text : 'Help' },
{ name : 'ca-nstab-main', text : 'Main' },
{ name : 'ca-nstab-special', text : 'Special' },
{ name : 'ca-nstab-project', text : 'Wikipedia' },
{ name : 'ca-nstab-user', text : 'User' },
{ name : 'ca-edit', text : 'Edit' },
{ name : 'ca-viewsource', text : 'Source' },
{ name : 'ca-history', text : 'Hist' },
{ name : 'ca-talk', text : 'Talk' },
{ name : 'ca-addsection', text : '+' },
{ name : 'pt-userpage', text : 'User' },
{ name : 'pt-mytalk', text : 'Talk' },
{ name : 'pt-preferences', text : 'Prefs' },
{ name : 'pt-watchlist', text : 'Watchlist' },
{ name : 'pt-mycontris', text : 'Contribs' }
);
}
if( window.idsToRename === false ) {
// Detect false value and create empty array, effectively disabling the script.
idsToRename = new Array();
}
function fixtabs()
{
for(i = 0; i < idsToRename.length; i++) {
if(document.getElementById(idsToRename[i].name)) {
document.getElementById(idsToRename[i].name).firstChild.innerHTML = idsToRename[i].text;
}
}
}
$(fixtabs);