Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
camelCase keyboard action names
zadam52f4876f2d22
diff --git a/src/public/javascripts/services/keyboard_actions.js b/src/public/javascripts/services/keyboard_actions.jsindex 618393483b..9fdb663a41 100644--- a/src/public/javascripts/services/keyboard_actions.js+++ b/src/public/javascripts/services/keyboard_actions.js@@ -9,7 +9,6 @@ const keyboardActionsLoaded = server.get('keyboard-actions').then(actions => {for (const action of actions) {action.effectiveShortcuts = action.effectiveShortcuts.filter(shortcut => !shortcut.startsWith("global:"));- action.actionName = action.actionName.charAt(0).toLowerCase() + action.actionName.slice(1);keyboardActionRepo[action.actionName] = action;}diff --git a/src/services/keyboard_actions.js b/src/services/keyboard_actions.jsindex 771d30a959..b1a1f3d626 100644--- a/src/services/keyboard_actions.js+++ b/src/services/keyboard_actions.js@@ -12,58 +12,58 @@ const DEFAULT_KEYBOARD_ACTIONS = [separator: "Note navigation"},{- actionName: "BackInNoteHistory",+ actionName: "backInNoteHistory",// Mac has a different history navigation shortcuts - https://github.com/zadam/trilium/issues/376defaultShortcuts: isMac ? ["Meta+Left"] : ["Alt+Left"],scope: "window"},{- actionName: "ForwardInNoteHistory",+ actionName: "forwardInNoteHistory",// Mac has a different history navigation shortcuts - https://github.com/zadam/trilium/issues/376defaultShortcuts: isMac ? ["Meta+Right"] : ["Alt+Right"],scope: "window"},{- actionName: "JumpToNote",+ actionName: "jumpToNote",defaultShortcuts: ["CommandOrControl+J"],description: 'Open "Jump to note" dialog',scope: "window"},{- actionName: "ScrollToActiveNote",+ actionName: "scrollToActiveNote",defaultShortcuts: ["CommandOrControl+."],scope: "window" // FIXME - how do we find what note tree should be updated?},{- actionName: "SearchNotes",+ actionName: "searchNotes",defaultShortcuts: ["CommandOrControl+S"],scope: "window"},{- actionName: "SearchInSubtree",+ actionName: "searchInSubtree",defaultShortcuts: ["CommandOrControl+Shift+S"],description: "Search for notes in the active note's subtree",scope: "note-tree"},{- actionName: "CollapseTree",+ actionName: "collapseTree",defaultShortcuts: ["Alt+C"],scope: "note-tree"},{- actionName: "CollapseSubtree",+ actionName: "collapseSubtree",defaultShortcuts: ["Alt+-"],description: "Collapses subtree of current note",scope: "note-tree"},{- actionName: "ActivateParentNote",+ actionName: "activateParentNote",defaultShortcuts: ["Backspace"],description: "Activates the parent note of currently active note",scope: "note-tree"},{- actionName: "SortChildNotes",+ actionName: "sortChildNotes",defaultShortcuts: ["Alt+S"],description: "Sort child notes",scope: "note-tree"@@ -74,70 +74,70 @@ const DEFAULT_KEYBOARD_ACTIONS = [separator: "Creating and moving notes"},{- actionName: "CreateNoteAfter",+ actionName: "createNoteAfter",defaultShortcuts: ["CommandOrControl+O"],scope: "window"},{- actionName: "CreateNoteInto",+ actionName: "createNoteInto",defaultShortcuts: ["CommandOrControl+P"],scope: "window"},{- actionName: "CreateNoteIntoDayNote",+ actionName: "createNoteIntoDayNote",defaultShortcuts: ["global:CommandOrControl+Alt+P"],description: "Create and open subnote of a current day note",scope: "window"},{- actionName: "DeleteNotes",+ actionName: "deleteNotes",defaultShortcuts: ["Delete"],description: "Delete note",scope: "note-tree"},{- actionName: "MoveNoteUp",+ actionName: "moveNoteUp",defaultShortcuts: ["CommandOrControl+Up"],description: "Move note up",scope: "note-tree"},{- actionName: "MoveNoteDown",+ actionName: "moveNoteDown",defaultShortcuts: ["CommandOrControl+Down"],description: "Move note down",scope: "note-tree"},{- actionName: "MoveNoteUpInHierarchy",+ actionName: "moveNoteUpInHierarchy",defaultShortcuts: ["CommandOrControl+Left"],description: "Move note up in hierarchy",scope: "note-tree"},{- actionName: "MoveNoteDownInHierarchy",+ actionName: "moveNoteDownInHierarchy",defaultShortcuts: ["CommandOrControl+Right"],description: "Move note down in hierarchy",scope: "note-tree"},{- actionName: "EditNoteTitle",+ actionName: "editNoteTitle",defaultShortcuts: ["Enter"],description: "Jump from tree to the note detail and edit title",scope: "note-tree"},{- actionName: "EditBranchPrefix",+ actionName: "editBranchPrefix",defaultShortcuts: ["F2"],description: "Show Edit branch prefix dialog",scope: "window"},{- actionName: "CloneNotesTo",+ actionName: "cloneNotesTo",defaultShortcuts: ["CommandOrControl+Shift+C"],scope: "window"},{- actionName: "MoveNotesTo",+ actionName: "moveNotesTo",defaultShortcuts: ["CommandOrControl+Shift+X"],scope: "window"},@@ -148,37 +148,37 @@ const DEFAULT_KEYBOARD_ACTIONS = [{- actionName: "CopyNotesToClipboard",+ actionName: "copyNotesToClipboard",defaultShortcuts: ["CommandOrControl+C"],description: "Copy selected notes to the clipboard",scope: "note-tree"},{- actionName: "PasteNotesFromClipboard",+ actionName: "pasteNotesFromClipboard",defaultShortcuts: ["CommandOrControl+V"],description: "Paste notes from the clipboard into active note",scope: "note-tree"},{- actionName: "CutNotesToClipboard",+ actionName: "cutNotesToClipboard",defaultShortcuts: ["CommandOrControl+X"],description: "Cut selected notes to the clipboard",scope: "note-tree"},{- actionName: "SelectAllNotesInParent",+ actionName: "selectAllNotesInParent",defaultShortcuts: ["CommandOrControl+A"],description: "Select all notes from the current note level",scope: "note-tree"},{- actionName: "AddNoteAboveToSelection",+ actionName: "addNoteAboveToSelection",defaultShortcuts: ["Shift+Up"],description: "Add note above to the selection",scope: "note-tree"},{- actionName: "AddNoteBelowToSelection",+ actionName: "addNoteBelowToSelection",defaultShortcuts: ["Shift+Down"],description: "Add note above to the selection",scope: "note-tree"@@ -189,25 +189,25 @@ const DEFAULT_KEYBOARD_ACTIONS = [separator: "Tabs"},{- actionName: "OpenNewTab",+ actionName: "openNewTab",defaultShortcuts: isElectron ? ["CommandOrControl+T"] : [],description: "Opens new tab",scope: "window"},{- actionName: "CloseActiveTab",+ actionName: "closeActiveTab",defaultShortcuts: isElectron ? ["CommandOrControl+W"] : [],description: "Closes active tab",scope: "window"},{- actionName: "ActivateNextTab",+ actionName: "activateNextTab",defaultShortcuts: isElectron ? ["CommandOrControl+Tab"] : [],description: "Activates tab on the right",scope: "window"},{- actionName: "ActivatePreviousTab",+ actionName: "activatePreviousTab",defaultShortcuts: isElectron ? ["CommandOrControl+Shift+Tab"] : [],description: "Activates tab on the left",scope: "window"@@ -218,61 +218,61 @@ const DEFAULT_KEYBOARD_ACTIONS = [separator: "Dialogs"},{- actionName: "ShowAttributes",+ actionName: "showAttributes",defaultShortcuts: ["Alt+A"],description: "Shows Attributes dialog",scope: "window"},{- actionName: "ShowNoteInfo",+ actionName: "showNoteInfo",defaultShortcuts: [],description: "Shows Note Info dialog",scope: "window"},{- actionName: "ShowNoteSource",+ actionName: "showNoteSource",defaultShortcuts: [],description: "Shows Note Source dialog",scope: "window"},{- actionName: "ShowLinkMap",+ actionName: "showLinkMap",defaultShortcuts: [],description: "Shows Link Map dialog",scope: "window"},{- actionName: "ShowOptions",+ actionName: "showOptions",defaultShortcuts: [],description: "Shows Options dialog",scope: "window"},{- actionName: "ShowNoteRevisions",+ actionName: "showNoteRevisions",defaultShortcuts: [],description: "Shows Note Revisions dialog",scope: "window"},{- actionName: "ShowRecentChanges",+ actionName: "showRecentChanges",defaultShortcuts: [],description: "Shows Recent Changes dialog",scope: "window"},{- actionName: "ShowSQLConsole",+ actionName: "showSQLConsole",defaultShortcuts: ["Alt+O"],description: "Shows SQL Console dialog",scope: "window"},{- actionName: "ShowBackendLog",+ actionName: "showBackendLog",defaultShortcuts: [],description: "Shows Backend Log dialog",scope: "window"},{- actionName: "ShowHelp",+ actionName: "showHelp",defaultShortcuts: ["F1"],description: "Shows built-in Help / cheatsheet",scope: "window"@@ -284,24 +284,24 @@ const DEFAULT_KEYBOARD_ACTIONS = [},{- actionName: "AddLinkToText",+ actionName: "addLinkToText",defaultShortcuts: ["CommandOrControl+L"],description: "Open dialog to add link to the text",scope: "text-detail"},{- actionName: "InsertDateTimeToText",+ actionName: "insertDateTimeToText",defaultShortcuts: ["Alt+T"],scope: "text-detail"},{- actionName: "PasteMarkdownIntoText",+ actionName: "pasteMarkdownIntoText",defaultShortcuts: [],description: "Pastes Markdown from clipboard into text note",scope: "text-detail"},{- actionName: "CutIntoNote",+ actionName: "cutIntoNote",defaultShortcuts: [],description: "Cuts the selection from the current note and creates subnote with the selected text",scope: "text-detail"@@ -312,59 +312,59 @@ const DEFAULT_KEYBOARD_ACTIONS = [},{- actionName: "PrintActiveNote",+ actionName: "printActiveNote",defaultShortcuts: [],scope: "note-detail"},{- actionName: "RunActiveNote",+ actionName: "runActiveNote",defaultShortcuts: ["CommandOrControl+Enter"],description: "Run active JavaScript (frontend/backend) code note",scope: "code-detail"},{- actionName: "ToggleNoteHoisting",+ actionName: "toggleNoteHoisting",defaultShortcuts: ["Alt+H"],description: "Toggles note hoisting of active note",scope: "window"},{- actionName: "ReloadFrontendApp",+ actionName: "reloadFrontendApp",defaultShortcuts: ["F5", "CommandOrControl+R"],scope: "window"},{- actionName: "OpenDevTools",+ actionName: "openDevTools",defaultShortcuts: ["CommandOrControl+Shift+I"],scope: "window"},{- actionName: "FindInText",+ actionName: "findInText",defaultShortcuts: ["CommandOrControl+F"],scope: "window"},{- actionName: "ToggleFullscreen",+ actionName: "toggleFullscreen",defaultShortcuts: ["F11"],scope: "window"},{- actionName: "ToggleZenMode",+ actionName: "toggleZenMode",defaultShortcuts: ["Alt+M"],scope: "window"},{- actionName: "ZoomOut",+ actionName: "zoomOut",defaultShortcuts: ["CommandOrControl+-"],scope: "window"},{- actionName: "ZoomIn",+ actionName: "zoomIn",defaultShortcuts: ["CommandOrControl+="],scope: "window"},{- actionName: "CopyWithoutFormatting",+ actionName: "copyWithoutFormatting",defaultShortcuts: ["CommandOrControl+Alt+C"],scope: "text-detail"}@@ -387,7 +387,8 @@ async function getKeyboardActions() {for (const option of await optionService.getOptions()) {if (option.name.startsWith('keyboardShortcuts')) {- const actionName = option.name.substr(17);+ let actionName = option.name.substr(17);+ actionName = actionName.charAt(0).toLowerCase() + actionName.slice(1);const action = actions.find(ea => ea.actionName === actionName);