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

Returns:

Directionality (ltr/rtl)

Type
string | null
Source:
Get the directionality

getLang() → {string|null} #

Get the language

Returns:

Language code

Type
string | null
Source:
Get the language

isReadOnly() → {boolean} #

Check if the widget is read-only

Returns:

Type
boolean
Source:
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

Returns:

Type
ve.ui.LanguageInputWidget
Source:
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

Returns:

Type
ve.ui.LanguageInputWidget

Fires:

Source:

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

Returns:

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

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

Update the disabled state of the controls

Returns:

The widget, for chaining

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

Events

change(lang, dir) #

Parameters:

Name Type Description
lang string

Language code

dir string

Directionality

Source: