var api, config;
config = {
- fetch: function ( userInput ) {
- var $textbox = this,
- node = this[0];
+ fetch: function ( userInput, response, maxRows ) {
+ var node = this[0];
api = api || new mw.Api();
list: 'allusers',
// Prefix of list=allusers is case sensitive. Normalise first
// character to uppercase so that "fo" may yield "Foo".
- auprefix: userInput.charAt( 0 ).toUpperCase() + userInput.slice( 1 )
+ auprefix: userInput.charAt( 0 ).toUpperCase() + userInput.slice( 1 ),
+ aulimit: maxRows
} ).done( function ( data ) {
var users = $.map( data.query.allusers, function ( userObj ) {
return userObj.name;
} );
- // Set the results as the autocomplete options
- $textbox.suggestions( 'suggestions', users );
+ response( users );
} ) );
},
cancel: function () {