mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 17:26:38 +01:00
support global shortcuts with global: prefix
This commit is contained in:
@@ -30,6 +30,7 @@ import cssLoader from './services/css_loader.js';
|
||||
import dateNoteService from './services/date_notes.js';
|
||||
import sidebarService from './services/sidebar.js';
|
||||
import importService from './services/import.js';
|
||||
import keyboardActionService from "./services/keyboard_actions.js";
|
||||
|
||||
window.glob.isDesktop = utils.isDesktop;
|
||||
window.glob.isMobile = utils.isMobile;
|
||||
@@ -108,18 +109,8 @@ $("body").on("click", "a.external", function () {
|
||||
});
|
||||
|
||||
if (utils.isElectron()) {
|
||||
require('electron').ipcRenderer.on('create-day-sub-note', async function(event) {
|
||||
const todayNote = await dateNoteService.getTodayNote();
|
||||
const notePath = await treeService.getSomeNotePath(todayNote);
|
||||
|
||||
const node = await treeService.expandToNote(notePath);
|
||||
|
||||
await noteDetailService.openEmptyTab(false);
|
||||
|
||||
await treeService.createNote(node, todayNote.noteId, 'into', {
|
||||
type: "text",
|
||||
isProtected: node.data.isProtected
|
||||
});
|
||||
require('electron').ipcRenderer.on('globalShortcut', async function(event, actionName) {
|
||||
keyboardActionService.triggerAction(actionName);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user