User:Kanonkas/quickblock.js

// ======== 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 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 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 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 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 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 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 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 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 contact me",true,true,true,false,false)','month-hard','p-block-ab-1m');

addTab('javascript:('+QuickBlock+')("1 month","",false,true,true,false,false)','school-month','p-block-ab-1m');

addTab('javascript:('+QuickBlock+')("3 months","",false,true,true,false,false)','school-3m','p-block-ab-3m'); addTab('javascript:('+QuickBlock+')("6 months","",false,false,true,false,false)','school 6m','p-block-anon-6m'); //   addTab('javascript:('+QuickBlock+')("3 months","",false,true,true,false,false)','anon-3months','p-block-ab-3m');

addTab('javascript:('+QuickBlock+')("6 months","",false,false,true,false,false)','anon-6months','p-block-anon-6m'); //

addTab('javascript:('+QuickBlock+')("2 years","",true,true,true,false,false)','Proxy','p-block-proxy'); //

addTab('javascript:('+QuickBlock+')("3 months","",true,true,true,false,false)','TOR','p-block-proxy'); //

addTab('javascript:('+QuickBlock+')("indefinite","Blocked indefinitely, due to abuse. To appeal or request help, please contact me",false,true,true,false,false)','indef','p-block-ab-ind');

addTab('javascript:('+QuickBlock+')("indefinite","Abusing multiple accounts. To appeal or request help, please contact me",true,true,true,false,false)','sock','p-block-sock-ind'); addTab('javascript:('+QuickBlock+')("indefinite","",true,false,false,false,false)','name','p-block-username'); //   addTab('javascript:('+QuickBlock+')("indefinite","Abuse",true,true,true,true,true)','grawp','p-block-grawp'); } });