All files / src/ce/nodes ve.ce.AlienNode.js

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

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                                    1x   58x     58x     58x         58x         1x   1x       1x   1x             1x 41x    
/*!
 * VisualEditor ContentEditable AlienNode class.
 *
 * @copyright See AUTHORS.txt
 */
 
/**
 * ContentEditable alien node.
 *
 * @class
 * @abstract
 * @extends ve.ce.LeafNode
 * @mixes ve.ce.FocusableNode
 *
 * @constructor
 * @param {ve.dm.AlienNode} model
 * @param {Object} [config]
 */
ve.ce.AlienNode = function VeCeAlienNode() {
	// Parent constructor
	ve.ce.AlienNode.super.apply( this, arguments );
 
	// DOM changes
	this.$element = $( ve.copyDomElements( this.model.getOriginalDomElements( this.model.getDocument().getStore() ), document ) );
 
	// Mixin constructors
	ve.ce.FocusableNode.call( this, this.$element, {
		classes: [ 've-ce-alienNode-highlights' ]
	} );
 
	// Re-initialize after $element changes
	this.initialize();
};
 
/* Inheritance */
 
OO.inheritClass( ve.ce.AlienNode, ve.ce.LeafNode );
 
OO.mixinClass( ve.ce.AlienNode, ve.ce.FocusableNode );
 
/* Static Properties */
 
ve.ce.AlienNode.static.name = 'alien';
 
ve.ce.AlienNode.static.iconWhenInvisible = 'puzzle';
 
/* Methods */
 
/**
 * @inheritdoc
 */
ve.ce.AlienNode.static.getDescription = function () {
	return ve.msg( 'visualeditor-aliennode-tooltip' );
};