Expand all

mw.widgets.UserInputWidget

User input widget.

Extends

Constructor

new mw.widgets.UserInputWidget([config]) #

Create a mw.widgets.UserInputWidget object.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
limit number optional
10

Number of results to show

excludenamed boolean optional

Whether to exclude named users or not

excludetemp boolean optional

Whether to exclude temporary users or not

api mw.Api optional

API object to use, creates a default mw.Api instance if not specified

Mixes in:
Source:

Methods

getLookupCacheDataFromResponse(response) → {Object} #

Get lookup cache item from server response data.

Parameters:

Name Type Description
response any

Response from server

Source:

Returns:

Type
Object
Get lookup cache item from server response data.

getLookupMenuOptionsFromData(data) → {Array.<OO.ui.MenuOptionWidget>} #

Get list of menu items from a server response.

Parameters:

Name Type Description
data Object

Query result

Source:

Returns:

Menu items

Type
Array.<OO.ui.MenuOptionWidget>
Get list of menu items from a server response.

onLookupMenuChoose(item) #

Handle menu item 'choose' event, updating the text input value to the value of the clicked item.

Parameters:

Name Type Description
item OO.ui.MenuOptionWidget

Selected item

Source:
Handle menu item 'choose' event, updating the text input value to the value of the clicked item.

setLookupsDisabled([disabled]) #

Disable or re-enable lookups, but does not apply the re-enabling of lookups if this.alwaysDisableLookups is set to true.

Parameters:

Name Type Attributes Default Description
disabled boolean optional
false

Disable lookups

Source:

Disable or re-enable lookups, but does not apply the re-enabling of lookups if this.alwaysDisableLookups is set to true.