jenkins-bot has submitted this change and it was merged.

Change subject: [DEPRECATING CHANGE] Rename link inspector tools
......................................................................


[DEPRECATING CHANGE] Rename link inspector tools

ve.ui.Tool is subclassed mostly to override onUpdateState.

Rename and restructure the existing tools to:
* ve.ui.WindowTool, which becomes active iff the associated window
  is open.
* ve.ui.FragmentWindowTool, which becomes active iff the selected
  fragment covers a related model.
* ve.ui.FragmentInspectorTool, same as above but tells the context
  not to embed derived ContextItems.

Move modelClasses and isCompatibleWith implementation up to
FragmentWindowTool as they are not relevant to WindowTools.

Change the LinearContext check for embeddability to look for a specific
feature flag, rather just inheritence from InspectorTool.

Change-Id: I3a0e761f0d6e942d503ec30a127359c5b5c4268e
---
M build/modules.json
M demos/ve/desktop.html
M demos/ve/mobile.html
M src/ui/contexts/ve.ui.LinearContext.js
M src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
A src/ui/tools/ve.ui.FragmentInspectorTool.js
A src/ui/tools/ve.ui.FragmentWindowTool.js
D src/ui/tools/ve.ui.InspectorTool.js
M src/ui/tools/ve.ui.LanguageInspectorTool.js
M src/ui/tools/ve.ui.ToolbarDialogTool.js
R src/ui/tools/ve.ui.WindowTool.js
M src/ui/ve.ui.Tool.js
M tests/index.html
13 files changed, 218 insertions(+), 168 deletions(-)

Approvals:
  DLynch: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/build/modules.json b/build/modules.json
index 66bb231..7291615 100644
--- a/build/modules.json
+++ b/build/modules.json
@@ -472,12 +472,13 @@
                        
"src/ui/widgets/ve.ui.WhitespacePreservingTextInputWidget.js",
                        "src/ui/tools/ve.ui.AnnotationTool.js",
                        "src/ui/tools/ve.ui.ClearAnnotationTool.js",
-                       "src/ui/tools/ve.ui.DialogTool.js",
+                       "src/ui/tools/ve.ui.WindowTool.js",
+                       "src/ui/tools/ve.ui.FragmentWindowTool.js",
+                       "src/ui/tools/ve.ui.FragmentInspectorTool.js",
                        "src/ui/tools/ve.ui.ToolbarDialogTool.js",
                        "src/ui/tools/ve.ui.FormatTool.js",
                        "src/ui/tools/ve.ui.HistoryTool.js",
                        "src/ui/tools/ve.ui.IndentationTool.js",
-                       "src/ui/tools/ve.ui.InspectorTool.js",
                        "src/ui/tools/ve.ui.LanguageInspectorTool.js",
                        "src/ui/tools/ve.ui.ListTool.js",
                        "src/ui/tools/ve.ui.TableTool.js",
diff --git a/demos/ve/desktop.html b/demos/ve/desktop.html
index d266268..566871b 100644
--- a/demos/ve/desktop.html
+++ b/demos/ve/desktop.html
@@ -433,12 +433,13 @@
                <script 
src="../../src/ui/widgets/ve.ui.WhitespacePreservingTextInputWidget.js"></script>
                <script 
src="../../src/ui/tools/ve.ui.AnnotationTool.js"></script>
                <script 
src="../../src/ui/tools/ve.ui.ClearAnnotationTool.js"></script>
-               <script src="../../src/ui/tools/ve.ui.DialogTool.js"></script>
+               <script src="../../src/ui/tools/ve.ui.WindowTool.js"></script>
+               <script 
src="../../src/ui/tools/ve.ui.FragmentWindowTool.js"></script>
+               <script 
src="../../src/ui/tools/ve.ui.FragmentInspectorTool.js"></script>
                <script 
src="../../src/ui/tools/ve.ui.ToolbarDialogTool.js"></script>
                <script src="../../src/ui/tools/ve.ui.FormatTool.js"></script>
                <script src="../../src/ui/tools/ve.ui.HistoryTool.js"></script>
                <script 
src="../../src/ui/tools/ve.ui.IndentationTool.js"></script>
-               <script 
src="../../src/ui/tools/ve.ui.InspectorTool.js"></script>
                <script 
src="../../src/ui/tools/ve.ui.LanguageInspectorTool.js"></script>
                <script src="../../src/ui/tools/ve.ui.ListTool.js"></script>
                <script src="../../src/ui/tools/ve.ui.TableTool.js"></script>
diff --git a/demos/ve/mobile.html b/demos/ve/mobile.html
index 226e39c..6bc4f1d 100644
--- a/demos/ve/mobile.html
+++ b/demos/ve/mobile.html
@@ -435,12 +435,13 @@
                <script 
src="../../src/ui/widgets/ve.ui.WhitespacePreservingTextInputWidget.js"></script>
                <script 
src="../../src/ui/tools/ve.ui.AnnotationTool.js"></script>
                <script 
src="../../src/ui/tools/ve.ui.ClearAnnotationTool.js"></script>
-               <script src="../../src/ui/tools/ve.ui.DialogTool.js"></script>
+               <script src="../../src/ui/tools/ve.ui.WindowTool.js"></script>
+               <script 
src="../../src/ui/tools/ve.ui.FragmentWindowTool.js"></script>
+               <script 
src="../../src/ui/tools/ve.ui.FragmentInspectorTool.js"></script>
                <script 
src="../../src/ui/tools/ve.ui.ToolbarDialogTool.js"></script>
                <script src="../../src/ui/tools/ve.ui.FormatTool.js"></script>
                <script src="../../src/ui/tools/ve.ui.HistoryTool.js"></script>
                <script 
src="../../src/ui/tools/ve.ui.IndentationTool.js"></script>
-               <script 
src="../../src/ui/tools/ve.ui.InspectorTool.js"></script>
                <script 
src="../../src/ui/tools/ve.ui.LanguageInspectorTool.js"></script>
                <script src="../../src/ui/tools/ve.ui.ListTool.js"></script>
                <script src="../../src/ui/tools/ve.ui.TableTool.js"></script>
diff --git a/src/ui/contexts/ve.ui.LinearContext.js 
b/src/ui/contexts/ve.ui.LinearContext.js
index 1ced0ce..e3e9cdc 100644
--- a/src/ui/contexts/ve.ui.LinearContext.js
+++ b/src/ui/contexts/ve.ui.LinearContext.js
@@ -263,8 +263,7 @@
                                        toolClass = ve.ui.toolFactory.lookup( 
tools[ i ].name );
                                        this.relatedSources.push( {
                                                type: 'tool',
-                                               embeddable: !toolClass ||
-                                                       !( toolClass.prototype 
instanceof ve.ui.InspectorTool ),
+                                               embeddable: !toolClass || 
toolClass.static.makesEmbeddableContextItem,
                                                name: tools[ i ].name,
                                                model: tools[ i ].model
                                        } );
diff --git a/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js 
b/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
index 450475a..75d425a 100644
--- a/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
+++ b/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
@@ -13,9 +13,9 @@
  * @constructor
  * @param {Object} [config] Configuration options
  */
-ve.ui.SpecialCharacterDialog = function VeUiSpecialCharacterDialog( config ) {
+ve.ui.SpecialCharacterDialog = function VeUiSpecialCharacterDialog() {
        // Parent constructor
-       ve.ui.ToolbarDialog.call( this, config );
+       ve.ui.SpecialCharacterDialog.super.apply( this, arguments );
 
        this.characters = null;
        this.$buttonDomList = null;
diff --git a/src/ui/tools/ve.ui.FragmentInspectorTool.js 
b/src/ui/tools/ve.ui.FragmentInspectorTool.js
new file mode 100644
index 0000000..af31c58
--- /dev/null
+++ b/src/ui/tools/ve.ui.FragmentInspectorTool.js
@@ -0,0 +1,95 @@
+/*!
+ * VisualEditor UserInterface FragmentInspectorTool classes.
+ *
+ * @copyright 2011-2015 VisualEditor Team and others; see 
http://ve.mit-license.org
+ */
+
+/**
+ * UserInterface fragment inspector tool.
+ *
+ * @abstract
+ * @class
+ * @extends ve.ui.FragmentWindowTool
+ * @constructor
+ * @param {OO.ui.ToolGroup} toolGroup
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.FragmentInspectorTool = function VeUiFragmentInspectorTool() {
+       // Parent constructor
+       ve.ui.FragmentInspectorTool.super.apply( this, arguments );
+};
+
+/* Inheritance */
+
+OO.inheritClass( ve.ui.FragmentInspectorTool, ve.ui.FragmentWindowTool );
+
+/* Static Properties */
+
+ve.ui.FragmentInspectorTool.static.makesEmbeddableContextItem = false;
+
+/* Methods */
+
+// Deprecated alias
+ve.ui.InspectorTool = ve.ui.FragmentInspectorTool;
+
+/**
+ * UserInterface link tool.
+ *
+ * @class
+ * @extends ve.ui.FragmentInspectorTool
+ * @constructor
+ * @param {OO.ui.ToolGroup} toolGroup
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.LinkInspectorTool = function VeUiLinkInspectorTool() {
+       ve.ui.LinkInspectorTool.super.apply( this, arguments );
+};
+OO.inheritClass( ve.ui.LinkInspectorTool, ve.ui.FragmentInspectorTool );
+ve.ui.LinkInspectorTool.static.name = 'link';
+ve.ui.LinkInspectorTool.static.group = 'meta';
+ve.ui.LinkInspectorTool.static.icon = 'link';
+ve.ui.LinkInspectorTool.static.title =
+       OO.ui.deferMsg( 'visualeditor-annotationbutton-link-tooltip' );
+ve.ui.LinkInspectorTool.static.modelClasses = [ ve.dm.LinkAnnotation ];
+ve.ui.LinkInspectorTool.static.commandName = 'link';
+
+ve.ui.LinkInspectorTool.prototype.getSelectedModels = function ( fragment ) {
+       var surfaceView,
+               selection = fragment && fragment.getSelection();
+
+       // Ask the CE surface about selected models, so it can give the right
+       // answer about links based on the CE selection.
+       if ( selection instanceof ve.dm.LinearSelection ) {
+               surfaceView = this.toolbar.getSurface().getView();
+               if ( selection.equals( surfaceView.getModel().getSelection() ) 
) {
+                       return surfaceView.getSelectedModels();
+               }
+       }
+
+       return ve.ui.LinkInspectorTool.super.prototype.getSelectedModels.apply( 
this, arguments );
+};
+
+ve.ui.toolFactory.register( ve.ui.LinkInspectorTool );
+
+/**
+ * UserInterface comment tool.
+ *
+ * @class
+ * @extends ve.ui.FragmentInspectorTool
+ * @constructor
+ * @param {OO.ui.ToolGroup} toolGroup
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.CommentInspectorTool = function VeUiCommentInspectorTool() {
+       ve.ui.CommentInspectorTool.super.apply( this, arguments );
+};
+OO.inheritClass( ve.ui.CommentInspectorTool, ve.ui.FragmentInspectorTool );
+ve.ui.CommentInspectorTool.static.name = 'comment';
+ve.ui.CommentInspectorTool.static.group = 'meta';
+ve.ui.CommentInspectorTool.static.icon = 'notice';
+ve.ui.CommentInspectorTool.static.title =
+       OO.ui.deferMsg( 'visualeditor-commentinspector-tooltip' );
+ve.ui.CommentInspectorTool.static.modelClasses = [ ve.dm.CommentNode ];
+ve.ui.CommentInspectorTool.static.commandName = 'comment';
+ve.ui.CommentInspectorTool.static.deactivateOnSelect = true;
+ve.ui.toolFactory.register( ve.ui.CommentInspectorTool );
diff --git a/src/ui/tools/ve.ui.FragmentWindowTool.js 
b/src/ui/tools/ve.ui.FragmentWindowTool.js
new file mode 100644
index 0000000..c663d6b
--- /dev/null
+++ b/src/ui/tools/ve.ui.FragmentWindowTool.js
@@ -0,0 +1,81 @@
+/*!
+ * VisualEditor UserInterface FragmentWindowTool classes.
+ *
+ * @copyright 2011-2015 VisualEditor Team and others; see 
http://ve.mit-license.org
+ */
+
+/**
+ * UserInterface fragment window tool.
+ *
+ * @abstract
+ * @class
+ * @extends ve.ui.WindowTool
+ * @constructor
+ * @param {OO.ui.ToolGroup} toolGroup
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.FragmentWindowTool = function VeUiFragmentWindowTool() {
+       // Parent constructor
+       ve.ui.FragmentWindowTool.super.apply( this, arguments );
+};
+
+/* Inheritance */
+
+OO.inheritClass( ve.ui.FragmentWindowTool, ve.ui.WindowTool );
+
+/* Static Properties */
+
+/**
+ * Annotation or node models this tool is related to.
+ *
+ * Used by #isCompatibleWith.
+ *
+ * @static
+ * @property {Function[]}
+ * @inheritable
+ */
+ve.ui.FragmentWindowTool.static.modelClasses = [];
+
+ve.ui.FragmentWindowTool.static.deactivateOnSelect = false;
+
+/* Methods */
+
+/**
+ * @inheritdoc
+ */
+ve.ui.FragmentWindowTool.static.isCompatibleWith = function ( model ) {
+       return ve.isInstanceOfAny( model, this.modelClasses );
+};
+
+/**
+ * @inheritdoc
+ */
+ve.ui.FragmentWindowTool.prototype.onUpdateState = function ( fragment ) {
+       var i, len, models;
+
+       this.setActive( false );
+
+       // Grand-parent method
+       // Parent method is skipped because it set's active state based on 
which windows
+       // are open, which we override in this implementation
+       ve.ui.FragmentWindowTool.super.super.prototype.onUpdateState.apply( 
this, arguments );
+
+       models = this.getSelectedModels( fragment ) ;
+
+       for ( i = 0, len = models.length; i < len; i++ ) {
+               if ( this.constructor.static.isCompatibleWith( models[ i ] ) ) {
+                       this.setActive( true );
+                       break;
+               }
+       }
+};
+
+/**
+ * Get list of selected nodes and annotations.
+ *
+ * @param {ve.dm.SurfaceFragment|null} fragment Surface fragment
+ * @return {ve.dm.Model[]} Selected models
+ */
+ve.ui.FragmentWindowTool.prototype.getSelectedModels = function ( fragment ) {
+       return fragment ? fragment.getSelectedModels() : [];
+};
diff --git a/src/ui/tools/ve.ui.InspectorTool.js 
b/src/ui/tools/ve.ui.InspectorTool.js
deleted file mode 100644
index c5b8518..0000000
--- a/src/ui/tools/ve.ui.InspectorTool.js
+++ /dev/null
@@ -1,123 +0,0 @@
-/*!
- * VisualEditor UserInterface InspectorTool classes.
- *
- * @copyright 2011-2015 VisualEditor Team and others; see 
http://ve.mit-license.org
- */
-
-/**
- * UserInterface inspector tool.
- *
- * @abstract
- * @class
- * @extends ve.ui.DialogTool
- * @constructor
- * @param {OO.ui.ToolGroup} toolGroup
- * @param {Object} [config] Configuration options
- */
-ve.ui.InspectorTool = function VeUiInspectorTool( toolGroup, config ) {
-       // Parent constructor
-       ve.ui.InspectorTool.super.call( this, toolGroup, config );
-};
-
-/* Inheritance */
-
-OO.inheritClass( ve.ui.InspectorTool, ve.ui.DialogTool );
-
-/* Static Properties */
-
-ve.ui.InspectorTool.static.deactivateOnSelect = false;
-
-/* Methods */
-
-/**
- * @inheritdoc
- */
-ve.ui.InspectorTool.prototype.onUpdateState = function ( fragment ) {
-       var i, len, models;
-
-       this.setActive( false );
-
-       // Parent method
-       ve.ui.InspectorTool.super.prototype.onUpdateState.apply( this, 
arguments );
-
-       models = this.getSelectedModels( fragment ) ;
-
-       for ( i = 0, len = models.length; i < len; i++ ) {
-               if ( this.constructor.static.isCompatibleWith( models[ i ] ) ) {
-                       this.setActive( true );
-                       break;
-               }
-       }
-};
-
-/**
- * Get list of selected nodes and annotations.
- *
- * @param {ve.dm.SurfaceFragment|null} fragment Surface fragment
- * @return {ve.dm.Model[]} Selected models
- */
-ve.ui.InspectorTool.prototype.getSelectedModels = function ( fragment ) {
-       return fragment ? fragment.getSelectedModels() : [];
-};
-
-/**
- * UserInterface link tool.
- *
- * @class
- * @extends ve.ui.InspectorTool
- * @constructor
- * @param {OO.ui.ToolGroup} toolGroup
- * @param {Object} [config] Configuration options
- */
-ve.ui.LinkInspectorTool = function VeUiLinkInspectorTool( toolGroup, config ) {
-       ve.ui.InspectorTool.call( this, toolGroup, config );
-};
-OO.inheritClass( ve.ui.LinkInspectorTool, ve.ui.InspectorTool );
-ve.ui.LinkInspectorTool.static.name = 'link';
-ve.ui.LinkInspectorTool.static.group = 'meta';
-ve.ui.LinkInspectorTool.static.icon = 'link';
-ve.ui.LinkInspectorTool.static.title =
-       OO.ui.deferMsg( 'visualeditor-annotationbutton-link-tooltip' );
-ve.ui.LinkInspectorTool.static.modelClasses = [ ve.dm.LinkAnnotation ];
-ve.ui.LinkInspectorTool.static.commandName = 'link';
-
-ve.ui.LinkInspectorTool.prototype.getSelectedModels = function ( fragment ) {
-       var surfaceView,
-               selection = fragment && fragment.getSelection();
-
-       // Ask the CE surface about selected models, so it can give the right
-       // answer about links based on the CE selection.
-       if ( selection instanceof ve.dm.LinearSelection ) {
-               surfaceView = this.toolbar.getSurface().getView();
-               if ( selection.equals( surfaceView.getModel().getSelection() ) 
) {
-                       return surfaceView.getSelectedModels();
-               }
-       }
-
-       return ve.ui.LinkInspectorTool.super.prototype.getSelectedModels.apply( 
this, arguments );
-};
-
-ve.ui.toolFactory.register( ve.ui.LinkInspectorTool );
-
-/**
- * UserInterface comment tool.
- *
- * @class
- * @extends ve.ui.InspectorTool
- * @constructor
- * @param {OO.ui.ToolGroup} toolGroup
- * @param {Object} [config] Configuration options
- */
-ve.ui.CommentInspectorTool = function VeUiCommentInspectorTool( toolGroup, 
config ) {
-       ve.ui.InspectorTool.call( this, toolGroup, config );
-};
-OO.inheritClass( ve.ui.CommentInspectorTool, ve.ui.InspectorTool );
-ve.ui.CommentInspectorTool.static.name = 'comment';
-ve.ui.CommentInspectorTool.static.group = 'meta';
-ve.ui.CommentInspectorTool.static.icon = 'notice';
-ve.ui.CommentInspectorTool.static.title =
-       OO.ui.deferMsg( 'visualeditor-commentinspector-tooltip' );
-ve.ui.CommentInspectorTool.static.modelClasses = [ ve.dm.CommentNode ];
-ve.ui.CommentInspectorTool.static.commandName = 'comment';
-ve.ui.CommentInspectorTool.static.deactivateOnSelect = true;
-ve.ui.toolFactory.register( ve.ui.CommentInspectorTool );
diff --git a/src/ui/tools/ve.ui.LanguageInspectorTool.js 
b/src/ui/tools/ve.ui.LanguageInspectorTool.js
index 6356d33..7a9e1b3 100644
--- a/src/ui/tools/ve.ui.LanguageInspectorTool.js
+++ b/src/ui/tools/ve.ui.LanguageInspectorTool.js
@@ -8,15 +8,15 @@
  * UserInterface language tool.
  *
  * @class
- * @extends ve.ui.InspectorTool
+ * @extends ve.ui.FragmentInspectorTool
  * @constructor
  * @param {OO.ui.ToolGroup} toolGroup
  * @param {Object} [config] Configuration options
  */
-ve.ui.LanguageInspectorTool = function VeUiLanguageInspectorTool( toolGroup, 
config ) {
-       ve.ui.InspectorTool.call( this, toolGroup, config );
+ve.ui.LanguageInspectorTool = function VeUiLanguageInspectorTool() {
+       ve.ui.LanguageInspectorTool.super.apply( this, arguments );
 };
-OO.inheritClass( ve.ui.LanguageInspectorTool, ve.ui.InspectorTool );
+OO.inheritClass( ve.ui.LanguageInspectorTool, ve.ui.FragmentInspectorTool );
 ve.ui.LanguageInspectorTool.static.name = 'language';
 ve.ui.LanguageInspectorTool.static.group = 'meta';
 ve.ui.LanguageInspectorTool.static.icon = 'textLanguage';
diff --git a/src/ui/tools/ve.ui.ToolbarDialogTool.js 
b/src/ui/tools/ve.ui.ToolbarDialogTool.js
index 4f38f8c..5534dfb 100644
--- a/src/ui/tools/ve.ui.ToolbarDialogTool.js
+++ b/src/ui/tools/ve.ui.ToolbarDialogTool.js
@@ -9,7 +9,7 @@
  *
  * @abstract
  * @class
- * @extends ve.ui.DialogTool
+ * @extends ve.ui.WindowTool
  * @constructor
  * @param {OO.ui.ToolGroup} toolGroup
  * @param {Object} [config] Configuration options
@@ -21,7 +21,7 @@
 
 /* Inheritance */
 
-OO.inheritClass( ve.ui.ToolbarDialogTool, ve.ui.DialogTool );
+OO.inheritClass( ve.ui.ToolbarDialogTool, ve.ui.WindowTool );
 
 /* Static Properties */
 
diff --git a/src/ui/tools/ve.ui.DialogTool.js b/src/ui/tools/ve.ui.WindowTool.js
similarity index 70%
rename from src/ui/tools/ve.ui.DialogTool.js
rename to src/ui/tools/ve.ui.WindowTool.js
index 1ba3f2c..28c6f27 100644
--- a/src/ui/tools/ve.ui.DialogTool.js
+++ b/src/ui/tools/ve.ui.WindowTool.js
@@ -1,5 +1,5 @@
 /*!
- * VisualEditor UserInterface DialogTool class.
+ * VisualEditor UserInterface WindowTool class.
  *
  * @copyright 2011-2015 VisualEditor Team and others; see 
http://ve.mit-license.org
  */
@@ -14,27 +14,16 @@
  * @param {OO.ui.ToolGroup} toolGroup
  * @param {Object} [config] Configuration options
  */
-ve.ui.DialogTool = function VeUiDialogTool() {
+ve.ui.WindowTool = function VeUiWindowTool() {
        // Parent constructor
-       ve.ui.DialogTool.super.apply( this, arguments );
+       ve.ui.WindowTool.super.apply( this, arguments );
 };
 
 /* Inheritance */
 
-OO.inheritClass( ve.ui.DialogTool, ve.ui.Tool );
+OO.inheritClass( ve.ui.WindowTool, ve.ui.Tool );
 
 /* Static Properties */
-
-/**
- * Annotation or node models this tool is related to.
- *
- * Used by #isCompatibleWith.
- *
- * @static
- * @property {Function[]}
- * @inheritable
- */
-ve.ui.DialogTool.static.modelClasses = [];
 
 /**
  * Name of the associated windows, if there is more than one possible value, 
or if it can't be
@@ -44,25 +33,18 @@
  * @property {string[]}
  * @inheritable
  */
-ve.ui.DialogTool.static.associatedWindows = null;
-
-/**
- * @inheritdoc
- */
-ve.ui.DialogTool.static.isCompatibleWith = function ( model ) {
-       return ve.isInstanceOfAny( model, this.modelClasses );
-};
+ve.ui.WindowTool.static.associatedWindows = null;
 
 /* Methods */
 
 /**
  * @inheritdoc
  */
-ve.ui.DialogTool.prototype.onUpdateState = function ( fragment, 
contextDirection, activeDialogs ) {
+ve.ui.WindowTool.prototype.onUpdateState = function ( fragment, 
contextDirection, activeDialogs ) {
        var command, myWindowNames = [];
 
        // Parent method
-       ve.ui.DialogTool.super.prototype.onUpdateState.apply( this, arguments );
+       ve.ui.WindowTool.super.prototype.onUpdateState.apply( this, arguments );
 
        if ( this.constructor.static.associatedWindows !== null ) {
                myWindowNames = this.constructor.static.associatedWindows;
@@ -77,11 +59,14 @@
        this.setActive( $( activeDialogs ).filter( myWindowNames ).length !== 0 
);
 };
 
+// Deprecated alias
+ve.ui.DialogTool = ve.ui.WindowTool;
+
 /**
  * Command help tool.
  *
  * @class
- * @extends ve.ui.DialogTool
+ * @extends ve.ui.WindowTool
  * @constructor
  * @param {OO.ui.ToolGroup} toolGroup
  * @param {Object} [config] Configuration options
@@ -89,7 +74,7 @@
 ve.ui.CommandHelpDialogTool = function VeUiCommandHelpDialogTool() {
        ve.ui.CommandHelpDialogTool.super.apply( this, arguments );
 };
-OO.inheritClass( ve.ui.CommandHelpDialogTool, ve.ui.DialogTool );
+OO.inheritClass( ve.ui.CommandHelpDialogTool, ve.ui.WindowTool );
 ve.ui.CommandHelpDialogTool.static.name = 'commandHelp';
 ve.ui.CommandHelpDialogTool.static.group = 'dialog';
 ve.ui.CommandHelpDialogTool.static.icon = 'help';
diff --git a/src/ui/ve.ui.Tool.js b/src/ui/ve.ui.Tool.js
index 9a11a16..1845b09 100644
--- a/src/ui/ve.ui.Tool.js
+++ b/src/ui/ve.ui.Tool.js
@@ -51,6 +51,15 @@
 ve.ui.Tool.static.deactivateOnSelect = true;
 
 /**
+ * If this tool is used to create a ve.ui.ToolContextItem, should that item be 
embeddable
+ *
+ * @static
+ * @property {boolean}
+ * @inheritable
+ */
+ve.ui.Tool.static.makesEmbeddableContextItem = true;
+
+/**
  * Get the symbolic command name for this tool.
  *
  * @return {string|null}
diff --git a/tests/index.html b/tests/index.html
index 9610934..431fc9c 100644
--- a/tests/index.html
+++ b/tests/index.html
@@ -359,12 +359,13 @@
                <script 
src="../src/ui/widgets/ve.ui.WhitespacePreservingTextInputWidget.js"></script>
                <script src="../src/ui/tools/ve.ui.AnnotationTool.js"></script>
                <script 
src="../src/ui/tools/ve.ui.ClearAnnotationTool.js"></script>
-               <script src="../src/ui/tools/ve.ui.DialogTool.js"></script>
+               <script src="../src/ui/tools/ve.ui.WindowTool.js"></script>
+               <script 
src="../src/ui/tools/ve.ui.FragmentWindowTool.js"></script>
+               <script 
src="../src/ui/tools/ve.ui.FragmentInspectorTool.js"></script>
                <script 
src="../src/ui/tools/ve.ui.ToolbarDialogTool.js"></script>
                <script src="../src/ui/tools/ve.ui.FormatTool.js"></script>
                <script src="../src/ui/tools/ve.ui.HistoryTool.js"></script>
                <script src="../src/ui/tools/ve.ui.IndentationTool.js"></script>
-               <script src="../src/ui/tools/ve.ui.InspectorTool.js"></script>
                <script 
src="../src/ui/tools/ve.ui.LanguageInspectorTool.js"></script>
                <script src="../src/ui/tools/ve.ui.ListTool.js"></script>
                <script src="../src/ui/tools/ve.ui.TableTool.js"></script>

-- 
To view, visit https://gerrit.wikimedia.org/r/257387
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3a0e761f0d6e942d503ec30a127359c5b5c4268e
Gerrit-PatchSet: 4
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: DLynch <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to