User:Luk/block.js

// ======== QuickBlocks ======= function QuickBlock(expiry, reason, ao, autob, accfreeze, emailblock, watch, addUnblockMessage, submit) { var blockForm = document.getElementsByClassName('mw-htmlform')[0]; var inputs = blockForm.getElementsByTagName('input'); var unblockMessage = 'To appeal or request help, please contact me or follow the instructions below'; var unblockMessageIp = 'To appeal or request help, please follow the instructions below'; var isUser = document.getElementById('t-emailuser');

for (var i = 0; i < inputs.length; i++) { if (inputs[i].name == 'wpExpiry-other') { inputs[i].value = expiry; continue; }       if (inputs[i].name == 'wpReason-other') { if (addUnblockMessage) { reason += unblockMessage; }           inputs[i].value = reason; continue; }       if (inputs[i].name == 'wpHardBlock') { if (ao == 0) { inputs[i].checked = 'checked'; }           else { inputs[i].checked = false; }           continue; }       if (inputs[i].name == 'wpAutoBlock') { if (autob == 1) { inputs[i].checked = 'checked'; }           else { inputs[i].checked = false; }           continue; }       if (inputs[i].name == 'wpCreateAccount') { if (accfreeze == 1) { inputs[i].checked = 'checked'; }           else { inputs[i].checked = false; }           continue; }       if (inputs[i].name == 'wpDisableEmail') { if (emailblock == 1) { inputs[i].checked = 'checked'; }           else { inputs[i].checked = false; }           continue; }       if (inputs[i].name == 'wpWatch') { if (watch == 1) { inputs[i].checked = 'checked'; }           else { inputs[i].checked = false; }           continue; }       if (inputs[i].name == 'wpDisableUTEdit') { if (emailblock == 1) { inputs[i].checked = 'checked'; }           else { inputs[i].checked = false; }           continue; }   }    if (submit == 1) { if (document.getElementById('mw-input-wpConfirm').value == '' || confirm('already blocked')) { // alert('submit'); blockForm.submit; }   } }

addOnloadHook(function {    if (document.title.indexOf("Block user") == -1) {        return;    } else {        //TEMPLATE: addTab('javascript:('+QuickBlock+')("expiry","reason",ao,autob,accfreeze,emailblock)','label','id',autosubmit);

addTab('javascript:QuickBlock("indefinite","",1,1,1,0,1,0,0)', 'indef', 'p-block-tweak');

addTab('javascript:QuickBlock("3 hours","Blocked due to recent abuse of editing privileges. Consider improving rather than damaging the work of others.",1,1,1,0,0,1,1)', '3h', 'p-block-ab-3h'); //Blocked due to recent abuse of editing privileges. Consider improving rather than damaging the work of others. To appeal or request help, please follow the instructions below.

addTab('javascript:QuickBlock("3 hours","Blocked due to recent vandalism attempts (triggering the abuse filter). Consider improving rather than damaging the work of others.",1,1,1,0,0,1,1)', '3af', 'p-block-ab-3ab');

addTab('javascript:QuickBlock("31 hours","You have been blocked for one day, due to recent abuse of editing privileges.",1,1,1,0,1,1,1)', '31', 'p-block-ab-31h'); //Blocked for one day, due to recent abuse of editing privileges. To appeal or request help, please contact me or follow the instructions below.

addTab('javascript:QuickBlock("55 hours","You have been blocked for a few days, due to recent abuse of editing privileges.",1,1,1,0,1,1,1)', '55', 'p-block-ab-48h'); //Blocked for a few days, due to recent abuse of editing privileges. To appeal or request help, please contact me or follow the instructions below.

addTab('javascript:QuickBlock("55 hours","This IP address has recently been used abusively.",0,1,1,0,1,1,1)', '55-h', 'p-block-ab-55-hard'); //This IP address has recently been used abusively. To appeal or request help, please contact me or follow the instructions below.

addTab('javascript:QuickBlock("8 days","Blocked for a few days, due to recent abuse of editing privileges.",1,1,1,0,1,1,1)', '1w', 'p-block-ab-1w'); //Blocked for a few days, due to recent abuse of editing privileges. To appeal or request help, please contact me or follow the instructions below.

addTab('javascript:QuickBlock("indefinite","You have been blocked indefinitely, due to abuse of editing privileges.",1,1,1,0,1,1,1)', 'indef', 'p-block-ab-ind'); //This user has been blocked indefinitely, due to abuse of editing privileges. To appeal or request help, please contact me or follow the instructions below.

addTab('javascript:QuickBlock("1 month 55 hours","Blocked due to persistent abuse of editing privileges.",1,1,1,0,1,1,1)', '1m', 'p-block-ab-1m'); //Blocked due to persistent abuse of editing privileges. To appeal or request help, please contact me or follow the instructions below.

addTab('javascript:QuickBlock("1 month 55 hours","This IP address has been used abusively. If you are a legitimate user, please tell us: please contact me or follow the instructions below so we can tweak the block.",0,1,1,0,1,0,1)', 'm-h', 'p-block-ab-1month-hard'); //This IP address has recently been used abusively. To appeal or request help, please contact me or follow the instructions below.

addTab('javascript:QuickBlock("1 month 55 hours","",1,0,1,0,0,0,1)', 'm-ano', 'p-block-anon-1m'); //

addTab('javascript:QuickBlock("1 year 10 days 3 hours","",1,0,1,0,0,0,1)', 'y-ano', 'p-block-anon-1y'); //

addTab('javascript:QuickBlock("1 year 35 days 3 hours","",1,0,1,0,0,0,1)', 'y-edu', 'p-block-school-1y'); //

addTab('javascript:QuickBlock("15 days","Spamming links to external sites. Persistent spammers may have their websites blacklisted and penalized by search engines.",1,0,1,0,0,0,0)', 'spam', 'p-block-anon-spam'); //Spamming links to external sites. Persistent spammers may have their websites blacklisted and penalized by search engines.

addTab('javascript:QuickBlock("indefinite","Spamming links to external sites. Persistent spammers may have their websites blacklisted and penalized by search engines.",1,1,1,0,1,1,1)', 'spamusr', 'p-block-user-spam'); //Spamming links to external sites. Persistent spammers may have their websites blacklisted and penalized by search engines.

addTab('javascript:QuickBlock("indefinite","Abusing multiple accounts.",1,1,1,0,1,1,0)', 'sock', 'p-block-sock-ind'); //Abusing multiple accounts. To appeal or request help, please contact me or follow the instructions below.

addTab('javascript:QuickBlock("indefinite","abuse",1,1,1,1,1,0,1)', 'troll', 'p-block-grawp');

addTab('javascript:QuickBlock("indefinite","",1,0,0,0,1,0,0)', 'usr', 'p-block-username'); //

} } );