User:Clientele/Protection/monobook.js

// //Helper tools

// var VoABot_on=1; //

function strip_namespace(target) { var colon = target.indexOf(':'); if (colon != -1) {     var spaces = new Array('User', 'Wikipedia', 'Image', 'MediaWiki', 'Template', 'Help', 'Category'); var ns = target.substring(0, colon); if (ns == '' || ns == 'Talk') return target.substring(colon + 1); else for (var i = 0; i < spaces.length; ++i) {           if (ns == spaces[i]                || ns == spaces[i] + '_talk') return target.substring(colon + 1); }   }

return target; } //END

function jssubmitclose { var form = document.getElementById('editform'); form.submit; } //END

//Auto-replace function oldautoreplacetxt(what,withw) { i = 1; var original = document.editform.wpTextbox1.value; if (what == ''){alert("Invalid command."); return;} else if (what == 'null'){alert("Action cancelled."); return;} else { if (withw == ''){alert("All such appearances of text will be removed.");} else if (withw.split(what)[1] != undefined) {alert("Action cancelled to avoid infinite loop."); return;} else { if (document.editform.wpTextbox1.value.split(what)[1] != undefined) { while (i == 1) { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(what, withw); if (document.editform.wpTextbox1.value.indexOf(what) != -1) {i = 1;} else {i = -1;} } } //document.editform.wpSummary.value += 'JS: Replacing text "' + what + '" with "' + withw + '" '; } } } //END

//Auto-replace function autoreplacetxt(s,r) { var original = document.editform.wpTextbox1.value; if(s) { if(!r && r != '') {alert('Action cancelled.'); return;} var txt = document.editform.wpTextbox1; txt.value = txt.value.replace(new RegExp(s, "g"), r); } } //END

// ============= test-n.js ============== function tnaddlilink(url, name) { var na = document.createElement('a'); na.setAttribute('href', url);

var txt = document.createTextNode(name); na.appendChild(txt);

var li = document.createElement('li'); li.appendChild(na); return li; } //--- //END addOnloadHook(protection_tabs); function protection_tabs { if(document.getElementById('ca-protect')) {document.getElementById('ca-protect').firstChild.innerHTML = ' protect ';} if(document.getElementById('ca-unprotect')) {document.getElementById('ca-unprotect').firstChild.innerHTML = ' un/re-protect ';} if (document.title.indexOf("Editing ") != -1) {     if(document.getElementById('ca-watch')) {document.getElementById('ca-watch').firstChild.innerHTML = '[w]';} if(document.getElementById('ca-unwatch')) {document.getElementById('ca-unwatch').firstChild.innerHTML = '[uw]';} document.getElementById('ca-talk').firstChild.innerHTML = 'Talk'; if (document.title.indexOf("Talk:") == -1 && document.title.indexOf("talk:") == -1 && document.title.indexOf("User:") == -1 && document.title.indexOf("MediaWiki:") == -1 && document.title.indexOf("Image:") == -1 && document.title.indexOf("Wikipedia:") == -1 && document.title.indexOf("Template:") == -1 && document.title.indexOf("Portal:") == -1 && document.title.indexOf("Help:") == -1 && document.title.indexOf("Main Page") == -1 && document.title.indexOf("Category:") == -1) {document.getElementById('ca-edit').firstChild.innerHTML = 'Modify';} else {document.getElementById('ca-edit').firstChild.innerHTML = 'Edit';} if(document.getElementById('ca-protect')) {document.getElementById('ca-protect').firstChild.innerHTML = ' P (off) ';} if(document.getElementById('ca-unprotect')) {document.getElementById('ca-unprotect').firstChild.innerHTML = ' P (on) ';} if (document.title.indexOf("Editing User talk:") != -1) {     addToolboxLink("javascript:usprotect","(Semi-Protect)","sem-pro"); addToolboxLink("javascript:ufprotect","(Full-Protect)","full-pro"); if(document.getElementById('ca-unprotect')) {addToolboxLink("javascript:uunprotect","(Un-Protect)","un-pro");} }   else if (document.title.indexOf("Editing User:") != -1) {       addToolboxLink("javascript:usprotect","(Semi-Protect)","sem-pro"); addToolboxLink("javascript:ufprotect","(Full-Protect)","full-pro"); if(document.getElementById('ca-unprotect')) {addToolboxLink("javascript:uunprotect","(Un-Protect)","un-pro");} } else if (document.title.indexOf("Editing Wikipedia:Requests for page protection (section)") != -1) {       var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; addlimenu(tabs, 'Sysop response', 'respfunc'); var respfunc = document.getElementById('respfunc').getElementsByTagName('ul')[0]; addlilink(respfunc, 'javascript:rfpps',"semi-pro", ''); addlilink(respfunc, 'javascript:rfppp',"full-pro", ''); addlilink(respfunc, 'javascript:rfppm',"move-pro", ''); addlilink(respfunc, 'javascript:rfpprv',"!semi-pro", ''); addlilink(respfunc, 'javascript:rfppr',"!full-pro", ''); addlilink(respfunc, 'javascript:rfppun',"un-protect", ''); addlilink(respfunc, 'javascript:rfpprus',"keep s-pro", ''); addlilink(respfunc, 'javascript:rfppruf',"keep f-pro", ''); addlilink(respfunc, 'javascript:rfppb',"block user", ''); addlilink(respfunc, 'javascript:rfppu',"other sysop", ''); } //This line removes a minor glitch else if (document.title.indexOf("Editing Wikipedia:Administrators' noticeboard/3RR (section)") != -1 || document.title.indexOf("Editing Help:Contents/Editing Wikipedia") != -1 || document.title.indexOf("Help:Contents/Editing Wikipedia") != -1) {   var nothing = 'yep!'; } else if(document.title.indexOf("Editing Talk:") != -1 || document.title.indexOf("Editing Wikipedia talk:") != -1 || document.title.indexOf("Editing Template talk:") != -1 || document.title.indexOf("Editing MediaWiki talk:") != -1 || document.title.indexOf("Editing Help talk:") != -1 || document.title.indexOf("Editing Portal talk:") != -1 || document.title.indexOf("Editing Image talk:") != -1) {     if(document.getElementById('ca-protect')) {     addToolboxLink("javascript:osprotect","(Semi-Protect)","sem-pro"); addToolboxLink("javascript:oprotect","(Full-Protect)","full-pro"); addToolboxLink("javascript:welcome","(Welcome message)","sem-pro"); }     if(document.getElementById('ca-unprotect')) {     addToolboxLink("javascript:usprotect","(Semi-Protect)","sem-pro"); addToolboxLink("javascript:ufprotect","(Full-Protect)","full-pro"); addToolboxLink("javascript:ounprotect","(Un-Protect)","un-pro"); }   } else if(document.title.indexOf("Editing Wikipedia:") != -1 || document.title.indexOf("Editing Template:") != -1 || document.title.indexOf("Editing Category:") != -1 || document.title.indexOf("Editing MediaWiki:") != -1 || document.title.indexOf("Editing Portal:") != -1 || document.title.indexOf("Editing Help:") != -1 || document.title.indexOf("Editing Image:") != -1) {     if(document.getElementById('ca-protect')) {     addToolboxLink("javascript:usprotect","(Semi-Protect)","sem-pro"); addToolboxLink("javascript:ufprotect","(Full-Protect)","full-pro"); addToolboxLink("javascript:welcome","(Welcome message)","sem-pro"); }     if(document.getElementById('ca-unprotect')) {     addToolboxLink("javascript:usprotect","(Semi-Protect)","sem-pro"); addToolboxLink("javascript:ufprotect","(Full-Protect)","full-pro"); addToolboxLink("javascript:ounprotect","(Un-Protect)","un-pro"); }   }  else {       if(document.getElementById('ca-protect')) {     addToolboxLink("javascript:sprotect","(Semi-Protect)","sem-pro"); addToolboxLink("javascript:protect","(Full-Protect)","full-pro"); }     if(document.getElementById('ca-unprotect')) {     addToolboxLink("javascript:sprotect","(Semi-Protect)","sem-pro"); addToolboxLink("javascript:protect","(Full-Protect)","full-pro"); addToolboxLink("javascript:unprotect","(Un-Protect)","un-pro"); }  }  } else if (document.title.indexOf("User:") != -1 || document.title.indexOf("User talk:") != -1) { var nothing = 'yep!'; } }

////////////////////WP:PP variables//////////////////// //This is for if people skrew with the WP:PP page layout var WPPPoffset=3; var allartsec = 9 - WPPPoffset; var movesec = 7 - WPPPoffset; var artfull = 10 - WPPPoffset; var artsemi = 11 - WPPPoffset; var otherpro = 13 - WPPPoffset; var userfull = 16 - WPPPoffset; var usersemi = 17 - WPPPoffset; var regtalk = 18 - WPPPoffset; var anontalk = 19 - WPPPoffset; var VoAsection = 12 - WPPPoffset; //End of WP:PP constants ////////////////////

function protect { var message = "Are you sure you want to full-protect this page?"; var return_value = confirm(message); if (return_value == true) { var z_check = ''; var target = document.title.split("Editing ")[1].split(" - ")[0]; jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search(/\{\{[Ss]protect|\{\{[Pp]rotect/) != -1) {var z_check = 'notag';} else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } document.editform.wpTextbox1.value = '\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+'; if (VoABot_on == 0) { window1 = window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + artfull + '&fakeaction=plist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); } window2 = window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&fakeaction=jsfprotect',             'targetname2',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); jssubmitclose; return; } if (z_check == 'notag') { alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); return; } } }

function sprotect { var message = "Are you sure you want to semi-protect this page?"; var return_value = confirm(message); if (return_value == true) { var z = ''; var target = document.title.split("Editing ")[1].split(" - ")[0]; jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search(/\{\{[Ss]protect|\{\{[Pp]rotect/) != -1) {var z_check = 'notag';} else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } document.editform.wpTextbox1.value = '\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+'; if (VoABot_on == 0) { window1 = window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + artsemi + '&fakeaction=plist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); } window2 = window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&fakeaction=jssprotect',             'targetname2',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); jssubmitclose; return; } if (z == 'notag') { alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); return; } } }

function usprotect { var z_check = ''; if (document.title.indexOf("Editing User talk") != -1) {   value = 't'; } if (document.title.indexOf("Editing User:") != -1) {   value = 'u'; } var reg = ''; var target = document.title.split("Editing ")[1].split(" - ")[0]; jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search(/\{\{[Ss]protect|\{\{[Pp]rotect/) != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search(/\{\{[Uu]sertalk-sprotect|\{\{[Ss]utprotected/) != -1) {var z_check = 'notag';} if (z_check == 'notag') {   alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); return; } else { if (value == 'u') {     var act = 'u'; type = 17; } else if (value == 't') {     var act = 'ut'; var reg = prompt('Is this an anon or a registered user (enter *a* or *r*)?'); if (reg == 'a') {           type = 19; }        else if (reg == 'r') {           type = 18; }        else {           alert("Error: Invalid input. Make sure you are not actually including the asterisk symbols."); return; }     }  else {     alert("Error: Invalid input. Make sure you are not actually including the asterisk symbols."); return; } form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } document.editform.wpTextbox1.value = '\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+'; window1 = window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + type + '&fakeaction=' + act + 'plist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); window2 = window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&fakeaction=jssprotect',             'targetname2',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); return; } }

function ufprotect { var z_check = ''; if (document.title.indexOf("Editing User:") != -1) {   value = 'u'; } var reg = ''; var target = document.title.split("Editing ")[1].split(" - ")[0]; jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search(/\{\{[Ss]protect|\{\{[Pp]rotect/) != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search(/\{\{[Uu]sertalk-sprotect|\{\{[Ss]utprotected/) != -1) {var z_check = 'notag';} if (z_check == 'notag') {   alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); return; } else { if (value == 'u') {     var act = 'u'; type = 16; } form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } document.editform.wpTextbox1.value = '\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+'; window1 = window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + type + '&fakeaction=' + act + 'plist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); window2 = window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&fakeaction=jsfprotect',             'targetname2',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); return; } }

function oprotect { var z = ''; var target = document.title.split("Editing ")[1].split(" - ")[0]; jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} if (z == 'notag') {   alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); return; } else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } document.editform.wpTextbox1.value = '\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+'; window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + otherpro + '&fakeaction=oplist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&fakeaction=jsfprotect',             'targetname2',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); } }

function osprotect { var z =''; var target = document.title.split("Editing ")[1].split(" - ")[0]; jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1) {z_check = 'notag';} else if (document.editform.wpTextbox1.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1) {var z_check = 'notag';} if (z == 'notag') { alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); } else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } document.editform.wpTextbox1.value = '\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+'; window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + otherpro + '&fakeaction=oplist&faketarget=' + target,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&fakeaction=jssprotect',             'targetnameo',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); } }

function unprotect { var message = "Are you sure you want to unprotect this page?"; var return_value = confirm(message); if (return_value == true) { var undefined; var original = document.editform.wpTextbox1.value; var target = document.title.split("Editing ")[1].split(" - ")[0]; jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.search(/\{\{sprotect\}\}/i) !=-1) { whattag = 'sprotect'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{sprotect\|.+\}\}/i) !=-1) { whattag = document.editform.wpTextbox1.value.match(/\{\{sprotect\|.+\}\}/i)[0].split('')[0]; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{sprotected\}\}/i) !=-1) { whattag = 'sprotected'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{semiprotect\}\}/i) !=-1) { whattag = 'semiprotect'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{semiprotected\}\}/i) !=-1) { whattag = 'semiprotected'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{semi-protected\}\}/i) !=-1) { whattag = 'semi-protected'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{sprotect-banneduser\}\}/i) !=-1) { whattag = 'sprotect-banneduser'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{sprotected-banneduser\}\}/i) !=-1) { whattag = 'sprotected-banneduser'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{vprotect\}\}/i) !=-1) { whattag = 'vprotect'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{vprotected\}\}/i) !=-1) { whattag = 'vprotected'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{Vprotect\}\}/i) !=-1) { whattag = 'Vprotect'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{Vprotected\}\}/i) !=-1) { whattag = 'Vprotected'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{protect\}\}/i) !=-1) { whattag = 'protect'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{protected\}\}/i) !=-1) { whattag = 'protected'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{Protect\}\}/i) !=-1) { whattag = 'Protect'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{Protected\}\}/i) !=-1) { whattag = 'Protected'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{moveprotect\}\}/i) !=-1) { whattag = 'moveprotect'; whattype = movesec; var go = 'yes'; } else if (document.editform.wpTextbox1.value.search(/\{\{moveprotected\}\}/i) !=-1) { whattag = 'moveprotected'; whattype = movesec; var go = 'yes'; } else { alert("Error: There is no recognized protection tag on this page."); return; } if (go == 'yes') { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } document.editform.wpSummary.value += 'Unprotected page -- removing tag'; var whattag_upper = whattag.substring(0,1).toUpperCase + whattag.substring(1,whattag.length); document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(,); document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(,); if (VoABot_on == 0) { window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + whattype + '&fakeaction=pdelist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); } window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&fakeaction=jsunprotect',             'targetnamepro',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); jssubmitclose; return; } } }

function ounprotect { var undefined; var original = document.editform.wpTextbox1.value; var target = document.title.split("Editing ")[1].split(" - ")[0]; jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   whattag = 'sprotect'; whattype = otherpro; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   whattag = 'sprotected'; whattype = otherpro; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   whattag = 'vprotect'; whattype = otherpro; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   whattag = 'vprotected'; whattype = otherpro; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   whattag = 'protect'; whattype = otherpro; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   whattag = 'protected'; whattype = otherpro; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   whattag = 'moveprotect'; whattype = movesec; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   whattag = 'moveprotected'; whattype = movesec; var go = 'yes'; } else { alert("Error: There is no recognized protection tag on this page."); } if (go == 'no') { alert("Error: The protection tag is preceded by text (in which case you have to remove it manually)."); } if (go == 'yes') { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } document.editform.wpSummary.value += 'Unprotected page -- removing tag'; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(,); if (VoABot_on ==0) { window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + whattype + '&fakeaction=pdelist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); } window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&fakeaction=jsunprotect',             'targetnamep',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); } }

//USERPAGE UNPROTECT function uunprotect { var gotagged = 'no'; var gonotagged = 'no'; if (document.title.indexOf("Editing User talk:") != -1) {   value = 't'; } if (document.title.indexOf("Editing User:") != -1) {   value = 'u'; } var original = document.editform.wpTextbox1.value; var target = document.title.split("Editing ")[1].split(" - ")[0]; jstarget = URLEncoding(target); if (value == 'u') {     type = 17; } else if (value == 't') {     var reg = prompt('Is this an anon or a registered user (enter *a* or *r*)?'); if (reg == 'a') {           type = 19; }        else if (reg == 'r') {           type = 18; }        else {           alert("Error: Invalid input. Make sure you are not actually including the asterisk symbols."); return; }     }  else {     alert("Error: Invalid input. Make sure you are not actually including the asterisk symbols."); return; } //Tag search if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) {    if (value == 'u') { gotagged = 'yes'; tagtype = 'sprotect'; type = usersemi; }    else if (value == 't') {       if (reg == 'a') { gotagged = 'yes'; tagtype = 'sprotect'; type = anontalk; }       else if (reg == 'r') { gotagged = 'yes'; tagtype = 'sprotect'; type = regtalk; }     }   } }  else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) {    if (value == 'u') { gotagged = 'yes'; tagtype = 'vprotect'; type = userfull; }    else if (value == 't') {       if (reg == 'a') { gotagged = 'yes'; tagtype = 'vprotect'; type = anontalk; }       else if (reg == 'r') { gotagged = 'yes'; tagtype = 'vprotect'; type = regtalk; }     }   } }  else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) {    if (value == 'u') { gotagged = 'yes'; tagtype = 'vutprotected'; type = userfull; }    else if (value == 't') {       if (reg == 'a') { gotagged = 'yes'; tagtype = 'vutprotected'; type = anontalk; }       else if (reg == 'r') { gotagged = 'yes'; tagtype = 'vutprotected'; type = regtalk; }     }   } } else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) {    if (value == 'u') { gotagged = 'yes'; tagtype = 'vprotected'; type = userfull; }    else if (value == 't') {       if (reg == 'a') { gotagged = 'yes'; tagtype = 'vprotected'; type = anontalk; }       else if (reg == 'r') { gotagged = 'yes'; tagtype = 'vprotected'; type = regtalk; }     }   } }  else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) {    if (value == 'u') { gotagged = 'yes'; tagtype = 'sprotected'; type = usersemi; }    else if (value == 't') {       if (reg == 'a') { gotagged = 'yes'; tagtype = 'sprotected'; type = anontalk; }       else if (reg == 'r') { gotagged = 'yes'; tagtype = 'sprotected'; type = regtalk; }     }   } } else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) {    if (value == 'u') { gotagged = 'yes'; tagtype = 'Usertalk-sprotect'; type = usersemi; }    else if (value == 't') {       if (reg == 'a') { gotagged = 'yes'; tagtype = 'Usertalk-sprotect'; type = anontalk; }       else if (reg == 'r') { gotagged = 'yes'; tagtype = 'Usertalk-sprotect'; type = regtalk; }     }   } } else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) {    if (value == 'u') { gotagged = 'yes'; tagtype = 'usertalk-sprotect'; type = usersemi; }    else if (value == 't') {       if (reg == 'a') { gotagged = 'yes'; tagtype = 'usertalk-sprotect'; type = anontalk; }       else if (reg == 'r') { gotagged = 'yes'; tagtype = 'usertalk-sprotect'; type = regtalk; }     }   } }  else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) {    if (value == 'u') { gotagged = 'yes'; tagtype = 'unblockabuse'; type = userfull; }    else if (value == 't') {       if (reg == 'a') { gotagged = 'yes'; tagtype = 'protect'; type = anontalk; }       else if (reg == 'r') { gotagged = 'yes'; tagtype = 'protect'; type = regtalk; }     }   } }  else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) {    if (value == 'u') { gotagged = 'yes'; tagtype = 'protect'; type = userfull; }    else if (value == 't') {       if (reg == 'a') { gotagged = 'yes'; tagtype = 'protect'; type = anontalk; }       else if (reg == 'r') { gotagged = 'yes'; tagtype = 'protect'; type = regtalk; }     }   } }  else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) {    if (value == 'u') { gotagged = 'yes'; tagtype = 'protected'; type = userfull; }    else if (value == 't') {       if (reg == 'a') { gotagged = 'yes'; tagtype = 'protected'; type = anontalk; }       else if (reg == 'r') { gotagged = 'yes'; tagtype = 'protected'; type = regtalk; }     }   } }  else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) { document.editform.wpSummary.value += 'Unprotected'; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split('')[1]; }  }  else if (document.editform.wpTextbox1.value.split('')[1] != undefined) {   if (document.editform.wpTextbox1.value.split()[0] == ) { document.editform.wpSummary.value += 'Unprotected'; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split('')[1]; }  } //No tag found...what now? else { var message = "Note: Either there is no recognized protection tag on this page or it is preceded by text. Press OK to continue."; var return_value = confirm(message); //If they click OK if (return_value == true) {   if (value == 't') {    if (reg == 'a') { window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + anontalk + '&fakeaction=pdelist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); gonotagged = 'yes'; }    else if (reg == 'r') { window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + regtalk + '&fakeaction=pdelist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); gonotagged = 'yes'; }    else {    alert("An unknown error has occured."); }    }    if (value == 'u') { var level = prompt("Page no longer semi or fully protected (enter *s* or *f*)?"); if (level == 's') { window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + usersemi + '&fakeaction=pdelist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); gonotagged = 'yes'; }    else if (level == 'f') { window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + userfull + '&fakeaction=pdelist&faketarget=' + target,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); gonotagged = 'yes'; }    else {      alert("Invalid input."); return; }     }   else if (value != 'u' && value != 't') {     alert("An unknown page recognition error has occured."); }    }   else {   document.editform.wpSummary.value += ""; return; }   }  form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } if (gotagged == 'yes') { document.editform.wpSummary.value += 'Unprotected'; var whattag_upper = tagtype.substring(0,1).toUpperCase + tagtype.substring(1,whattag.length); document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(,); document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(,); var windowpp = window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit&section=' + type + '&fakeaction=pdelist&faketarget=' + jstarget,             'targetname',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); var windowcp = window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&fakeaction=jsunprotect',             'targetnameu',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); } if (gonotagged == 'yes') { var windowcp = window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&fakeaction=jsunprotect',             'targetnameu',    'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes'); } }

//Listing function addOnloadHook(autoplist); function autoplist { if (document.title.indexOf('Editing ') == 0) {     var action = ''; var target = ''; if (location.search) {         var l = location.search.substring(1).split('&'); for (var i = 0; i < l.length; ++i) {             var eq = l[i].indexOf('='); var name = l[i].substring(0, eq); if (name == 'fakeaction') action = l[i].substring(eq + 1); else if (name == 'faketarget') target = unescape(l[i].substring(eq + 1)).replace(/_/g, ' '); }       }      if (action == 'plist') {        autoreplacetxt('\n\n','\n'); var pagename = strip_namespace(target); pagename = unescape(pagename); var original = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = pagename; var username = document.editform.wpTextbox1.value.split("User:")[1]; var usertalk = document.editform.wpTextbox1.value.split("User talk:")[1]; var themovename = document.editform.wpTextbox1.value.split("Wikipedia:")[1]; var themove = "*"; var thepage = "*"; var thepage2 = "* "; var lapage = "*"; var theuser = "*" + target + ""; var vandaltalk = "*"; document.editform.wpTextbox1.value = original; if (document.editform.wpTextbox1.value.split(theuser)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(vandaltalk)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(themove)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(thepage)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(thepage2)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(lapage)[1] != undefined) {           var errorl = 'yes'; }        if (errorl == 'yes') {             alert("Error: The page is already listed."); return; }          else {         form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } var reason = prompt("Enter an explanation for protection:") var f = document.editform, t = f.wpTextbox1; t.value +="*. " + reason + ". " + "~" + "~" + "~" + "~"; f.wpSummary.value += "" + pagename + " protected; adding to list."; }       }      if (action == 'uplist') {        autoreplacetxt('\n\n','\n'); var username = target.split("User:")[1]; var pagename = strip_namespace(target); pagename = unescape(pagename); var original = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = pagename; var username = document.editform.wpTextbox1.value.split("User:")[1]; var usertalk = document.editform.wpTextbox1.value.split("User talk:")[1]; var themovename = document.editform.wpTextbox1.value.split("Wikipedia:")[1]; var themove = "*"; var thepage = "*"; var thepage2 = "* "; var lapage = "*"; var theuser = "*" + target + ""; var vandaltalk = "*"; document.editform.wpTextbox1.value = original; if (document.editform.wpTextbox1.value.split(theuser)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(vandaltalk)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(themove)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(thepage)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(thepage2)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(lapage)[1] != undefined) {           var errorl = 'yes'; }        if (errorl == 'yes') {             alert("Error: The page is already listed."); return; }         else {  form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } var reason = prompt("Enter an explanation for protection:") var f = document.editform, t = f.wpTextbox1; t.value +="*User:" + pagename + " -- " + reason + ". " + "~" + "~" + "~" + "~"; f.wpSummary.value += "User:" + pagename + "" + " protected; adding to list."; }        } if (action == 'utplist') {        autoreplacetxt('\n\n','\n'); var username = target.split("User talk:")[1]; var pagename = strip_namespace(target); pagename = unescape(pagename); var original = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = pagename; var username = document.editform.wpTextbox1.value.split("User:")[1]; var usertalk = document.editform.wpTextbox1.value.split("User talk:")[1]; var themovename = document.editform.wpTextbox1.value.split("Wikipedia:")[1]; var themovename = document.editform.wpTextbox1.value.split("Talk:")[1]; var themove = "*"; var thetalk = "*"; var thepage = "*"; var thepage2 = "* "; var lapage = "*"; var theuser = "*" + target + ""; var vandaltalk = "*"; document.editform.wpTextbox1.value = original; if (document.editform.wpTextbox1.value.split(theuser)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(vandaltalk)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(themove)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(thepage)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(thepage2)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(lapage)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(thetalk)[1] != undefined) {           var errorl = 'yes'; }        if (errorl == 'yes') {             alert("Error: The page is already listed."); return; }         else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } var reason = prompt("Enter an explanation for protection:") var f = document.editform, t = f.wpTextbox1; t.value +="* --" + reason + ". " + "~" + "~" + "~" + "~"; f.wpSummary.value += "" + pagename + "" + " protected; adding to list."; }       } if (action == 'oplist') {        autoreplacetxt('\n\n','\n'); var pagename = strip_namespace(target); pagename = unescape(pagename); var original = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = pagename; var username = document.editform.wpTextbox1.value.split("User:")[1]; var usertalk = document.editform.wpTextbox1.value.split("User talk:")[1]; var themovename = document.editform.wpTextbox1.value.split("Wikipedia:")[1]; var themove = "*"; var thepage = "*"; var thepage2 = "* "; var lapage = "*"; var theuser = "*" + target + ""; var vandaltalk = "*"; document.editform.wpTextbox1.value = original; if (document.editform.wpTextbox1.value.split(theuser)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(vandaltalk)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(themove)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(thepage)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(thepage2)[1] != undefined) {           var errorl = 'yes'; }           else if (document.editform.wpTextbox1.value.split(lapage)[1] != undefined) {           var errorl = 'yes'; }        if (errorl == 'yes') {             alert("Error: The page is already listed."); return; }         else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} } var reason = prompt("Enter an explanation for protection") var f = document.editform, t = f.wpTextbox1; t.value +="*. " + reason + ". " + "~" + "~" + "~" + "~"; f.wpSummary.value += "" + target + "" + " protected; adding to list."; }       }    } }

//This function sets the selected values on the Confirm protection page addOnloadHook(jsprotect); function jsprotect { if (document.title.indexOf('Confirm protection') != -1) {     var action = ''; var target = ''; if (location.search) {         var l = location.search.substring(1).split('&'); for (var i = 0; i < l.length; ++i) {             var eq = l[i].indexOf('='); var name = l[i].substring(0, eq); if (name == 'fakeaction') action = l[i].substring(eq + 1); else if (name == 'faketarget') target = unescape(l[i].substring(eq + 1)).replace(/_/g, ' '); }        }      if (action == 'jsunprotect') {        var reasonbox = document.getElementById('mwProtect-reason'); reasonbox.value = 'Page protected for a while; hopefully protection is no longer necessary.'; if (document.getElementsByTagName('option')[2].selected==true) {reasonbox.value = 'Page locked for a while and dispute seems to have resolved/ended.';} //edit (allow,semi,full) document.getElementsByTagName('option')[0].selected=true; document.getElementsByTagName('option')[1].selected=false; document.getElementsByTagName('option')[2].selected=false; //move (allow,semi,full) document.getElementsByTagName('option')[3].selected=true; document.getElementsByTagName('option')[4].selected=false; document.getElementsByTagName('option')[5].selected=false; }     if (action == 'jssprotect') { //edit (allow,semi,full) document.getElementsByTagName('option')[0].selected=false; document.getElementsByTagName('option')[1].selected=true; document.getElementsByTagName('option')[2].selected=false; //move (allow,semi,full) document.getElementsByTagName('option')[3].selected=false; document.getElementsByTagName('option')[4].selected=true; document.getElementsByTagName('option')[5].selected=false; document.getElementById('mwProtect-reason').value = 'Heavy vandalism from multiple sources.'; }     if (action == 'jsfprotect') { //edit (allow,semi,full) document.getElementsByTagName('option')[0].selected=false; document.getElementsByTagName('option')[1].selected=false; document.getElementsByTagName('option')[2].selected=true; //move (allow,semi,full) document.getElementsByTagName('option')[3].selected=false; document.getElementsByTagName('option')[4].selected=false; document.getElementsByTagName('option')[5].selected=true; document.getElementById('mwProtect-reason').value = 'Users engaging in edit warring.'; }   } } //END

addOnloadHook(autopdelist); function autopdelist { if (document.title.indexOf('Editing ') == 0) {     var action = ''; var target = ''; if (location.search) {         var l = location.search.substring(1).split('&'); for (var i = 0; i < l.length; ++i) {             var eq = l[i].indexOf('='); var name = l[i].substring(0, eq); if (name == 'fakeaction') action = l[i].substring(eq + 1); else if (name == 'faketarget') target = unescape(l[i].substring(eq + 1)).replace(/_/g, ' '); }        }      if (action == 'pdelist') {        oldautoreplacetxt('* {{','*{{'); autoreplacetxt('\n\n','\n'); var pagename = strip_namespace(target); var original = document.editform.wpTextbox1.value; var username = pagename.split("User:")[1]; var usertalk = pagename.split("User talk:")[1]; var themovename = pagename.split("Wikipedia:")[1]; var thetalkname = pagename.split("Talk:")[1]; var themove = "*"; var thetalk = "*{{Non-article|Talk|" + thetalkname + "}}"; var thepage = "*"; var thepageLC = target.substring(0,1).toLowerCase + target.substr(1); var thepage2 = "*{{article|" + thepageLC + "}}"; var lapage = "*"; var theuser = "*" + target + ""; var vandaltalk = "*"; document.editform.wpTextbox1.value = original; form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {          if (l[i].name == 'wpMinoredit') {l[i].value = '1'; l[i].checked=true;} }     if (document.editform.wpTextbox1.value.split(thepage)[1] != undefined) {        if (document.editform.wpTextbox1.value.split(thepage)[0] != undefined) {        var firsthalf = document.editform.wpTextbox1.value.split(thepage)[0]; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(thepage)[1]; splitpoint = document.editform.wpTextbox1.value.split("*{{")[0]; document.editform.wpTextbox1.value = original; if (splitpoint.length <= 3) {        secondhalf = original.split(thepage)[1]; document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "" + target + " unprotected; delisting."; var message = 'The page "' + target + '" has been located and de-listed. The de-listed page had no protection explanation.'; var return_value = confirm(message); if (return_value == true){jssubmitclose;} }             else {          secondhalf = document.editform.wpTextbox1.value.split(thepage + splitpoint)[1]; document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "" + target + " unprotected; delisting."; var message = 'The page "' + target + '" has been located and de-listed. The protection explanation:' + '\n' +  + '\n' + splitpoint + '\n' +  + '\n' + '...was also removed. Please read this summary; avoid clicking "OK" if necessary.'; var return_value = confirm(message); if (return_value == true){jssubmitclose;} return; }         }      }       else if (document.editform.wpTextbox1.value.split(thepage2)[1] != undefined) {        if (document.editform.wpTextbox1.value.split(thepage2)[0] != undefined) {        var firsthalf = document.editform.wpTextbox1.value.split(thepage2)[0]; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(thepage2)[1]; splitpoint = document.editform.wpTextbox1.value.split("*{{")[0]; document.editform.wpTextbox1.value = original; if (splitpoint.length <= 3) {        secondhalf = original.split(thepage2)[1]; document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "" + target + " unprotected; delisting."; var message = 'The page "' + target + '" has been located and de-listed. The de-listed page had no protection explanation.'; var return_value = confirm(message); if (return_value == true){jssubmitclose;} }             else {             secondhalf = document.editform.wpTextbox1.value.split(thepage2 + splitpoint)[1]; document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "" + target + " unprotected; delisting."; var message = 'The page "' + target + '" has been located and de-listed. The protection explanation:' + '\n' +  + '\n' + splitpoint + '\n' +  + '\n' + '...was also removed. Please read this summary; avoid clicking "OK" if necessary.'; var return_value = confirm(message); if (return_value == true){jssubmitclose;} return; }          }       }      else if (document.editform.wpTextbox1.value.split(themove)[1] != undefined) {        if (document.editform.wpTextbox1.value.split(themove)[0] != undefined) {        var firsthalf = document.editform.wpTextbox1.value.split(themove)[0]; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(themove)[1]; splitpoint = document.editform.wpTextbox1.value.split("*{{")[0]; document.editform.wpTextbox1.value = original; if (splitpoint.length <= 3) {        secondhalf = original.split(themove)[1]; document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "" + target + " unprotected; delisting."; var message = 'The page "' + target + '" has been located and de-listed. The de-listed page had no protection explanation.'; var return_value = confirm(message); if (return_value == true){jssubmitclose;} }             else {                if (splitpoint.split("*" + "")[1] != undefined)                        {           splitpointb = splitpoint.split("*" + "[[")[0];           secondhalf = document.editform.wpTextbox1.value.split(themove + splitpointb)[1];           document.editform.wpTextbox1.value = firsthalf + secondhalf;           document.editform.wpSummary.value += "[[" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The protection explanation:' + '\n' +  + '\n' + splitpoint + '\n' +  + '\n' + '...was also removed. Please read this summary; avoid clicking "OK" if necessary.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}         return;                       }                 else                        {           secondhalf = document.editform.wpTextbox1.value.split(themove + splitpoint)[1];           document.editform.wpTextbox1.value = firsthalf + secondhalf;           document.editform.wpSummary.value += "" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The protection explanation:' + '\n' +  + '\n' + splitpoint + '\n' +  + '\n' + '...was also removed. Please read this summary; avoid clicking "OK" if necessary.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}         return;                       }           }        }     }       else if (document.editform.wpTextbox1.value.split(thetalk)[1] != undefined)        {         if (document.editform.wpTextbox1.value.split(thetalk)[0] != undefined)           {         var firsthalf = document.editform.wpTextbox1.value.split(thetalk)[0];         document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(thetalk)[1];          splitpoint = document.editform.wpTextbox1.value.split("*{{")[0];         document.editform.wpTextbox1.value = original;              if (splitpoint.length <= 3)                     {         secondhalf = original.split(thetalk)[1];         document.editform.wpTextbox1.value = firsthalf + secondhalf;         document.editform.wpSummary.value += "" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The de-listed page had no protection explanation.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}                    }              else                     {                 if (splitpoint.split("*" + "")[1] != undefined)                        {           splitpointb = splitpoint.split("*" + "[[")[0];           secondhalf = document.editform.wpTextbox1.value.split(thetalk + splitpointb)[1];           document.editform.wpTextbox1.value = firsthalf + secondhalf;           document.editform.wpSummary.value += "[[" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The protection explanation:' + '\n' +  + '\n' + splitpoint + '\n' +  + '\n' + '...was also removed. Please read this summary; avoid clicking "OK" if necessary.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}         return;                       }                 else                        {           secondhalf = document.editform.wpTextbox1.value.split(thetalk + splitpoint)[1];           document.editform.wpTextbox1.value = firsthalf + secondhalf;           document.editform.wpSummary.value += "" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The protection explanation:' + '\n' +  + '\n' + splitpoint + '\n' +  + '\n' + '...was also removed. Please read this summary; avoid clicking "OK" if necessary.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}         return;                       }           }        }     }      else if (document.editform.wpTextbox1.value.split(lapage)[1] != undefined)        {         if (document.editform.wpTextbox1.value.split(lapage)[0] != undefined)           {         var firsthalf = document.editform.wpTextbox1.value.split(lapage)[0];         document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(lapage)[1];          splitpoint = document.editform.wpTextbox1.value.split("*{{")[0];         document.editform.wpTextbox1.value = original;              if (splitpoint.length <= 3)                     {         secondhalf = original.split(lapage)[1];         document.editform.wpTextbox1.value = firsthalf + secondhalf;         document.editform.wpSummary.value += "" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The de-listed page had no protection explanation.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;} 	            }              else                     {                 if (splitpoint.split("*" + "")[1] != undefined)                        {           splitpointb = splitpoint.split("*" + "[[")[0];           secondhalf = document.editform.wpTextbox1.value.split(lapage + splitpointb)[1];           document.editform.wpTextbox1.value = firsthalf + secondhalf;           document.editform.wpSummary.value += "[[" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The protection explanation:' + '\n' +  + '\n' + splitpoint + '\n' +  + '\n' + '...was also removed. Please read this summary; avoid clicking "OK" if necessary.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}         return;                       }                 else                        {           secondhalf = document.editform.wpTextbox1.value.split(lapage + splitpoint)[1];           document.editform.wpTextbox1.value = firsthalf + secondhalf;           document.editform.wpSummary.value += "" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The protection explanation:' + '\n' +  + '\n' + splitpoint + '\n' +  + '\n' + '...was also removed. Please read this summary; avoid clicking "OK" if necessary.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}         return;                       }           }        }     } else if (document.editform.wpTextbox1.value.split(vandaltalk)[1] != undefined)         {         if (document.editform.wpTextbox1.value.split(vandaltalk)[0] != undefined)            {         var firsthalf = document.editform.wpTextbox1.value.split(vandaltalk)[0];         document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(vandaltalk)[1];          splitpoint = document.editform.wpTextbox1.value.split("*" + "{{")[0];         document.editform.wpTextbox1.value = original.split(splitpoint)[1];         var secondhalf = original.split(vandaltalk + splitpoint)[1];         document.editform.wpTextbox1.value = original;              if (splitpoint.length <= 3)                     {         secondhalf = document.editform.wpTextbox1.value.split(vandaltalk)[1];         document.editform.wpTextbox1.value = firsthalf + secondhalf;         document.editform.wpSummary.value += "" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The de-listed page had no protection explanation.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}         return;                    }              else                     {         document.editform.wpTextbox1.value = firsthalf + secondhalf;         document.editform.wpSummary.value += "" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The protection explanation:' + '\n' +  + '\n' + splitpoint + '\n' +  + '\n' + '...was also removed. Please read this summary; avoid clicking "OK" if necessary.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}         return;                    }              }         } else if (document.editform.wpTextbox1.value.split(theuser)[1] != undefined)         {         if (document.editform.wpTextbox1.value.split(theuser)[0] != undefined)            {         var firsthalf = document.editform.wpTextbox1.value.split(theuser)[0];         document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(theuser)[1];          splitpoint = document.editform.wpTextbox1.value.split("*" + "User:")[0];         document.editform.wpTextbox1.value = original.split(splitpoint)[1];         var secondhalf = original.split(theuser + splitpoint)[1];         document.editform.wpTextbox1.value = original;              if (splitpoint.length <= 3)                     {         secondhalf = document.editform.wpTextbox1.value.split(theuser + splitpoint)[1];         document.editform.wpTextbox1.value = firsthalf + secondhalf;         document.editform.wpSummary.value += "[[" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The de-listed page had no protection explanation.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}         return;                    }              else                     {         document.editform.wpTextbox1.value = firsthalf + secondhalf;         document.editform.wpSummary.value += "" + target + " unprotected; delisting.";         var message = 'The page "' + target + '" has been located and de-listed. The protection explanation:' + '\n' +  + '\n' + splitpoint + '\n' +  + '\n' + '...was also removed. Please read this summary; avoid clicking "OK" if necessary.';         var return_value = confirm(message);          if (return_value == true){jssubmitclose;}         return;                    }              }         }     else         {          alert("Note: The page you unprotected was not found on the list and may never have been listed. However, check to make sure that this is not a glitch, such as the listed article being a redirect to the actual page. Move-protected articles tend to be listed inconsistantly. Also, some entries for non-articles are listed with templates that this tool does not look for." + "\n" + "" + "\n" + "Debuging Information: " + "vandaltalk=" + vandaltalk + " |username=" + username + " |username2=" + usertalk + " |target=" + target + " |thepage=" + thepage + " |thepage2=" + thepage2 + " |themove=" + themove  + " |thetalk=" + thetalk + " |theuser=" + theuser);          document.editform.wpSummary.value += "" + target + " unprotected; delisting.";          return;          document.editform.wpTextbox1.value = original;         }      }   } } //END //RFPP tabs

function rfppp { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": Fully protected due to revert warring. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: page fully protected"; }

function rfpps { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": Semi-protected due to heavy vandalism. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: page semi-protected"; }

function rfppm { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": Move-protected due to excessive renaming. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: page move-protected"; }

function rfppun { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": Un-protected. It's been protected for long enough. Hopefully things have calmed down since then. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: page un-protected"; }

function rfppu { var pro = prompt("A user already protected or un-protected (enter *p* or *u*)?") if (pro == 'p') { value = 'protected'; } else if (pro == 'u') { value = 'un-protected'; } else { alert("Error: Invalid input. Make sure that you are not actually including the aterisk symbols."); return; } var user = prompt("What user?") if (!user){return;} usera = user.replace(/ /g,'_'); var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": Page " + value + "+ usera + " by " + user + "" + ". " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: " + value + " by another Sysop"; }

function rfpprus { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": Its still to soon to un-protect since the wave of vandalism will likely continue immediately after un-protection. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: un-protection request denied"; }

function rfppruf { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": The reasonable issues that started the revert war do not yet seem to have been resolved. It is also too soon to assume that the editors have lost enough interest. Consider adding {{Editprotected}} to the page's talk page to request small modifications, or making a significant edit request on this page for large edits that are agreed upon. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: un-protection request denied"; }

function rfppr { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": There is not enough recent activity to justify protection at this time. For now, be sure to use descriptive edit summaries and discuss edits on talk. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: protection request denied"; }

function rfpprv { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": There is not enough recent activity to justify protection at this time. Just watchlist and revert any vandalism. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: protection request denied"; }

function rfppb { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": The user has been blocked from editing. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: user blocked"; }

function rfppap { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": The page is already protected. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: page already protected"; }

function rfppau { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=": The page is not actually protected. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: page was not protected"; }

function welcome { document.editform.wpTextbox1.value.split('{{subst:User:Clientele/Welcome}}',''); } //