2014-01-15 03:04:58 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor ContentEditable MWGalleryNode class.
|
|
|
|
*
|
2018-01-03 00:54:47 +00:00
|
|
|
* @copyright 2011-2018 VisualEditor Team and others; see AUTHORS.txt
|
2014-01-15 03:04:58 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ContentEditable MediaWiki gallery node.
|
|
|
|
*
|
|
|
|
* @class
|
2014-05-20 11:56:37 +00:00
|
|
|
* @extends ve.ce.MWBlockExtensionNode
|
2014-01-15 03:04:58 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {ve.dm.MWGalleryNode} model Model to observe
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2014-11-12 19:02:57 +00:00
|
|
|
ve.ce.MWGalleryNode = function VeCeMWGalleryNode() {
|
2014-01-15 03:04:58 +00:00
|
|
|
// Parent constructor
|
2014-11-12 19:02:57 +00:00
|
|
|
ve.ce.MWGalleryNode.super.apply( this, arguments );
|
2014-01-15 03:04:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2014-05-20 11:56:37 +00:00
|
|
|
OO.inheritClass( ve.ce.MWGalleryNode, ve.ce.MWBlockExtensionNode );
|
2014-01-15 03:04:58 +00:00
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
|
|
|
ve.ce.MWGalleryNode.static.name = 'mwGallery';
|
|
|
|
|
|
|
|
ve.ce.MWGalleryNode.static.tagName = 'div';
|
|
|
|
|
2013-12-20 23:25:24 +00:00
|
|
|
ve.ce.MWGalleryNode.static.primaryCommandName = 'gallery';
|
|
|
|
|
2014-06-16 10:52:37 +00:00
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
2014-07-24 09:54:22 +00:00
|
|
|
* @inheritdoc ve.ce.GeneratedContentNode
|
2014-06-16 10:52:37 +00:00
|
|
|
*/
|
2014-07-24 09:54:22 +00:00
|
|
|
ve.ce.MWGalleryNode.prototype.getFocusableElement = function () {
|
2018-02-21 21:22:49 +00:00
|
|
|
var $gallery = this.$element.find( '.gallery' ).addBack( '.gallery' ).children();
|
|
|
|
return $gallery.length ? $gallery : this.$element;
|
2014-06-16 10:52:37 +00:00
|
|
|
};
|
|
|
|
|
2017-11-03 22:29:25 +00:00
|
|
|
/**
|
|
|
|
* @inheritdoc ve.ce.GeneratedContentNode
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.ce.MWGalleryNode.prototype.getBoundingElement = ve.ce.MWGalleryNode.prototype.getFocusableElement;
|
|
|
|
|
2014-01-15 03:04:58 +00:00
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.ce.nodeFactory.register( ve.ce.MWGalleryNode );
|