Expand all

ve.ui.MWWikitextLinkAnnotationInspector

Extends

Constructor

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

Inspector for applying and editing labeled MediaWiki internal and external links.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Source:
Inspector for applying and editing labeled MediaWiki internal and external links.

Methods

getAnnotationFromFragment(fragment) → {ve.dm.MWInternalLinkAnnotation|ve.dm.MWExternalLinkAnnotation|null} #

Gets an annotation object from a fragment.

The type of link is automatically detected based on some crude heuristics.

Parameters:

Name Type Description
fragment ve.dm.SurfaceFragment

Current selection

Inherited from:
Source:

Returns:

Type
ve.dm.MWInternalLinkAnnotation | ve.dm.MWExternalLinkAnnotation | null
Gets an annotation object from a fragment.

isExternal() → {boolean} #

Check if the current input mode is for external links

Inherited from:
Source:

Returns:

Input mode is for external links

Type
boolean
Check if the current input mode is for external links

newExternalLinkAnnotation(element) → {ve.dm.MWExternalLinkAnnotation} #

newInternalLinkAnnotationFromTitle(title) → {ve.dm.MWInternalLinkAnnotation} #

Parameters:

Name Type Description
title mw.Title

The title to link to.

Inherited from:
Source:

Returns:

The annotation.

Type
ve.dm.MWInternalLinkAnnotation

onExternalLinkChange(annotation) #

Handle change events on the external link widget

Parameters:

Name Type Description
annotation ve.dm.MWExternalLinkAnnotation
Inherited from:
Source:
Handle change events on the external link widget

onExternalLinkInputChange(value) #

Handle change events on the external link widget's input

Parameters:

Name Type Description
value string

Current value of input widget

Inherited from:
Source:
Handle change events on the external link widget's input

onInternalLinkChange(annotation) #

Handle change events on the internal link widget

Parameters:

Name Type Description
annotation ve.dm.MWInternalLinkAnnotation
Inherited from:
Source:
Handle change events on the internal link widget

onInternalLinkChangeResultsChange(items, index) #

Handle list change events ('add') from the interal link's result widget

Parameters:

Name Type Description
items Array.<OO.ui.OptionWidget>

Added items

index number

Index of insertion point

Inherited from:
Source:
Handle list change events ('add') from the interal link's result widget

onInternalLinkInputChange(value) #

Handle change events on the internal link widget's input

Parameters:

Name Type Description
value string

Current value of input widget

Inherited from:
Source:
Handle change events on the internal link widget's input

onInternalLinkSearchResultsChoose(item) #

Handle choose events from the result widget

Parameters:

Name Type Description
item OO.ui.OptionWidget

Chosen item

Inherited from:
Source:
Handle choose events from the result widget

onLabelInputChange(value) #

Handle change events on the label input

Parameters:

Name Type Description
value string
Inherited from:
Source:
Handle change events on the label input

onLinkInputEnter(e) #

Handle enter events on the external/internal link inputs

Parameters:

Name Type Description
e jQuery.Event

Key press event

Inherited from:
Source:
Handle enter events on the external/internal link inputs

onLinkTypeIndexSet(tabPanel) #

Handle set events from the linkTypeIndex layout

Parameters:

Name Type Description
tabPanel OO.ui.TabPanelLayout

Current tabPanel

Inherited from:
Source:
Handle set events from the linkTypeIndex layout