diff --git a/extension.json b/extension.json index a3c20fd0..0fc6450e 100644 --- a/extension.json +++ b/extension.json @@ -246,7 +246,6 @@ ], "dependencies": [ "mediawiki.cookie", - "jquery.client", "jquery.textSelection", "jquery.ui", "mediawiki.api", diff --git a/modules/jquery.wikiEditor.dialogs.config.js b/modules/jquery.wikiEditor.dialogs.config.js index 08ca1329..b535468f 100644 --- a/modules/jquery.wikiEditor.dialogs.config.js +++ b/modules/jquery.wikiEditor.dialogs.config.js @@ -42,8 +42,7 @@ module.exports = { action: { type: 'dialog', module: 'insert-link' - }, - hotkey: 'KeyK' + } }, file: { label: mw.msg( 'wikieditor-toolbar-tool-file' ), diff --git a/modules/jquery.wikiEditor.toolbar.config.js b/modules/jquery.wikiEditor.toolbar.config.js index aad43e35..ea93f643 100644 --- a/modules/jquery.wikiEditor.toolbar.config.js +++ b/modules/jquery.wikiEditor.toolbar.config.js @@ -45,8 +45,7 @@ toolbarConfig = { peri: mw.msg( 'wikieditor-toolbar-tool-bold-example' ), post: "'''" } - }, - hotkey: 'KeyB' + } }, italic: { section: 'main', @@ -62,8 +61,7 @@ toolbarConfig = { peri: mw.msg( 'wikieditor-toolbar-tool-italic-example' ), post: "''" } - }, - hotkey: 'KeyI' + } } } }, @@ -208,8 +206,7 @@ toolbarConfig = { peri: mw.msg( 'wikieditor-toolbar-tool-nowiki-example' ), post: '' } - }, - hotkey: 'Backslash' + } }, newline: { label: mw.msg( 'wikieditor-toolbar-tool-newline' ), @@ -263,8 +260,7 @@ toolbarConfig = { peri: mw.msg( 'wikieditor-toolbar-tool-superscript-example' ), post: '' } - }, - hotkey: 'Period' + } }, subscript: { label: mw.msg( 'wikieditor-toolbar-tool-subscript' ), @@ -277,8 +273,7 @@ toolbarConfig = { peri: mw.msg( 'wikieditor-toolbar-tool-subscript-example' ), post: '' } - }, - hotkey: 'Comma' + } } } }, diff --git a/modules/jquery.wikiEditor.toolbar.js b/modules/jquery.wikiEditor.toolbar.js index f4a25a52..91529426 100644 --- a/modules/jquery.wikiEditor.toolbar.js +++ b/modules/jquery.wikiEditor.toolbar.js @@ -359,9 +359,6 @@ var toolbarModule = { } } ); } - if ( 'hotkey' in tool ) { - toolbarModule.fn.ctrlShortcuts[ tool.hotkey ] = tool; - } } return $button; case 'select': @@ -789,21 +786,6 @@ var toolbarModule = { // Use hook for attaching new toolbar tools to avoid race conditions mw.hook( 'wikiEditor.toolbarReady' ).fire( context.$textarea ); } ); - toolbarModule.fn.setupShortcuts( context ); - }, - ctrlShortcuts: {}, - setupShortcuts: function ( context ) { - var platform = $.client.profile().platform; - var modifierKey = platform === 'mac' ? 'metaKey' : 'ctrlKey'; - - context.$textarea.on( 'keydown', function ( e ) { - // Check if modifier key is pressed and hotkey is recognised - var target = e[ modifierKey ] && toolbarModule.fn.ctrlShortcuts[ e.code ]; - if ( target ) { - e.preventDefault(); - toolbarModule.fn.doAction( context, target.action ); - } - } ); }, handleKeyDown: function ( $element, event, $parent ) { var $currentItem = $element.find( '.wikiEditor-character-highlighted' ),