mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	change in default keyboard shortcuts
This commit is contained in:
		| @@ -63,7 +63,11 @@ const addLink = (function() { | |||||||
|         return false; |         return false; | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     $(document).bind('keydown', 'alt+l', showDialog); |     $(document).bind('keydown', 'ctrl+l', e => { | ||||||
|  |         showDialog(); | ||||||
|  |  | ||||||
|  |         e.preventDefault(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|     return { |     return { | ||||||
|         showDialog |         showDialog | ||||||
|   | |||||||
| @@ -4,7 +4,6 @@ const jumpToNote = (function() { | |||||||
|     const dialogEl = $("#jump-to-note-dialog"); |     const dialogEl = $("#jump-to-note-dialog"); | ||||||
|     const autoCompleteEl = $("#jump-to-note-autocomplete"); |     const autoCompleteEl = $("#jump-to-note-autocomplete"); | ||||||
|     const formEl = $("#jump-to-note-form"); |     const formEl = $("#jump-to-note-form"); | ||||||
|     const noteDetailEl = $('#note-detail'); |  | ||||||
|  |  | ||||||
|     async function showDialog() { |     async function showDialog() { | ||||||
|         glob.activeDialog = dialogEl; |         glob.activeDialog = dialogEl; | ||||||
| @@ -42,7 +41,11 @@ const jumpToNote = (function() { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $(document).bind('keydown', 'alt+j', showDialog); |     $(document).bind('keydown', 'ctrl+j', e => { | ||||||
|  |         showDialog(); | ||||||
|  |  | ||||||
|  |         e.preventDefault(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|     formEl.submit(() => { |     formEl.submit(() => { | ||||||
|         const action = dialogEl.find("button:focus").val(); |         const action = dialogEl.find("button:focus").val(); | ||||||
|   | |||||||
| @@ -123,7 +123,11 @@ const recentNotes = (function() { | |||||||
|  |  | ||||||
|     reload(); |     reload(); | ||||||
|  |  | ||||||
|     $(document).bind('keydown', 'alt+q', showDialog); |     $(document).bind('keydown', 'ctrl+e', e => { | ||||||
|  |         showDialog(); | ||||||
|  |  | ||||||
|  |         e.preventDefault(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|     selectBoxEl.dblclick(e => { |     selectBoxEl.dblclick(e => { | ||||||
|         setActiveNoteBasedOnRecentNotes(); |         setActiveNoteBasedOnRecentNotes(); | ||||||
|   | |||||||
| @@ -1,22 +1,27 @@ | |||||||
| "use strict"; | "use strict"; | ||||||
|  |  | ||||||
| // hot keys are active also inside inputs and content editables | // hot keys are active also inside inputs and content editables | ||||||
| jQuery.hotkeys.options.filterInputAcceptingElements = true; | jQuery.hotkeys.options.filterInputAcceptingElements = false; | ||||||
| jQuery.hotkeys.options.filterContentEditable = true; | jQuery.hotkeys.options.filterContentEditable = false; | ||||||
|  | jQuery.hotkeys.options.filterTextInputs = false; | ||||||
|  |  | ||||||
| $(document).bind('keydown', 'alt+m', () => { | $(document).bind('keydown', 'alt+m', e => { | ||||||
|     const toggle = $(".hide-toggle"); |     const toggle = $(".hide-toggle"); | ||||||
|     const hidden = toggle.css('visibility') === 'hidden'; |     const hidden = toggle.css('visibility') === 'hidden'; | ||||||
|  |  | ||||||
|     toggle.css('visibility', hidden ? 'visible' : 'hidden'); |     toggle.css('visibility', hidden ? 'visible' : 'hidden'); | ||||||
|  |  | ||||||
|  |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| // hide (toggle) everything except for the note content for distraction free writing | // hide (toggle) everything except for the note content for distraction free writing | ||||||
| $(document).bind('keydown', 'alt+t', () => { | $(document).bind('keydown', 'alt+t', e => { | ||||||
|     const date = new Date(); |     const date = new Date(); | ||||||
|     const dateString = formatDateTime(date); |     const dateString = formatDateTime(date); | ||||||
|  |  | ||||||
|     link.addTextToEditor(dateString); |     link.addTextToEditor(dateString); | ||||||
|  |  | ||||||
|  |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $(document).bind('keydown', 'f5', () => { | $(document).bind('keydown', 'f5', () => { | ||||||
|   | |||||||
| @@ -357,12 +357,6 @@ const noteTree = (function() { | |||||||
|  |  | ||||||
|     function initFancyTree(noteTree) { |     function initFancyTree(noteTree) { | ||||||
|         const keybindings = { |         const keybindings = { | ||||||
|             "insert": node => { |  | ||||||
|                 const parentNoteId = node.data.note_pid; |  | ||||||
|                 const isProtected = treeUtils.getParentProtectedStatus(node); |  | ||||||
|  |  | ||||||
|                 createNote(node, parentNoteId, 'after', isProtected); |  | ||||||
|             }, |  | ||||||
|             "del": node => { |             "del": node => { | ||||||
|                 treeChanges.deleteNode(node); |                 treeChanges.deleteNode(node); | ||||||
|             }, |             }, | ||||||
| @@ -644,10 +638,32 @@ const noteTree = (function() { | |||||||
|         showMessage("Created!"); |         showMessage("Created!"); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $(document).bind('keydown', 'ctrl+insert', () => { |     $(document).bind('keydown', 'ctrl+o', e => { | ||||||
|  |         console.log("pressed O"); | ||||||
|  |  | ||||||
|  |         const node = getCurrentNode(); | ||||||
|  |         const parentNoteId = node.data.note_pid; | ||||||
|  |         const isProtected = treeUtils.getParentProtectedStatus(node); | ||||||
|  |  | ||||||
|  |         createNote(node, parentNoteId, 'after', isProtected); | ||||||
|  |  | ||||||
|  |         e.preventDefault(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     $(document).bind('keydown', 'ctrl+p', e => { | ||||||
|         const node = getCurrentNode(); |         const node = getCurrentNode(); | ||||||
|  |  | ||||||
|         createNote(node, node.data.note_id, 'into', node.data.is_protected); |         createNote(node, node.data.note_id, 'into', node.data.is_protected); | ||||||
|  |  | ||||||
|  |         e.preventDefault(); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     $(document).bind('keydown', 'ctrl+del', e => { | ||||||
|  |         const node = getCurrentNode(); | ||||||
|  |  | ||||||
|  |         treeChanges.deleteNode(node); | ||||||
|  |  | ||||||
|  |         e.preventDefault(); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     $(document).bind('keydown', 'ctrl+.', scrollToCurrentNote); |     $(document).bind('keydown', 'ctrl+.', scrollToCurrentNote); | ||||||
|   | |||||||
| @@ -24,7 +24,7 @@ async function createNewNote(parentNoteId, note, sourceId) { | |||||||
|  |  | ||||||
|             // not updating date_modified to avoig having to sync whole rows |             // not updating date_modified to avoig having to sync whole rows | ||||||
|             await sql.execute('UPDATE notes_tree SET note_pos = note_pos + 1 WHERE note_pid = ? AND note_pos > ? AND is_deleted = 0', |             await sql.execute('UPDATE notes_tree SET note_pos = note_pos + 1 WHERE note_pid = ? AND note_pos > ? AND is_deleted = 0', | ||||||
|                 [utils.nowDate(), parentNoteId, afterNote.note_pos]); |                 [parentNoteId, afterNote.note_pos]); | ||||||
|  |  | ||||||
|             await sync_table.addNoteReorderingSync(parentNoteId, sourceId); |             await sync_table.addNoteReorderingSync(parentNoteId, sourceId); | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user