mediawiki-extensions-Visual.../modules/ve/ce/ve.ce.NodeFactory.js
Catrope 6afed5e5cc Move ve2/ back to ve/
Change-Id: Ie51d8e48171fb1f84045d1560ee603cee62b91f6
2012-06-19 18:20:28 -07:00

36 lines
687 B
JavaScript

/**
* ContentEditable node factory.
*
* @class
* @extends {ve.Factory}
* @constructor
*/
ve.ce.NodeFactory = function() {
// Inheritance
ve.Factory.call( this );
};
/* Methods */
/**
* Checks if a given node type can be split.
*
* @param {String} type Node type
* @returns {Boolean} The node can have grandchildren
* @throws 'Unknown node type'
*/
ve.ce.NodeFactory.prototype.canNodeBeSplit = function( type ) {
if ( type in this.registry ) {
return this.registry[type].rules.canBeSplit;
}
throw 'Unknown node type: ' + type;
};
/* Inheritance */
ve.extendClass( ve.ce.NodeFactory, ve.Factory );
/* Initialization */
ve.ce.nodeFactory = new ve.ce.NodeFactory();