mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 18:05:55 +01:00 
			
		
		
		
	import/export refactorign
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| import treeService from '../services/tree.js'; | ||||
| import treeUtils from "../services/tree_utils.js"; | ||||
| import exportService from "../services/export.js"; | ||||
| import utils from "../services/utils.js"; | ||||
| import protectedSessionHolder from "../services/protected_session_holder.js"; | ||||
|  | ||||
| const $dialog = $("#export-dialog"); | ||||
| const $form = $("#export-form"); | ||||
| @@ -46,13 +47,19 @@ $form.submit(() => { | ||||
|  | ||||
|     const currentNode = treeService.getCurrentNode(); | ||||
|  | ||||
|     exportService.exportBranch(currentNode.data.branchId, exportType, exportFormat); | ||||
|     exportBranch(currentNode.data.branchId, exportType, exportFormat); | ||||
|  | ||||
|     $dialog.modal('hide'); | ||||
|  | ||||
|     return false; | ||||
| }); | ||||
|  | ||||
| function exportBranch(branchId, type, format) { | ||||
|     const url = utils.getHost() + `/api/notes/${branchId}/export/${type}/${format}?protectedSessionId=` + encodeURIComponent(protectedSessionHolder.getProtectedSessionId()); | ||||
|  | ||||
|     utils.download(url); | ||||
| } | ||||
|  | ||||
| $('input[name=export-type]').change(function () { | ||||
|     if (this.value === 'subtree') { | ||||
|         if ($("input[name=export-subtree-format]:checked").length === 0) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user