Debian Codegraph @

extensions/VisualEditor/lib/ve/src/dm/nodes/ve.dm.InternalItemNode.js

raw symbols SCIP
1 /*!
2 * VisualEditor DataModel InternalItemNode class.
3 *
4 * @copyright See AUTHORS.txt
5 */
6
7 /**
8 * DataModel internal item node.
9 *
10 * @class
11 * @extends ve.dm.BranchNode
12 *
13 * @constructor
14 * @param {Object} [element] Reference to element in linear model
15 * @param {ve.dm.Node[]} [children]
16 */
17 ve.dm.InternalItemNode = function VeDmInternalItemNode() {
18 // Parent constructor
19 ve.dm.InternalItemNode.super.apply( this, arguments );
20 };
21
22 /* Inheritance */
23
24 OO.inheritClass( ve.dm.InternalItemNode, ve.dm.BranchNode );
25
26 /* Static members */
27
28 ve.dm.InternalItemNode.static.name = 'internalItem';
29
30 ve.dm.InternalItemNode.static.matchTagNames = [];
31
32 ve.dm.InternalItemNode.static.ignoreChildren = true;
33
34 ve.dm.InternalItemNode.static.isInternal = true;
35
36 ve.dm.InternalItemNode.static.isDeletable = false;
37
38 ve.dm.InternalItemNode.static.parentNodeTypes = [ 'internalList' ];
39
40 /* Methods */
41
42 /**
43 * @inheritdoc
44 */
45 ve.dm.InternalItemNode.static.describeChanges = function () {
46 return [];
47 };
48
49 /**
50 * @inheritdoc
51 */
52 ve.dm.InternalItemNode.static.getHashObject = function ( dataElement ) {
53 return { type: dataElement.type };
54 };
55
56 ve.dm.InternalItemNode.prototype.getAttributes = function () {
57 // InternalItem node has an originalHtml attribute which confuses the differ
58 // TODO: Move this to a new model method like getAttributesForDiff
59 return {};
60 };
61
62 /* Registration */
63
64 ve.dm.modelRegistry.register( ve.dm.InternalItemNode );