User:Vipermagi/monobook.js

// ***** ADDITIONAL LINKS *****

function addBar { document.getElementById('p-navigation').innerHTML += ' '+ ' '+  ' Admin links '+ ' '+ 'Deletion Candidates'+ 'Banning Candidates'+ 'Logs'+ 'New Pages</li>'+ '<a href=\"/Special:Newimages">New Images</a></li>'+ '<a href=\"/Special:Blockip">Block User</a></li>'+ '<a href=\"/Special:Prefixindex">Prefix Index</a></li>'+ '<a href=\"/Special:Randomredirect">Random Redirect</a></li>'+ '</ul> '; } //Close addBar addOnloadHook(addBar); //Call addBar on load

//WIKISWAP

function importScript(page, lang) { var url = wgScriptPath + '/index.php?title=' + encodeURIComponent(page.replace(' ','_')) + '&action=raw&ctype=text/javascript&dontcountme=s'; if (lang) url = 'http://' + lang + '.wikipedia.org' + url; var s = document.createElement('script'); s.src = url; s.type='text/javascript'; document.getElementsByTagName('head')[0].appendChild(s); }

//WikiSwap importScript('User:AT/wikiswap.js');

/*** hideUser for RC ***/ /*** Author: User:Dr ishmael ***/ function hideUserWrapper {   if (document.title.substring(0,14) == 'Recent changes') { var tables = document.getElementsByTagName('table'); var RCinput; for (var i = 0; i < tables.length; i++) { if (tables[i].className == 'mw-recentchanges-table') { RCinput = tables[i]; break; }       }        var uls = document.getElementsByTagName('ul'); var RCuls = new Array; for (var i = 0; i < uls.length; i++) { if (uls[i].className == 'special') { RCuls.push(uls[i]); }       }

var myInput = document.createElement('input'); myInput.type = 'text'; myInput.id = 'hideUsername'; myInput.name = 'hideUsername';

var myLabel = document.createElement('label'); myLabel.for = 'hideUsername'; myLabel.innerHTML = "Hide user:";

var mySubmit = document.createElement('input'); mySubmit.type = 'button'; mySubmit.value = 'Hide'; var newRow = RCinput.insertRow(1); var newLabelCell = newRow.insertCell(0); var newInputCell = newRow.insertCell(1);

newLabelCell.appendChild(myLabel);

newInputCell.appendChild(myInput); newInputCell.appendChild(mySubmit);

try { //IE mySubmit.attachEvent("onclick", function{ hideUser(RCuls) } ); }       catch(e) { //Mozilla mySubmit.addEventListener("click", function { hideUser(RCuls) }, false); }   } } addOnloadHook(hideUserWrapper);

function hideUser(RCuls) {   var myUser = document.getElementById('hideUsername').value; for (var j = 0; j < RCuls.length; j++) { var lis = RCuls[j].getElementsByTagName('li'); for (var i = 0; i < lis.length; i++) { var userLink; if (lis[i].innerHTML.substring(0,6) == '(diff)') userLink = lis[i].getElementsByTagName('a')[2]; else userLink = lis[i].getElementsByTagName('a')[3]; if (userLink.innerHTML == myUser) lis[i].style.display = 'none'; else lis[i].style.display = ''; }   } } /*** end hideUser ***/