Jump to content

User:Dgw/changelinks.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dgw (talk | contribs) at 19:41, 14 December 2007 (updating documentation comments). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* This array is my default.
   You can override it in your own code by putting your own version
   after the include line for the script.
   Syntax should be self-explanatory, but each line is an ID and the text to use.
   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, if you wish to rename other scripts' tabs, that you add this to the
   end of your user JS page.                                                          */

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-format', text : 'Fmt' }
);

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;
    }
  }
}
 
addOnloadHook(fixtabs);