Debian Codegraph @

extensions/VisualEditor/modules/ve-mw/ui/contextitems/ve.ui.MWGalleryContextItem.js

raw symbols SCIP
1 /*!
2 * VisualEditor MWGalleryContextItem class.
3 *
4 * @copyright See AUTHORS.txt
5 */
6
7 /**
8 * Context item for a MWGallery.
9 *
10 * @class
11 * @extends ve.ui.LinearContextItem
12 *
13 * @param {ve.ui.LinearContext} context Context the item is in
14 * @param {ve.dm.Model} model Model the item is related to
15 * @param {Object} [config]
16 */
17 ve.ui.MWGalleryContextItem = function VeUiMWGalleryContextItem() {
18 // Parent constructor
19 ve.ui.MWGalleryContextItem.super.apply( this, arguments );
20
21 // Initialization
22 this.$element.addClass( 've-ui-mwGalleryContextItem' );
23 };
24
25 /* Inheritance */
26
27 OO.inheritClass( ve.ui.MWGalleryContextItem, ve.ui.LinearContextItem );
28
29 /* Static Properties */
30
31 ve.ui.MWGalleryContextItem.static.name = 'mwGallery';
32
33 ve.ui.MWGalleryContextItem.static.icon = 'imageGallery';
34
35 ve.ui.MWGalleryContextItem.static.label = OO.ui.deferMsg( 'visualeditor-mwgallerydialog-title' );
36
37 ve.ui.MWGalleryContextItem.static.modelClasses = [ ve.dm.MWGalleryNode ];
38
39 ve.ui.MWGalleryContextItem.static.commandName = 'gallery';
40
41 /* Methods */
42
43 /**
44 * @inheritdoc
45 */
46 ve.ui.MWGalleryContextItem.prototype.getDescription = function () {
47 return ve.msg( 'visualeditor-mwgallerycontext-description', this.model.getImageNodes().length );
48 };
49
50 /* Registration */
51
52 ve.ui.contextItemFactory.register( ve.ui.MWGalleryContextItem );