Media dialog support
*/index.php
* Added links to new files
VisualEditor.php
* Added links to new files
* Removed keys of non-existent messages
ve.ui.ContentDialog.js, ve.ui.MetaDialog.js
* Removed redundant comments
ve.ui.MediaDialog.js
* New dialog, just for media
icons.ai, picture.png, picture.svg, ve.ui.Icons-*.css
* Added picture icon
ve.ui.MediaButtonTool.js
* New button, just for media (shows up in the context toolbar)
ve.ui.DialogButtonTool.js
* New base class for dialog buttons
ve.ui.Context.js
* Added basic support for showing dialog buttons, in addition to
annotation buttons, in the context toolbar - to test, select only an
image node
ve.ui.Dialog.js
* Prevent clicks on the click-block from changing focus
* Moved initialize to below the event handlers and updated its
documentation
ve.ui.DialogFactory.js
* Added a way to get the names of dialogs that can be used to edit a
node
ve.ui.Inspector.js
* Removed close handler which set focus, this is done already in window
ve.ui.InspectorFactory.js
* Fixed comment so it's not telling lies anymore
ve.ui.Window.js
* Removed auto-focus on frame, it's changing the focus in the parent
document which blows-away the focus in CE, and it really isn't needed
as it turns out
VisualEditor.18n.php
* Added media dialog title message
* Added media tool tooltip message
Bug: 37870
Change-Id: I9150c46b3e292910fed899fa60d6da433049ca45
2013-03-28 19:15:17 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface DialogButtonTool class.
|
|
|
|
*
|
|
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* UserInterface dialog button tool.
|
|
|
|
*
|
|
|
|
* @abstract
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.ButtonTool
|
|
|
|
* @constructor
|
|
|
|
* @param {ve.ui.Toolbar} toolbar
|
|
|
|
* @param {Object} [config] Config options
|
|
|
|
*/
|
|
|
|
ve.ui.DialogButtonTool = function VeUiDialogButtonTool( toolbar, config ) {
|
|
|
|
// Parent constructor
|
|
|
|
ve.ui.ButtonTool.call( this, toolbar, config );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
ve.inheritClass( ve.ui.DialogButtonTool, ve.ui.ButtonTool );
|
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Symbolic name of dialog the button opens.
|
|
|
|
*
|
|
|
|
* @abstract
|
|
|
|
* @static
|
|
|
|
* @property
|
|
|
|
* @type {string}
|
|
|
|
* @inheritable
|
|
|
|
*/
|
|
|
|
ve.ui.DialogButtonTool.static.dialog = '';
|
|
|
|
|
2013-06-26 21:54:51 +00:00
|
|
|
/**
|
|
|
|
* Annotation or node models this tool is related to.
|
|
|
|
*
|
|
|
|
* Used by #canEditModel.
|
|
|
|
*
|
|
|
|
* @static
|
|
|
|
* @property {Function[]}
|
|
|
|
*/
|
|
|
|
ve.ui.DialogButtonTool.static.modelClasses = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.DialogButtonTool.static.canEditModel = function ( model ) {
|
|
|
|
return ve.isInstanceOfAny( model, this.modelClasses );
|
|
|
|
};
|
|
|
|
|
Media dialog support
*/index.php
* Added links to new files
VisualEditor.php
* Added links to new files
* Removed keys of non-existent messages
ve.ui.ContentDialog.js, ve.ui.MetaDialog.js
* Removed redundant comments
ve.ui.MediaDialog.js
* New dialog, just for media
icons.ai, picture.png, picture.svg, ve.ui.Icons-*.css
* Added picture icon
ve.ui.MediaButtonTool.js
* New button, just for media (shows up in the context toolbar)
ve.ui.DialogButtonTool.js
* New base class for dialog buttons
ve.ui.Context.js
* Added basic support for showing dialog buttons, in addition to
annotation buttons, in the context toolbar - to test, select only an
image node
ve.ui.Dialog.js
* Prevent clicks on the click-block from changing focus
* Moved initialize to below the event handlers and updated its
documentation
ve.ui.DialogFactory.js
* Added a way to get the names of dialogs that can be used to edit a
node
ve.ui.Inspector.js
* Removed close handler which set focus, this is done already in window
ve.ui.InspectorFactory.js
* Fixed comment so it's not telling lies anymore
ve.ui.Window.js
* Removed auto-focus on frame, it's changing the focus in the parent
document which blows-away the focus in CE, and it really isn't needed
as it turns out
VisualEditor.18n.php
* Added media dialog title message
* Added media tool tooltip message
Bug: 37870
Change-Id: I9150c46b3e292910fed899fa60d6da433049ca45
2013-03-28 19:15:17 +00:00
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle the button being clicked.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
ve.ui.DialogButtonTool.prototype.onClick = function () {
|
2013-05-14 23:45:42 +00:00
|
|
|
this.toolbar.getSurface().getDialogs().open( this.constructor.static.dialog );
|
Media dialog support
*/index.php
* Added links to new files
VisualEditor.php
* Added links to new files
* Removed keys of non-existent messages
ve.ui.ContentDialog.js, ve.ui.MetaDialog.js
* Removed redundant comments
ve.ui.MediaDialog.js
* New dialog, just for media
icons.ai, picture.png, picture.svg, ve.ui.Icons-*.css
* Added picture icon
ve.ui.MediaButtonTool.js
* New button, just for media (shows up in the context toolbar)
ve.ui.DialogButtonTool.js
* New base class for dialog buttons
ve.ui.Context.js
* Added basic support for showing dialog buttons, in addition to
annotation buttons, in the context toolbar - to test, select only an
image node
ve.ui.Dialog.js
* Prevent clicks on the click-block from changing focus
* Moved initialize to below the event handlers and updated its
documentation
ve.ui.DialogFactory.js
* Added a way to get the names of dialogs that can be used to edit a
node
ve.ui.Inspector.js
* Removed close handler which set focus, this is done already in window
ve.ui.InspectorFactory.js
* Fixed comment so it's not telling lies anymore
ve.ui.Window.js
* Removed auto-focus on frame, it's changing the focus in the parent
document which blows-away the focus in CE, and it really isn't needed
as it turns out
VisualEditor.18n.php
* Added media dialog title message
* Added media tool tooltip message
Bug: 37870
Change-Id: I9150c46b3e292910fed899fa60d6da433049ca45
2013-03-28 19:15:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle the toolbar state being updated.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @param {ve.dm.Node[]} nodes List of nodes covered by the current selection
|
|
|
|
* @param {ve.dm.AnnotationSet} full Annotations that cover all of the current selection
|
|
|
|
* @param {ve.dm.AnnotationSet} partial Annotations that cover some or all of the current selection
|
|
|
|
*/
|
|
|
|
ve.ui.DialogButtonTool.prototype.onUpdateState = function ( nodes ) {
|
|
|
|
if ( nodes.length ) {
|
2013-06-26 21:54:51 +00:00
|
|
|
this.setActive( ve.ui.toolFactory.getToolForNode( nodes[0] ) === this.constructor );
|
Media dialog support
*/index.php
* Added links to new files
VisualEditor.php
* Added links to new files
* Removed keys of non-existent messages
ve.ui.ContentDialog.js, ve.ui.MetaDialog.js
* Removed redundant comments
ve.ui.MediaDialog.js
* New dialog, just for media
icons.ai, picture.png, picture.svg, ve.ui.Icons-*.css
* Added picture icon
ve.ui.MediaButtonTool.js
* New button, just for media (shows up in the context toolbar)
ve.ui.DialogButtonTool.js
* New base class for dialog buttons
ve.ui.Context.js
* Added basic support for showing dialog buttons, in addition to
annotation buttons, in the context toolbar - to test, select only an
image node
ve.ui.Dialog.js
* Prevent clicks on the click-block from changing focus
* Moved initialize to below the event handlers and updated its
documentation
ve.ui.DialogFactory.js
* Added a way to get the names of dialogs that can be used to edit a
node
ve.ui.Inspector.js
* Removed close handler which set focus, this is done already in window
ve.ui.InspectorFactory.js
* Fixed comment so it's not telling lies anymore
ve.ui.Window.js
* Removed auto-focus on frame, it's changing the focus in the parent
document which blows-away the focus in CE, and it really isn't needed
as it turns out
VisualEditor.18n.php
* Added media dialog title message
* Added media tool tooltip message
Bug: 37870
Change-Id: I9150c46b3e292910fed899fa60d6da433049ca45
2013-03-28 19:15:17 +00:00
|
|
|
}
|
|
|
|
};
|