User:DannyS712 test/nuke.js

// Install this version with: // // or with //  // // If forking this script, please note my contributions / give me credit // $(function { var rn_config = {	name: 'Nuke requester',	version: 1.0,	debug: true };

mw.loader.using(['mediawiki.util', 'mediawiki.api', 'mediawiki.Title', 'mediawiki.RegExp'], function {	$(document).ready( function { if ( mw.config.get( 'wgNamespaceNumber' ) == 2) { var link = mw.util.addPortletLink( 'p-cactions', 'javascript:void(0)', 'Nuke', 'ca-RNK', 'Request that the pages created by this user be nuked'); $( link ).click( function ( event ) {	           event.preventDefault;	            console.log ( 'Nuking' );				importScript( 'User:DannyS712 test/append.js' );    			RNK_run;	        } ); }	} ); } ); function RNK_run{ var user = mw.config.get('wgRelevantUserName'); var page = "User:DannyS712 test/sandbox"; var explanation = prompt("Why are you requesting a nuke of the pages created by " + user + "?", ""); if (explanation === null || explanation === "") { alert("You didn't enter an explanation. Aborting..."); return; }	var request_heading = "Nuke requested"; var request_content = "Please nuke the pages created by User:" + user + ". The reason for this nuke request is: " + explanation + ". Thanks, ~"; var rn_summary = 'Request a nuke of the pages created by User:' + user + ' with ' + rn_config.name + ' (version ' + rn_config.version + ')'; addNewSectionTo( rn_summary, request_heading, request_content, page ); } }); //