User:Tholly/monobook.js

importScript('User:Tholly/Status.js');

//TEST //function addSumLink { //var page = url.match(/[?&]title=([^&]*)/; //} function shortcutsInit {   shortcutsAddLink ('Uncategorized Pages', 'Special:UncategorizedPages');  shortcutsAddLink ('Prefix Index', 'Special:PrefixIndex');  shortcutsAddLink ('Admin Noticeboard', 'WP:AN');  shortcutsAddLink ('Category Tree', 'Special:CategoryTree/Project'); }

importScript('User:AzaToth/twinkle.js'); importScript('User:Ioeth/friendly.js'); importScript('User:Lupin/recent2.js');

// // **The script below is an adaption of one from User:Gracenotes/rollback.js** //          **Please read that page for more details on the script.** // // The Differences: // -Instead of just being able to:  $user --> username // -Now there is:  $user --> username - (linked) // -And also:  $talk --> username's talk page - (also linked) // // -Another change is that there is already text in the summary box, defaulting to:  "Reverted edits by $user ($talk)." // -Finally, the link to click on next to rollback is "summary", not "sum". //

function addSumLink { var ntitle2 = document.getElementById("mw-diff-ntitle2") if (!ntitle2) return; var rbnode = getElementsByClassName(document.getElementById("mw-diff-ntitle2"), "span", "mw-rollback-link"); if (rbnode.length != 0) addRollbackSummaryLink(rbnode[0]); } function confirmRollback { var url = this.href; var user = url.match(/[?&]from=([^&]*)/); if (!user) return; var user = decodeURIComponent(user[1].replace("+", " ")); var summary = prompt("Enter a summary to use for rollback. Leave blank to use the default.\n\n'$user' will be replaced with the link to " + user + "'s userpage and '$talk' to their talk page.", "Reverted edits by $user ($talk).") if (summary == undefined) return false; else if (summary == "") return true; var finsum = summary.replace(/\$user/g, "" + user + ""); this.href += "&summary=" + encodeURIComponent(finsum.replace(/\$talk/g, "" + user + "'s talk page"));

return true; }; function addRollbackSummaryLink(rbnode) { var rblink = rbnode.getElementsByTagName("a")[0] var alink = rblink.cloneNode(true); alink.className = ""; alink.firstChild.nodeValue = "summary"; alink.onclick = confirmRollback; rbnode.insertBefore(alink, rblink.nextSibling); rbnode.insertBefore(document.createTextNode("|"), alink); } addOnloadHook(addSumLink);

//Again, from User:Gracenotes //utility function: box gets edit textarea value, box(text) sets it function box(text) { if (text) { document.getElementById("wpTextbox1").value = text; } else { return document.getElementById("wpTextbox1").value; } }

//Again, from User:Gracenotes //add (cur) link on contribution pages if (wgPageName == 'Special:Contributions' && (((lim = document.location.href.match(/[&?]limit=([^&]*)/)) && parseInt(lim[1]) < 250) || !lim)) { addOnloadHook(function {       var contribs = document.getElementById('bodyContent').getElementsByTagName('li');        var mainNode;        var aNode;        var links;        for (var i = 0, leng = contribs.length; i < leng; i++) {            links = contribs[i].getElementsByTagName('a');            mainNode = document.createElement('span');               mainNode.appendChild(document.createTextNode('(')); aNode = document.createElement('a'); aNode.href = links[1].href.replace('prev', 'cur'); aNode.appendChild(document.createTextNode('cur')); mainNode.appendChild(aNode); mainNode.appendChild(document.createTextNode(') '));           contribs[i].insertBefore(mainNode, links[2]);        }    }); }

//This scipt is very usefull, as it adds voting symbols based on what the person has written in bold as their title. //It makes the page easier to look at with the coloured symbols. //Again, from User:Gracenotes //following script based off of User:Ais523/votesymbols.js; mostly string functions modified

function lowerNoPunct(s) { return s.toLowerCase.replace(/\.|,|:|;|\+/g, ''); } addOnloadHook(function { if(wgNamespaceNumber==0 || wgPageName == "Wikipedia:Requests_for_adminship") return; //RFA is often rather long; may also add wgPageName.indexOf("Wikipedia:Articles_for_deletion/Log/") == 0  var vt= ["http://upload.wikimedia.org/wikipedia/commons/thumb/9/94/Symbol_support_vote.svg/15px-Symbol_support_vote.svg.png",  "http://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Symbol_keep_vote.svg/15px-Symbol_keep_vote.svg.png",  "http://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Symbol_oppose_vote.svg/15px-Symbol_oppose_vote.svg.png",  "http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Symbol_delete_vote.svg/15px-Symbol_delete_vote.svg.png",  "http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Symbol_neutral_vote.svg/15px-Symbol_neutral_vote.svg.png",  "http://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Symbol_merge_vote.svg/15px-Symbol_merge_vote.svg.png", "http://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Symbol_move_vote.svg/15px-Symbol_move_vote.svg.png", "http://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Symbol_redirect_vote.svg/15px-Symbol_redirect_vote.svg.png", "http://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Symbol_opinion_vote.svg/15px-Symbol_opinion_vote.svg.png", "http://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Symbol_comment_vote.svg/15px-Symbol_comment_vote.svg.png", "http://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Symbol_unsupport_vote.svg/15px-Symbol_unsupport_vote.svg.png", "http://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Symbol_question.svg/15px-Symbol_question.svg.png", "http://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Symbol_divide_vote.svg/15px-Symbol_divide_vote.svg.png", "http://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Symbol_wait.svg/15px-Symbol_wait.svg.png", "http://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Face-grin.svg/15px-Face-grin.svg.png"]; var la=[]; la['support']=0; la['endorse']=0; la['keep']=1; la['oppose']=2; la['overturn']=2; la['object']=2; la['delete']=3; la['neutral']=4; la['merge']=5; la['upmerge']=5; la['move']=6; la['rename']=6; la['userfy']=6; la['transwiki']=6; la['redirect']=7; la['opinion']=8; la['relist']=8; la['subst']=8; la['salt']=8; la['change']=8; // Note that icon 8 on the list is often used for debate-specific !votes la['comment']=9; la['comments']=9; la['update']=9; la['note']=9; la['notes']=9; la['delist']=10; la['question']=11; la['split']=12; la['wait']=13; la['bjaodn']=14; var btc=document.body.getElementsByTagName("b"); i=btc.length; while(i--) {   var j,k; j=btc[i].innerHTML.replace(/<|>|\//g, " ").split(" "); k=0; var x=""; while(k "; }     k++; }   if(x!="") btc[i].innerHTML=x+btc[i].innerHTML; } });