Jump to content

User:Anþony/fullcode.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.
//adds tabs to user pages
//from [[user:Where/usertabs]], [[Wikipedia:WikiProject User scripts/Scripts/User tabs]]
 addOnloadHook(function() {
   if (document.title.search("/") != -1 || document.title.search("- History -") != -1) { //no subpages or history
      return;
   }
   if (document.title.indexOf("User:") == 0 || document.title.indexOf("User talk:") == 0) {
      username_a = document.URL.match(/:.*:(.*)/);
      username=username_a[1];
      addTab("http://en.wikipedia.org/wiki/Special:Contributions/" + username, "contribs", "ca-contribs", "contribs", "");
//      addTab("http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=move&user=" + username, "page moves", "ca-pagemoves", "page moves", "");
//      addTab("http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=block&user=" + username, "block log", "ca-blog", "blog", "");
//      addTab("http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user=" + username, "edit count", "ca-kate", "kate", "");
      addTab("http://tools.wikimedia.de/~interiot/cgi-bin/Tool1/wannabe_kate?site=en.wikipedia.org&username=" + username, "edit count", "ca-editcount", "edit count", "");
   }
 });

// forces links to empty talk pages to start a new section
function talkpageplus()
{
    var talkpagelink = document.getElementById('ca-talk');
    if ((undefined != talkpagelink) && (talkpagelink.className == 'new'))
    {
        talkpagelink.firstChild.href += '&section=new';
    }
}
$(talkpageplus);