2 * Add autocomplete suggestions for action forms reasons.
6 var reasons
= mw
.config
.get( 'reasons' );
8 // Add relevant suggestion
9 $( '#mwProtect-reason, #wpReason, #mw-input-wpReason-other' ).suggestions( {
11 var $this = $( this ), relevantSuggestions
;
12 relevantSuggestions
= $.grep( reasons
, function ( reason
) {
13 return ( reason
.toLowerCase().indexOf( $this.val().toLowerCase() ) > -1 );
15 $this.suggestions( 'suggestions', relevantSuggestions
);
20 }( mediaWiki
, jQuery
) );