mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
6b7d62e4a4
Change-Id: I617e2a17cb6fbd11e486c2981e361ae931ac1870
45 lines
1 KiB
JavaScript
45 lines
1 KiB
JavaScript
/*!
|
|
* VisualEditor ContentEditable MWEntityNode class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* ContentEditable MediaWiki image node.
|
|
*
|
|
* @class
|
|
* @extends ve.ce.ImageNode
|
|
* @constructor
|
|
* @param {ve.dm.MWInlineImageNode} model Model to observe
|
|
*/
|
|
ve.ce.MWInlineImageNode = function VeCeMWInlineImageNode( model ) {
|
|
// Parent constructor
|
|
ve.ce.ImageNode.call( this, model );
|
|
|
|
// Properties
|
|
this.$ = $( '<' + ( model.getAttribute( 'isLinked' ) ? 'a' : 'span' ) + '>' );
|
|
|
|
// Initialization
|
|
this.$
|
|
.attr( 'contenteditable', false )
|
|
.addClass( 've-ce-mwInlineImageNode' )
|
|
.append( this.$image )
|
|
.data( 'view', this.$image.data( 'view' ) );
|
|
this.onUpdate();
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ce.MWInlineImageNode, ve.ce.ImageNode );
|
|
|
|
/* Static Properties */
|
|
|
|
ve.ce.MWInlineImageNode.static.name = 'MWinlineimage';
|
|
|
|
/* Methods */
|
|
|
|
/* Registration */
|
|
|
|
ve.ce.nodeFactory.register( ve.ce.MWInlineImageNode );
|