All files / src/dm ve.dm.MetaItem.js

100% Statements 14/14
100% Branches 0/0
100% Functions 2/2
100% Lines 14/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73                                    1x   319x   319x   319x         1x   1x       1x   1x   1x   1x                 1x                 1x                   1x 42x    
/*!
 * VisualEditor DataModel MetaItem class.
 *
 * @copyright See AUTHORS.txt
 */
 
/**
 * DataModel meta item.
 * TODO: rename to MetaNode to reflect the fact it is now a node
 *
 * @class
 * @abstract
 * @extends ve.dm.LeafNode
 * @mixes OO.EventEmitter
 *
 * @constructor
 * @param {Object} element Reference to element in meta-linmod
 */
ve.dm.MetaItem = function VeDmMetaItem() {
	// Parent constructor
	ve.dm.MetaItem.super.apply( this, arguments );
	// Mixin
	OO.EventEmitter.call( this );
	// Properties
	this.list = null;
};
 
/* Inheritance */
 
OO.inheritClass( ve.dm.MetaItem, ve.dm.LeafNode );
 
OO.mixinClass( ve.dm.MetaItem, OO.EventEmitter );
 
/* Static members */
 
ve.dm.MetaItem.static.isContent = false;
 
ve.dm.MetaItem.static.isMetaData = true;
 
ve.dm.MetaItem.static.canSerializeAsContent = true;
 
ve.dm.MetaItem.static.isDiffedAsLeaf = true;
 
/**
 * Symbolic name for the group this meta item type will be grouped in in ve.dm.MetaList.
 *
 * @static
 * @property {string}
 * @inheritable
 */
ve.dm.MetaItem.static.group = 'misc';
 
/**
 * If the metaitem can be removed by regular remove operations
 *
 * @static
 * @property {boolean}
 * @inheritable
 */
ve.dm.MetaItem.static.removable = false;
 
/* Methods */
 
/**
 * Get the group this meta item belongs to.
 *
 * @see #static-group
 * @return {string} Group
 */
ve.dm.MetaItem.prototype.getGroup = function () {
	return this.constructor.static.group;
};