Expand all

mw.widgets

OOUI widgets specific to MediaWiki. Initially empty. To expand the amount of available widgets the mediawiki.widget module can be loaded.

Example

mw.loader.using('mediawiki.widget').then(() => {
  OO.ui.getWindowManager().addWindows( [ new mw.widget.AbandonEditDialog() ] );
});

Namespaces

datetime
OOUI widgets specific to MediaWiki for inputting date and time.

Classes

APIResultsProvider
API results provider.
APIResultsQueue
API results queue.
AbandonEditDialog
Confirm dialog shown when the user is leaving an editor without saving.
CalendarWidget
Calendar widget.
CategoryMultiselectWidget

Displays an OO.ui.MenuTagMultiselectWidget and autocompletes with available categories.

CategoryTagItemWidget

Extends OO.ui.TagItemWidget with the ability to link to the given page, and to show its existence status (whether it is a redlink).

CheckMatrixWidget
A JavaScript version of CheckMatrixWidget.
ComplexNamespaceInputWidget

Displays a dropdown box with the choice of available namespaces, plus two checkboxes to include associated namespace or to invert selection.

ComplexTitleInputWidget
Like TitleInputWidget, but the namespace has to be input through a separate dropdown field.
CopyTextLayout
Extends CopyTextLayout with MediaWiki notifications.
DateInputWidget
Date input widget.
ExpiryWidget
Expiry widget.
MediaResourceProvider
Media resource provider.
MediaResourceQueue
Media resource queue.
MediaResultWidget
Media result widget.
MediaSearchProvider
Media search provider.
MediaSearchQueue
Media resource queue.
MediaSearchWidget
Media search widget.
MediaUserUploadsProvider
User uploads provider.
MediaUserUploadsQueue
Media resource queue.
NamespaceInputWidget
Displays a dropdown box with the choice of available namespaces.
NamespacesMenuOptionWidget

Returns an item match text that includes both the label and the data, so the menu can filter on either.

NamespacesMultiselectWidget
Namespaces multiselect widget.
RowWidget
Table row widget.
RowWidgetModel
RowWidget model.
SearchInputWidget
Search input widget.
SelectWithInputWidget
Select with input widget.
SizeFilterWidget
Size filter widget.
StashedFileWidget

Accepts a stashed file and displays the information for purposes of publishing the file at the behest of the user.

TableWidget

Groups row widgets together to form a bidimensional grid of text inputs.

TableWidgetModel
TableWidget model.
TagMultiselectWidget
Input list of tags in a single line.
TitleInputWidget
Title input widget.
TitleOptionWidget
Title option widget.
TitleSearchWidget
Title search widget.
TitleWidget
Mixin for title widgets.
TitlesMultiselectWidget
Titles multiselect widget.
ToggleSwitchWidget
Add an invisible checkbox element which will be used to submit the value.
UserInputWidget
User input widget.
UsersMultiselectWidget
Input list of users in a single line.

Methods

visibleByteLimit(textInputWidget, [limit], [filterFunction])static #

Add a visible byte limit label to a TextInputWidget.

Loaded from mediawiki.widgets.visibleLengthLimit module.

Uses byteLimit to enforce the limit.

Parameters:

Name Type Attributes Description
textInputWidget OO.ui.TextInputWidget
limit number optional

Byte limit, defaults to input's maxlength attribute

filterFunction function optional

Function to call on the string before assessing the length

Source:
Add a visible byte limit label to a TextInputWidget.

visibleByteLimitWithDropdown(textInputWidget, dropdownInputWidget, [limit])static #

Add a visible byte limit label to a TextInputWidget, assuming that the value of the DropdownInputWidget will be added as a prefix. MediaWiki formats the comment fields for many actions that way, e.g. for page deletion.

Loaded from mediawiki.widgets.visibleLengthLimit module.

Uses byteLimit to enforce the limit.

Parameters:

Name Type Attributes Description
textInputWidget OO.ui.TextInputWidget
dropdownInputWidget OO.ui.DropdownInputWidget
limit number optional

Code point limit, defaults to input's maxlength attribute

Source:

Add a visible byte limit label to a TextInputWidget, assuming that the value of the DropdownInputWidget will be added as a prefix.

visibleCodePointLimit(textInputWidget, [limit], [filterFunction])static #

Add a visible codepoint (character) limit label to a TextInputWidget.

Loaded from mediawiki.widgets.visibleLengthLimit module.

Uses codePointLimit to enforce the limit.

Parameters:

Name Type Attributes Description
textInputWidget OO.ui.TextInputWidget
limit number optional

Code point limit, defaults to input's maxlength attribute

filterFunction function optional

Function to call on the string before assessing the length

Source:
Add a visible codepoint (character) limit label to a TextInputWidget.

visibleCodePointLimitWithDropdown(textInputWidget, dropdownInputWidget, [limit])static #

Add a visible codepoint (character) limit label to a TextInputWidget, assuming that the value of the DropdownInputWidget will be added as a prefix. MediaWiki formats the comment fields for many actions that way, e.g. for page deletion.

Loaded from mediawiki.widgets.visibleLengthLimit module.

Uses codePointLimit to enforce the limit.

Parameters:

Name Type Attributes Description
textInputWidget OO.ui.TextInputWidget
dropdownInputWidget OO.ui.DropdownInputWidget
limit number optional

Code point limit, defaults to input's maxlength attribute

Source:

Add a visible codepoint (character) limit label to a TextInputWidget, assuming that the value of the DropdownInputWidget will be added as a prefix.