User:Pppery/purge.js

$.when(mw.loader.using(['mediawiki.util', 'mediawiki.api']), $.ready).done(function {	var href = mw.config.get( 'wgServer' ) + mw.config.get( 'wgScript' )	href = href + "?title="+mw.util.wikiUrlencode(mw.config.get('wgPageName'))+"&action=purge";	$("a[href='"+href+"']").on( 'click', function (e) { new mw.Api.post( { action: 'purge', titles: mw.config.get( 'wgPageName' ) } ).then(function {			location.reload;		}, function  {			mw.notify( 'Purge failed', { type: 'error' } );		}); e.preventDefault; }); });