User:Cbrown1023/tabs.js

function userlogs { //no subpages or history if (document.title.search("/") != -1 || location.href.search(/Special:|&action=[^p]|&diff=/) !=-1) {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/w/index.php?title=Special%3ALog&type=block&user=&page=User:" + username, "blk-log", "ca-blog", "block log", ""); addTab("http://en.wikipedia.org/w/index.php?title=Special:Prefixindex&namespace=2&from=" + username, "u-space", "ca-uspace", "userspace", ""); addTab("https://tools.wmflabs.org/xtools-ec/?user=" + username + "&project=en.wikipedia.org", "e-count", "ca-editcount", "count", ""); } } //************

//************ //LAST DIFF TAB function lastdiff {   if (document.title.indexOf("Editing ") != -1 || document.getElementById('ca-history') == undefined || location.href.search(/&action=history/) !=-1) {return;} z=document.getElementById("content").childNodes; for (var n=0;n<z.length;n++) { if (z[n].className=="firstHeading") { var pname=document.title.split(' - ')[0].replace(/&/g,'%26').replace(/\\+/g, '%2B'); }   } addTab("http://en.wikipedia.org/w/index.php?title=" + pname + "&diff=cur&oldid=prev", "Last", "ca-diff", "Show most recent diff", ""); }

//************ //MAIN //************

$(Mainfast) function Mainfast {   userlogs; changelinks; navigationlinks; addtoolboxlinks; }

window.onload = Main; function Main {   lastdiff; } //END //************