MediaWiki:Gadget-EditSummary.js

/* * * EditSummary.js * /* global mw, $, OO, wb */ $( function {	if( !mw.config.exists( 'wbEntityId' ) ) {		return;	}	mw.loader.using( [ 'wikibase.api.RepoApi', 'oojs-ui' ], function  { var textInput = new OO.ui.TextInputWidget( {			maxLength: 250,			placeholder: 'edit summary here'		} ), summary = '', oldPost = wb.api.RepoApi.prototype._post;

textInput.on( 'change', function {			summary = textInput.getValue.trim;		} );

textInput.$element .insertBefore( '.wikibase-entitytermsview-entitytermsforlanguagelistview-toggler' );

wb.api.RepoApi.prototype._post = function ( params ) { if ( params.summary === undefined && summary !== '' ) { params.summary = summary; }			return oldPost.call( this, params ); };	} ); } );