Expand all

ve.ui.MWLanguageVariantInspector

Extends

Constructor

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

Inspector for a ve.dm.MWLanguageVariantNode.

Properties

getContentFromInspector #

Convert the current inspector state to new content which can be used to update the ve.dm.SurfaceFragment backing this inspector.

Source:

Convert the current inspector state to new content which can be used to update the ve.dm.SurfaceFragment backing this inspector.

getDefaultVariantInfo #

Return a valid variantInfo object which will be used when a new node of this subclass is inserted. For instance, ve.ui.MWLanguageVariantDisabledInspector will return the appropriate object to use when the equivalent of wikitext -{}- is inserted in the document.

Source:

Return a valid variantInfo object which will be used when a new node of this subclass is inserted.

Methods

createTextTarget([placeholder]) → {ve.ui.TargetWidget} #

Helper function to create a subdocument editor for HTML embedded in the language variant node.

Parameters:

Name Type Attributes Description
placeholder string optional

Placeholder text for this editor.

Source:

Returns:

Type
ve.ui.TargetWidget

Helper function to create a subdocument editor for HTML embedded in the language variant node.

getHtmlForDoc(doc) → {string} #

Helper function to serialize the document backing a ve.ui.TargetWidget back into HTML which can be embedded into the language variant node. This method needs to do a bit of hackery to remove unnecessary p-wrapping and (TODO) determine if an inline node needs to be converted to a block node or vice-versa.

Parameters:

Name Type Description
doc ve.dm.Document

The document backing an editor widget, as returned by ve.ui.MWLanguageVariantInspector#setupTextTargetDoc.

Source:

Returns:

An HTML string appropriate for embedding into a language variant node.

Type
string

Helper function to serialize the document backing a ve.ui.TargetWidget back into HTML which can be embedded into the language variant node.

getSetupProcess([data]) → {OO.ui.Process} #

Handle the inspector being setup.

Parameters:

Name Type Attributes Description
data Object optional

Inspector opening data

Source:

Returns:

Type
OO.ui.Process
Handle the inspector being setup.

initialize() #

Handle frame ready events.

setupTextTargetDoc([textTarget], [htmlString]) → {ve.dm.Document} #

Helper function to initialize a ve.ui.TargetWidget with a given HTML string extracted from the language variant node.

Parameters:

Name Type Attributes Description
textTarget ve.ui.TargetWidget optional

A subdocument editor widget created by ve.ui.MWLanguageVariantInspector#createTextTarget.

htmlString string optional

The HTML string extracted from this node.

Source:

Returns:

The document model now backing the widget.

Type
ve.dm.Document

Helper function to initialize a ve.ui.TargetWidget with a given HTML string extracted from the language variant node.

getImportRules() → {Object}static #

Get the import rules for embedded target widgets in this inspector.

Source:
See:

Returns:

Import rules

Type
Object
Get the import rules for embedded target widgets in this inspector.