Expand all

abstract ve.dm.MWTransclusionPartModel

Constructor

new ve.dm.MWTransclusionPartModel(transclusion)abstract #

Abstract base class for items in a {@see ve.dm.MWTransclusionModel}. Holds a back-reference to it's parent. Currently used for:

  • {@see ve.dm.MWTemplateModel} for a single template invocation.
  • {@see ve.dm.MWTemplatePlaceholderModel} while searching for a template name to be added.
  • {@see ve.dm.MWTransclusionContentModel} for a raw wikitext snippet.

Parameters:

Name Type Description
transclusion ve.dm.MWTransclusionModel
Mixes in:
Source:
Abstract base class for items in a {@see ve.dm.MWTransclusionModel}.

Methods

containsValuableData() → {boolean} #

Source:

Returns:

True if there is meaningful user input that was not e.g. auto-generated

Type
boolean

getId() → {string} #

Get a unique part ID within the transclusion.

Source:

Returns:

Unique ID

Type
string
Get a unique part ID within the transclusion.

getTransclusion() → {ve.dm.MWTransclusionModel} #

Get transclusion part is in.

Source:

Returns:

Transclusion

Type
ve.dm.MWTransclusionModel
Get transclusion part is in.

remove() #

Remove part from transclusion.

Source:
Remove part from transclusion.

serialize() → {Object|string|undefined} #

Create a serialized representation of this part. Contains all information needed to recreate the original wikitext, including extra whitespace. Used in {@see ve.dm.MWTransclusionModel.getPlainObject}. The corresponding deserializer is in {@see ve.dm.MWTransclusionNode.static.getWikitext}.

Source:

Returns:

Serialized representation, raw wikitext, or undefined if empty

Type
Object | string | undefined
Create a serialized representation of this part.

Events

change() #

Emitted when anything changed in the content the part represents, e.g. a parameter was added to a template, or a value edited.

Source:
Emitted when anything changed in the content the part represents, e.g.