mediawiki-extensions-Visual.../modules/ve/ce/nodes/ve.ce.ParagraphNode.js
Inez Korczyński 1d7cf569e6 Support for thumb and frame images with captions.
* VisualEditor.hooks.php
** export URL to magnify clip as a configuration variable so thumbnail image can render correctly

* ve.ce.Surface.css
** add CSS styling to make image captions look the same way in edit mode as they look in the view mode

* ve.ce.ParagraphNode.js
** add CSS class ve-ce-generated-wrapper if it is a generated wrapper

* ve.ce.MWImageCaptionNode.js
** make image caption rendering match the view mode

Change-Id: I0cd1b25e8f8355e0500aabc90e7c4cdf591545f3
2013-05-23 00:44:43 -07:00

45 lines
1 KiB
JavaScript

/*!
* VisualEditor ContentEditable ParagraphNode class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* ContentEditable paragraph node.
*
* @class
* @extends ve.ce.BranchNode
* @constructor
* @param {ve.dm.ParagraphNode} model Model to observe
* @param {Object} [config] Config options
*/
ve.ce.ParagraphNode = function VeCeParagraphNode( model, config ) {
// Parent constructor
ve.ce.ContentBranchNode.call( this, model, config );
// DOM changes
if (
this.model.getElement().internal &&
this.model.getElement().internal.generated === 'wrapper'
) {
this.$.addClass( 've-ce-generated-wrapper' );
}
};
/* Inheritance */
ve.inheritClass( ve.ce.ParagraphNode, ve.ce.ContentBranchNode );
/* Static Properties */
ve.ce.ParagraphNode.static.name = 'paragraph';
ve.ce.ParagraphNode.static.tagName = 'p';
ve.ce.ParagraphNode.static.canBeSplit = true;
/* Registration */
ve.ce.nodeFactory.register( ve.ce.ParagraphNode );