User:Wikieat/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin is at User:Wikieat/monobook.css. |
// ======== 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');
}
});