mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-05 11:18:19 +00:00
12cc56400b
Updates the model and re-renders the gallery. Bug: T150621 Bug: T149602 Bug: T149596 Change-Id: I1e93c3af02eeeff1fcdaa5549cccc61ea755ee04
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
/*!
|
|
* VisualEditor DataModel MWGalleryImageCaptionNode class.
|
|
*
|
|
* @copyright 2016 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* DataModel gallery image caption node.
|
|
*
|
|
* @class
|
|
* @extends ve.dm.BranchNode
|
|
*
|
|
* @constructor
|
|
* @param {Object} [element] Reference to element in linear model
|
|
* @param {ve.dm.Node[]} [children]
|
|
*/
|
|
ve.dm.MWGalleryImageCaptionNode = function VeDmMWGalleryImageCaptionNode() {
|
|
// Parent constructor
|
|
ve.dm.MWGalleryImageCaptionNode.super.apply( this, arguments );
|
|
};
|
|
|
|
OO.inheritClass( ve.dm.MWGalleryImageCaptionNode, ve.dm.BranchNode );
|
|
|
|
ve.dm.MWGalleryImageCaptionNode.static.name = 'mwGalleryImageCaption';
|
|
|
|
ve.dm.MWGalleryImageCaptionNode.static.matchTagNames = [];
|
|
|
|
ve.dm.MWGalleryImageCaptionNode.static.parentNodeTypes = [ 'mwGalleryImage' ];
|
|
|
|
ve.dm.MWGalleryImageCaptionNode.static.toDomElements = function ( dataElement, doc ) {
|
|
var div = doc.createElement( 'div' );
|
|
div.classList.add( 'gallerytext' );
|
|
return [ div ];
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.dm.modelRegistry.register( ve.dm.MWGalleryImageCaptionNode );
|