Content deleted Content added
Aaron Schulz (talk | contribs) m |
Amorymeltzer (talk | contribs) m Remove legacy globals per phab:T72470 (via WP:JWB) |
||
(19 intermediate revisions by 3 users not shown) | |||
Line 1:
//<pre><nowiki>
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');
}
Line 97 ⟶ 9:
function jssubmitclose()
{
}
Line 143 ⟶ 54:
function protection_tabs()
{
var non_art = /Talk:| talk:|User:|MediaWiki:|Image:|Wikipedia:|Template:|Portal:|Help:|Main Page|Category:/;
if (document.title.indexOf("Editing ") != -1)
{
if (document.title.indexOf("Editing User talk:") != -1)
{
Line 333 ⟶ 225:
else if (txtbox.value.search('\\{\\{(tl\\|)[Mm]oveprotect(ed)\\}\\}') != -1)
{var z_check = 'notag';}
else if (txtbox.value.search(/\{\{[Ss]protect|\{\{[Pp]rotect/) != -1)
{var z_check = 'notag';}
else
Line 437 ⟶ 329:
document.editform.wpTextbox1.value = '{{sprotected' + '}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value += '+{{sprotected' + '}}';
window2 = window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&jsaction=sprotect',
'Page protect',
Line 497 ⟶ 387:
document.editform.wpTextbox1.value = '{{Vprotected' + '}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value += '+{{Vprotected' + '}}';
window2 = window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&jsaction=fprotect',
'Page protect',
Line 543 ⟶ 430:
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=' + target.replace(/&/g,"%26") + '&action=protect&jsaction=fprotect',
'Page protect',
Line 587 ⟶ 471:
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=' + target.replace(/&/g,"%26") + '&action=protect&jsaction=sprotect',
'targetnameo',
Line 607 ⟶ 488:
{
var original = document.editform.wpTextbox1.value;
jstarget = URLEncoding(mw.config.get('wgTitle'));
if(m = document.editform.wpTextbox1.value.match(/\{\{(\w\w-|)semi-
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{(\w\w-|)full-
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{(\w\w-|)semi-protected(\|small=\w{2,3}|)\}\}/)
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{(\w\w-|)full-protected(\|small=\w{2,3}|)\}\}/)
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{pp-(dispute|vandalism)\}\}/)
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{sprot(ect|ected|)(2
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{semiprotect(ed|)(2
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{sprotect-
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{sprotected-
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{
{
whattag = m[0];
}
else if(m = document.editform.wpTextbox1.value.match(/\{\{
{
whattag = m[0];
Line 683 ⟶ 564:
{
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;
}
Line 695 ⟶ 576:
document.editform.wpSummary.value += 'Unprotected page -- removing tag';
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(whattag,'');
window.open('http://en.wikipedia.org/w/index.php?title=' + mw.config.get('wgTitle').replace(/&/g,"%26") + '&action=protect&jsaction=unprotect' + auto,
'WP:unpro:' + mw.config.get('wgTitle'),
'___location=no,toolbar=no,status=no,directories=no,scrollbars=yes,fullscreen=yes');
jssubmitclose();
Line 1,042 ⟶ 923:
{
if (reg == 'a')
{
gonotagged = 'yes';
}
else if (reg == 'r')
{
gonotagged = 'yes';
}
Line 1,064 ⟶ 939:
var level = prompt("Page no longer semi or fully protected (enter *s* or *f*)?");
if (level == 's')
{
gonotagged = 'yes';
}
else if (level == 'f')
{
gonotagged = 'yes';
}
Line 1,106 ⟶ 975:
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 windowcp = window.open('http://en.wikipedia.org/w/index.php?title=' + target.replace(/&/g,"%26") + '&action=protect&jsaction=unprotect',
'Page unprotect',
Line 1,135 ⟶ 1,001:
}
}
else if (
{
var auto = '0';
Line 1,183 ⟶ 1,049:
edit.getElementsByTagName('option')[2].selected=false;
document.getElementById('mwProtect-reason').value = 'Heavy vandalism from multiple sources.';
document.getElementById('
}
if (action == 'fprotect')
Line 1,196 ⟶ 1,062:
edit.getElementsByTagName('option')[2].selected=true;
document.getElementById('mwProtect-reason').value = 'Users engaging in edit warring.';
document.getElementById('
}
if (auto=='1') {document.getElementsByTagName('form')[0].click();}
Line 1,210 ⟶ 1,076:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: page fully protected";
}
Line 1,219 ⟶ 1,085:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: page semi-protected";
}
Line 1,228 ⟶ 1,094:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: page move-protected";
}
Line 1,237 ⟶ 1,103:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: page un-protected";
}
Line 1,260 ⟶ 1,126:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: " + value + " by another Sysop";
}
Line 1,269 ⟶ 1,135:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: un-protection request denied";
}
Line 1,278 ⟶ 1,144:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: un-protection request denied";
}
Line 1,287 ⟶ 1,153:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: protection request denied";
}
Line 1,296 ⟶ 1,162:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: protection request denied";
}
Line 1,305 ⟶ 1,171:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: user blocked";
}
Line 1,314 ⟶ 1,180:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: page monitored by bot";
}
Line 1,323 ⟶ 1,189:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
f.wpSummary.value += "Response: page already protected";
}
Line 1,332 ⟶ 1,198:
if (t.value.length > 0)
t.value += '\n';
t.value +=":
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>
|