User:Ozank Cx/common.js

/* One-click block anons button on contributions */

if (mw.config.get('wgCanonicalSpecialPageName') === "Contributions" && mw.config.get('wgTitle').split('.').length == 4) $('.chat-ban-log').after(' | Annihilate ');

$('#contribs-annihilate').click(function {	var API = new mw.Api;	API.post({ action: 'block', user: mw.config.get('wgTitle').replace("Contributions/",""), reason: '', anononly: '', allowusertalk: '', autoblock: 0, expiry: '6 months', nocreate: '', token: mw.user.tokens.values.editToken })	.done(function(d) { if (!d.error) { console.log('User successfully blocked!'); location.reload; }		else alert('Failed to block user: ' + d.error.code); })	.fail(function { alert('Failed to block user!'); }); });