2 * Add autocomplete suggestions for names of registered users.
8 fetch: function ( userInput, response, maxRows ) {
11 api = api || new mw.Api();
13 $.data( node, 'request', api.get( {
16 // Prefix of list=allusers is case sensitive. Normalise first
17 // character to uppercase so that "fo" may yield "Foo".
18 auprefix: userInput.charAt( 0 ).toUpperCase() + userInput.slice( 1 ),
20 } ).done( function ( data ) {
21 var users = $.map( data.query.allusers, function ( userObj ) {
29 request = $.data( node, 'request' );
33 $.removeData( node, 'request' );
39 $( '.mw-autocomplete-user' ).suggestions( config );
41 }( mediaWiki, jQuery ) );