Add node shoutcuts

This commit is contained in:
Paulo Gustavo Veiga 2022-03-13 23:36:43 -03:00
parent a9e36e9a05
commit 8fb25a64a7
3 changed files with 25 additions and 1 deletions

View File

@ -126,6 +126,16 @@ class KeyboardShortcutDialog extends BootstrapDialog {
<td>Ctrl + b</td> <td>Ctrl + b</td>
<td> + b</td> <td> + b</td>
</tr> </tr>
<tr>
<td>${$msg('TOPIC_NOTE')}</td>
<td>Ctrl + n</td>
<td> + n</td>
</tr>
<tr>
<td>${$msg('TOPIC_LINK')}</td>
<td>Ctrl + l</td>
<td> + l</td>
</tr>
</tbody> </tbody>
</table> </table>
</div>`); </div>`);

View File

@ -117,6 +117,20 @@ class DesignerKeyboard extends Keyboard {
designer.copyToClipboard(); 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( this.addShortcut(
['ctrl+v', 'meta+v'], (event: Event) => { ['ctrl+v', 'meta+v'], (event: Event) => {
event.preventDefault(); event.preventDefault();

View File

@ -36,7 +36,7 @@ const ZH = {
ONE_TOPIC_MUST_BE_SELECTED: '无法创建主题。必须选择一个主题。', ONE_TOPIC_MUST_BE_SELECTED: '无法创建主题。必须选择一个主题。',
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE: '无法折叠子节点,必须只选择一个主题。', ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE: '无法折叠子节点,必须只选择一个主题。',
SAVE_COULD_NOT_BE_COMPLETED: '无法完成保存,请稍后再试。', SAVE_COULD_NOT_BE_COMPLETED: '无法完成保存,请稍后再试。',
UNEXPECTED_ERROR_LOADING: "我们很抱歉,发生了意外错误。\n再次尝试重新加载编辑器。如果问题仍然存在请联系我们support@wisemapping.com。", UNEXPECTED_ERROR_LOADING: '我们很抱歉,发生了意外错误。\n再次尝试重新加载编辑器。如果问题仍然存在请联系我们support@wisemapping.com。',
MAIN_TOPIC: '重点主题', MAIN_TOPIC: '重点主题',
SUB_TOPIC: '子主题', SUB_TOPIC: '子主题',
ISOLATED_TOPIC: '独立主题', ISOLATED_TOPIC: '独立主题',