User:PrestestSP/monobook.js

importScript("User:Lupin/recent2.js"); // User:Lupin/popups.js importScript('User:Lupin/popups.js'); // Script from User:Outriggr/metadata.js document.write(''); // Helper tools mw.loader.load(            'https://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Addtabs/monobook.js'             + '&action=raw&ctype=text/javascript&dontcountme=s'); // Admin warning tools document.write(' '); // //  function aivlist(type) { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; var ip = prompt("Enter IP address", ""); var reason = prompt("Enter reason for listing", ""); t.value += "* " + reason + "--~" + "~" + "~" + "~"; f.wpSummary.value = "Listing " + ip; f.submit; }

addOnloadHook( function addaivlink {  if (document.title.indexOf("Editing Wikipedia:Administrator intervention against vandalism") != -1)  {    mw.util.addPortletLink("p-cactions", "javascript:aivlist('vandal')", "vandal", "ca-vandal", "Report a vandal", "");    mw.util.addPortletLink("p-cactions", "javascript:aivlist('ipvandal')", "ipvandal", "ca-ipvandal", "Report an ipvandal", "");  } } ); //

importScript('Wikipedia:WikiProject User scripts/Scripts/User tabs'); // History tools mw.loader.load(            'https://en.wikipedia.org/w/index.php?title=User:Voice_of_All/History/monobook.js'             + '&action=raw&ctype=text/javascript&dontcountme=s');

//

// User:Jsimlo/shortcuts.js

document.write(' ');

function shortcutsInit {

shortcutsAddLink ('Monobook Javascript', 'User:PrestestSP/monobook.js'); shortcutsAddLink ('Page Protection', 'Wikipedia:Requests for page protection '); shortcutsAddLink ('Question/Answer', 'Wikipedia:Reference desk'); shortcutsAddLink ('Admin nominees', 'Wikipedia:Requests for adminship'); shortcutsAddLink ('Welcoming newcomers', 'Special:Log/newusers'); shortcutsAddLink ('Vandalism levels', 'Template:Wdefcon‎'); shortcutsAddLink ('Testing Area', 'Wikipedia:Sandbox'); shortcutsAddLink ('Vandal Reporting', 'Wikipedia:Administrator intervention against vandalism'); shortcutsAddLink ('MotD (Nom.)', 'Wikipedia:Motto of the day/Nominations/In review'); shortcutsAddLink ('Abusive vandals', 'Wikipedia:Long term abuse'); shortcutsAddLink ('Admin discussion', 'WP:ANI');

}

//Conflicts with force edit summary script!

var scIndex = 0; var scKeys = new Array; var scValues = new Array;

function scFormSubmit { var i=0 var textArea = document.getElementById("wpTextbox1"); var text = textArea.value; while (i<scIndex) { text = text.replace(scKeys[i], scValues[i]); ++i; }  textArea.value = text; }

addOnloadHook(function {  if (document.title.indexOf("Editing ") != 0) {return;}   document.getElementById("wpSave").onclick = scFormSubmit;   document.getElementById("wpPreview").onclick = scFormSubmit;   document.getElementById("wpDiff").onclick = scFormSubmit;   //TODO: make it work with previews too! });

addOnloadHook(function {  if (document.title.indexOf("Editing ") != 0) {return;}   var textArea = document.getElementById("wpTextbox1");   var text = textArea.value;   var re = /.*/g;   var lastIndex = 0; /*   while (1) {      var textSubstr = text.substr(lastIndex);      alert(lastIndex);      alert(textSubstr); //TODO: remove      var newIndex = textSubstr.search(re);      alert("newindex:" + newIndex);      if (newIndex == -1) {	 break;      }      lastIndex += newIndex+1;*/      text = text.replace(re, function(str, p1, p2, offset, s) { //	   alert("In replacement function"); if (p1 == p2) { var newString = "-" + p1 + ""; scKeys[scIndex] = newString; scValues[scIndex] = str; ++scIndex; return newString; }	   else { return str; }	 });  //}   textArea.value = text; });