User:Solar Dragon/global.js

ShoutWiki — express yourself and be heard!
Jump to: navigation, search
// *****************************************************************
// &bot=1 on contribs pages (Special:Contributions/Foo).
// *****************************************************************
function hideRollback() {
	var botlink = document.location.href;
	if( botlink.indexOf( '?' ) == -1 ) {
		botlink += '?bot=1';
	} else {
		botlink += '&bot=1';
	}
	addPortletLink( 'p-cactions', botlink, '&bot=1', 'ca-bot' );
}
if( wgCanonicalSpecialPageName == 'Contributions' ) {
	addOnloadHook( hideRollback );
}

// Blank the deletion summary if it has some content (such as "content was"...or anything else, really)
// Adapted from http://www.mediawiki.org/wiki/MediaWiki:Gadget-CleanDeleteReasons.js
jQuery( document ).ready( function() {
	if ( mw.config.get( 'wgAction' ) == 'delete' ) {
		var wpReason = document.getElementById( 'wpReason' );
		if ( !wpReason ) {
			return;
		}
		if ( wpReason.value !== '' ) {
			wpReason.value = '';
		}
	}
} );