Extends
Properties
getContentFromInspector
#
Convert the current inspector state to new content which can be used
to update the ve.dm
.SurfaceFragment backing this inspector.
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.
Return a valid variantInfo
object which will be used when a new
node of this subclass is inserted.
Methods
createItem([lang], [content]) → {Object}
#
Create widgets corresponding to a given mapping given by this rule.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
lang |
string |
optional |
The language code for the content text. |
content |
string |
optional |
The HTML content text. |
Returns:
An object containing the required widgets and backing documents for this mapping item.
- Type
- Object
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. |
- Inherited from:
- Source:
Returns:
- Type
- ve.ui.TargetWidget
Helper function to create a subdocument editor for HTML embedded in the language variant node.
getActionProcess()
#
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. |
- Inherited from:
- 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 |
- Overrides:
- Source:
Returns:
- Type
- OO.ui.Process
getTeardownProcess()
#
initialize()
#
Handle frame ready events.
onAddButtonClick()
#
Create a new mapping item in the inspector.
onClearButtonClick(item)
#
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. |
- Inherited from:
- 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.