Extends
Constructor
new ve.ui.MWDefinedTransclusionContextItem(context, model, [config])abstract
#
Hierarchy
Context item for a defined MWTransclusion.
Templates are defined on-wiki using the message page [[MediaWiki:Visualeditor-template-tools-definition.json]]
Example: { // This key is the static name of the ve.ui.ContextItem "citationNeeded": [ { // Normalized title string, or list of strings (for redirects) "title": [ "Citation needed", "cn" ], // Extra params. This whole object can be accessed // via #getMatchedTool "params": { "reason": "reason", "date": "date" } }, { "title": "Cite quote", "params": { "date": "date" } } ] }
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
context |
ve.ui.LinearContext | Context the item is in |
|
model |
ve.dm.Model | Model the item is related to |
|
config |
Object |
optional |
Properties
templatestatic
#
Only display item for single-template transclusions of these templates.
Properties:
Type | Description |
---|---|
string
|
Array.<string>
|
null
|
Methods
getCanonicalParam(name) → {string|null
}
#
null
}
#
Get a template param using its canonical name
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Canonical parameter name |
Returns:
Param wikitext, null if not found
- Type
-
string
|
null
getDescription()
#
onEditButtonClick()
#
renderBody()
#
- Inherited from:
- Source:
toggleLoadingVisualization([isLoading])private
#
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
isLoading |
boolean |
optional |
false |
getMatchedTool(model) → {Object|null
}static
#
null
}static
#
Get the tool definition that matches a specific model, if any
Parameters:
Name | Type | Description |
---|---|---|
model |
ve.dm.Model |
Returns:
Tool definition, or null if no match
- Type
-
Object
|
null
getToolsByTitle() → {Object}static
#
Get tool definitions, indexed by normalized title
Returns:
Collection of tool definitions
- Type
- Object