//<pre><nowiki>
VoABot_on=1;
//This function sets the selected values on the Confirm protection page
addOnloadHook(WP_PP_helper);
function WP_PP_helper()
{
if (document.title.indexOf('Wikipedia:List of protected pages') !=0 && document.title.indexOf('Protected pages') !=0 ) return;
if (document.title.indexOf('/') !=-1) return;
if (___location.href.search(/&action=/) !=-1) return;
addTab("javascript:addProtectReasons()", "Show reasons", "ca-reasons", "Show reasons", "");
}
//
var li_prot = 0;
function addProtectReasons()
{
if (!document.getElementsByTagName('ul')[0])
{alert('There are no elements in this list.'); return;}
if (!document.getElementsByTagName('ul')[0].getElementsByTagName('li')[0])
{alert('There are no elements in this list.'); return;}
var ls = document.getElementsByTagName('ul')[0].getElementsByTagName('li');
if (document.getElementById('contentSub').innerHTML.indexOf('Injecting log reasons for these items.') !=-1)
{alert('Results already shown.'); return;}
document.getElementById('contentSub').innerHTML += '<br>Injecting log reasons for these items.<br>';
consec_addReasons();
}
function consec_addReasons()
{
if (document.getElementsByTagName('ul')[0].getElementsByTagName('li')[li_prot])
{
var name = document.getElementsByTagName('ul')[0].getElementsByTagName('li')[li_prot].getElementsByTagName('a')[0].innerHTML;
var URL = '/w/index.php?title=Special:Log&limit=1&type=protect&page=' + escape(name) + '&useskin=standard';
xml_http = HTTPClient();
xml_http.open("GET", URL, true);
xml_http.onreadystatechange = fetch_log_contents;
xml_http.send(null);
}
else
{
document.getElementById('bodyContent').innerHTML = '<strong><span style="color:darkblue;">Log comment and dates inserted</span></strong><br>' + document.getElementById('bodyContent').innerHTML;
var l =document.getElementById('bodyContent').getElementsByTagName('li');
for (var i=0; i<l.length; i++)
{
var title = l[i].getElementsByTagName('a')[0].title;
var href = l[i].getElementsByTagName('a')[0].href;
if (title)
{
l[i].innerHTML = '<a href=javascript:WP_PP_unprotect("' + href.split('/wiki/')[1] + '")><strong>(release)</strong></a> ' + l[i].innerHTML;
}
}
}
}
function fetch_log_contents()
{
if (xml_http.readyState != 4) return;
var Done=0;
var xmlpage = xml_http.responseText.split("<div id='article'>")[1].split('<!-- end content -->')[0];
//UTC done
if (xmlpage.indexOf('<ul>') == -1)
{
document.getElementsByTagName('li')[li_prot].innerHTML += '<span style="color:red;"><strong> (error)</strong></span>';
}
else
{
//Current time
xmlpage = xmlpage.split('<ul>')[1].split('</ul>')[0];
if (xmlpage.indexOf('<li>') == -1)
{
document.getElementsByTagName('li')[li_prot].innerHTML += '<span style="color:red;"><strong> (error)</strong></span>';
}
else
{
var now = new Date();
var curtime = now.toUTCString().replace(/GMT/, "UTC");
var li_html = xmlpage.split('<li>')[1].split('</li>')[0];
var lasttime = li_html.split(' <a href=')[0].split(' <A href=')[0].split('<a href=')[0].split('<A href=')[0];
var totdays = getElapsedTime(curtime,lasttime);
totdays = Math.round((100)*totdays)/100;
var reason = li_html.split('<span class="comment">(')[1].split(')</span>')[0];
reason = reason.split(' [edit=')[0].split(' [move=')[0].split('[edit=')[0].split('[move=')[0];
if ( reason=='' ) reason = 'none given';
document.getElementsByTagName('li')[li_prot].innerHTML += '<br>[<strong>' + totdays + ' days old</strong>] <i>(' + reason + ')</i>';
}
}
li_prot += 1;
consec_addReasons();
}
function WP_PP_unprotect(title)
{
var URL = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=' + escape(title) + '&action=edit&jsaction=release';
window.open(URL,'WP:AUTOunpro:' + title,'___location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes');
}
function jssubmitclose()
{
var form = document.getElementById('editform').submit();
form.submit();
}
function protection_tabs()
{
if(document.getElementById('ca-protect'))
{document.getElementById('ca-protect').firstChild.innerHTML = '<span style="color:black;">protect</span>';}
if(document.getElementById('ca-unprotect'))
{document.getElementById('ca-unprotect').firstChild.innerHTML = '<strong>un/re-protect</strong>';}
var non_art = /Talk:| talk:|User:|MediaWiki:|Image:|Wikipedia:|Template:|Portal:|Help:|Main Page|Category:/;
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]';}
if (document.title.search(non_art) != -1)
{document.getElementById('ca-talk').firstChild.innerHTML = 'Talk';}
//article pages
if (document.title.search(non_art) == -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 = '<span style="color:black;">P (off)</span>';}
if(document.getElementById('ca-unprotect'))
{document.getElementById('ca-unprotect').firstChild.innerHTML = '<strong>P (on)</strong>';}
if (document.title.indexOf("Editing User talk:") != -1)
{
addToolboxLink("javascript:usprotect()","(Semi-Protect)","sem-pro",",");
addToolboxLink("javascript:ufprotect()","(Full-Protect)","full-pro",".");
addToolboxLink("javascript:ounprotectunprotect()","(Un-Protect)","un-pro","/");
}
}
}
if(document.getElementById('ca-unprotect'))
{addToolboxLink("javascript:ounprotectunprotect()","(Un-Protect)","un-pro","/");}
}
else
var target = document.title.split("Editing ")[1].split(" - ")[0];
jstarget = URLEncoding(target);
ifvar txtbox = (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1);
if (txtbox.value.search('\\{\\{\w\w-(semi|full)-protected\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(Vptl\\|vp|P|p)rotect[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{[Mm]oveprotect(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (txtbox.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search(/\{\{[Ss]protect|\{\{[Pp]rotect/) != -1)
{var z_check = 'notag';}
else
document.editform.wpTextbox1.value = '{{protected' + '}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value += '+{{protected' + '}}';
if (VoABot_on == 0)
{
window1 = window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit§ion=' + artfull + '&jsaction=plist&jsaction=' + jstarget,
'WP:PP add',
'___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&jsaction=fprotect',
'Page protect',
var target = document.title.split("Editing ")[1].split(" - ")[0];
jstarget = URLEncoding(target);
ifvar txtbox = (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1);
if (txtbox.value.search('\\{\\{\w\w-(semi|full)-protected\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(Vptl\\|vp|P|p)rotect[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{[Mm]oveprotect(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (txtbox.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search(/\{\{[Ss]protect|\{\{[Pp]rotect/) != -1)
{var z_check = 'notag';}
else
document.editform.wpTextbox1.value = '{{sprotected' + '}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value += '+{{sprotected' + '}}';
if (VoABot_on == 0)
{
window1 = window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit§ion=' + artsemi + '&jsaction=plist&jsaction=' + jstarget,
'WP:PP add',
'___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&jsaction=sprotect',
'Page protect',
var target = document.title.split("Editing ")[1].split(" - ")[0];
jstarget = URLEncoding(target);
ifvar txtbox = (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1);
if (txtbox.value.search('\\{\\{\w\w-(semi|full)-protected\\}\\}') != -1)
{z_check = 'notag';}
else if (txtbox.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search(/\{\{[Ss]protect|\{\{[Pp]rotect/) != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search(/\{\{[Uu]sertalk-sprotect|\{\{[Ss]utprotected/) != -1)
{var z_check = 'notag';}
if (z_check == 'notag')
document.editform.wpTextbox1.value = '{{sprotected' + '}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value += '+{{sprotected' + '}}';
window1 = window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit§ion=' + type + '&jsaction=' + act + 'plist&jsaction=' + jstarget,
'WP:PP add',
'___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&jsaction=sprotect',
'Page protect',
var target = document.title.split("Editing ")[1].split(" - ")[0];
jstarget = URLEncoding(target);
ifvar txtbox = (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1);
if (txtbox.value.search('\\{\\{\w\w-(semi|full)-protected\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(Vptl\\|vp|P|p)rotect[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{[Mm]oveprotect(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (txtbox.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search(/\{\{[Ss]protect|\{\{[Pp]rotect/) != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search(/\{\{[Uu]sertalk-sprotect|\{\{[Ss]utprotected/) != -1)
{var z_check = 'notag';}
if (z_check == 'notag')
document.editform.wpTextbox1.value = '{{Vprotected' + '}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value += '+{{Vprotected' + '}}';
window1 = window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit§ion=' + type + '&jsaction=' + act + 'plist&jsaction=' + jstarget,
'WP:PP add',
'___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&jsaction=fprotect',
'Page protect',
var target = document.title.split("Editing ")[1].split(" - ")[0];
jstarget = URLEncoding(target);
ifvar txtbox = (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1);
if (txtbox.value.search('\\{\\{\w\w-(semi|full)-protected\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(Vptl\\|vp|P|p)rotect[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{[Mm]oveprotect(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (txtbox.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
if (z == 'notag')
document.editform.wpTextbox1.value = '{{protected' + '}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value += '+{{protected' + '}}';
window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit§ion=' + otherpro + '&jsaction=oplist&jsaction=' + jstarget,
'WP:PP add',
'___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&jsaction=fprotect',
'Page protect',
var target = document.title.split("Editing ")[1].split(" - ")[0];
jstarget = URLEncoding(target);
ifvar txtbox = (document.editform.wpTextbox1.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1);
if (txtbox.value.search('\\{\\{\w\w-(semi|full)-protected\\}\\}') != -1)
{z_check = 'notag';}
if (txtbox.value.search('\\{\\{[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Ss]protect(ed|-banneduser)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)(Vp|vp|P|p)rotect(ed)\\}\\}') != -1)
{z_check = 'notag';}
else if (document.editform.wpTextbox1txtbox.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
if (z == 'notag')
document.editform.wpTextbox1.value = '{{sprotected' + '}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value += '+{{sprotected' + '}}';
window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit§ion=' + otherpro + '&jsaction=oplist&jsaction=' + 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&jsaction=sprotect',
'targetnameo',
{
var message = "Are you sure you want to unprotect this page?";
var auto = '&auto=0';
var m = null;
if (___location.href.indexOf('&jsaction=release') ==-1)
{var return_value = confirm(message);}
{
var original = document.editform.wpTextbox1.value;
jstarget = URLEncoding(mw.config.get('wgTitle'));
if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{sprotect(\w\w-|)semi-protected(2|)\}\}/i) !=-1)
{
whattag = 'sprotect'm[0];
whattype = artsemi;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{sprotect(\w\w-|)full-protected(2|)\|.+\}\}/i) !=-1)
{
whattag = m[0];
whattag = document.editform.wpTextbox1.value.match(/\{\{sprotect(2|)\|.+\}\}/i)[0].split('{{')[1].split('}}')[0];
whattype = artsemi;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{sprot(\w\w-|)semi-protected(\|small=\w{2,3}|)\}\}/i) !=-1)
{
whattag = m[0];
whattag = document.editform.wpTextbox1.value.match(/\{\{sprot(2|)\}\}/i)[0].split('{{')[1].split('}}')[0];
whattype = artsemi;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{sprotected(\w\w-|)full-protected(\|small=\w{2,3}|)\}\}/i) !=-1)
{
whattag = 'sprotected'm[0];
whattype = artsemi;
var go = 'yes';
}
else if(m = (document.editform.wpTextbox1.value.searchmatch(/\{\{semiprotectpp-(2dispute|vandalism)\}\}/i) !=-1)
{
whattag = 'semiprotect'm[0];
whattype = artsemi;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{semiprotectedsprot(ect|ected|)(2|)\}\}/i) !=-1)
{
whattag = 'semiprotected'm[0];
whattype = artsemi;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{semi-protectedsemiprotect(ed|)(2|)\}\}/i) !=-1)
{
whattag = 'semi-protected'm[0];
whattype = artsemi;
var go = 'yes';
}
else if(m = (document.editform.wpTextbox1.value.searchmatch(/\{\{sprotect-banneduser(2|)\}\}/i) !=-1)
{
whattag = 'sprotect-banneduser'm[0];
whattype = artsemi;
var go = 'yes';
}
else if(m = (document.editform.wpTextbox1.value.searchmatch(/\{\{sprotected-banneduser(2|)\}\}/i) !=-1)
{
whattag = 'sprotected-banneduser'm[0];
whattype = artsemi;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{vprotect(2|)\}\}/i) !=-1)
{
whattag = 'vprotect'm[0];
whattype = artfull;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{vprotected(2|)\}\}/i) !=-1)
{
whattag = 'vprotected'm[0];
whattype = artfull;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{Vprotect(2|)\}\}/i) !=-1)
{
whattag = 'Vprotect'm[0];
whattype = artfull;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{Vprotected(2|)\}\}/i) !=-1)
{
whattag = 'Vprotected'm[0];
whattype = artfull;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{protect(2|)\}\}/i) !=-1)
{
whattag = 'protect'm[0];
whattype = artfull;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{protected(2|)\}\}/i) !=-1)
{
whattag = 'protected'm[0];
whattype = artfull;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{Protect(2|)\}\}/i) !=-1)
{
whattag = 'Protect'm[0];
whattype = artfull;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{Protectedmoveprotect(2|)\}\}/i) !=-1)
{
whattag = 'Protected'm[0];
whattype = artfull;
var go = 'yes';
}
else if (m = document.editform.wpTextbox1.value.searchmatch(/\{\{moveprotectmoveprotected(2|)\}\}/i) !=-1)
{
whattag = 'moveprotect'm[0];
whattype = movesec;
var go = 'yes';
}
else if (document.editform.wpTextbox1.value.search(/\{\{moveprotected(2|)\}\}/i) !=-1)
{
whattag = 'moveprotected';
whattype = movesec;
var go = 'yes';
}
else
{
alert("Error: There is no recognized protection tag on this page.");
___location.href = 'http://en.wikipedia.org/w/index.php?title=' + mw.config.get('wgTitle').replace(/&/g,"%26") + '&action=protect&jsaction=unprotect';
return;
}
if (go == 'yes')
{
form = document.getElementById('bodyContent');
l = form.getElementsByTagName('input');
}
document.editform.wpSummary.value += 'Unprotected page -- removing tag';
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(whattag,'');
var whattag_upper = whattag.substring(0,1).toUpperCase() + whattag.substring(1,whattag.length);
window.open('http://en.wikipedia.org/w/index.php?title=' + mw.config.get('wgTitle').replace(/&/g,"%26") + '&action=protect&jsaction=unprotect' + auto,
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{' + whattag + '}}','');
'WP:unpro:' + mw.config.get('wgTitle'),
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{' + whattag_upper + '}}','');
if (VoABot_on==0)
{
window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit§ion=' + whattype + '&jsaction=pdelist&jsaction=' + jstarget,
'targetname',
'___location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes');
}
window.open('http://en.wikipedia.org/w/index.php?title=' + wgTitle.replace(/&/g,"%26") + '&action=protect&jsaction=unprotect' + auto,
'WP:unpro:' + wgTitle,
'___location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes');
jssubmitclose();
}
}
}
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('{{sprotect}}')[1] != undefined)
{
whattag = 'sprotect';
whattype = otherpro;
var go = 'yes';
}
else if (document.editform.wpTextbox1.value.split('{{sprotected}}')[1] != undefined)
{
whattag = 'sprotected';
whattype = otherpro;
var go = 'yes';
}
else if (document.editform.wpTextbox1.value.split('{{vprotect}}')[1] != undefined)
{
whattag = 'vprotect';
whattype = otherpro;
var go = 'yes';
}
else if (document.editform.wpTextbox1.value.split('{{vprotected}}')[1] != undefined)
{
whattag = 'vprotected';
whattype = otherpro;
var go = 'yes';
}
else if (document.editform.wpTextbox1.value.split('{{protect}}')[1] != undefined)
{
whattag = 'protect';
whattype = otherpro;
var go = 'yes';
}
else if (document.editform.wpTextbox1.value.split('{{protected}}')[1] != undefined)
{
whattag = 'protected';
whattype = otherpro;
var go = 'yes';
}
else if (document.editform.wpTextbox1.value.split('{{moveprotect}}')[1] != undefined)
{
whattag = 'moveprotect';
whattype = movesec;
var go = 'yes';
}
else if (document.editform.wpTextbox1.value.split('{{moveprotected}}')[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('{{' + whattag + '}}','');
if (VoABot_on ==0)
{
window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit§ion=' + whattype + '&jsaction=pdelist&jsaction=' + jstarget,
'WP:PP remove',
'___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&jsaction=unprotect',
'Page protect',
'___location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes');
}
}
{
if (reg == 'a')
{
window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit§ion=' + anontalk + '&jsaction=pdelist&jsaction=' + jstarget,
'WP:PP remove',
'___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§ion=' + regtalk + '&jsaction=pdelist&jsaction=' + jstarget,
'Page unprotect',
'___location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes');
gonotagged = 'yes';
}
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§ion=' + usersemi + '&jsaction=pdelist&jsaction=' + jstarget,
'WP:PP remove',
'___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§ion=' + userfull + '&jsaction=pdelist&jsaction=' + target,
'Page unprotect',
'___location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes');
gonotagged = 'yes';
}
var whattag_upper = tagtype.substring(0,1).toUpperCase() + tagtype.substring(1,whattag.length);
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{' + tagtype + '}}','');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{' + whattag_upper + '}}','');
var windowpp = window.open('http://en.wikipedia.org/w/index.php?title=Wikipedia:List_of_protected_pages&action=edit§ion=' + type + '&jsaction=pdelist&jsaction=' + jstarget,
'WP:PP remove',
'___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&jsaction=unprotect',
'Page unprotect',
}
}
else if (document___location.titlehref.indexOf('Confirm protection&action=protect') !==0-1)
{
var auto = '0';
edit.getElementsByTagName('option')[2].selected=false;
document.getElementById('mwProtect-reason').value = 'Heavy vandalism from multiple sources.';
document.getElementById('mwProtect-expiryexpires').value = '5 days';
}
if (action == 'fprotect')
edit.getElementsByTagName('option')[2].selected=true;
document.getElementById('mwProtect-reason').value = 'Users engaging in edit warring.';
document.getElementById('mwProtect-expiryexpires').value = 'infinite';
}
if (auto=='1') {document.getElementsByTagName('form')[0].click();}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol support vote.svg{{RFPP|20px]] '''Fully protected'''p}} due to [[Wikipedia:Edit war|revert warring]]. " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: page fully protected";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol support vote.svg{{RFPP|20px]] '''Semi-protected'''s}} due to heavy [[vandalism]]. " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: page semi-protected";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol support vote.svg{{RFPP|20px]] '''Move-protected'''m}} due to excessive renaming. " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: page move-protected";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol keep vote.svg{{RFPP|20px]] '''Un-protected.'''u}} It's been protected for long enough. Hopefully things have calmed down since then. " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: page un-protected";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol opinion vote.svg{{RFPP|20px]]d}} Page " + value + "[http://en.wikipedia.org/w/index.php?title=Special:Log/protect&user=" + usera + "] by [[user:" + user + "|" + user + "]]" + ". " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: " + value + " by another Sysop";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol oppose vote.svg{{RFPP|20px]]d}} It's still totoo soon to un-protect since the wave of [[Wikipedia:Vandalism|vandalism]] will likely continue immediately after un-protection. " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: un-protection request denied";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol oppose vote.svg{{RFPP|20px]]d}} The [[WP:AGF|reasonable]] issues that started the [[Wikipedia:Edit war|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 <no" + "wiki>{{Editprotected}}</nowiki> 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";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol oppose vote.svg{{RFPP|20px]]d}} There is not enough recent activity to [[Wikipedia:Protection_policy#Uses|justify]] [[Wikipedia:Protection policy|protection]] at this time. For now, be sure to use descriptive [[Wikipedia:Edit summary|edit summaries]] and discuss edits on [[Wikipedia:Talk pages|talk]]. " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: protection request denied";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol oppose vote.svg{{RFPP|20px]]d}} There is not enough recent activity to [[Wikipedia:Protection_policy#Uses|justify]] [[Wikipedia:Semi-protection_policy|protection]] at this time. Just [[watchlist]] and revert any vandalism. " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: protection request denied";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol opinion vote.svg{{RFPP|20px]] The user has been [[WP:BLOCK|blocked]] from editing.b}} " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: user blocked";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol opinion vote.svg{{RFPP|20px]]n}} The page is now monitored for changes by a [[User:VoABot II|bot]]. " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: page monitored by bot";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol comment vote.svg{{RFPP|20px]]ap}} The page is already protected. " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: page already protected";
}
if (t.value.length > 0)
t.value += '\n';
t.value +=":[[Image:Symbol comment vote.svg{{RFPP|20px]]au}} The page is not actually protected. " + "~" + "~" + "~" + "~";
f.wpSummary.value += "Response: page was not protected";
}
function URLEncoding(input)
{
var encodedInputString=escape(input);
encodedInputString=encodedInputString.replace(/\+/g, "%2B");
encodedInputString=encodedInputString.replace(/\//g,"%2F");
encodedInputString=encodedInputString.replace(/&/g,"%26");
var outputurl=encodedInputString;
return outputurl;
}
//</nowiki></pre>
|