utilsOoui

Helpers for heavily used OOUI widgets and dialogs.

Source:

Methods

(static) createCheckboxField(options) → {module:utilsOoui~CreateCheckboxFieldReturn}

Source:

Create a checkbox field.

Parameters:
Name Type Description
options object
Properties
Name Type Attributes Description
value string
label string
selected boolean <optional>
disabled boolean <optional>
help string <optional>
tabIndex string <optional>
classes Array.<string> <optional>
Returns:
Type
module:utilsOoui~CreateCheckboxFieldReturn

(static) createCopyTextField(options) → {external:OO.ui.CopyTextLayout|external:OO.ui.ActionFieldLayout}

Source:

Create an action field for copying text from an input.

Parameters:
Name Type Description
options object
Properties
Name Type Attributes Description
label object
value object
disabled object <optional>
help object <optional>
copyCallback object
Returns:
Type
external:OO.ui.CopyTextLayout | external:OO.ui.ActionFieldLayout

(static) createNumberField(options) → {module:utilsOoui~CreateNumberFieldReturn}

Source:

Create a number input field.

Parameters:
Name Type Description
options object
Properties
Name Type Attributes Description
value string
label string
min string <optional>
max string <optional>
buttonStep string <optional>
help string <optional>
classes Array.<string> <optional>
Returns:
Type
module:utilsOoui~CreateNumberFieldReturn

(static) createRadioField(options) → {module:utilsOoui~CreateRadioFieldReturn}

Source:

Create a radio select field.

Parameters:
Name Type Description
options object
Properties
Name Type Attributes Description
label string
selected string <optional>
help string <optional>
options Array.<object>
Returns:
Type
module:utilsOoui~CreateRadioFieldReturn

(static) createTextField(options) → {module:utilsOoui~CreateTextFieldReturn}

Source:

Create a text input field.

Parameters:
Name Type Description
options object
Properties
Name Type Attributes Description
value string <optional>
label string
required string <optional>
classes string <optional>
maxLength string <optional>
help string <optional>
Returns:
Type
module:utilsOoui~CreateTextFieldReturn

(static) mixEventEmitterInObject(obj)

Source:

Add OO.EventEmitter's methods to an arbitrary object itself, not its prototype. Can be used for singletons or classes. In the latter case, the methods will be added as static.

Parameters:
Name Type Description
obj object

(static) mixinUserOoUiClass(targetClass, originClass)

Source:

Mix in a user class into a target OOUI class.

Parameters:
Name Type Description
targetClass function
originClass function

(static) showConfirmDialog(message, optionsopt) → {Promise.<Array>}

Source:

Display an OOUI message dialog where user is asked to confirm something. Compared to OO.ui.confirm, returns an action string, not a boolean (which helps to differentiate between more than two types of answer and also a window close by pressing Esc).

Parameters:
Name Type Attributes Default Description
message external:jQuery | string
options object <optional>
{}
Returns:
Type
Promise.<Array>

(static) tweakUserOoUiClass(targetClass) → {function}

Source:

Add some properties to the inheritor class that the (ES5) OOUI inheritance mechanism uses. It partly replicates the operations made in OO.inheritClass.

Parameters:
Name Type Description
targetClass function

Inheritor class.

Returns:
Type
function

Type Definitions

CreateCheckboxFieldReturn

Source:
Properties:
Name Type Description
field external:OO.ui.FieldLayout
input CheckboxInputWidget
Type:
  • object

CreateNumberFieldReturn

Source:
Properties:
Name Type Description
field external:OO.ui.FieldLayout
input external:OO.ui.TextInputWidget
Type:
  • object

CreateRadioFieldReturn

Source:
Properties:
Name Type Description
field external:OO.ui.FieldLayout
select external:OO.ui.RadioSelectWidget
items Array.<RadioOptionWidget>
Type:
  • object

CreateTextFieldReturn

Source:
Properties:
Name Type Description
field external:OO.ui.FieldLayout
input external:OO.ui.TextInputWidget
Type:
  • object