Mooeypoo has uploaded a new change for review.
https://gerrit.wikimedia.org/r/92256
Change subject: [NOT2Merge!] Example for Selective Chrome bug in Inspectors
......................................................................
[NOT2Merge!] Example for Selective Chrome bug in Inspectors
I've created this as a testing ground for a bug in the way inspectors
load in Chrome.
The code given is an empty new inspector, completely inherited without
any special behavior at all from SurfaceInspector.
In theory, this should open an empty inspector popup with only the
title, icon and 'back' button. In reality, this works as expected
in Firefox but in Chrome the inspector fails to appear.
It only appears if you first open another surface inspector
(like Link or Language) and then open the test inspector.
Change-Id: Ib9cd1022ef395b96168fc349d28d3f436a1654de
---
M VisualEditor.i18n.php
M VisualEditor.php
A modules/ve/ui/inspectors/ve.ui.TestInspector.js
M modules/ve/ui/tools/ve.ui.InspectorTool.js
4 files changed, 74 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/56/92256/1
diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php
index b2cc671..f72fa09 100644
--- a/VisualEditor.i18n.php
+++ b/VisualEditor.i18n.php
@@ -193,6 +193,8 @@
'visualeditor-savedialog-warning-dirty' => 'Your edit may have been
corrupted – please review before saving.',
'visualeditor-saveerror' => 'Error saving data to server: $1.',
'visualeditor-serializeerror' => 'Error loading data from server: $1.',
+ 'visualeditor-testinspector-button-tooltip' => 'Test inspector',
+ 'visualeditor-testinspector-title' => 'Test inspector',
'visualeditor-toolbar-cancel' => 'Cancel',
'visualeditor-toolbar-more' => 'More',
'visualeditor-toolbar-savedialog' => 'Save page',
@@ -619,6 +621,8 @@
Parameters:
* $1 is an error message, in English.',
+ 'visualeditor-testinspector-button-tooltip' => 'Tool tip for the test
inspector',
+ 'visualeditor-testinspector-title' => 'Title for the test inspector',
'visualeditor-toolbar-cancel' => 'Label text for button to exit from
VisualEditor.
{{Identical|Cancel}}',
'visualeditor-toolbar-more' => 'Label for the toolbar group that
contains a list of all other available tools.
diff --git a/VisualEditor.php b/VisualEditor.php
index faf826c..37ea549 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -536,6 +536,7 @@
've/ui/inspectors/ve.ui.LinkInspector.js',
've-mw/ui/inspectors/ve.ui.MWLinkInspector.js',
've-mw/ui/inspectors/ve.ui.MWExtensionInspector.js',
+ 've/ui/inspectors/ve.ui.TestInspector.js',
),
'styles' => array(
// ce
@@ -698,6 +699,8 @@
'visualeditor-savedialog-warning-dirty',
'visualeditor-saveerror',
'visualeditor-serializeerror',
+ 'visualeditor-testinspector-button-tooltip',
+ 'visualeditor-testinspector-title',
'visualeditor-toolbar-cancel',
'visualeditor-toolbar-more',
'visualeditor-toolbar-savedialog',
diff --git a/modules/ve/ui/inspectors/ve.ui.TestInspector.js
b/modules/ve/ui/inspectors/ve.ui.TestInspector.js
new file mode 100644
index 0000000..748a81a
--- /dev/null
+++ b/modules/ve/ui/inspectors/ve.ui.TestInspector.js
@@ -0,0 +1,47 @@
+/*!
+ * VisualEditor UserInterface TestInspector class.
+ *
+ * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * Test inspector.
+ *
+ * @class
+ * @extends ve.ui.SurfaceInspector
+ *
+ * @constructor
+ * @param {ve.ui.SurfaceWindowSet} windowSet Window set this inspector is part
of
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.TestInspector = function VeUiTestInspector( windowSet, config ) {
+ // Parent constructor
+ ve.ui.SurfaceInspector.call( this, windowSet, config );
+
+ // Properties
+ this.initialAnnotation = null;
+ this.initialAnnotationHash = null;
+ this.initialText = null;
+ this.isNewAnnotation = false;
+};
+
+/* Inheritance */
+
+OO.inheritClass( ve.ui.TestInspector, ve.ui.SurfaceInspector );
+
+/* Static properties */
+
+ve.ui.TestInspector.static.name = 'testinspector';
+
+ve.ui.TestInspector.static.icon = 'link'; // Just so we can see something here
+
+ve.ui.TestInspector.static.titleMessage = 'visualeditor-testinspector-title';
+
+ve.ui.TestInspector.static.removeable = false;
+
+/* Methods */
+
+/* Registration */
+
+ve.ui.inspectorFactory.register( ve.ui.TestInspector );
diff --git a/modules/ve/ui/tools/ve.ui.InspectorTool.js
b/modules/ve/ui/tools/ve.ui.InspectorTool.js
index 17c15a4..cb4ee8c 100644
--- a/modules/ve/ui/tools/ve.ui.InspectorTool.js
+++ b/modules/ve/ui/tools/ve.ui.InspectorTool.js
@@ -99,3 +99,23 @@
ve.ui.LinkInspectorTool.static.inspector = 'link';
ve.ui.LinkInspectorTool.static.modelClasses = [ ve.dm.LinkAnnotation ];
ve.ui.toolFactory.register( ve.ui.LinkInspectorTool );
+
+/**
+ * UserInterface TestInspector tool.
+ *
+ * @class
+ * @extends ve.ui.InspectorTool
+ * @constructor
+ * @param {ve.ui.SurfaceToolbar} toolbar
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.TestInspectorTool = function VeUiTestInspectorTool( toolbar, config ) {
+ ve.ui.InspectorTool.call( this, toolbar, config );
+};
+OO.inheritClass( ve.ui.TestInspectorTool, ve.ui.InspectorTool );
+ve.ui.TestInspectorTool.static.name = 'testinspector';
+ve.ui.TestInspectorTool.static.group = 'meta';
+ve.ui.TestInspectorTool.static.icon = 'link';
+ve.ui.TestInspectorTool.static.titleMessage =
'visualeditor-testinspector-button-tooltip';
+ve.ui.TestInspectorTool.static.inspector = 'testinspector';
+ve.ui.toolFactory.register( ve.ui.TestInspectorTool );
--
To view, visit https://gerrit.wikimedia.org/r/92256
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9cd1022ef395b96168fc349d28d3f436a1654de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits