2019-07-12 11:21:32 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MWGalleryContextItem class.
|
|
|
|
*
|
2023-12-01 16:06:11 +00:00
|
|
|
* @copyright See AUTHORS.txt
|
2019-07-12 11:21:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Context item for a MWGallery.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.LinearContextItem
|
|
|
|
*
|
2023-07-10 13:31:31 +00:00
|
|
|
* @param {ve.ui.LinearContext} context Context the item is in
|
|
|
|
* @param {ve.dm.Model} model Model the item is related to
|
2023-02-02 09:47:32 +00:00
|
|
|
* @param {Object} [config]
|
2019-07-12 11:21:32 +00:00
|
|
|
*/
|
|
|
|
ve.ui.MWGalleryContextItem = function VeUiMWGalleryContextItem() {
|
|
|
|
// Parent constructor
|
|
|
|
ve.ui.MWGalleryContextItem.super.apply( this, arguments );
|
|
|
|
|
|
|
|
// Initialization
|
|
|
|
this.$element.addClass( 've-ui-mwGalleryContextItem' );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.ui.MWGalleryContextItem, ve.ui.LinearContextItem );
|
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
|
|
|
ve.ui.MWGalleryContextItem.static.name = 'mwGallery';
|
|
|
|
|
|
|
|
ve.ui.MWGalleryContextItem.static.icon = 'imageGallery';
|
|
|
|
|
|
|
|
ve.ui.MWGalleryContextItem.static.label = OO.ui.deferMsg( 'visualeditor-mwgallerydialog-title' );
|
|
|
|
|
|
|
|
ve.ui.MWGalleryContextItem.static.modelClasses = [ ve.dm.MWGalleryNode ];
|
|
|
|
|
|
|
|
ve.ui.MWGalleryContextItem.static.commandName = 'gallery';
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.MWGalleryContextItem.prototype.getDescription = function () {
|
2023-01-18 12:43:23 +00:00
|
|
|
return ve.msg( 'visualeditor-mwgallerycontext-description', this.model.getImageNodes().length );
|
2019-07-12 11:21:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.ui.contextItemFactory.register( ve.ui.MWGalleryContextItem );
|