]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/shortcuts.js
Fixed local_secure_restricted preventing attachment uploads
[bookstack] / resources / js / wysiwyg / shortcuts.js
index 7b7af41ec6db874b3f92b9c7887867275240560a..b42851a46588b7274b9feec28fee13db704fea4d 100644 (file)
@@ -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