From 8fb25a64a76b1bfc0ddb4ed95929ae9344a3bfb8 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Mar 2022 23:36:43 -0300 Subject: [PATCH] Add node shoutcuts --- .../src/classes/menu/KeyboardShortcutDialog.js | 10 ++++++++++ .../mindplot/src/components/DesignerKeyboard.ts | 14 ++++++++++++++ packages/mindplot/src/components/lang/zh.js | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/classes/menu/KeyboardShortcutDialog.js b/packages/editor/src/classes/menu/KeyboardShortcutDialog.js index 58231d27..99e82694 100644 --- a/packages/editor/src/classes/menu/KeyboardShortcutDialog.js +++ b/packages/editor/src/classes/menu/KeyboardShortcutDialog.js @@ -126,6 +126,16 @@ class KeyboardShortcutDialog extends BootstrapDialog { Ctrl + b ⌘ + b + + ${$msg('TOPIC_NOTE')} + Ctrl + n + ⌘ + n + + + ${$msg('TOPIC_LINK')} + Ctrl + l + ⌘ + l + `); diff --git a/packages/mindplot/src/components/DesignerKeyboard.ts b/packages/mindplot/src/components/DesignerKeyboard.ts index 0d146ef8..278de869 100644 --- a/packages/mindplot/src/components/DesignerKeyboard.ts +++ b/packages/mindplot/src/components/DesignerKeyboard.ts @@ -117,6 +117,20 @@ class DesignerKeyboard extends Keyboard { designer.copyToClipboard(); }, ); + this.addShortcut( + ['ctrl+l', 'meta+l'], (event: Event) => { + event.preventDefault(); + event.stopPropagation(); + designer.addLink(); + }, + ); + this.addShortcut( + ['ctrl+n', 'meta+n'], (event: Event) => { + event.preventDefault(); + event.stopPropagation(); + designer.addNote(); + }, + ); this.addShortcut( ['ctrl+v', 'meta+v'], (event: Event) => { event.preventDefault(); diff --git a/packages/mindplot/src/components/lang/zh.js b/packages/mindplot/src/components/lang/zh.js index 31adcd34..b4eb5c96 100644 --- a/packages/mindplot/src/components/lang/zh.js +++ b/packages/mindplot/src/components/lang/zh.js @@ -36,7 +36,7 @@ const ZH = { ONE_TOPIC_MUST_BE_SELECTED: '无法创建主题。必须选择一个主题。', ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE: '无法折叠子节点,必须只选择一个主题。', SAVE_COULD_NOT_BE_COMPLETED: '无法完成保存,请稍后再试。', - UNEXPECTED_ERROR_LOADING: "我们很抱歉,发生了意外错误。\n再次尝试重新加载编辑器。如果问题仍然存在,请联系我们support@wisemapping.com。", + UNEXPECTED_ERROR_LOADING: '我们很抱歉,发生了意外错误。\n再次尝试重新加载编辑器。如果问题仍然存在,请联系我们support@wisemapping.com。', MAIN_TOPIC: '重点主题', SUB_TOPIC: '子主题', ISOLATED_TOPIC: '独立主题',