Skip to content

Build your personal knowledge base with Trilium Notes

better back/forward navigation WIP

zadam5f4d963580db
diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.html
index eef147b0d4..c4a1e9e579 100644
--- a/docs/backend_api/BackendScriptApi.html
+++ b/docs/backend_api/BackendScriptApi.html
@@ -396,7 +396,7 @@ the backend.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line394">line 394</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line395">line 395</a>
</li></ul></dd>
@@ -1117,6 +1117,8 @@ JSON MIME type. See also createNewNote() for more options.
+ <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>please use createNote() API method instead</li></ul></dd>
+
@@ -1129,7 +1131,7 @@ JSON MIME type. See also createNewNote() for more options.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line258">line 258</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line259">line 259</a>
</li></ul></dd>
@@ -1815,7 +1817,7 @@ JSON MIME type. See also createNewNote() for more options.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line399">line 399</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line400">line 400</a>
</li></ul></dd>
@@ -2279,7 +2281,7 @@ JSON MIME type. See also createNewNote() for more options.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line314">line 314</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line315">line 315</a>
</li></ul></dd>
@@ -3047,7 +3049,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line341">line 341</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line342">line 342</a>
</li></ul></dd>
@@ -3700,7 +3702,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line305">line 305</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line306">line 306</a>
</li></ul></dd>
@@ -3806,7 +3808,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line322">line 322</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line323">line 323</a>
</li></ul></dd>
@@ -3984,7 +3986,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line332">line 332</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line333">line 333</a>
</li></ul></dd>
@@ -4139,7 +4141,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line350">line 350</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line351">line 351</a>
</li></ul></dd>
@@ -4289,7 +4291,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line297">line 297</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line298">line 298</a>
</li></ul></dd>
@@ -4792,7 +4794,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line371">line 371</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line372">line 372</a>
</li></ul></dd>
@@ -4925,7 +4927,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line357">line 357</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line358">line 358</a>
</li></ul></dd>
@@ -5300,7 +5302,7 @@ transactional by default.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line384">line 384</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line385">line 385</a>
</li></ul></dd>
diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.html
index fad34eef74..23591433e3 100644
--- a/docs/backend_api/Note.html
+++ b/docs/backend_api/Note.html
@@ -685,7 +685,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line875">line 875</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line877">line 877</a>
</li></ul></dd>
@@ -1347,7 +1347,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line821">line 821</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line823">line 823</a>
</li></ul></dd>
@@ -1449,7 +1449,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line849">line 849</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line851">line 851</a>
</li></ul></dd>
@@ -1555,7 +1555,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line835">line 835</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line837">line 837</a>
</li></ul></dd>
@@ -4951,7 +4951,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line861">line 861</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line863">line 863</a>
</li></ul></dd>
@@ -6518,7 +6518,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line828">line 828</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line830">line 830</a>
</li></ul></dd>
@@ -7555,7 +7555,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line896">line 896</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line898">line 898</a>
</li></ul></dd>
diff --git a/docs/backend_api/entities_note.js.html b/docs/backend_api/entities_note.js.html
index c199be200d..484b0a84bd 100644
--- a/docs/backend_api/entities_note.js.html
+++ b/docs/backend_api/entities_note.js.html
@@ -64,7 +64,7 @@ const RELATION_DEFINITION = 'relation-definition';
class Note extends Entity {
static get entityName() { return "notes"; }
static get primaryKeyName() { return "noteId"; }
- static get hashedProperties() { return ["noteId", "title", "type", "isProtected", "isDeleted", "deleteId"]; }
+ static get hashedProperties() { return ["noteId", "title", "type", "mime", "isProtected", "isDeleted", "deleteId"]; }
/**
* @param row - object containing database row from "notes" table
@@ -839,8 +839,10 @@ class Note extends Entity {
FROM attributes
WHERE noteId = ? AND
isDeleted = 0 AND
- type = 'relation' AND
- name IN ('internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink')`, [this.noteId]);
+ ((type = 'relation' AND
+ name IN ('internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink'))
+ OR
+ (type = 'label' AND name = 'externalLink'))`, [this.noteId]);
}
/**
diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.html
index 673fb043ac..480a977cdc 100644
--- a/docs/backend_api/services_backend_script_api.js.html
+++ b/docs/backend_api/services_backend_script_api.js.html
@@ -276,6 +276,7 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
+ * @deprecated please use createNote() API method instead
*
* @param {string} parentNoteId - create new note under this parent
* @param {string} title
diff --git a/docs/frontend_api/Branch.html b/docs/frontend_api/Branch.html
index 17e0c710ab..a6c630ea55 100644
--- a/docs/frontend_api/Branch.html
+++ b/docs/frontend_api/Branch.html
@@ -201,6 +201,64 @@
+<h4 class="name" id="isDeleted"><span class="type-signature"></span>isDeleted<span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line23">line 23</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
<h4 class="name" id="isExpanded"><span class="type-signature"></span>isExpanded<span class="type-signature"></span></h4>
@@ -549,7 +607,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line25">line 25</a>
+ <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line27">line 27</a>
</li></ul></dd>
@@ -651,7 +709,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line30">line 30</a>
+ <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line32">line 32</a>
</li></ul></dd>
@@ -753,7 +811,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line35">line 35</a>
+ <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line37">line 37</a>
</li></ul></dd>
diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html
index 525fc8b05f..503b92f670 100644
--- a/docs/frontend_api/FrontendScriptApi.html
+++ b/docs/frontend_api/FrontendScriptApi.html
@@ -241,7 +241,7 @@
-<h4 class="name" id="currentNote"><span class="type-signature"></span>currentNote<span class="type-signature"></span></h4>
+<h4 class="name" id="CollapsibleWidget"><span class="type-signature"></span>CollapsibleWidget<span class="type-signature"></span></h4>
@@ -260,8 +260,6 @@
<thead>
<tr>
- <th>Name</th>
-
<th>Type</th>
@@ -278,13 +276,11 @@
<tr>
- <td class="name"><code>note</code></td>
-
<td class="type">
-<span class="param-type">object</span>
+<span class="param-type">CollapsibleWidget</span>
@@ -294,7 +290,7 @@
- <td class="description last">where script is currently executing</td>
+ <td class="description last"></td>
</tr>
@@ -333,7 +329,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line30">line 30</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line38">line 38</a>
</li></ul></dd>
@@ -351,7 +347,7 @@
-<h4 class="name" id="originEntity"><span class="type-signature"></span>originEntity<span class="type-signature"></span></h4>
+<h4 class="name" id="currentNote"><span class="type-signature"></span>currentNote<span class="type-signature"></span></h4>
@@ -388,16 +384,13 @@
<tr>
- <td class="name"><code>entity</code></td>
+ <td class="name"><code>note</code></td>
<td class="type">
<span class="param-type">object</span>
-|
-
-<span class="param-type">null</span>
@@ -407,7 +400,7 @@
- <td class="description last">whose event triggered this execution</td>
+ <td class="description last">where script is currently executing</td>
</tr>
@@ -446,7 +439,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line32">line 32</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line30">line 30</a>
</li></ul></dd>
@@ -464,7 +457,7 @@
-<h4 class="name" id="StandardWidget"><span class="type-signature"></span>StandardWidget<span class="type-signature"></span></h4>
+<h4 class="name" id="originEntity"><span class="type-signature"></span>originEntity<span class="type-signature"></span></h4>
@@ -483,6 +476,8 @@
<thead>
<tr>
+ <th>Name</th>
+
<th>Type</th>
@@ -499,11 +494,16 @@
<tr>
+ <td class="name"><code>entity</code></td>
+
<td class="type">
-<span class="param-type">StandardWidget</span>
+<span class="param-type">object</span>
+|
+
+<span class="param-type">null</span>
@@ -513,7 +513,7 @@
- <td class="description last"></td>
+ <td class="description last">whose event triggered this execution</td>
</tr>
@@ -552,7 +552,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line41">line 41</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line32">line 32</a>
</li></ul></dd>
@@ -679,115 +679,6 @@
-
-<h4 class="name" id="tabContext"><span class="type-signature"></span>tabContext<span class="type-signature"></span></h4>
-
-
-
-
-
-
-
-
-
-
- <h5 class="subsection-title">Properties:</h5>
-
-
-
-<table class="props">
- <thead>
- <tr>
-
-
- <th>Type</th>
-
-
-
-
-
- <th class="last">Description</th>
- </tr>
- </thead>
-
- <tbody>
-
-
- <tr>
-
-
- <td class="type">
-
-
-<span class="param-type">TabContext</span>
-|
-
-<span class="param-type">null</span>
-
-
-
- </td>
-
-
-
-
-
- <td class="description last">experimental!</td>
- </tr>
-
-
- </tbody>
-</table>
-
-
-
-
-<dl class="details">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line38">line 38</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
@@ -900,7 +791,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line66">line 66</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line57">line 57</a>
</li></ul></dd>
@@ -1055,7 +946,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line50">line 50</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line47">line 47</a>
</li></ul></dd>
@@ -1210,7 +1101,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line85">line 85</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line77">line 77</a>
</li></ul></dd>
@@ -1347,7 +1238,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line287">line 287</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line279">line 279</a>
</li></ul></dd>
@@ -1503,7 +1394,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line382">line 382</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line384">line 384</a>
</li></ul></dd>
@@ -1683,7 +1574,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line279">line 279</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line271">line 271</a>
</li></ul></dd>
@@ -1816,7 +1707,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line239">line 239</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line231">line 231</a>
</li></ul></dd>
@@ -1922,7 +1813,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line293">line 293</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line285">line 285</a>
</li></ul></dd>
@@ -2028,7 +1919,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line307">line 307</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line299">line 299</a>
</li></ul></dd>
@@ -2182,7 +2073,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line301">line 301</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line293">line 293</a>
</li></ul></dd>
@@ -2319,7 +2210,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line348">line 348</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line350">line 350</a>
</li></ul></dd>
@@ -2426,7 +2317,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line232">line 232</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line224">line 224</a>
</li></ul></dd>
@@ -2581,7 +2472,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line357">line 357</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line359">line 359</a>
</li></ul></dd>
@@ -2737,7 +2628,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line204">line 204</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line196">line 196</a>
</li></ul></dd>
@@ -2938,7 +2829,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line216">line 216</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line208">line 208</a>
</li></ul></dd>
@@ -3044,7 +2935,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line339">line 339</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line341">line 341</a>
</li></ul></dd>
@@ -3199,7 +3090,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line366">line 366</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line368">line 368</a>
</li></ul></dd>
@@ -3253,19 +3144,13 @@ otherwise (by e.g. createNoteLink())
- <h4 class="name" id="isNoteStillActive"><span class="type-signature"></span>isNoteStillActive<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+ <h4 class="name" id="parseDate"><span class="type-signature"></span>parseDate<span class="signature">(str)</span><span class="type-signature"> &rarr; {Date}</span></h4>
-<div class="description">
- This method checks whether user navigated away from the note from which the scripts has been started.
-This is necessary because script execution is async and by the time it is finished, the user might have
-already navigated away from this page - the end result would be that script might return data for the wrong
-note.
-</div>
@@ -3274,6 +3159,54 @@ note.
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>str</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"></td>
+ </tr>
+
+
+ </tbody>
+</table>
+
@@ -3308,7 +3241,7 @@ note.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line318">line 318</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line238">line 238</a>
</li></ul></dd>
@@ -3337,7 +3270,7 @@ note.
<div class="param-desc">
- returns true if the original note is still loaded, false if user switched to another
+ parsed object
</div>
@@ -3348,7 +3281,7 @@ note.
</dt>
<dd>
-<span class="param-type">boolean</span>
+<span class="param-type">Date</span>
</dd>
@@ -3366,7 +3299,93 @@ note.
- <h4 class="name" id="parseDate"><span class="type-signature"></span>parseDate<span class="signature">(str)</span><span class="type-signature"> &rarr; {Date}</span></h4>
+ <h4 class="name" id="protectActiveNote"><span class="type-signature"></span>protectActiveNote<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>use protectNote and protectSubtree instead</li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line311">line 311</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="protectNote"><span class="type-signature"></span>protectNote<span class="signature">(noteId, protect)</span><span class="type-signature"></span></h4>
@@ -3406,7 +3425,7 @@ note.
<tr>
- <td class="name"><code>str</code></td>
+ <td class="name"><code>noteId</code></td>
<td class="type">
@@ -3426,6 +3445,29 @@ note.
</tr>
+
+ <tr>
+
+ <td class="name"><code>protect</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">boolean</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">true to protect note, false to unprotect</td>
+ </tr>
+
+
</tbody>
</table>
@@ -3463,7 +3505,7 @@ note.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line246">line 246</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line322">line 322</a>
</li></ul></dd>
@@ -3488,26 +3530,19 @@ note.
-<h5>Returns:</h5>
-
-<div class="param-desc">
- parsed object
-</div>
-<dl>
- <dt>
- Type
- </dt>
- <dd>
+
-<span class="param-type">Date</span>
+
+
- </dd>
-</dl>
+
+ <h4 class="name" id="protectSubTree"><span class="type-signature"></span>protectSubTree<span class="signature">(noteId, protect)</span><span class="type-signature"></span></h4>
+
@@ -3515,25 +3550,82 @@ note.
-
-
-
+
+
+
+
+ <h5>Parameters:</h5>
- <h4 class="name" id="protectActiveNote"><span class="type-signature"></span>protectActiveNote<span class="signature">()</span><span class="type-signature"></span></h4>
-
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <tr>
+
+ <td class="name"><code>noteId</code></td>
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+ </td>
+
+
+ <td class="description last"></td>
+ </tr>
+
+ <tr>
+
+ <td class="name"><code>protect</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">boolean</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">true to protect subtree, false to unprotect</td>
+ </tr>
+
+
+ </tbody>
+</table>
@@ -3657,7 +3749,7 @@ note.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line270">line 270</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line262">line 262</a>
</li></ul></dd>
@@ -3812,7 +3904,7 @@ note.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line224">line 224</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line216">line 216</a>
</li></ul></dd>
@@ -3973,7 +4065,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line135">line 135</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line127">line 127</a>
</li></ul></dd>
@@ -4081,7 +4173,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line164">line 164</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line156">line 156</a>
</li></ul></dd>
@@ -4219,7 +4311,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line192">line 192</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line184">line 184</a>
</li></ul></dd>
@@ -4375,7 +4467,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line174">line 174</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line166">line 166</a>
</li></ul></dd>
@@ -4530,7 +4622,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line375">line 375</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line377">line 377</a>
</li></ul></dd>
@@ -4681,7 +4773,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line326">line 326</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line305">line 305</a>
</li></ul></dd>
@@ -4818,7 +4910,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line262">line 262</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line254">line 254</a>
</li></ul></dd>
@@ -4955,7 +5047,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line254">line 254</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line246">line 246</a>
</li></ul></dd>
@@ -5047,7 +5139,7 @@ Typical use case is when new note has been created, we should wait until it is s
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line393">line 393</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line395">line 395</a>
</li></ul></dd>
diff --git a/docs/frontend_api/NoteShort.html b/docs/frontend_api/NoteShort.html
index 20d98d86e4..3fb72f5b2d 100644
--- a/docs/frontend_api/NoteShort.html
+++ b/docs/frontend_api/NoteShort.html
@@ -1159,7 +1159,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line290">line 290</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line295">line 295</a>
</li></ul></dd>
@@ -1359,7 +1359,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line164">line 164</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line169">line 169</a>
</li></ul></dd>
@@ -1537,7 +1537,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line312">line 312</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line317">line 317</a>
</li></ul></dd>
@@ -1643,7 +1643,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line107">line 107</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line112">line 112</a>
</li></ul></dd>
@@ -1697,6 +1697,108 @@
+ <h4 class="name" id="getBranchIds"><span class="type-signature"></span>getBranchIds<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line107">line 107</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Array.&lt;string></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
<h4 class="name" id="getChildBranches"><span class="type-signature">(async) </span>getChildBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>>}</span></h4>
@@ -1745,7 +1847,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line119">line 119</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line124">line 124</a>
</li></ul></dd>
@@ -1847,7 +1949,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line137">line 137</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line142">line 142</a>
</li></ul></dd>
@@ -1949,7 +2051,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line142">line 142</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line147">line 147</a>
</li></ul></dd>
@@ -2100,7 +2202,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line352">line 352</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line357">line 357</a>
</li></ul></dd>
@@ -2267,7 +2369,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line228">line 228</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line233">line 233</a>
</li></ul></dd>
@@ -2434,7 +2536,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line220">line 220</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line225">line 225</a>
</li></ul></dd>
@@ -2589,7 +2691,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line376">line 376</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line381">line 381</a>
</li></ul></dd>
@@ -2767,7 +2869,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line279">line 279</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line284">line 284</a>
</li></ul></dd>
@@ -2967,7 +3069,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line151">line 151</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line156">line 156</a>
</li></ul></dd>
@@ -3145,7 +3247,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line301">line 301</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line306">line 306</a>
</li></ul></dd>
@@ -3300,7 +3402,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line346">line 346</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line351">line 351</a>
</li></ul></dd>
@@ -3467,7 +3569,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line212">line 212</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line217">line 217</a>
</li></ul></dd>
@@ -3622,7 +3724,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line370">line 370</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line375">line 375</a>
</li></ul></dd>
@@ -3777,7 +3879,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line358">line 358</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line363">line 363</a>
</li></ul></dd>
@@ -3944,7 +4046,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line236">line 236</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line241">line 241</a>
</li></ul></dd>
@@ -4099,7 +4201,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line382">line 382</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line387">line 387</a>
</li></ul></dd>
@@ -4205,7 +4307,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line127">line 127</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line132">line 132</a>
</li></ul></dd>
@@ -4307,7 +4409,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line132">line 132</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line137">line 137</a>
</li></ul></dd>
@@ -4458,7 +4560,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line364">line 364</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line369">line 369</a>
</li></ul></dd>
@@ -4625,7 +4727,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line252">line 252</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line257">line 257</a>
</li></ul></dd>
@@ -4792,7 +4894,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line244">line 244</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line249">line 249</a>
</li></ul></dd>
@@ -4947,7 +5049,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line394">line 394</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line399">line 399</a>
</li></ul></dd>
@@ -5117,7 +5219,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line404">line 404</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line409">line 409</a>
</li></ul></dd>
@@ -5268,7 +5370,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line388">line 388</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line393">line 393</a>
</li></ul></dd>
@@ -5378,7 +5480,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line428">line 428</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line433">line 433</a>
</li></ul></dd>
@@ -5552,7 +5654,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line261">line 261</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line266">line 266</a>
</li></ul></dd>
@@ -5658,7 +5760,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line114">line 114</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line119">line 119</a>
</li></ul></dd>
@@ -5809,7 +5911,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line328">line 328</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line333">line 333</a>
</li></ul></dd>
@@ -5987,7 +6089,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line270">line 270</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line275">line 275</a>
</li></ul></dd>
@@ -6142,7 +6244,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line322">line 322</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line327">line 327</a>
</li></ul></dd>
@@ -6297,7 +6399,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line334">line 334</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line339">line 339</a>
</li></ul></dd>
@@ -6452,7 +6554,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line340">line 340</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line345">line 345</a>
</li></ul></dd>
@@ -6563,7 +6665,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line419">line 419</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line424">line 424</a>
</li></ul></dd>
diff --git a/docs/frontend_api/entities_branch.js.html b/docs/frontend_api/entities_branch.js.html
index 1b5bf3a493..aecc310ae8 100644
--- a/docs/frontend_api/entities_branch.js.html
+++ b/docs/frontend_api/entities_branch.js.html
@@ -47,6 +47,8 @@ class Branch {
this.prefix = row.prefix;
/** @param {boolean} */
this.isExpanded = !!row.isExpanded;
+ /** @param {boolean} */
+ this.isDeleted = !!row.isDeleted;
}
/** @returns {NoteShort} */
diff --git a/docs/frontend_api/entities_note_short.js.html b/docs/frontend_api/entities_note_short.js.html
index 16c7fd55d0..772230b86c 100644
--- a/docs/frontend_api/entities_note_short.js.html
+++ b/docs/frontend_api/entities_note_short.js.html
@@ -73,7 +73,7 @@ class NoteShort {
/** @param {int} */
this.contentLength = row.contentLength;
/** @param {boolean} */
- this.isProtected = row.isProtected;
+ this.isProtected = !!row.isProtected;
/** @param {string} one of 'text', 'code', 'file' or 'render' */
this.type = row.type;
/** @param {string} content-type, e.g. "application/json" */
@@ -131,6 +131,11 @@ class NoteShort {
}
}
+ /** @returns {string[]} */
+ getBranchIds() {
+ return Object.values(this.parentToBranch);
+ }
+
/** @returns {Promise&lt;Branch[]>} */
async getBranches() {
const branchIds = Object.values(this.parentToBranch);
@@ -468,6 +473,11 @@ class NoteShort {
return dto;
}
+
+ async getCssClass() {
+ const labels = await this.getLabels('cssClass');
+ return labels.map(l => l.value).join(' ');
+ }
}
export default NoteShort;</code></pre>
diff --git a/docs/frontend_api/global.html b/docs/frontend_api/global.html
index b4c13d6c85..665c91fe54 100644
--- a/docs/frontend_api/global.html
+++ b/docs/frontend_api/global.html
@@ -303,7 +303,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line72">line 72</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line64">line 64</a>
</li></ul></dd>
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html
index f9f8f02a06..a49e3f1059 100644
--- a/docs/frontend_api/services_frontend_script_api.js.html
+++ b/docs/frontend_api/services_frontend_script_api.js.html
@@ -35,7 +35,7 @@ import treeCache from './tree_cache.js';
import noteTooltipService from './note_tooltip.js';
import protectedSessionService from './protected_session.js';
import dateNotesService from './date_notes.js';
-import StandardWidget from '../widgets/collapsible_widget.js';
+import CollapsibleWidget from '../widgets/collapsible_widget.js';
import ws from "./ws.js";
import hoistedNoteService from "./hoisted_note.js";
import appContext from "./app_context.js";
@@ -46,7 +46,7 @@ import appContext from "./app_context.js";
* @constructor
* @hideconstructor
*/
-function FrontendScriptApi(startNote, currentNote, originEntity = null, tabContext = null, $container = null) {
+function FrontendScriptApi(startNote, currentNote, originEntity = null, $container = null) {
const $pluginButtons = $("#plugin-buttons");
/** @property {jQuery} container of all the rendered script content */
@@ -62,11 +62,8 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
// to keep consistency with backend API
this.dayjs = dayjs;
- /** @property {TabContext|null} - experimental! */
- this.tabContext = tabContext;
-
- /** @property {StandardWidget} */
- this.StandardWidget = StandardWidget;
+ /** @property {CollapsibleWidget} */
+ this.CollapsibleWidget = CollapsibleWidget;
/**
* Activates note in the tree and in the note detail.
@@ -75,14 +72,8 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
* @param {string} notePath (or noteId)
* @returns {Promise&lt;void>}
*/
- this.activateNote = async (notePath, noteLoadedListener) => {
- await treeService.activateNote(notePath, async () => {
- await appContext.getMainNoteTree().scrollToActiveNoteListener();
-
- if (noteLoadedListener) {
- noteLoadedListener();
- }
- });
+ this.activateNote = async notePath => {
+ await appContext.tabManager.getActiveTabContext().setNote(notePath);
};
/**
@@ -94,7 +85,8 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
this.activateNewNote = async notePath => {
await ws.waitForMaxKnownSyncId();
- await treeService.activateNote(notePath, () => appContext.trigger('focusAndSelectTitle'));
+ await appContext.tabManager.getActiveTabContext().setNote(notePath);
+ appContext.triggerCommand('focusAndSelectTitle');
};
/**
@@ -312,13 +304,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
* @param {string} text - this must be clear text, HTML is not supported.
* @method
*/
- this.addTextToActiveTabEditor = text => appContext.trigger('addTextToActiveEditor', {text});
+ this.addTextToActiveTabEditor = text => appContext.triggerCommand('addTextToActiveEditor', {text});
/**
* @method
* @returns {NoteShort} active note (loaded into right pane)
*/
- this.getActiveTabNote = appContext.getActiveTabNote;
+ this.getActiveTabNote = appContext.tabManager.getActiveTabNote;
/**
* See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html for a documentation on the returned instance.
@@ -326,37 +318,47 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
* @method
* @param callback - method receiving "textEditor" instance
*/
- this.getActiveTabTextEditor = callback => appContext.trigger('executeInActiveEditor', {callback});
+ this.getActiveTabTextEditor = callback => appContext.triggerCommand('executeInActiveEditor', {callback});
/**
* @method
* @returns {Promise&lt;string|null>} returns note path of active note or null if there isn't active note
*/
- this.getActiveTabNotePath = appContext.getActiveTabNotePath;
+ this.getActiveTabNotePath = appContext.tabManager.getActiveTabNotePath;
/**
- * This method checks whether user navigated away from the note from which the scripts has been started.
- * This is necessary because script execution is async and by the time it is finished, the user might have
- * already navigated away from this page - the end result would be that script might return data for the wrong
- * note.
- *
* @method
- * @return {boolean} returns true if the original note is still loaded, false if user switched to another
+ * @param {object} $el - jquery object on which to setup the tooltip
+ */
+ this.setupElementTooltip = noteTooltipService.setupElementTooltip;
+
+ /**
+ * @deprecated use protectNote and protectSubtree instead
+ * @method
*/
- this.isNoteStillActive = () => {
- return tabContext.note &amp;&amp; this.originEntity.noteId === tabContext.note.noteId;
+ this.protectActiveNote = async () => {
+ const activeNote = appContext.tabManager.getActiveTabNote();
+
+ await protectedSessionService.protectNote(activeNote.noteId, true, false);
};
/**
* @method
- * @param {object} $el - jquery object on which to setup the tooltip
+ * @param {string} noteId
+ * @param {boolean} protect - true to protect note, false to unprotect
*/
- this.setupElementTooltip = noteTooltipService.setupElementTooltip;
+ this.protectNote = async (noteId, protect) => {
+ await protectedSessionService.protectNote(noteId, protect, false);
+ };
/**
* @method
+ * @param {string} noteId
+ * @param {boolean} protect - true to protect subtree, false to unprotect
*/
- this.protectActiveNote = protectedSessionService.protectNoteAndSendToServer;
+ this.protectSubTree = async (noteId, protect) => {
+ await protectedSessionService.protectNote(noteId, protect, true);
+ };
/**
* Returns date-note for today. If it doesn't exist, it is automatically created.
diff --git a/src/public/javascripts/services/entrypoints.js b/src/public/javascripts/services/entrypoints.js
index d53b7709c7..152428458e 100644
--- a/src/public/javascripts/services/entrypoints.js
+++ b/src/public/javascripts/services/entrypoints.js
@@ -138,11 +138,17 @@ export default class Entrypoints extends Component {
}
backInNoteHistoryCommand() {
- window.history.back();
+ const electron = require('electron');
+ const {webContents} = electron.remote.getCurrentWindow();
+
+ webContents.goBack();
}
- forwardInNoteHistoryCommand() {
- window.history.forward();
+ forwardInNoteHistoryCommand() {console.log("forward");
+ const electron = require('electron');
+ const {webContents} = electron.remote.getCurrentWindow();
+
+ webContents.goForward();
}
async searchForResultsCommand({searchText}) {
diff --git a/src/public/javascripts/services/tab_manager.js b/src/public/javascripts/services/tab_manager.js
index 5b50e6d364..11af52d2a6 100644
--- a/src/public/javascripts/services/tab_manager.js
+++ b/src/public/javascripts/services/tab_manager.js
@@ -117,6 +117,8 @@ export default class TabManager extends Component {
// it helps navigating in history if note title is included in the title
document.title += " - " + activeTabContext.note.title;
}
+
+ this.triggerEvent('activeNoteChanged');
}
}
diff --git a/src/public/javascripts/widgets/history_navigation.js b/src/public/javascripts/widgets/history_navigation.js
index 7055dfc7c0..8d964e3841 100644
--- a/src/public/javascripts/widgets/history_navigation.js
+++ b/src/public/javascripts/widgets/history_navigation.js
@@ -1,6 +1,9 @@
import BasicWidget from "./basic_widget.js";
import utils from "../services/utils.js";
import keyboardActionService from "../services/keyboard_actions.js";
+import contextMenu from "../services/context_menu.js";
+import treeService from "../services/tree.js";
+import appContext from "../services/app_context.js";
const TPL = `
<div class="history-navigation">
@@ -20,6 +23,26 @@ export default class HistoryNavigationWidget extends BasicWidget {
doRender() {
if (utils.isElectron()) {
this.$widget = $(TPL);
+
+ this.$backInHistory = this.$widget.find("[data-trigger-command='backInNoteHistory']");
+ this.$backInHistory.on('contextmenu', e => {
+ e.preventDefault();
+
+ if (this.webContents.history.length < 2) {
+ return;
+ }
+
+ this.showContextMenu(e);
+ });
+
+
+ this.$forwardInHistory = this.$widget.find("[data-trigger-command='forwardInNoteHistory']");
+
+ const electron = require('electron');
+ this.webContents = electron.remote.getCurrentWindow().webContents;
+ this.webContents.clearHistory();
+
+ this.refresh();
}
else {
this.$widget = $("<div>");
@@ -27,4 +50,50 @@ export default class HistoryNavigationWidget extends BasicWidget {
return this.$widget;
}
+
+ async showContextMenu(e) {
+ let items = [];
+
+ for (const url of this.webContents.history) {
+ const [_, notePathWithTab] = url.split('#');
+ const [notePath, tabId] = notePathWithTab.split('-');
+
+ const title = await treeService.getNotePathTitle(notePath);
+
+ items.push({
+ title,
+ notePath,
+ tabId,
+ uiIcon: "empty"
+ });
+ }
+
+ items.reverse();
+
+ items = items.slice(1); // remove the current note
+
+ if (items.length > 20) {
+ items = items.slice(0, 20);
+ }
+
+ contextMenu.show({
+ x: e.pageX,
+ y: e.pageY,
+ items,
+ selectMenuItemHandler: ({notePath, tabId}) => appContext.tabManager.switchToTab(tabId, notePath)
+ });
+ }
+
+ refresh() {
+ if (!utils.isElectron()) {
+ return;
+ }
+
+ this.$backInHistory.toggleClass('disabled', !this.webContents.canGoBack());
+ this.$forwardInHistory.toggleClass('disabled', !this.webContents.canGoForward());
+ }
+
+ activeNoteChangedEvent() {
+ this.refresh();
+ }
}
\ No newline at end of file
diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css
index b96a4d2f16..920463de5c 100644
--- a/src/public/stylesheets/style.css
+++ b/src/public/stylesheets/style.css
@@ -185,7 +185,7 @@ span.fancytree-node.archived {
overflow-x: hidden;
}
-.icon-action:hover {
+.icon-action:hover:not(.disabled) {
text-decoration: none;
border-color: var(--button-border-color);
}
@@ -198,6 +198,11 @@ span.fancytree-node.archived {
font-size: 1.5em;
}
+.icon-action.disabled {
+ color: var(--muted-text-color) !important;
+ cursor: not-allowed;
+}
+
.ui-widget-content a:not(.ui-tabs-anchor) {
color: #337ab7 !important;
}