User:JPMcGrath/vector.js

From Wikipedia, the free encyclopedia
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.
function renameTab( elementID, name ) {
    var tab = document.getElementById( elementID );
    if ( !tab ) { return; }
 
    var link = tab.getElementsByTagName( 'a' )[0]
    if ( !link ) { return; }
 
    if ( skin == "vector" ) {
        link = link.getElementsByTagName( 'span' )[0];
        if ( !link ) { return; }
    }

    link.firstChild.nodeValue = name;
}

addOnloadHook( function() {
    renameTab( 'ca-talk', 'Talk' );
    renameTab( 'ca-addsection', 'New' );
    renameTab( 'ca-history', 'History' );
});