Expand all

ve.ui.MWLinkAnnotationInspector

Extends

Constructor

new ve.ui.MWLinkAnnotationInspector([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

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

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} #

Parameters:

Name Type Description
element Object
Source:

Returns:

The annotation.

Type
ve.dm.MWExternalLinkAnnotation

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

Parameters:

Name Type Description
title mw.Title

The title to link to.

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
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

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
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

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

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

Source:
Handle choose events from the result widget

onLabelInputChange(value) #

Handle change events on the label input

Parameters:

Name Type Description
value string
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

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

Source:
Handle set events from the linkTypeIndex layout