mw.widgets.UsersMultiselectWidget

Input list of users in a single line.

If used inside HTML form the results will be sent as the list of newline-separated usernames.

This can be configured to accept IP addresses and/or ranges as well as usernames.

Extends

Constructor

new mw.widgets.UsersMultiselectWidget(config) #

Create an instance of mw.widgets.UsersMultiselectWidget.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
api mw.Api optional

Instance of mw.Api (or subclass thereof) to use for queries

limit number optional
10

Number of results to show in autocomplete menu

name string optional

Name of input to submit results (when used in HTML forms)

ipAllowed boolean optional
false

Show IP addresses in autocomplete menu If false, single IP addresses are not allowed, even if IP ranges are allowed.

ipRangeAllowed boolean optional
false

Show IP ranges in autocomplete menu

ipRangeLimits Object optional

Maximum allowed IP ranges (defaults match HTMLUserTextField.php)

Properties:
Name Type Attributes Default Description
IPv4 number optional
16

Maximum allowed IPv4 range

IPv6 number optional
32

Maximum allowed IPv6 range

Source:

Methods

getSelectedUsernames() → {Array.<string>} #

Get currently selected usernames.

Source:

Returns:

usernames

Type
Array.<string>
Get currently selected usernames.

onTagSelect() #

We have an empty menu when the input is empty, override the implementation from MenuTagMultiselectWidget to avoid error and make tags editable.

Only editable when the input is empty.

Source:

We have an empty menu when the input is empty, override the implementation from MenuTagMultiselectWidget to avoid error and make tags editable.