Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | Documentation for this user script can be added at User:MZMcBride/csd. |
/**
* Speedy deletion script
* Based on https://wikimediafoundation.org/wiki/User:MZMcBride/prod.js
* @author Legoktm, MZMcBride
* Public domain; 2013
*/
var prodlink = mw.util.addPortletLink( 'p-cactions',
'#',
'CSD',
'ca-csd',
'CSD G6' );
// Bind click handler
$( prodlink ).click( function () {
var page_title = mw.config.get('wgPageName');
prod( page_title );
});
function prod( page_title ) {
var api = new mw.Api();
api.get( { action: 'query',
prop: 'info',
intoken: 'edit',
titles: 'beepboop', // Hello. I'm here.
format: 'json'
} ).done(
function( data ) {
var edit_token = data.query.pages['-1'].edittoken;
console.log(edit_token);
api.post( { action: 'edit',
title: page_title,
text: '{'+'{db-g6|rationale=cleanup following [[bugzilla:53670]]}}',
summary: '[[WP:CSD#G6|CSD G6]]',
token: edit_token
} ).done(
function( data ) {
window.location = '/wiki/'+page_title;
} );
}
); }