mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 23:35:50 +01:00
all JS functions are now inside old-school JS modules, preparation for ES6 modularization
This commit is contained in:
@@ -1,24 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
async function syncNow() {
|
||||
const result = await server.post('sync/now');
|
||||
const syncService = (function() {
|
||||
async function syncNow() {
|
||||
const result = await server.post('sync/now');
|
||||
|
||||
if (result.success) {
|
||||
utils.showMessage("Sync finished successfully.");
|
||||
}
|
||||
else {
|
||||
if (result.message.length > 50) {
|
||||
result.message = result.message.substr(0, 50);
|
||||
if (result.success) {
|
||||
utils.showMessage("Sync finished successfully.");
|
||||
}
|
||||
else {
|
||||
if (result.message.length > 50) {
|
||||
result.message = result.message.substr(0, 50);
|
||||
}
|
||||
|
||||
utils.showError("Sync failed: " + result.message);
|
||||
utils.showError("Sync failed: " + result.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$("#sync-now-button").click(syncNow);
|
||||
$("#sync-now-button").click(syncNow);
|
||||
|
||||
async function forceNoteSync(noteId) {
|
||||
const result = await server.post('sync/force-note-sync/' + noteId);
|
||||
async function forceNoteSync(noteId) {
|
||||
const result = await server.post('sync/force-note-sync/' + 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