2011-11-02 21:00:55 +00:00
|
|
|
/**
|
|
|
|
* Creates an es.ParagraphModel object.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @constructor
|
2011-11-03 21:48:40 +00:00
|
|
|
* @extends {es.DocumentModelLeafNode}
|
2011-11-02 21:00:55 +00:00
|
|
|
* @param {Object} element Document data element of this node
|
|
|
|
* @param {Integer} length Length of document data element
|
|
|
|
*/
|
|
|
|
es.ParagraphModel = function( element, length ) {
|
|
|
|
// Inheritance
|
2011-11-03 21:48:40 +00:00
|
|
|
es.DocumentModelLeafNode.call( this, 'paragraph', element, length );
|
2011-11-02 21:00:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a paragraph view for this model.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @returns {es.ParagraphView}
|
|
|
|
*/
|
|
|
|
es.ParagraphModel.prototype.createView = function() {
|
|
|
|
return new es.ParagraphView( this );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
es.DocumentModel.nodeModels.paragraph = es.ParagraphModel;
|
|
|
|
|
|
|
|
es.DocumentModel.nodeRules.paragraph = {
|
|
|
|
'parents': null,
|
2011-11-16 19:28:13 +00:00
|
|
|
'children': []
|
2011-11-02 21:00:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2011-11-03 21:48:40 +00:00
|
|
|
es.extendClass( es.ParagraphModel, es.DocumentModelLeafNode );
|