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