mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-05 14:12:53 +00:00
cdfed7039f
To achieve this we need to evaluate the DOM contents of transclusion nodes to see if it consists solely of meta items and whitespace. To check for meta items we do a model registry match, but with an additional parameter to exclude mwTransclusion types as a possible result (as the first item may be a meta tag, but with a mw:Transclusion typeof attribute). Bug: 51322 Change-Id: I89a220350fb7e10e15f3682d21438539196a5846
38 lines
1,011 B
JavaScript
38 lines
1,011 B
JavaScript
/*!
|
|
* VisualEditor DataModel MWTransclusionMetaItem class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* DataModel MW-specific meta item.
|
|
*
|
|
* @class
|
|
* @abstract
|
|
* @extends ve.dm.AlienMetaItem
|
|
* @constructor
|
|
* @param {Object} element Reference to element in meta-linmod
|
|
*/
|
|
ve.dm.MWTransclusionMetaItem = function VeDmMWTransclusionMetaItem( element ) {
|
|
// Parent constructor
|
|
ve.dm.AlienMetaItem.call( this, element );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.dm.MWTransclusionMetaItem, ve.dm.AlienMetaItem );
|
|
|
|
/* Static Properties */
|
|
|
|
ve.dm.MWTransclusionMetaItem.static.name = 'mwTransclusionMeta';
|
|
|
|
ve.dm.MWTransclusionMetaItem.static.matchTagNames = [];
|
|
|
|
// mwTransclusionMetaItems are generated by ve.dm.MWTransclusionNode#toDataElement when
|
|
// all of the transclusions contents are considered to be metadata or whitespace
|
|
|
|
/* Registration */
|
|
|
|
ve.dm.modelRegistry.register( ve.dm.MWTransclusionMetaItem );
|