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( {
17 // Prefix of list=allusers is case sensitive. Normalise first
18 // character to uppercase so that "fo" may yield "Foo".
19 auprefix
: userInput
[ 0 ].toUpperCase() + userInput
.slice( 1 ),
21 } ).done( function ( data
) {
22 var users
= $.map( data
.query
.allusers
, function ( userObj
) {
30 request
= $.data( node
, 'request' );
34 $.removeData( node
, 'request' );
40 $( '.mw-autocomplete-user' ).suggestions( config
);
42 }( mediaWiki
, jQuery
) );