mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
MWSaveDialogAction: Don't break on strange accesskey messages
Quietly return instead. Bug: T153472 Change-Id: I7c325624734f122c9fd939aee1192187c63d9247
This commit is contained in:
parent
f182d5d223
commit
17ced451f4
|
@ -147,9 +147,14 @@ ve.ui.commandRegistry.register(
|
||||||
shortcuts.forEach( function ( shortcut ) {
|
shortcuts.forEach( function ( shortcut ) {
|
||||||
var accessKey = ve.msg( shortcut.accessKey );
|
var accessKey = ve.msg( shortcut.accessKey );
|
||||||
if ( accessKey !== '-' && accessKey !== '' ) {
|
if ( accessKey !== '-' && accessKey !== '' ) {
|
||||||
ve.ui.triggerRegistry.register(
|
try {
|
||||||
shortcut.command, new ve.ui.Trigger( accessKeyPrefix + accessKey )
|
ve.ui.triggerRegistry.register(
|
||||||
);
|
shortcut.command, new ve.ui.Trigger( accessKeyPrefix + accessKey )
|
||||||
|
);
|
||||||
|
} catch ( e ) {
|
||||||
|
mw.log.warn( 'Invalid accesskey data? Failed to register ' + accessKeyPrefix + accessKey );
|
||||||
|
return;
|
||||||
|
}
|
||||||
ve.ui.commandHelpRegistry.register( 'other', shortcut.command, {
|
ve.ui.commandHelpRegistry.register( 'other', shortcut.command, {
|
||||||
trigger: shortcut.command,
|
trigger: shortcut.command,
|
||||||
label: shortcut.label
|
label: shortcut.label
|
||||||
|
@ -157,5 +162,4 @@ ve.ui.commandRegistry.register(
|
||||||
ve.ui.MWCommandHelpDialog.static.commandGroups.other.demote.push( shortcut.command );
|
ve.ui.MWCommandHelpDialog.static.commandGroups.other.demote.push( shortcut.command );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
}() );
|
}() );
|
||||||
|
|
Loading…
Reference in a new issue