mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 02:51:50 +00:00
85b807ed5d
This makes it possible to get identical rendering in the editor, but may make other things more complex. The Wikitext serializer is no longer compatible for rendering lists so it's been stubbed out. Also the way the toolbar works with lists is broken, so that's been disabled. The HTML serializer has been fixed to work correctly and no-longer-used styles have been removed. Change-Id: If156f55068b1f6d229b3fa789164f28b2e3dfc76
52 lines
1.1 KiB
JavaScript
52 lines
1.1 KiB
JavaScript
/**
|
|
* Creates an ve.ce.LeafNode object.
|
|
*
|
|
* @class
|
|
* @abstract
|
|
* @constructor
|
|
* @extends {ve.LeafNode}
|
|
* @extends {ve.ce.Node}
|
|
* @param model {ve.ModelNode} Model to observe
|
|
* @param {jQuery} [$element] Element to use as a container
|
|
*/
|
|
ve.ce.LeafNode = function( model, $element ) {
|
|
// Inheritance
|
|
ve.LeafNode.call( this );
|
|
ve.ce.Node.call( this, model, $element );
|
|
|
|
this.$.data( 'view', this );
|
|
this.$.addClass( 've-ce-leafNode' );
|
|
|
|
// Properties
|
|
this.contentView = new ve.ce.Content( model, this.$, this );
|
|
|
|
// Events
|
|
this.contentView.on( 'update', this.emitUpdate );
|
|
};
|
|
|
|
/* Methods */
|
|
|
|
ve.ce.LeafNode.prototype.convertDomElement = function( type ) {
|
|
ve.ce.Node.prototype.call( this, type );
|
|
// Transplant content view
|
|
this.contentView.setContainer( this.$ );
|
|
};
|
|
|
|
/**
|
|
* Render content.
|
|
*
|
|
* @method
|
|
*/
|
|
ve.ce.LeafNode.prototype.renderContent = function() {
|
|
this.contentView.render();
|
|
};
|
|
|
|
ve.ce.LeafNode.prototype.getDOMText = function() {
|
|
return ve.ce.getDOMText( this.$[0] );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.extendClass( ve.ce.LeafNode, ve.LeafNode );
|
|
ve.extendClass( ve.ce.LeafNode, ve.ce.Node );
|