mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 17:36:35 +00:00
a15b2f77f2
Add some missing constructor names and rename the ones with a lowercase 'v'. I previously changed Object.create and others to using hasOwn, but that turned out to be useless. The thought at the time was to only use the native one if it really is a native one (and not a polyfill from another script), however in then hasOwn is only relevant on prototypes and when negated. For static members it would be an own-property either way. Follows-up: * Id6783fcfc35a896db088ff424ff9faaabcaff716 (metanode) * Iab763954fb8cf375900d7a9a92dec1c755d5407e (object-management) Change-Id: Ia6ef597e5e5453277472dfc23f25d2878b68b7f6
65 lines
1.4 KiB
JavaScript
65 lines
1.4 KiB
JavaScript
/**
|
|
* VisualEditor content editable MetaInlineNode class.
|
|
*
|
|
* @copyright 2011-2012 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* ContentEditable node for a list.
|
|
*
|
|
* @class
|
|
* @constructor
|
|
* @extends {ve.ce.LeafNode}
|
|
* @param model {ve.dm.MetaInlineNode} Model to observe
|
|
*/
|
|
ve.ce.MetaInlineNode = function VeCeMetaInlineNode( model ) {
|
|
// Parent constructor
|
|
ve.ce.LeafNode.call( this, 'metaInline', model );
|
|
|
|
// FIXME most of this is duplicated from MetaBlockNode, use a mixin or something
|
|
// DOM Changes
|
|
this.$.addClass( 've-ce-metaInlineNode' );
|
|
this.$.attr( 'contenteditable', false );
|
|
|
|
// Properties
|
|
this.currentKey = null; // Populated by the first onUpdate() call
|
|
this.currentValue = null; // Populated by the first onUpdate() call
|
|
|
|
// Events
|
|
this.model.addListenerMethod( this, 'update', 'onUpdate' );
|
|
|
|
// Intialization
|
|
this.onUpdate();
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ce.MetaInlineNode, ve.ce.LeafNode );
|
|
|
|
/* Static Members */
|
|
|
|
/**
|
|
* Node rules.
|
|
*
|
|
* @see ve.ce.NodeFactory
|
|
* @static
|
|
* @member
|
|
*/
|
|
ve.ce.MetaInlineNode.rules = {
|
|
'canBeSplit': false
|
|
};
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* Responds to model update events.
|
|
*
|
|
* @method
|
|
*/
|
|
ve.ce.MetaInlineNode.prototype.onUpdate = ve.ce.MetaBlockNode.prototype.onUpdate;
|
|
|
|
/* Registration */
|
|
|
|
ve.ce.nodeFactory.register( 'metaInline', ve.ce.MetaInlineNode );
|