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
added context menu "recent changes in subtree"
zadam189202b1f644
diff --git a/src/public/javascripts/dialogs/recent_changes.js b/src/public/javascripts/dialogs/recent_changes.jsindex 42fdd75bb1..df07f46d81 100644--- a/src/public/javascripts/dialogs/recent_changes.js+++ b/src/public/javascripts/dialogs/recent_changes.js@@ -9,10 +9,14 @@ import hoistedNoteService from "../services/hoisted_note.js";const $dialog = $("#recent-changes-dialog");const $content = $("#recent-changes-content");-export async function showDialog() {+export async function showDialog(ancestorNoteId) {utils.openDialog($dialog);- const result = await server.get('recent-changes/' + hoistedNoteService.getHoistedNoteId());+ if (!ancestorNoteId) {+ ancestorNoteId = hoistedNoteService.getHoistedNoteId();+ }++ const result = await server.get('recent-changes/' + ancestorNoteId);// preload all notes into cacheawait treeCache.getNotes(result.map(r => r.noteId), true);diff --git a/src/public/javascripts/services/tree_context_menu.js b/src/public/javascripts/services/tree_context_menu.jsindex 6db23878fa..cb0d4158e9 100644--- a/src/public/javascripts/services/tree_context_menu.js+++ b/src/public/javascripts/services/tree_context_menu.js@@ -75,7 +75,8 @@ class TreeContextMenu {{ title: "Advanced", uiIcon: "empty", enabled: true, items: [{ title: 'Collapse subtree <kbd data-command="collapseSubtree"></kbd>', command: "collapseSubtree", uiIcon: "align-justify", enabled: noSelectedNotes },{ title: "Force note sync", command: "forceNoteSync", uiIcon: "refresh", enabled: noSelectedNotes },- { title: 'Sort alphabetically <kbd data-command="sortChildNotes"></kbd>', command: "sortChildNotes", uiIcon: "empty", enabled: noSelectedNotes && notSearch }+ { title: 'Sort alphabetically <kbd data-command="sortChildNotes"></kbd>', command: "sortChildNotes", uiIcon: "empty", enabled: noSelectedNotes && notSearch },+ { title: 'Recent changes in subtree', command: "recentChangesInSubtree", uiIcon: "history", enabled: noSelectedNotes }] },{ title: "----" },{ title: "Protect subtree", command: "protectSubtree", uiIcon: "check-shield", enabled: noSelectedNotes },diff --git a/src/public/javascripts/widgets/note_tree.js b/src/public/javascripts/widgets/note_tree.jsindex 5a4a306cc0..5471189ce7 100644--- a/src/public/javascripts/widgets/note_tree.js+++ b/src/public/javascripts/widgets/note_tree.js@@ -737,6 +737,12 @@ export default class NoteTreeWidget extends TabAwareWidget {treeService.sortAlphabetically(node.data.noteId);}+ async recentChangesInSubtreeCommand({node}) {+ const recentChangesDialog = await import('../dialogs/recent_changes.js');++ recentChangesDialog.showDialog(node.data.noteId);+ }+selectAllNotesInParentCommand({node}) {for (const child of node.getParent().getChildren()) {child.setSelected(true);