mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 17:36:35 +00:00
3be13a7cbc
MWfooBar or MWfoobar should be mwFooBar Change-Id: I30f0ef05960c9df218ef6f1cb161ff6ccd529bc7
47 lines
1.1 KiB
JavaScript
47 lines
1.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
|
|
* @param {Object} [config] Config options
|
|
*/
|
|
ve.ce.MWInlineImageNode = function VeCeMWInlineImageNode( model, config ) {
|
|
// Parent constructor
|
|
ve.ce.ImageNode.call( this, model, config );
|
|
|
|
// Properties
|
|
this.$ = 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';
|
|
|
|
ve.ce.MWInlineImageNode.static.tagName = 'img';
|
|
|
|
/* Registration */
|
|
|
|
ve.ce.nodeFactory.register( ve.ce.MWInlineImageNode );
|