diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html
index e71c0b407..bcb2edccb 100644
--- a/docs/frontend_api/FrontendScriptApi.html
+++ b/docs/frontend_api/FrontendScriptApi.html
@@ -1366,7 +1366,7 @@
Source:
@@ -1546,7 +1546,7 @@
Source:
@@ -1679,7 +1679,7 @@
Source:
@@ -1785,7 +1785,7 @@
Source:
@@ -1891,7 +1891,7 @@
Source:
@@ -2050,7 +2050,7 @@
Source:
@@ -2157,7 +2157,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -2312,7 +2312,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -2468,7 +2468,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -2669,7 +2669,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -2775,7 +2775,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -2930,7 +2930,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3039,7 +3039,7 @@ note.
Source:
@@ -3194,7 +3194,7 @@ note.
Source:
@@ -3327,7 +3327,7 @@ note.
Source:
@@ -3433,7 +3433,7 @@ note.
Source:
@@ -3521,7 +3521,7 @@ note.
Source:
@@ -3627,7 +3627,7 @@ note.
Source:
@@ -3733,7 +3733,7 @@ note.
Source:
@@ -3888,7 +3888,7 @@ note.
Source:
@@ -3924,7 +3924,7 @@ note.
- runOnServer(script, params) → {Promise.<*>}
+ runOnBackend(script, params) → {Promise.<*>}
@@ -3932,7 +3932,7 @@ note.
- Executes given anonymous function on the server.
+ Executes given anonymous function on the backend.
Internally this serializes the anonymous function into string and sends it to backend via AJAX.
@@ -4101,6 +4101,92 @@ Internally this serializes the anonymous function into string and sends it to ba
+
+
+
+
+
+
+ runOnServer()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Deprecated:
- new name of this API call is runOnBackend so use that
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -4209,7 +4295,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4365,7 +4451,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4520,7 +4606,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4671,7 +4757,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4808,7 +4894,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4945,7 +5031,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4988,6 +5074,14 @@ Internally this serializes the anonymous function into string and sends it to ba
+
+ Trilium runs in backend and frontend process, when something is changed on the backend from script,
+frontend will get asynchronously synchronized.
+
+This method returns a promise which resolves once all the backend -> frontend synchronization is finished.
+Typical use case is when new note has been created, we should wait until it is synced into frontend and only then activate it.
+
+
@@ -5029,7 +5123,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
diff --git a/docs/frontend_api/entities_branch.js.html b/docs/frontend_api/entities_branch.js.html
index 27e633a2b..d8208013d 100644
--- a/docs/frontend_api/entities_branch.js.html
+++ b/docs/frontend_api/entities_branch.js.html
@@ -34,7 +34,6 @@ class Branch {
this.branchId = row.branchId;
/** @param {string} */
this.noteId = row.noteId;
- this.note = null;
/** @param {string} */
this.parentNoteId = row.parentNoteId;
/** @param {int} */
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html
index 6d22768bb..d45ca3336 100644
--- a/docs/frontend_api/services_frontend_script_api.js.html
+++ b/docs/frontend_api/services_frontend_script_api.js.html
@@ -153,14 +153,14 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
}
/**
- * Executes given anonymous function on the server.
+ * Executes given anonymous function on the backend.
* Internally this serializes the anonymous function into string and sends it to backend via AJAX.
*
* @param {string} script - script to be executed on the backend
* @param {Array.<?>} params - list of parameters to the anonymous function to be send to backend
* @return {Promise<*>} return value of the executed function on the backend
*/
- this.runOnServer = async (script, params = []) => {
+ this.runOnBackend = async (script, params = []) => {
if (typeof script === "function") {
script = script.toString();
}
@@ -187,6 +187,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
}
};
+ /**
+ * @deprecated new name of this API call is runOnBackend so use that
+ * @method
+ */
+ this.runOnServer = this.runOnBackend;
+
/**
* This is a powerful search method - you can search by attributes and their values, e.g.:
* "@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
@@ -412,6 +418,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
this.bindGlobalShortcut = utils.bindGlobalShortcut;
/**
+ * Trilium runs in backend and frontend process, when something is changed on the backend from script,
+ * frontend will get asynchronously synchronized.
+ *
+ * This method returns a promise which resolves once all the backend -> frontend synchronization is finished.
+ * Typical use case is when new note has been created, we should wait until it is synced into frontend and only then activate it.
+ *
* @method
*/
this.waitUntilSynced = ws.waitForMaxKnownSyncId;