User:GHe/global.js

function contribtools { if(wgPageName!="Special:Contributions") return var ug = wgUserGroups.join(' '); var cs = document.getElementById('contentSub'); // poorman contribs type finder. -1 = existing user var ctype = cs.getElementsByTagName('a')[0].href.indexOf('User_talk');

if(ug.indexOf('staff') + ug.indexOf('checkuser') > -2) { if(ctype==-1) { var culink = '/wiki/Special:CheckUser?subuser=OK&user='; } else { var culink = '/wiki/Special:CheckUser?subipusers=OK&ip='; }   var cu1 = document.createTextNode(' | '); var cu2 = document.createElement('a'); cu2.href = culink + document.forms[0].target.value; cu2.setAttribute('title', cu2.href); cu2.appendChild(document.createTextNode('Checkuser')); cs.insertBefore(cu1,cs.childNodes[cs.childNodes.length-1]); cs.insertBefore(cu2,cs.childNodes[cs.childNodes.length-1]); }

//may need tweaking for you personally, like if(1==1) if(ug.indexOf('staff') + ug.indexOf('lookupcontribs') > -2) { var lulink = 'http://www.wikia.com/wiki/Special:Lookupcontribs?mode=normal&view=full&target='; var lu1 = document.createTextNode(' | '); var lu2 = document.createElement('a'); lu2.href = lulink + document.forms[0].target.value.replace(/_/g,'+'); lu2.setAttribute('title', lu2.href); lu2.appendChild(document.createTextNode('LookupContribs')); cs.insertBefore(lu1,cs.childNodes[cs.childNodes.length-1]); cs.insertBefore(lu2,cs.childNodes[cs.childNodes.length-1]); }

if((ug.indexOf('staff') > -1)&&(ctype!=-1)) { var mulink = 'http://www.wikia.com/wiki/Special:MultiLookup?wpIP='; var mu1 = document.createTextNode(' | '); var mu2 = document.createElement('a'); mu2.href = mulink + document.forms[0].target.value; mu2.setAttribute('title', mu2.href); mu2.appendChild(document.createTextNode('MultiLookup')); cs.insertBefore(mu1,cs.childNodes[cs.childNodes.length-1]); cs.insertBefore(mu2,cs.childNodes[cs.childNodes.length-1]); } } addOnloadHook(contribtools);