mediawiki-extensions-Visual.../modules/ve/dm/nodes/ve.dm.GeneratedContentNode.js
Roan Kattouw e9395273de Clean up static stuff in dm.GeneratedContentNode
Remove enableAboutGrouping from GCNode and move it to the subclasses
so we can have GCNodes without grouping.

Having matchTagNames there doesn't make sense now that GCNode is a
mixin rather than a base class.

Also removed unused .static.generatedContent property.

Change-Id: I2b5350e70b7829cf009c752d066919e5a3593db0
2013-06-24 21:50:38 +00:00

34 lines
1 KiB
JavaScript

/*!
* VisualEditor DataModel GeneratedContentNode class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* DataModel generated content node.
*
* @class
* @abstract
* @constructor
* @param {number} [length] Length of content data in document; ignored and overridden to 0
* @param {Object} [element] Reference to element in linear model
*/
ve.dm.GeneratedContentNode = function VeDmGeneratedContentNode() {
};
/* Static methods */
ve.dm.GeneratedContentNode.static = {};
/**
* Store HTML of DOM elements, hashed on data element
* @param {Object} dataElement Data element
* @param {HTMLElement[]} domElements DOM elements
* @param {ve.dm.IndexValueStore} store Index-value store
* @returns {number} Index of stored data
*/
ve.dm.GeneratedContentNode.static.storeDomElements = function ( dataElement, domElements, store ) {
var hash = ve.getHash( this.getHashObject( dataElement ) );
return store.index( domElements, hash );
};