mediawiki-extensions-Visual.../modules/ve2/ce/ve.ce.NodeFactory.js
Trevor Parscal 042ffb4e3b Added foundation for new converter
* Added converters to all relevant node implementations
* Added new annotation objects with their own factory

Change-Id: I9870d6d5eac45083929d74d2e58917d0939ca917
2012-05-31 16:50:16 -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();