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
This commit is contained in:
Ed Sanders 2013-05-24 17:43:58 +02:00
parent 026af0d6c0
commit 626a8c60f2
3 changed files with 10 additions and 7 deletions

View file

@ -421,7 +421,6 @@ $wgResourceModules += array(
'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 @@ $wgResourceModules += array(
'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 @@ $wgResourceModules += array(
'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 @@ $wgResourceModules += array(
'visualeditor-dialogbutton-reference-tooltip',
'visualeditor-dialog-template-title',
'visualeditor-dialogbutton-template-tooltip',
'visualeditor-dialog-meta-title',
),
),
'ext.visualEditor.icons-raster' => $wgVisualEditorResourceTemplate + array(

View file

@ -34,7 +34,7 @@ ve.inheritClass( ve.ui.CommandRegistry, ve.Registry );
* @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 );
}

View file

@ -173,11 +173,13 @@ ve.ui.Toolbar.prototype.addTools = function ( tools ) {
}
// 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] );
tool = false;
try {
tool = ve.ui.toolFactory.create( group.items[j], this );
} catch(e) {}
if ( tool ) {
$group.append( tool.$ );
}
$group.append( tool.$ );
}
// Append group
this.$tools.append( $group );