Jump to content

User:Wikieat/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// ======== QuickBlocks =======
function QuickBlock (expiry,reason,hardblock,autob,accfreeze,emailblock,talkblock)
{
//cache reference to block form, inputs list
blockForm = document.getElementById('blockip');
inputs = blockForm.getElementsByTagName('input');
 
//fill out the form fields
for (i=0; i<inputs.length; i++)
{
switch (inputs[i].name)
{
case 'wpBlockOther':
inputs[i].value = expiry;
break;
 
case 'wpBlockReason':
inputs[i].value = reason;
break;
 
case 'wpAnonOnly':
inputs[i].checked = !hardblock;
break;
 
case 'wpEnableAutoblock':
inputs[i].checked = autob;
break;
 
case 'wpCreateAccount':
inputs[i].checked = accfreeze;
break;
 
case 'wpEmailBan':
inputs[i].checked = emailblock;
break;
 
case 'wpAllowUsertalk':
inputs[i].checked = !talkblock; //this one's flipped
break;
 
} //switch
} //for
 
//submit the form :D
 
if (document.getElementById('Already_blocked') != null)
{
alert('User is already blocked. Submit manually to update settings.');
}
else
{
blockForm.submit();
}
}
 
addOnloadHook(function(){
if (document.title.indexOf("Block user") == -1) return;
else {
 
addTab('javascript:('+QuickBlock+')("12 hours","Blocked for 12 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",true,true,true,false,false)','12h-hard','p-block-ab-1h');
 
addTab('javascript:('+QuickBlock+')("24 hours","Blocked for 24 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",false,true,true,false,false)','24h','p-block-ab-24h');
 
addTab('javascript:('+QuickBlock+')("24 hours","Blocked for 24 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",true,true,true,false,false)','24h-hard','p-block-ab-24h');
 
addTab('javascript:('+QuickBlock+')("48 hours","Blocked for 48 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",false,true,true,false,false)','48h','p-block-ab-48h');
 
addTab('javascript:('+QuickBlock+')("48 hours","This IP address has recently been used abusively. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",true,true,true,false,false)','48h-hard','p-block-ab-48-hard');
 
addTab('javascript:('+QuickBlock+')("1 week","Blocked for one week, due to repeat abuse. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",false,true,true,false,false)','week','p-block-ab-1w');
 
addTab('javascript:('+QuickBlock+')("1 week","Blocked for one week, due to repeat abuse. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",true,true,true,false,false)','one week-hard','p-block-ab-1w');
 
addTab('javascript:('+QuickBlock+')("1 month","Blocked for one month, due to repeat abuse. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",false,true,true,false,false)','month','p-block-ab-1m');
 
addTab('javascript:('+QuickBlock+')("1 month","Blocked for one month, due to repeat abuse. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",true,true,true,false,false)','month-hard','p-block-ab-1m');
 
addTab('javascript:('+QuickBlock+')("1 month","{{Schoolblock}}",false,true,true,false,false)','school-month','p-block-ab-1m');
 
addTab('javascript:('+QuickBlock+')("3 months","{{Schoolblock}}",false,true,true,false,false)','school-3m','p-block-ab-3m');
 
addTab('javascript:('+QuickBlock+')("6 months","{{Schoolblock}}",false,false,true,false,false)','school 6m','p-block-anon-6m');
//{{anonblock}}
 
addTab('javascript:('+QuickBlock+')("3 months","{{Anonblock}}",false,true,true,false,false)','anon-3months','p-block-ab-3m');
 
addTab('javascript:('+QuickBlock+')("6 months","{{Anonblock}}",false,false,true,false,false)','anon-6months','p-block-anon-6m');
//{{anonblock}}
 
addTab('javascript:('+QuickBlock+')("2 years","{{Blocked proxy}}",true,true,true,false,false)','Proxy','p-block-proxy');
//{{openproxy}}
 
addTab('javascript:('+QuickBlock+')("3 months","{{Tor}}",true,true,true,false,false)','TOR','p-block-proxy');
//{{openproxy}}
 
addTab('javascript:('+QuickBlock+')("indefinite","Blocked indefinitely, due to abuse. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",false,true,true,false,false)','indef','p-block-ab-ind');
 
addTab('javascript:('+QuickBlock+')("indefinite","Abusing [[Wikipedia:Sock puppetry|multiple accounts]]. To appeal or request help, please [[Special:Emailuser/"+wgUserName+"|contact me]]",true,true,true,false,false)','sock','p-block-sock-ind');
 
addTab('javascript:('+QuickBlock+')("indefinite","{{usernameblocked}}",true,false,false,false,false)','name','p-block-username');
//{{Usernameblocked}}
 
addTab('javascript:('+QuickBlock+')("indefinite","Abuse",true,true,true,true,true)','grawp','p-block-grawp');
}
});