mediawiki-extensions-Visual.../modules/ve-mw/ui/tools/ve.ui.MWGalleryInspectorTool.js
Ed Sanders 07d56b6b5d Create more MW sequences
* '{|' for tables
* '<!--' for comments
* '<gallery' for galleries

Change-Id: Ib78c411bf8676bc1974bb80515fd56c642cd67b7
2015-10-22 22:23:13 +01:00

40 lines
1.3 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' ] }
)
);
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextGallery', 'gallery', '<gallery', 8 )
);