Jump to content

User:Enterprisey/short-tab-titles.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.
var t = document.title;
if( t.substring( 0, 5 )  === "User:" ) document.title = "U:" + t.substring( 5 );
else {
    var m = t.substring( 0, 9 );
    if( m === "Category:" ) document.title = "CAT:" + t.substring( 9 );
    else {
        var e = t.substring( 0, 10 );
        if( e === "Wikipedia:" ) document.title = "WP:" + t.substring( 10 );
        else if( e === "User talk:" ) document.title = "UT:" + t.substring( 10 );
        else {
            var n = t.substring ( 0, 14 );
            if ( n === "Category talk:" ) document.title = "CAT-T:" + t.substring( 14 );
            else {
                var s = t.substring( 0, 15 );
                if( s === "Wikipedia talk:" ) document.title = "WT:" + t.substring( 15 );
            }
        }
    }
}