Debian Codegraph @

extensions/VisualEditor/lib/ve/src/ce/annotations/ve.ce.TextStyleAnnotation.js

raw symbols SCIP
1 /*!
2 * VisualEditor ContentEditable TextStyleAnnotation class.
3 *
4 * @copyright See AUTHORS.txt
5 */
6
7 /**
8 * ContentEditable text style annotation.
9 *
10 * @class
11 * @abstract
12 * @extends ve.ce.Annotation
13 * @constructor
14 * @param {ve.dm.TextStyleAnnotation} model Model to observe
15 * @param {ve.ce.ContentBranchNode} [parentNode] Node rendering this annotation
16 * @param {Object} [config] Configuration options
17 */
18 ve.ce.TextStyleAnnotation = function VeCeTextStyleAnnotation() {
19 // Parent constructor
20 ve.ce.TextStyleAnnotation.super.apply( this, arguments );
21
22 // DOM changes
23 this.$element.addClass( 've-ce-textStyleAnnotation' );
24 };
25
26 /* Inheritance */
27
28 OO.inheritClass( ve.ce.TextStyleAnnotation, ve.ce.Annotation );
29
30 /* Static Properties */
31
32 ve.ce.TextStyleAnnotation.static.name = 'textStyle';
33
34 /* Methods */
35
36 /**
37 * @inheritdoc
38 */
39 ve.ce.TextStyleAnnotation.prototype.getTagName = function () {
40 return this.getModel().getAttribute( 'nodeName' ) || this.constructor.static.tagName;
41 };
42
43 /* Registration */
44
45 ve.ce.annotationFactory.register( ve.ce.TextStyleAnnotation );