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
export branch => export subtree
azivner3ad7db39dd0a
diff --git a/src/public/javascripts/services/context_menu.js b/src/public/javascripts/services/context_menu.jsindex aaacca5424..48a5ea37b0 100644--- a/src/public/javascripts/services/context_menu.js+++ b/src/public/javascripts/services/context_menu.js@@ -94,9 +94,9 @@ const contextMenuOptions = {{title: "Paste into <kbd>Ctrl+V</kbd>", cmd: "pasteInto", uiIcon: "ui-icon-clipboard"},{title: "Paste after", cmd: "pasteAfter", uiIcon: "ui-icon-clipboard"},{title: "----"},- {title: "Export branch", cmd: "exportBranch", uiIcon: " ui-icon-arrowthick-1-ne", children: [- {title: "Native Tar", cmd: "exportBranchToTar"},- {title: "OPML", cmd: "exportBranchToOpml"}+ {title: "Export subtree", cmd: "exportSubTree", uiIcon: " ui-icon-arrowthick-1-ne", children: [+ {title: "Native Tar", cmd: "exportSubTreeToTar"},+ {title: "OPML", cmd: "exportSubTreeToOpml"}]},{title: "Import into branch (tar, opml)", cmd: "importBranch", uiIcon: "ui-icon-arrowthick-1-sw"},{title: "----"},@@ -120,7 +120,7 @@ const contextMenuOptions = {$tree.contextmenu("enableEntry", "pasteAfter", clipboardIds.length > 0 && isNotRoot && parentNote.type !== 'search');$tree.contextmenu("enableEntry", "pasteInto", clipboardIds.length > 0 && note.type !== 'search');$tree.contextmenu("enableEntry", "importBranch", note.type !== 'search');- $tree.contextmenu("enableEntry", "exportBranch", note.type !== 'search');+ $tree.contextmenu("enableEntry", "exportSubTree", note.type !== 'search');$tree.contextmenu("enableEntry", "editBranchPrefix", isNotRoot && parentNote.type !== 'search');// Activate node on right-click@@ -166,11 +166,11 @@ const contextMenuOptions = {else if (ui.cmd === "delete") {treeChangesService.deleteNodes(treeService.getSelectedNodes(true));}- else if (ui.cmd === "exportBranchToTar") {- exportService.exportBranch(node.data.noteId, 'tar');+ else if (ui.cmd === "exportSubTreeToTar") {+ exportService.exportSubTree(node.data.noteId, 'tar');}- else if (ui.cmd === "exportBranchToOpml") {- exportService.exportBranch(node.data.noteId, 'opml');+ else if (ui.cmd === "exportSubTreeToOpml") {+ exportService.exportSubTree(node.data.noteId, 'opml');}else if (ui.cmd === "importBranch") {exportService.importBranch(node.data.noteId);diff --git a/src/public/javascripts/services/export.js b/src/public/javascripts/services/export.jsindex 9f92a67c75..7111d1f5e8 100644--- a/src/public/javascripts/services/export.js+++ b/src/public/javascripts/services/export.js@@ -3,7 +3,7 @@ import protectedSessionHolder from './protected_session_holder.js';import utils from './utils.js';import server from './server.js';-function exportBranch(noteId, format) {+function exportSubTree(noteId, format) {const url = utils.getHost() + "/api/notes/" + noteId + "/export/" + format +"?protectedSessionId=" + encodeURIComponent(protectedSessionHolder.getProtectedSessionId());@@ -35,6 +35,6 @@ $("#import-upload").change(async function() {});export default {- exportBranch,+ exportSubTree,importBranch};\ No newline at end of filediff --git a/src/views/index.ejs b/src/views/index.ejsindex 4fef027e83..ddc51b5c55 100644--- a/src/views/index.ejs+++ b/src/views/index.ejs@@ -563,7 +563,7 @@<div style="display: flex; justify-content: space-between;"><button class="btn btn-sm">Save</button>- <button class="btn btn-sm" type="button" data-help-page="Prefix">+ <button class="btn btn-sm" type="button" data-help-page="Tree-concepts#prefix"><i class="glyphicon glyphicon-info-sign"></i> Help</button></div>