mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	all JS functions are now inside old-school JS modules, preparation for ES6 modularization
This commit is contained in:
		@@ -151,16 +151,16 @@ const contextMenu = (function() {
 | 
				
			|||||||
                treeChanges.deleteNodes(treeService.getSelectedNodes(true));
 | 
					                treeChanges.deleteNodes(treeService.getSelectedNodes(true));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (ui.cmd === "exportSubTree") {
 | 
					            else if (ui.cmd === "exportSubTree") {
 | 
				
			||||||
                exportSubTree(node.data.noteId);
 | 
					                exportService.exportSubTree(node.data.noteId);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (ui.cmd === "importSubTree") {
 | 
					            else if (ui.cmd === "importSubTree") {
 | 
				
			||||||
                importSubTree(node.data.noteId);
 | 
					                exportService.importSubTree(node.data.noteId);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (ui.cmd === "collapseSubTree") {
 | 
					            else if (ui.cmd === "collapseSubTree") {
 | 
				
			||||||
                treeService.collapseTree(node);
 | 
					                treeService.collapseTree(node);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (ui.cmd === "forceNoteSync") {
 | 
					            else if (ui.cmd === "forceNoteSync") {
 | 
				
			||||||
                forceNoteSync(node.data.noteId);
 | 
					                syncService.forceNoteSync(node.data.noteId);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (ui.cmd === "sortAlphabetically") {
 | 
					            else if (ui.cmd === "sortAlphabetically") {
 | 
				
			||||||
                treeService.sortAlphabetically(node.data.noteId);
 | 
					                treeService.sortAlphabetically(node.data.noteId);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,6 @@
 | 
				
			|||||||
"use strict";
 | 
					"use strict";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const exportService = (function () {
 | 
				
			||||||
    function exportSubTree(noteId) {
 | 
					    function exportSubTree(noteId) {
 | 
				
			||||||
        const url = utils.getHost() + "/api/export/" + noteId + "?protectedSessionId="
 | 
					        const url = utils.getHost() + "/api/export/" + noteId + "?protectedSessionId="
 | 
				
			||||||
            + encodeURIComponent(protected_session.getProtectedSessionId());
 | 
					            + encodeURIComponent(protected_session.getProtectedSessionId());
 | 
				
			||||||
@@ -30,3 +31,9 @@ $("#import-upload").change(async function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        await treeService.reload();
 | 
					        await treeService.reload();
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					        exportSubTree,
 | 
				
			||||||
 | 
					        importSubTree
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					})();
 | 
				
			||||||
@@ -1,5 +1,6 @@
 | 
				
			|||||||
"use strict";
 | 
					"use strict";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const initService = (function() {
 | 
				
			||||||
    // hot keys are active also inside inputs and content editables
 | 
					    // hot keys are active also inside inputs and content editables
 | 
				
			||||||
    jQuery.hotkeys.options.filterInputAcceptingElements = false;
 | 
					    jQuery.hotkeys.options.filterInputAcceptingElements = false;
 | 
				
			||||||
    jQuery.hotkeys.options.filterContentEditable = false;
 | 
					    jQuery.hotkeys.options.filterContentEditable = false;
 | 
				
			||||||
@@ -248,3 +249,4 @@ $("#attachment-upload").change(async function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        await treeService.activateNode(resp.noteId);
 | 
					        await treeService.activateNode(resp.noteId);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					})();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,6 @@
 | 
				
			|||||||
"use strict";
 | 
					"use strict";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const syncService = (function() {
 | 
				
			||||||
    async function syncNow() {
 | 
					    async function syncNow() {
 | 
				
			||||||
        const result = await server.post('sync/now');
 | 
					        const result = await server.post('sync/now');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -22,3 +23,9 @@ async function forceNoteSync(noteId) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        utils.showMessage("Note added to sync queue.");
 | 
					        utils.showMessage("Note added to sync queue.");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					        syncNow,
 | 
				
			||||||
 | 
					        forceNoteSync
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					})();
 | 
				
			||||||
		Reference in New Issue
	
	Block a user