User:Void/quickDel.js

// // Quickly written script designed to delete pages equally as quickly.

if( mw.config.get( 'wgCanonicalNamespace' ) !== 'Special' ) { var delLink = mw.util.addPortletLink(	   'p-cactions',	    '#',	    'QuickDel',    	'pt-spamlink',	    'Delete the current page'	);

$( delLink ).click( function {		var confirmDel = confirm( 'Do you really want to delete this page?' );		if( confirmDel ) {			var summary = prompt("Enter a reason for deleting the page (default is spam):", "spam");			deletePage(summary);		}	}); }

function deletePage( summary ) { if( summary.trim.length === 0 ) summary = "spam"; switch(summary) { case "spam": summary = "Spam (CVT action)"; break; case "vandalism": summary = "Vandalism (CVT action)"; break; default: // Leave as is	} var pageTitle = mw.config.get( 'wgPageName' ); $.ajax( {       url: mw.util.wikiScript( 'api' ),        type: 'POST',        dataType: 'json',        data: {            format: 'json',            action: 'delete',            title: pageTitle,            reason: summary,            token: mw.user.tokens.get( 'csrfToken' ),        }    } ).done(console.log( "Deleted page: " + pageTitle )    ).fail( function ( e, data ) {    	console.log( e.message );    	console.log( JSON.stringify( data ) );    }); }

//