Expand all

ve.ui.LanguageInputWidget

Extends

Constructor

new ve.ui.LanguageInputWidget([config]) #

Creates an ve.ui.LanguageInputWidget object.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
dirInput string optional
'auto'

How to display the directionality input. Options are: - none: Directionality input is hidden. - no-auto: Directionality input is visible and options are LTR or RTL. - auto: Directionality input is visible and options include "auto" in addition to LTR and RTL.

readOnly boolean optional
false

Prevent changes to the value of the input.

hideCodeInput boolean optional

Prevent user from entering a language code as free text

dialogManager ve.ui.WindowManager optional

Window manager to launch the language search dialog in

availableLanguages Array.<string> optional

Available language codes to show in search dialog

Source:
Creates an ve.ui.LanguageInputWidget object.

Methods

getDir() → {string|null} #

Get the directionality

Source:

Returns:

Directionality (ltr/rtl)

Type
string | null
Get the directionality

getLang() → {string|null} #

Get the language

Source:

Returns:

Language code

Type
string | null
Get the language

isReadOnly() → {boolean} #

Check if the widget is read-only

Source:

Returns:

Type
boolean
Check if the widget is read-only

onChange() #

Handle input widget change events.

Source:
Handle input widget change events.

onFindLanguageButtonClick() #

Handle find language button click events.

Source:
Handle find language button click events.

setDisabled(disabled) → {ve.ui.LanguageInputWidget}chainable #

Disable or enable the inputs

Parameters:

Name Type Description
disabled boolean

Set disabled or enabled

Source:

Returns:

Type
ve.ui.LanguageInputWidget
Disable or enable the inputs

setLangAndDir(lang, dir) → {ve.ui.LanguageInputWidget}chainable #

Set language and directionality

The inputs value will automatically be updated.

Parameters:

Name Type Description
lang string | null

Language code

dir string | null

Directionality

Source:

Returns:

Type
ve.ui.LanguageInputWidget

Fires:

Set language and directionality

The inputs value will automatically be updated.

setReadOnly(readOnly) → {ve.ui.LanguageInputWidget}chainable #

Set the read-only state of the widget

Parameters:

Name Type Description
readOnly boolean

Make widget read-only

Source:

Returns:

Type
ve.ui.LanguageInputWidget
Set the read-only state of the widget

updateControlsDisabled() → {OO.ui.NumberInputWidget}protectedchainable #

Update the disabled state of the controls

Source:

Returns:

The widget, for chaining

Type
OO.ui.NumberInputWidget
Update the disabled state of the controls

Events

change(lang, dir) #

Parameters:

Name Type Description
lang string

Language code

dir string

Directionality

Source: