mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-05 14:12:53 +00:00
9c967267e6
We weren't really using it exclusively for nodes any more, and the only functionality in there was for using .static.name Change-Id: Ie26928cd01faee95a10912201663b45f1f20fb19
44 lines
985 B
JavaScript
44 lines
985 B
JavaScript
/*!
|
|
* VisualEditor ContentEditable NodeFactory class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* ContentEditable node factory.
|
|
*
|
|
* @class
|
|
* @extends ve.NamedClassFactory
|
|
* @constructor
|
|
*/
|
|
ve.ce.NodeFactory = function VeCeNodeFactory() {
|
|
// Parent constructor
|
|
ve.NamedClassFactory.call( this );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ce.NodeFactory, ve.NamedClassFactory );
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* Check if a node type can be split.
|
|
*
|
|
* @param {string} type Node type
|
|
* @returns {boolean} The node can have grandchildren
|
|
* @throws {Error} Unknown node type
|
|
*/
|
|
ve.ce.NodeFactory.prototype.canNodeBeSplit = function ( type ) {
|
|
if ( type in this.registry ) {
|
|
return this.registry[type].static.canBeSplit;
|
|
}
|
|
throw new Error( 'Unknown node type: ' + type );
|
|
};
|
|
|
|
/* Initialization */
|
|
|
|
// TODO: Move instantiation to a different file
|
|
ve.ce.nodeFactory = new ve.ce.NodeFactory();
|