User:Psl631/block.js

// ======== QuickBlocks ======= // m:MediaWiki:Gadget-blockoptions.js function QuickBlock (expiry,reason,anonOnly,autoBlock,accountCreationBlocked,disableEmail,watch,disableUserTalk) { $('#mw-input-wpExpiry-other').value=expiry; $('#mw-input-wpReason-other').value=reason; $('#mw-input-wpCreateAccount').checked=accountCreationBlocked; $('#mw-input-wpDisableEmail').checked=disableEmail; $('#mw-input-wpDisableUTEdit').checked=disableUserTalk; $('#mw-input-wpAutoBlock').checked=autoBlock; $('#mw-input-wpWatch').checked=watch; $('#mw-input-wpHardBlock').checked=!anonOnly; } function userIsInGroup( group ) { return ( mw.config.get(wgUserGroups) != null && mw.config.get(wgUserGroups).indexOf( group ) != -1 ) || ( mw.config.get(wgUserGroups) == null && group == 'anon' ); } function addblockoptions { // options: anon only/autoblock/account creation blocked/email blocked/watch/disable editing of user talk mw.util.addPortletLink('p-cactions',		'javascript:QuickBlock("indefinite","Vandalism-only account",0,1,1,0,0,0)',		'vandal: indef',		'p-block-vandalism'); mw.util.addPortletLink('p-cactions',		'javascript:QuickBlock("indefinite","Abusing several accounts",0,1,1,0,0,0)',		'sock: indef',		'p-block-sock'); mw.util.addPortletLink('p-cactions',		'javascript:QuickBlock("24 hours","Vandalism",1,1,1,0,0,0)',		'vandal: 24h',		'p-block-24h'); mw.util.addPortletLink('p-cactions',		'javascript:QuickBlock("31 hours","Vandalism",1,1,1,0,0,0)',		'vandal: 31h',		'p-block-31h'); mw.util.addPortletLink('p-cactions',		'javascript:QuickBlock("1 week","Vandalism",1,1,1,0,0,0)',		'vandal: 1w',		'p-block-week'); mw.util.addPortletLink('p-cactions',		'javascript:QuickBlock("indefinite","Spambot",1,1,1,1,0,1)',		'spambot',		'p-spambot'); mw.util.addPortletLink('p-cactions',		'javascript:QuickBlock("72 hours","Long-term abuse",1,1,1,1,0,1)',		'lta: samlaptop',		'p-samlaptop'); mw.util.addPortletLink('p-cactions',		'javascript:QuickBlock("2 weeks","",1,1,0,0,0,0)',		'lta: pakistan',		'p-pakistan'); } // options: anon only/autoblock/account creation blocked/email blocked/watch/disable editing of user talk

if ( mw.config.get(wgCanonicalSpecialPageName) == 'Block' )$(addblockoptions);