User:Chrs/weedwhacker.js

mw.loader.using(['mediawiki.user'], function {	if(mw.config.get('wgCanonicalSpecialPageName') == 'Recentchanges'){		$('.mw-changeslist-log-farmer.mw-changeslist-user-newcomer .mw-changeslist-log-entry').each(function{ if($(this).find('.history-deleted:contains("log details removed")').length == 0){ $(this).append([' [',$('whack').click(function{ var reqId = $(this).siblings('a[href^="/wiki/Special:RequestWikiQueue/"]').attr('href').split('/')[3]; if(window.confirm("Whack request #"+reqId+"?")){ $(this).off('click'); $(this).css('color', ' #871F78'); $(this).text('whacking'); $.ajax({							type: 'POST',							url: 'https://meta.miraheze.org/wiki/Special:RequestWikiQueue/'+reqId,							dataType: 'json',							data: {								'wpEditToken': mw.user.tokens.get('csrfToken'),								'wpsubmit-handle': 'Submit',								'wpsubmission-action': 'decline',								'wpvisibility': 1,								'wpreason': 'Request removed from public view, purely disruptive material.'							},							success: (json) => {								$(this).css('color', ' #006400');								$(this).text('whacked');							}						}); }				}),']'])			}		})	} });