mediawiki-extensions-Visual.../modules/ve/ce/ve.ce.NodeFactory.js
James D. Forrester 82114467f1 Bump copyright notice year range to -2013 over -2012
199 files touched. Whee!

Change-Id: Id82ce4a32f833406db4a1cc585674f2bdb39ba0d
2013-02-19 15:37:34 -08:00

44 lines
955 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.Factory
* @constructor
*/
ve.ce.NodeFactory = function VeCeNodeFactory() {
// Parent constructor
ve.Factory.call( this );
};
/* Inheritance */
ve.inheritClass( ve.ce.NodeFactory, ve.Factory );
/* 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();