mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
37b3c07b26
Creating an MWImageModel that handles all image edit operations. If the new attributes mean a change of image types from inline to block or vice versa, the model will handle the creation and insertion of the new node. Change-Id: Ibe71bc8bd74e4ba5a024ac722432ccf0b8f65e71
53 lines
2 KiB
JavaScript
53 lines
2 KiB
JavaScript
/*!
|
|
* VisualEditor MediaWiki media dialog tool classes.
|
|
*
|
|
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* MediaWiki UserInterface media edit tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.DialogTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWMediaEditDialogTool = function VeUiMWMediaEditDialogTool( toolGroup, config ) {
|
|
ve.ui.DialogTool.call( this, toolGroup, config );
|
|
};
|
|
OO.inheritClass( ve.ui.MWMediaEditDialogTool, ve.ui.DialogTool );
|
|
ve.ui.MWMediaEditDialogTool.static.name = 'mediaEdit';
|
|
ve.ui.MWMediaEditDialogTool.static.group = 'object';
|
|
ve.ui.MWMediaEditDialogTool.static.icon = 'picture';
|
|
ve.ui.MWMediaEditDialogTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-dialogbutton-media-tooltip' );
|
|
ve.ui.MWMediaEditDialogTool.static.modelClasses = [ ve.dm.MWBlockImageNode, ve.dm.MWInlineImageNode ];
|
|
ve.ui.MWMediaEditDialogTool.static.commandName = 'mediaEdit';
|
|
ve.ui.MWMediaEditDialogTool.static.autoAddToCatchall = false;
|
|
ve.ui.MWMediaEditDialogTool.static.autoAddToGroup = false;
|
|
ve.ui.toolFactory.register( ve.ui.MWMediaEditDialogTool );
|
|
|
|
/**
|
|
* MediaWiki UserInterface media insert tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.DialogTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWMediaInsertDialogTool = function VeUiMWMediaInsertDialogTool( toolGroup, config ) {
|
|
ve.ui.DialogTool.call( this, toolGroup, config );
|
|
};
|
|
OO.inheritClass( ve.ui.MWMediaInsertDialogTool, ve.ui.DialogTool );
|
|
ve.ui.MWMediaInsertDialogTool.static.name = 'mediaInsert';
|
|
ve.ui.MWMediaInsertDialogTool.static.group = 'object';
|
|
ve.ui.MWMediaInsertDialogTool.static.icon = 'picture';
|
|
ve.ui.MWMediaInsertDialogTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-dialogbutton-media-tooltip' );
|
|
ve.ui.MWMediaInsertDialogTool.static.commandName = 'mediaInsert';
|
|
ve.ui.MWMediaInsertDialogTool.static.requiresRange = true;
|
|
ve.ui.toolFactory.register( ve.ui.MWMediaInsertDialogTool );
|