User:Manticore/global.js

// // Editcount link for contribs if(wgCanonicalSpecialPageName == 'Contributions') addOnloadHook(editcountlink)

function editcountlink { var cs = document.getElementById('contentSub'); // poorman contribs type finder. -1 = existing user try { var ctype = cs.getElementsByTagName('a')[0].href.indexOf('User_talk'); } catch(e) { var ctype = -1; } var inputs = document.getElementsByTagName('input'); var targ; for(var i=0;i<inputs.length;i++) { if(inputs[i].name=='target') targ = inputs[i].value; } if(!targ) return

if(ctype=-1) insertContentSubContribLink('/wiki/Special:Editcount/' + targ,'Editcount') }

function insertContentSubContribLink(link,text) { var cs = document.getElementById('contentSub'); var icssep = document.createTextNode(' | '); var ics = document.createElement('a'); ics.href = link; ics.setAttribute('title', ics.href); ics.appendChild(document.createTextNode(text)); try { cs.insertBefore(icssep,cs.childNodes[cs.childNodes.length-1]); cs.insertBefore(ics,cs.childNodes[cs.childNodes.length-1]); } catch(e) { cs.appendChild(document.createTextNode('(Error: contentSub still empty! Inserting... '));   cs.appendChild(ics);  } }

// ***************************************************************** // LookupContribs link on Special:Contributions // ***************************************************************** function contribtools { var cs = document.getElementById('contentSub'); // poorman contribs type finder. -1 = existing user var ctype = cs.getElementsByTagName('a')[0].href.indexOf('User_talk');

var lulink = 'http://www.wikia.com/wiki/Special:Lookupcontribs?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((wgCanonicalSpecialPageName == 'Contributions')) addOnloadHook(contribtools)

// ***************************************************************** // Load various external scripts // ***************************************************************** function appendScript(url) { var scriptElem = document.createElement('script'); scriptElem.setAttribute('src',url); scriptElem.setAttribute('type','text/javascript'); document.getElementsByTagName('head')[0].appendChild(scriptElem); } appendScript('http://www.wikia.com/index.php?title=User:Splarka/fastdelete.js&action=raw&ctype=text/javascript&dontcountme=s') appendScript('http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js&action=raw&ctype=text/javascript&dontcountme=s')

// ***************************************************************** // Custom automatic delete buttons // ***************************************************************** // Adds customizable one-click deletion buttons to any deletable page. // Requires w:User:Splarka/fastdelete.js in appendScript; var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'Unused', 'label': 'Unused'};

// ***************************************************************** // &bot=1 on contribs pages. // ***************************************************************** function hiderollback { var botlink = document.location.href; if(botlink.indexOf('?')==-1) { botlink += '?bot=1'; } else { botlink += '&bot=1'; } addPortletLink('p-cactions', botlink, '&bot=1', 'ca-bot'); } if((wgCanonicalSpecialPageName == 'Contributions')) addOnloadHook(hiderollback)

// ***************************************************************** // Custom edit buttons // ***************************************************************** if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/3/3b/Button_template_alt.png", "speedTip": "", "tagOpen": "", "sampleText": "w:User:Manticore"}; } //