User:Seb26/quickblock.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. |
![]() | Documentation for this user script can be added at User:Seb26/quickblock. |
//Interiot's Tool
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript');
// ======== QuickBlocks =======
function QuickBlock (expiry,reason,ao,autob,accfreeze) {
blockForm = document.getElementById('blockip');
inputs = blockForm.getElementsByTagName('input');
for (i=0; i<inputs.length; i++) {
if (inputs[i].name == 'wpBlockOther') {
inputs[i].value = expiry;
continue;
}
if (inputs[i].name == 'wpBlockReason') {
inputs[i].value = reason;
continue;
}
if (inputs[i].name == 'wpAnonOnly') {
if (ao==1) {
inputs[i].checked = 'checked';
}
else if (ao==0) {
inputs[i].checked = false;
}
continue;
}
if (inputs[i].name == 'wpEnableAutoblock') {
if (autob==0) {
inputs[i].checked=false;
}
continue;
}
if (inputs[i].name == 'wpCreateAccount') {
if (accfreeze==0) {
inputs[i].checked=false;
}
continue;
}
}
blockForm.submit();
}
addOnloadHook(function(){
if (document.title.indexOf("Block user") == -1) return;
else {
//TEMPLATE: addTab('javascript:('+QuickBlock+')("expiry","reason",ao,autob,accfreeze)','label','id');
addTab('javascript:('+QuickBlock+')("1 hour","Blocked for one hour, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','hour','p-block-ab-1h');
//Blocked for one hour, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("3 hours","Blocked for three hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','3h','p-block-ab-3h');
//Blocked for three hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("12 hours","Blocked for 12 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','12h','p-block-ab-12h');
//Blocked for 12 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("24 hours","Blocked for 24 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','24h','p-block-ab-24h');
//Blocked for 24 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("31 hours","Blocked for 31 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','31h','p-block-ab-31h');
//Blocked for 31 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("48 hours","Blocked for 48 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','48h','p-block-ab-48h');
//Blocked for 48 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("48 hours","Blocked for 72 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','72h','p-block-ab-72h');
//Blocked for 72 hours, due to recent abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("1 week","Blocked for one week, due to repeat abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','week','p-block-ab-1w');
//Blocked for one week, due to repeat abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("1 month","Blocked for one month, due to repeat abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','month','p-block-ab-1m');
//Blocked for one month, due to repeat abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("3 months","Blocked for three months, due to repeat abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','3m','p-block-ab-3m');
//Blocked for three months, due to repeat abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("indefinite","Blocked indefinitely, due to abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",1,1,1)','indef','p-block-ab-ind');
//Blocked indefinitely, due to abuse. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
addTab('javascript:('+QuickBlock+')("48 hours","This IP address has recently been used abusively. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.",0,1,1)','48h-hard','p-block-ab-48-hard');
//This IP address has recently been used abusively. To appeal or request help, please [[Special:Emailuser/Spebi|contact me]], [[#Emailing us|unblock-en-l]], or follow the instructions below.
}
});