MediaWiki:Gadget-pseudodelete.js

try { // containerize gadget, to protect other gadgets if this one goes wrong

/** * Based on w:en:User:Twinzor's Wikimarks script * Also uses Bawolff's awesome API. * * This script adds a "QD" link near the usual view/edit/history buttons, * allowing a user to semi-automatically add Template:Delete to pages; * essentially mimicking the delete button for non-sysops. * * You can enable this gadget by selecting the relevant checkbox in * Special:Preferences. */

function initQD { mw.util.addPortletLink( 'p-cactions', 'javascript:showQD', 'QD', 'ca-addQD', 'QD this page', ,  ); } $( initQD );

function addQD( qdreason ) { var QDNewpage = mw.config.get('wgPageName').replace( "_", " " ); api( QDNewpage ).setDefaultSummary( 'Tagging for deletion with js assistance' ).getPage.lift( function ( pageText ) {       return '\n' + pageText;    } ).savePage.exec; jsMsg( 'Page tagged for deletion! An administrator will be along shortly to consider your request.' ); } function showQD { var reasons = { "content": "A1: Nonsense", "test": "A2: Test page", "vand": "A3: Vandalism", "short": "A4: No context", //"rename": "A5: Cleanup after copy/paste move"; "spam": "A6: Spam", "author": "A7: Author request", "hoax": "A8: Hoax", "undelete": "A9: Recreation of deleted content", "foreign": "A10: Not English", "scope": "A11: Out of project scope", "broken": "R1: Broken redirect", "namespace": "R2: Cross namespace redirect", "typo": "R3: Typo redirect", "r4": "R4: Result of page-move vandalism", "fairuse": "I1: Violation of fair use policy", "redundant": "I2: Redundant image", "unused": "I3: Unused image", //"userpage": "G1: Userpage deletion request by author", "disassociated": "G2: Disassociated talk/comments page", //"IP": "G3: Old IP talk page", "empty": "G4: Empty category", //"retired": "G5: User page of retired user", //"unpublished": "G6: Comments page of unpublished article" };

var msg = ''; for ( var reason in reasons ) { msg += '' + reasons[reason] + '\n'; }   jsMsg( msg ); }

} catch (e) { // containerize gadget, to protect other gadgets if this one goes wrong // ignore }