mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 23:05:35 +00:00
dedc107507
By moving the registration to the code which introduce the commands, if any module such as 'media' is omitted from an integration, we don't register a command which is never used. MWCommandRegistry.js remains to be used for over-rides of core tools' exact commands, such as insertTable. Change-Id: I84b4351b980a764d3c72a564f605821ae1c761f9
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
/*!
|
|
* VisualEditor MediaWiki UserInterface gallery tool class.
|
|
*
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* MediaWiki UserInterface gallery tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.InspectorTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWGalleryInspectorTool = function VeUiMWGalleryInspectorTool( toolGroup, config ) {
|
|
ve.ui.InspectorTool.call( this, toolGroup, config );
|
|
};
|
|
OO.inheritClass( ve.ui.MWGalleryInspectorTool, ve.ui.InspectorTool );
|
|
ve.ui.MWGalleryInspectorTool.static.name = 'gallery';
|
|
ve.ui.MWGalleryInspectorTool.static.group = 'object';
|
|
ve.ui.MWGalleryInspectorTool.static.icon = 'gallery';
|
|
ve.ui.MWGalleryInspectorTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-mwgalleryinspector-title' );
|
|
ve.ui.MWGalleryInspectorTool.static.modelClasses = [ ve.dm.MWGalleryNode ];
|
|
ve.ui.MWGalleryInspectorTool.static.commandName = 'gallery';
|
|
ve.ui.toolFactory.register( ve.ui.MWGalleryInspectorTool );
|
|
|
|
ve.ui.commandRegistry.register(
|
|
new ve.ui.Command(
|
|
'gallery', 'window', 'open',
|
|
{ args: [ 'gallery' ], supportedSelections: [ 'linear' ] }
|
|
)
|
|
);
|