2012-02-06 23:50:56 +00:00
|
|
|
/**
|
|
|
|
* Creates an ve.dm.ListItemNode 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.ListItemNode = function( element, contents ) {
|
|
|
|
// Inheritance
|
|
|
|
ve.dm.BranchNode.call( this, 'listItem', element, contents );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a list item view for this model.
|
|
|
|
*
|
|
|
|
* @method
|
2012-03-06 22:39:43 +00:00
|
|
|
* @returns {ve.ce.ListItemNode}
|
2012-02-06 23:50:56 +00:00
|
|
|
*/
|
|
|
|
ve.dm.ListItemNode.prototype.createView = function() {
|
2012-03-06 22:39:43 +00:00
|
|
|
return new ve.ce.ListItemNode( this );
|
2012-02-06 23:50:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.dm.DocumentNode.nodeModels.listItem = ve.dm.ListItemNode;
|
|
|
|
|
|
|
|
ve.dm.DocumentNode.nodeRules.listItem = {
|
|
|
|
'parents': ['list'],
|
|
|
|
'children': null
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
ve.extendClass( ve.dm.ListItemNode, ve.dm.BranchNode );
|