Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/65302


Change subject: Make MW meta dialog experimental
......................................................................

Make MW meta dialog experimental

Also remove the exception thrown when we try to add an non-existent
toolbar button, as it may just be experimental and not loaded.

Change-Id: I0a60421f45d7a3941c510defc60d1fbf9469e784
---
M VisualEditor.php
M modules/ve/ui/ve.ui.CommandRegistry.js
M modules/ve/ui/ve.ui.Toolbar.js
M modules/ve/ve.Factory.js
4 files changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/02/65302/1

diff --git a/VisualEditor.php b/VisualEditor.php
index 3b7dbac..4e266df 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -421,7 +421,6 @@
                        've/ui/dialogs/ve.ui.ContentDialog.js',
                        've/ui/dialogs/ve.ui.MediaDialog.js',
                        've/ui/dialogs/ve.ui.PagedDialog.js',
-                       've/ui/dialogs/ve.ui.MWMetaDialog.js',
 
                        've/ui/tools/ve.ui.ButtonTool.js',
                        've/ui/tools/ve.ui.AnnotationButtonTool.js',
@@ -512,7 +511,6 @@
                        'visualeditor-saveerror',
                        'visualeditor-editconflict',
                        'visualeditor-aliennode-tooltip',
-                       'visualeditor-dialog-meta-title',
                        'visualeditor-dialog-media-title',
                        'visualeditor-dialog-content-title',
                        'visualeditor-dialog-action-apply',
@@ -538,6 +536,8 @@
                        've/ce/nodes/ve.ce.MWReferenceListNode.js',
                        've/ce/nodes/ve.ce.MWReferenceNode.js',
 
+                       've/ui/dialogs/ve.ui.MWMetaDialog.js',
+
                        've/ui/tools/buttons/ve.ui.MWReferenceButtonTool.js',
                        've/ui/tools/buttons/ve.ui.MWTemplateButtonTool.js',
                        've/ui/dialogs/ve.ui.MWReferenceDialog.js',
@@ -551,6 +551,7 @@
                        'visualeditor-dialogbutton-reference-tooltip',
                        'visualeditor-dialog-template-title',
                        'visualeditor-dialogbutton-template-tooltip',
+                       'visualeditor-dialog-meta-title',
                ),
        ),
        'ext.visualEditor.icons-raster' => $wgVisualEditorResourceTemplate + 
array(
diff --git a/modules/ve/ui/ve.ui.CommandRegistry.js 
b/modules/ve/ui/ve.ui.CommandRegistry.js
index 6414514..a180fd9 100644
--- a/modules/ve/ui/ve.ui.CommandRegistry.js
+++ b/modules/ve/ui/ve.ui.CommandRegistry.js
@@ -34,7 +34,7 @@
  * @throws {Error} Action must be a string
  * @throws {Error} Method must be a string
  */
-ve.ui.CommandRegistry.prototype.register = function ( name , action, method ) {
+ve.ui.CommandRegistry.prototype.register = function ( name, action, method ) {
        if ( typeof name !== 'string' && !ve.isArray( name ) ) {
                throw new Error( 'name must be a string or array, cannot be a ' 
+ typeof name );
        }
diff --git a/modules/ve/ui/ve.ui.Toolbar.js b/modules/ve/ui/ve.ui.Toolbar.js
index c5ea951..e1a3132 100644
--- a/modules/ve/ui/ve.ui.Toolbar.js
+++ b/modules/ve/ui/ve.ui.Toolbar.js
@@ -174,10 +174,9 @@
                // Add tools
                for ( j = 0; j < group.items.length; j++ ) {
                        tool = ve.ui.toolFactory.create( group.items[j], this );
-                       if ( !tool ) {
-                               throw new Error( 'Unknown tool: ' + 
group.items[j] );
+                       if ( tool ) {
+                               $group.append( tool.$ );
                        }
-                       $group.append( tool.$ );
                }
                // Append group
                this.$tools.append( $group );
diff --git a/modules/ve/ve.Factory.js b/modules/ve/ve.Factory.js
index 1936a4a..5a2a1e9 100644
--- a/modules/ve/ve.Factory.js
+++ b/modules/ve/ve.Factory.js
@@ -59,7 +59,9 @@
                constructor = this.registry[name];
 
        if ( constructor === undefined ) {
-               throw new Error( 'No class registered by that name: ' + name );
+               // Don't throw an exception, as it could just be an 
experimental class
+               ve.log( 'No class registered by the name: ' + name );
+               return;
        }
 
        // Convert arguments to array and shift the first argument (name) off

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a60421f45d7a3941c510defc60d1fbf9469e784
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

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

Reply via email to