Expand all

ve.dm.MWTransclusionBlockNode

Extends

Constructor

new ve.dm.MWTransclusionBlockNode([element]) #

DataModel MediaWiki transclusion block node.

Parameters:

Name Type Attributes Description
element Object optional

Reference to element in linear model

Source:
DataModel MediaWiki transclusion block node.

Methods

getPartsList() → {Array.<Object>} #

Get a simplified description of the transclusion's parts.

Returns:

List of objects with either template or content properties

Type
Array.<Object>
Inherited from:
Source:
Get a simplified description of the transclusion's parts.

getSingleTemplateName() → {string|undefined} #

Get the name of the template if it's a single template transclusion

Returns:

Name of the template, undefined if not a single template transclusion

Type
string | undefined
Inherited from:
Source:
Get the name of the template if it's a single template transclusion

getSingleTemplatePart() → {Object|undefined} #

Get the transclusion's template part if it's a single template transclusion

Returns:

Object with template properties, undefined if not a single template transclusion

Type
Object | undefined
Inherited from:
Source:
Get the transclusion's template part if it's a single template transclusion

getWikitext(skipParameters) → {string} #

Wrapper for static method, ve.dm.MWTransclusionNode.static.getWikitext above.

Parameters:

Name Type Description
skipParameters boolean

Exclude parameters from result

Returns:

Wikitext

Type
string
Inherited from:
Source:
Wrapper for static method, ve.dm.MWTransclusionNode.static.getWikitext above.

isSingleTemplate([allowedTemplates]) → {boolean} #

Check if transclusion contains only a single template and optionally check if it's part of a list of allowed template names.

Parameters:

Name Type Attributes Description
allowedTemplates string | Array.<string> optional

Names of allowed templates, omit to allow any template name

Returns:

Type
boolean
Inherited from:
Source:

Check if transclusion contains only a single template and optionally check if it's part of a list of allowed template names.

onAttributeChange(key, from, to) #

Handle attribute change events.

Parameters:

Name Type Description
key string

Attribute key

from string

Old value

to string

New value

Inherited from:
Source:
Handle attribute change events.