//<pre><nowiki>
VoABot_on=1;
//This function sets the selected values on the Confirm protection page
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
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',
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',
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,
'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,
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');
}
}
|