Debian Codegraph @

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

raw symbols SCIP
1 /*!
2 * VisualEditor DataModel TextNode class.
3 *
4 * @copyright See AUTHORS.txt
5 */
6
7 /**
8 * DataModel text node.
9 *
10 * @class
11 * @extends ve.dm.LeafNode
12 *
13 * @constructor
14 * @param {number} [length] Length of content data in document
15 */
16 ve.dm.TextNode = function VeDmTextNode( length ) {
17 // Parent constructor
18 ve.dm.TextNode.super.call( this );
19
20 // TODO: length is only set on construction in tests
21 this.length = length || 0;
22 };
23
24 /* Inheritance */
25
26 OO.inheritClass( ve.dm.TextNode, ve.dm.LeafNode );
27
28 /* Static Properties */
29
30 ve.dm.TextNode.static.name = 'text';
31
32 ve.dm.TextNode.static.isWrapped = false;
33
34 ve.dm.TextNode.static.isContent = true;
35
36 ve.dm.TextNode.static.matchTagNames = [];
37
38 /* Methods */
39
40 ve.dm.TextNode.prototype.canHaveSlugBefore = function () {
41 return false;
42 };
43
44 ve.dm.TextNode.prototype.canHaveSlugAfter = function () {
45 return false;
46 };
47
48 /* Registration */
49
50 ve.dm.modelRegistry.register( ve.dm.TextNode );