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 mcw.deleteBlanking = false; to Special:MyPage/common.js */ if ( window.mcw && ( mcw.deleteBlanking === undefined || mcw.deleteBlanking ) && mw.config.get( 'wgAction' ) === 'delete' ) { var summary = $( '#wpReason' ), summaryVal = summary.prop( 'value' ); if ( summaryVal.match( /content (?:before blanking )?was:/ ) ) { var deleteReason = summaryVal.match( /\{\{\s*(template:\s*)?delete\s*\|\s*([^\}]+?)\s*(\|[^\]\}]*)?(\}\}|\.\.\.$)/i ); if ( deleteReason ) { summary.prop( 'value', deleteReason[2] ); } else { summary.prop( 'value', '' ); }	} }

/** * Allow moved pages to be patrolled * * Adds the rcid to the link in the log to the new page * for pages that are moved without redirect, so they are patrollable */ var rcid = mw.util.getParamValue( 'rcid' ); if ( rcid && !$( '.patrollink' ).length ) { $( '.mw-warning-with-logexcerpt li > a:last' ).prop( 'href', function {		return this.href += '?redirect=no&rcid=' + rcid;	} ); }

} );