Extends
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 |
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.
getHref() → {string}
#
Get the hyperlink location.
Returns:
Hyperlink location
- Type
- string
Get the hyperlink location.
getTextInputWidget() → {OO.ui.TextInputWidget}
#
Get the text input widget used by the annotation widget
Returns:
Text input widget
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 |
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 |
Returns:
Fires:
Sets the annotation value.
setDisabled()
#
setReadOnly(readOnly) → {ve.ui.LinkAnnotationWidget}chainable
#
Set the read-only state of the widget
Parameters:
Name | Type | Description |
---|---|---|
readOnly |
boolean | Make widget read-only |
Returns:
Set the read-only state of the widget
getAnnotationFromText(value) → {ve.dm.LinkAnnotation|null
}static
#
null
}static
#
Get an annotation from the current text value
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Text value |
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 |
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
|
A change event is emitted when the annotation value of the input changes.