MediaWiki:Gadget-group-sysop.js

/* Any JavaScript here will be loaded for sysops only */ $( function { 'use strict';

/** * Blank the "Other/additional reason" field when deleting pages * * This is so we don't get stupid vandalism and * spam and whatnot preserved for posterity in the * delete log * * Disable by adding disableDeleteBlanking = true; to Special:MyPage/common.js */ if ( !window.disableDeleteBlanking && mw.config.get( 'wgAction' ) == 'delete' ) { var summary = $( '#wpReason' ), summaryVal = summary.prop( 'value' ); if ( summaryVal.match( /content (?:before blanking )?was:/ ) ) { var deleteReason = summaryVal.match( /\{\{(?:template:)?delete\|([^}]*)(\}\})?/i ); if ( deleteReason ) { if ( deleteReason[2] ) { summary.prop( 'value', deleteReason[1] ); } else { summary.prop( 'value', deleteReason[1].slice( 0, -1 ) ); }       } else { summary.prop( 'value', '' ); }   } }

} );