mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 02:51:50 +00:00
6fdbe9fd7e
Make new graphical interface for editing existing galleries and adding new galleries. NB The dialog does not yet support rich text in the image captions, nor does it provide separate fields for e.g. link, alt text, etc. These are dependent on parsing the text within the tag, which is yet to be implemented by Parsoid. For now, these attributes should be specified in wikitext in the image-specific caption field. Bug: T45037 Change-Id: I2b4082e991268241a15b9bbd6d85c94cdc2185f2
40 lines
1.3 KiB
JavaScript
40 lines
1.3 KiB
JavaScript
/*!
|
|
* VisualEditor MediaWiki UserInterface gallery tool class.
|
|
*
|
|
* @copyright 2011-2016 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* MediaWiki UserInterface gallery tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.FragmentWindowTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWGalleryDialogTool = function VeUiMWGalleryDialogTool() {
|
|
ve.ui.MWGalleryDialogTool.super.apply( this, arguments );
|
|
};
|
|
OO.inheritClass( ve.ui.MWGalleryDialogTool, ve.ui.FragmentWindowTool );
|
|
ve.ui.MWGalleryDialogTool.static.name = 'gallery';
|
|
ve.ui.MWGalleryDialogTool.static.group = 'object';
|
|
ve.ui.MWGalleryDialogTool.static.icon = 'imageGallery';
|
|
ve.ui.MWGalleryDialogTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-mwgallerydialog-title' );
|
|
ve.ui.MWGalleryDialogTool.static.modelClasses = [ ve.dm.MWGalleryNode ];
|
|
ve.ui.MWGalleryDialogTool.static.commandName = 'gallery';
|
|
ve.ui.toolFactory.register( ve.ui.MWGalleryDialogTool );
|
|
|
|
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 )
|
|
);
|