mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	export branch => export subtree
This commit is contained in:
		
							parent
							
								
									bc207d5e30
								
							
						
					
					
						commit
						3ad7db39dd
					
				| @ -94,9 +94,9 @@ const contextMenuOptions = { | |||||||
|         {title: "Paste into <kbd>Ctrl+V</kbd>", cmd: "pasteInto", uiIcon: "ui-icon-clipboard"}, |         {title: "Paste into <kbd>Ctrl+V</kbd>", cmd: "pasteInto", uiIcon: "ui-icon-clipboard"}, | ||||||
|         {title: "Paste after", cmd: "pasteAfter", uiIcon: "ui-icon-clipboard"}, |         {title: "Paste after", cmd: "pasteAfter", uiIcon: "ui-icon-clipboard"}, | ||||||
|         {title: "----"}, |         {title: "----"}, | ||||||
|         {title: "Export branch", cmd: "exportBranch", uiIcon: " ui-icon-arrowthick-1-ne", children: [ |         {title: "Export subtree", cmd: "exportSubTree", uiIcon: " ui-icon-arrowthick-1-ne", children: [ | ||||||
|             {title: "Native Tar", cmd: "exportBranchToTar"}, |             {title: "Native Tar", cmd: "exportSubTreeToTar"}, | ||||||
|             {title: "OPML", cmd: "exportBranchToOpml"} |             {title: "OPML", cmd: "exportSubTreeToOpml"} | ||||||
|         ]}, |         ]}, | ||||||
|         {title: "Import into branch (tar, opml)", cmd: "importBranch", uiIcon: "ui-icon-arrowthick-1-sw"}, |         {title: "Import into branch (tar, opml)", cmd: "importBranch", uiIcon: "ui-icon-arrowthick-1-sw"}, | ||||||
|         {title: "----"}, |         {title: "----"}, | ||||||
| @ -120,7 +120,7 @@ const contextMenuOptions = { | |||||||
|         $tree.contextmenu("enableEntry", "pasteAfter", clipboardIds.length > 0 && isNotRoot && parentNote.type !== 'search'); |         $tree.contextmenu("enableEntry", "pasteAfter", clipboardIds.length > 0 && isNotRoot && parentNote.type !== 'search'); | ||||||
|         $tree.contextmenu("enableEntry", "pasteInto", clipboardIds.length > 0 && note.type !== 'search'); |         $tree.contextmenu("enableEntry", "pasteInto", clipboardIds.length > 0 && note.type !== 'search'); | ||||||
|         $tree.contextmenu("enableEntry", "importBranch", 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'); |         $tree.contextmenu("enableEntry", "editBranchPrefix", isNotRoot && parentNote.type !== 'search'); | ||||||
| 
 | 
 | ||||||
|         // Activate node on right-click
 |         // Activate node on right-click
 | ||||||
| @ -166,11 +166,11 @@ const contextMenuOptions = { | |||||||
|         else if (ui.cmd === "delete") { |         else if (ui.cmd === "delete") { | ||||||
|             treeChangesService.deleteNodes(treeService.getSelectedNodes(true)); |             treeChangesService.deleteNodes(treeService.getSelectedNodes(true)); | ||||||
|         } |         } | ||||||
|         else if (ui.cmd === "exportBranchToTar") { |         else if (ui.cmd === "exportSubTreeToTar") { | ||||||
|             exportService.exportBranch(node.data.noteId, 'tar'); |             exportService.exportSubTree(node.data.noteId, 'tar'); | ||||||
|         } |         } | ||||||
|         else if (ui.cmd === "exportBranchToOpml") { |         else if (ui.cmd === "exportSubTreeToOpml") { | ||||||
|             exportService.exportBranch(node.data.noteId, 'opml'); |             exportService.exportSubTree(node.data.noteId, 'opml'); | ||||||
|         } |         } | ||||||
|         else if (ui.cmd === "importBranch") { |         else if (ui.cmd === "importBranch") { | ||||||
|             exportService.importBranch(node.data.noteId); |             exportService.importBranch(node.data.noteId); | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ import protectedSessionHolder from './protected_session_holder.js'; | |||||||
| import utils from './utils.js'; | import utils from './utils.js'; | ||||||
| import server from './server.js'; | import server from './server.js'; | ||||||
| 
 | 
 | ||||||
| function exportBranch(noteId, format) { | function exportSubTree(noteId, format) { | ||||||
|     const url = utils.getHost() + "/api/notes/" + noteId + "/export/" + format + |     const url = utils.getHost() + "/api/notes/" + noteId + "/export/" + format + | ||||||
|         "?protectedSessionId=" + encodeURIComponent(protectedSessionHolder.getProtectedSessionId()); |         "?protectedSessionId=" + encodeURIComponent(protectedSessionHolder.getProtectedSessionId()); | ||||||
| 
 | 
 | ||||||
| @ -35,6 +35,6 @@ $("#import-upload").change(async function() { | |||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| export default { | export default { | ||||||
|     exportBranch, |     exportSubTree, | ||||||
|     importBranch |     importBranch | ||||||
| }; | }; | ||||||
| @ -563,7 +563,7 @@ | |||||||
|         <div style="display: flex; justify-content: space-between;"> |         <div style="display: flex; justify-content: space-between;"> | ||||||
|           <button class="btn btn-sm">Save</button> |           <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 |             <i class="glyphicon glyphicon-info-sign"></i> Help | ||||||
|           </button> |           </button> | ||||||
|         </div> |         </div> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner