Index: trunk/extensions/VisualEditor/demos/ce/index.php |
— | — | @@ -117,13 +117,13 @@ |
118 | 118 | <script src="../../modules/ve/es/ve.es.js"></script> |
119 | 119 | <script src="../../modules/ve/es/ve.es.Node.js"></script> |
120 | 120 | <script src="../../modules/ve/es/ve.es.BranchNode.js"></script> |
121 | | - <script src="../../modules/ve/es/ve.es.LeafNode.js"></script> |
| 121 | + <script src="../../modules/ve/ce/ve.es.LeafNode.js"></script> |
122 | 122 | <script src="../../modules/ve/ce/ve.es.Content.js"></script> |
123 | 123 | <script src="../../modules/ve/ce/ve.es.Surface.js"></script> |
124 | 124 | |
125 | 125 | <script src="../../modules/ve/ce/nodes/ve.es.DocumentNode.js"></script> |
126 | 126 | <script src="../../modules/ve/es/nodes/ve.es.HeadingNode.js"></script> |
127 | | - <script src="../../modules/ve/es/nodes/ve.es.ParagraphNode.js"></script> |
| 127 | + <script src="../../modules/ve/ce/nodes/ve.es.ParagraphNode.js"></script> |
128 | 128 | <script src="../../modules/ve/es/nodes/ve.es.PreNode.js"></script> |
129 | 129 | <script src="../../modules/ve/es/nodes/ve.es.ListItemNode.js"></script> |
130 | 130 | <script src="../../modules/ve/es/nodes/ve.es.ListNode.js"></script> |
Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.es.LeafNode.js |
— | — | @@ -0,0 +1,41 @@ |
| 2 | +/**
|
| 3 | + * Creates an ve.es.LeafNode object.
|
| 4 | + *
|
| 5 | + * @class
|
| 6 | + * @abstract
|
| 7 | + * @constructor
|
| 8 | + * @extends {ve.LeafNode}
|
| 9 | + * @extends {ve.es.Node}
|
| 10 | + * @param model {ve.ModelNode} Model to observe
|
| 11 | + * @param {jQuery} [$element] Element to use as a container
|
| 12 | + */
|
| 13 | +ve.es.LeafNode = function( model, $element ) {
|
| 14 | + // Inheritance
|
| 15 | + ve.LeafNode.call( this );
|
| 16 | + ve.es.Node.call( this, model, $element );
|
| 17 | +
|
| 18 | + this.$.data('view', this);
|
| 19 | + this.$.addClass('ce-leafNode');
|
| 20 | +
|
| 21 | + // Properties
|
| 22 | + this.contentView = new ve.es.Content( this.$, model );
|
| 23 | +
|
| 24 | + // Events
|
| 25 | + this.contentView.on( 'update', this.emitUpdate );
|
| 26 | +};
|
| 27 | +
|
| 28 | +/* Methods */
|
| 29 | +
|
| 30 | +/**
|
| 31 | + * Render content.
|
| 32 | + *
|
| 33 | + * @method
|
| 34 | + */
|
| 35 | +ve.es.LeafNode.prototype.renderContent = function() {
|
| 36 | + this.contentView.render();
|
| 37 | +};
|
| 38 | +
|
| 39 | +/* Inheritance */
|
| 40 | +
|
| 41 | +ve.extendClass( ve.es.LeafNode, ve.LeafNode );
|
| 42 | +ve.extendClass( ve.es.LeafNode, ve.es.Node );
|
Index: trunk/extensions/VisualEditor/modules/ve/ce/nodes/ve.es.ParagraphNode.js |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +/**
|
| 3 | + * Creates an ve.es.ParagraphNode object.
|
| 4 | + *
|
| 5 | + * @class
|
| 6 | + * @constructor
|
| 7 | + * @extends {ve.es.LeafNode}
|
| 8 | + * @param {ve.dm.ParagraphNode} model Paragraph model to view
|
| 9 | + */
|
| 10 | +ve.es.ParagraphNode = function( model ) {
|
| 11 | + // Inheritance
|
| 12 | + ve.es.LeafNode.call( this, model, $( '<p></p>' ) );
|
| 13 | +
|
| 14 | + // DOM Changes
|
| 15 | + this.$.addClass( 'es-paragraphView' );
|
| 16 | +};
|
| 17 | +
|
| 18 | +/* Registration */
|
| 19 | +
|
| 20 | +ve.es.DocumentNode.splitRules.paragraph = {
|
| 21 | + 'self': true,
|
| 22 | + 'children': null
|
| 23 | +};
|
| 24 | +
|
| 25 | +/* Inheritance */
|
| 26 | +
|
| 27 | +ve.extendClass( ve.es.ParagraphNode, ve.es.LeafNode );
|