Expand all

ve.ui.LinkAnnotationWidget

Extends

Constructor

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

Creates an ve.ui.LinkAnnotationWidget object.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Source:
Creates an ve.ui.LinkAnnotationWidget object.

Methods

createInputWidget([config]) → {OO.ui.Widget} #

Create a widget to be used by the annotation widget

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Source:

Returns:

Text input widget

Type
OO.ui.Widget
Create a widget to be used by the annotation widget

getAnnotation() → {ve.dm.LinkAnnotation} #

Gets the annotation value.

Source:

Returns:

Link annotation

Type
ve.dm.LinkAnnotation
Gets the annotation value.

getHref() → {string} #

Get the hyperlink location.

Source:

Returns:

Hyperlink location

Type
string
Get the hyperlink location.

getTextInputWidget() → {OO.ui.TextInputWidget} #

Get the text input widget used by the annotation widget

Source:

Returns:

Text input widget

Type
OO.ui.TextInputWidget
Get the text input widget used by the annotation widget

onTextChange(value) #

Handle value-changing events from the text input

Parameters:

Name Type Description
value string

New input value

Source:
Handle value-changing events from the text input

setAnnotation(annotation, [fromText]) → {ve.ui.LinkAnnotationWidget}chainable #

Sets the annotation value.

The input value will automatically be updated.

Parameters:

Name Type Attributes Description
annotation ve.dm.LinkAnnotation | null

Link annotation

fromText boolean optional

Annotation was generated from text input

Source:

Returns:

Type
ve.ui.LinkAnnotationWidget

Fires:

Sets the annotation value.

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

Set the read-only state of the widget

Parameters:

Name Type Description
readOnly boolean

Make widget read-only

Source:

Returns:

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

getAnnotationFromText(value) → {ve.dm.LinkAnnotation|null}static #

Get an annotation from the current text value

Parameters:

Name Type Description
value string

Text value

Source:

Returns:

Link annotation

Type
ve.dm.LinkAnnotation | null
Get an annotation from the current text value

getTextFromAnnotation(annotation) → {string}static #

Get a text value for the current annotation

Parameters:

Name Type Description
annotation ve.dm.LinkAnnotation | null

Link annotation

Source:

Returns:

Text value for the annotation

Type
string
Get a text value for the current annotation

Events

change(annotation) #

A change event is emitted when the annotation value of the input changes.

Parameters:

Name Type Description
annotation ve.dm.LinkAnnotation | null
Source:
A change event is emitted when the annotation value of the input changes.