mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
370070dfa2
* Fixed constructor of ve.ce.BranchNode which was calling the wrong method to perform an onSplice and with the wrong arguments * Removed/renamed events emitted from ve.ce.BranchNode.onSplice * Reintroduced .$ to all ce nodes * Ported over functionality for DOM node type variance used in headings, lists and list items * Moved the old ve.ce.Content guts to ve.ce.TextNode * Added getOffsetFromNode and getDataFromNode to ve.dm.DocumentFragment * Added setDocument and getDocument to dm nodes Change-Id: I185423ba2f1a858dde562cb2f5bc3852aec930db
32 lines
607 B
JavaScript
32 lines
607 B
JavaScript
/**
|
|
* ContentEditable node for a paragraph.
|
|
*
|
|
* @class
|
|
* @constructor
|
|
* @extends {ve.ce.BranchNode}
|
|
* @param model {ve.dm.ParagraphNode} Model to observe
|
|
*/
|
|
ve.ce.ParagraphNode = function( model ) {
|
|
// Inheritance
|
|
ve.ce.BranchNode.call( this, model, $( '<p></p>' ) );
|
|
};
|
|
|
|
/* Static Members */
|
|
|
|
/**
|
|
* @see ve.ce.NodeFactory
|
|
*/
|
|
ve.ce.ParagraphNode.rules = {
|
|
'canHaveChildren': true,
|
|
'canHaveGrandchildren': false,
|
|
'canBeSplit': true
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.ce.factory.register( 'paragraph', ve.ce.ParagraphNode );
|
|
|
|
/* Inheritance */
|
|
|
|
ve.extendClass( ve.ce.ParagraphNode, ve.ce.BranchNode );
|