All files / src/dm/nodes ve.dm.InternalItemNode.js

93.75% Statements 15/16
100% Branches 0/0
75% Functions 3/4
93.75% Lines 15/16

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                                1x   124x         1x       1x   1x   1x   1x   1x   1x             1x             1x 2x     1x     8x         1x  
/*!
 * VisualEditor DataModel InternalItemNode class.
 *
 * @copyright See AUTHORS.txt
 */
 
/**
 * DataModel internal item node.
 *
 * @class
 * @extends ve.dm.BranchNode
 *
 * @constructor
 * @param {Object} [element] Reference to element in linear model
 * @param {ve.dm.Node[]} [children]
 */
ve.dm.InternalItemNode = function VeDmInternalItemNode() {
	// Parent constructor
	ve.dm.InternalItemNode.super.apply( this, arguments );
};
 
/* Inheritance */
 
OO.inheritClass( ve.dm.InternalItemNode, ve.dm.BranchNode );
 
/* Static members */
 
ve.dm.InternalItemNode.static.name = 'internalItem';
 
ve.dm.InternalItemNode.static.matchTagNames = [];
 
ve.dm.InternalItemNode.static.ignoreChildren = true;
 
ve.dm.InternalItemNode.static.isInternal = true;
 
ve.dm.InternalItemNode.static.isDeletable = false;
 
ve.dm.InternalItemNode.static.parentNodeTypes = [ 'internalList' ];
 
/* Methods */
 
/**
 * @inheritdoc
 */
ve.dm.InternalItemNode.static.describeChanges = function () {
	return [];
};
 
/**
 * @inheritdoc
 */
ve.dm.InternalItemNode.static.getHashObject = function ( dataElement ) {
	return { type: dataElement.type };
};
 
ve.dm.InternalItemNode.prototype.getAttributes = function () {
	// InternalItem node has an originalHtml attribute which confuses the differ
	// TODO: Move this to a new model method like getAttributesForDiff
	return {};
};
 
/* Registration */
 
ve.dm.modelRegistry.register( ve.dm.InternalItemNode );