mediawiki-extensions-Visual.../modules/ve-mw/ui/contextitems/ve.ui.MWGalleryContextItem.js
Ed Sanders d42a0772bb Move verbose copyright message to AUTHORS.txt
Avoids having to update the date in every file every year,
which we stopped doing.

Change-Id: I7bf7aa0937eef911e00772470091753a7b06fd3d
2023-12-01 16:07:39 +00:00

53 lines
1.3 KiB
JavaScript

/*!
* VisualEditor MWGalleryContextItem class.
*
* @copyright See AUTHORS.txt
*/
/**
* Context item for a MWGallery.
*
* @class
* @extends ve.ui.LinearContextItem
*
* @param {ve.ui.LinearContext} context Context the item is in
* @param {ve.dm.Model} model Model the item is related to
* @param {Object} [config]
*/
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 () {
return ve.msg( 'visualeditor-mwgallerycontext-description', this.model.getImageNodes().length );
};
/* Registration */
ve.ui.contextItemFactory.register( ve.ui.MWGalleryContextItem );