X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c6ad16dba657c82512ae495a4a38b99b8cfa9eeb..refs/pull/3693/head:/resources/js/wysiwyg/shortcuts.js diff --git a/resources/js/wysiwyg/shortcuts.js b/resources/js/wysiwyg/shortcuts.js index 7b7af41ec..b42851a46 100644 --- a/resources/js/wysiwyg/shortcuts.js +++ b/resources/js/wysiwyg/shortcuts.js @@ -16,6 +16,8 @@ export function register(editor) { editor.shortcuts.add('meta+e', '', ['codeeditor', false, 'pre']); editor.shortcuts.add('meta+8', '', ['FormatBlock', false, 'code']); editor.shortcuts.add('meta+shift+E', '', ['FormatBlock', false, 'code']); + editor.shortcuts.add('meta+o', '', 'InsertOrderedList'); + editor.shortcuts.add('meta+p', '', 'InsertUnorderedList'); // Save draft shortcut editor.shortcuts.add('meta+S', '', () => { @@ -39,4 +41,19 @@ export function register(editor) { editor.formatter.apply('callout' + newFormat); }); + + // Link selector shortcut + editor.shortcuts.add('meta+shift+K', '', function() { + window.EntitySelectorPopup.show(function(entity) { + + if (editor.selection.isCollapsed()) { + editor.insertContent(editor.dom.createHTML('a', {href: entity.link}, editor.dom.encode(entity.name))); + } else { + editor.formatter.apply('link', {href: entity.link}); + } + + editor.selection.collapse(false); + editor.focus(); + }) + }); } \ No newline at end of file