2012-02-06 23:50:56 +00:00
|
|
|
/**
|
|
|
|
* Creates an ve.dm.ParagraphNode object.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @constructor
|
|
|
|
* @extends {ve.dm.LeafNode}
|
|
|
|
* @param {Object} element Document data element of this node
|
|
|
|
* @param {Integer} length Length of document data element
|
|
|
|
*/
|
|
|
|
ve.dm.ParagraphNode = function( element, length ) {
|
|
|
|
// Inheritance
|
|
|
|
ve.dm.LeafNode.call( this, 'paragraph', element, length );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a paragraph view for this model.
|
|
|
|
*
|
|
|
|
* @method
|
2012-03-06 22:39:43 +00:00
|
|
|
* @returns {ve.ce.ParagraphNode}
|
2012-02-06 23:50:56 +00:00
|
|
|
*/
|
|
|
|
ve.dm.ParagraphNode.prototype.createView = function() {
|
2012-03-06 22:39:43 +00:00
|
|
|
return new ve.ce.ParagraphNode( this );
|
2012-02-06 23:50:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.dm.DocumentNode.nodeModels.paragraph = ve.dm.ParagraphNode;
|
|
|
|
|
|
|
|
ve.dm.DocumentNode.nodeRules.paragraph = {
|
|
|
|
'parents': null,
|
|
|
|
'children': []
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
ve.extendClass( ve.dm.ParagraphNode, ve.dm.LeafNode );
|