mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 12:16:07 +00:00
parent
6ee35f55cc
commit
02fd1c48ed
@ -84,6 +84,8 @@ class MarkdownEditor {
|
||||
};
|
||||
// Save draft
|
||||
extraKeys[`${metaKey}-S`] = cm => {window.$events.emit('editor-save-draft')};
|
||||
// Save page
|
||||
extraKeys[`${metaKey}-Enter`] = cm => {window.$events.emit('editor-save-page')};
|
||||
// Show link selector
|
||||
extraKeys[`Shift-${metaKey}-K`] = cm => {this.actionShowLinkSelector()};
|
||||
// Insert Link
|
||||
|
@ -71,6 +71,11 @@ function registerEditorShortcuts(editor) {
|
||||
window.$events.emit('editor-save-draft');
|
||||
});
|
||||
|
||||
// Save page shortcut
|
||||
editor.shortcuts.add('meta+13', '', () => {
|
||||
window.$events.emit('editor-save-page');
|
||||
});
|
||||
|
||||
// Loop through callout styles
|
||||
editor.shortcuts.add('meta+9', '', function() {
|
||||
let selectedNode = editor.selection.getNode();
|
||||
|
@ -34,8 +34,9 @@ function mounted() {
|
||||
this.draftText = trans('entities.pages_editing_page');
|
||||
}
|
||||
|
||||
// Listen to save draft events from editor
|
||||
// Listen to save events from editor
|
||||
window.$events.listen('editor-save-draft', this.saveDraft);
|
||||
window.$events.listen('editor-save-page', this.savePage);
|
||||
|
||||
// Listen to content changes from the editor
|
||||
window.$events.listen('editor-html-change', html => {
|
||||
@ -106,6 +107,9 @@ let methods = {
|
||||
});
|
||||
},
|
||||
|
||||
savePage() {
|
||||
this.$el.closest('form').submit();
|
||||
},
|
||||
|
||||
draftNotifyChange(text) {
|
||||
this.draftText = text;
|
||||
|
Loading…
Reference in New Issue
Block a user