Skip to content

Build your personal knowledge base with Trilium Notes

script api docs

zadama6ade790c64a
diff --git a/docs/frontend_api/FAttribute.html b/docs/frontend_api/FAttribute.html
index 641c3a7372..901dc598c1 100644
--- a/docs/frontend_api/FAttribute.html
+++ b/docs/frontend_api/FAttribute.html
@@ -850,7 +850,7 @@ and relation (representing named relationship between source and target note)</d
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/FBranch.html b/docs/frontend_api/FBranch.html
index 284bc72d5a..4ec45ea97e 100644
--- a/docs/frontend_api/FBranch.html
+++ b/docs/frontend_api/FBranch.html
@@ -1062,7 +1062,7 @@ parents.</div>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/FNote.html b/docs/frontend_api/FNote.html
index cff8d1e8fa..cf7e9782c0 100644
--- a/docs/frontend_api/FNote.html
+++ b/docs/frontend_api/FNote.html
@@ -977,6 +977,116 @@
+ <h4 class="name" id="getAllNotePaths"><span class="type-signature"></span>getAllNotePaths<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;Array.&lt;string>>}</span></h4>
+
+
+
+
+
+
+<div class="description">
+ Gives all possible note paths leading to this note. Paths containing search note are ignored (could form cycles)
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line312">line 312</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ - array of notePaths (each represented by array of noteIds constituting the particular note path)
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Array.&lt;Array.&lt;string>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
<h4 class="name" id="getAttribute"><span class="type-signature"></span>getAttribute<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {<a href="FAttribute.html">FAttribute</a>}</span></h4>
@@ -1033,7 +1143,375 @@
- <td class="description last">attribute type (label, relation, etc.)</td>
+ <td class="description last">attribute type (label, relation, etc.)</td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">attribute name</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line580">line 580</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type"><a href="FAttribute.html">FAttribute</a></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getAttributeValue"><span class="type-signature"></span>getAttributeValue<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <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>type</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">attribute type (label, relation, etc.)</td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">attribute name</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line602">line 602</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ attribute value of given type and name or null if no such attribute exists.
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">string</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getAttributes"><span class="type-signature"></span>getAttributes<span class="signature">(type<span class="signature-attributes">opt</span>, name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="FAttribute.html">FAttribute</a>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>type</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last">(optional) attribute type to filter</td>
</tr>
@@ -1053,10 +1531,20 @@
</td>
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
- <td class="description last">attribute name</td>
+ <td class="description last">(optional) attribute name to filter</td>
</tr>
@@ -1097,7 +1585,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line554">line 554</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line246">line 246</a>
</li></ul></dd>
@@ -1126,7 +1614,7 @@
<div class="param-desc">
- attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
+ all note's attributes, including inherited ones
</div>
@@ -1137,7 +1625,7 @@
</dt>
<dd>
-<span class="param-type"><a href="FAttribute.html">FAttribute</a></span>
+<span class="param-type">Array.&lt;<a href="FAttribute.html">FAttribute</a>></span>
</dd>
@@ -1155,13 +1643,17 @@
- <h4 class="name" id="getAttributeValue"><span class="type-signature"></span>getAttributeValue<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {string}</span></h4>
+ <h4 class="name" id="getBestNotePath"><span class="type-signature"></span>getBestNotePath<span class="signature">(hoistedNoteId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
+<div class="description">
+ Returns note path considered to be the "best"
+</div>
+
@@ -1183,8 +1675,12 @@
<th>Type</th>
+ <th>Attributes</th>
+
+ <th>Default</th>
+
<th class="last">Description</th>
</tr>
@@ -1195,7 +1691,7 @@
<tr>
- <td class="name"><code>type</code></td>
+ <td class="name"><code>hoistedNoteId</code></td>
<td class="type">
@@ -1208,33 +1704,26 @@
</td>
-
-
-
- <td class="description last">attribute type (label, relation, etc.)</td>
- </tr>
-
-
-
- <tr>
-
- <td class="name"><code>name</code></td>
-
-
- <td class="type">
-
+ <td class="attributes">
+
+ &lt;optional><br>
-<span class="param-type">string</span>
+
+
+ </td>
- </td>
-
+ <td class="default">
+
+ 'root'
+
+ </td>
- <td class="description last">attribute name</td>
+ <td class="description last"></td>
</tr>
@@ -1275,7 +1764,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line576">line 576</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line368">line 368</a>
</li></ul></dd>
@@ -1304,7 +1793,7 @@
<div class="param-desc">
- attribute value of given type and name or null if no such attribute exists.
+ array of noteIds constituting the particular note path
</div>
@@ -1315,7 +1804,7 @@
</dt>
<dd>
-<span class="param-type">string</span>
+<span class="param-type">Array.&lt;string></span>
</dd>
@@ -1333,13 +1822,17 @@
- <h4 class="name" id="getAttributes"><span class="type-signature"></span>getAttributes<span class="signature">(type<span class="signature-attributes">opt</span>, name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="FAttribute.html">FAttribute</a>>}</span></h4>
+ <h4 class="name" id="getBestNotePathString"><span class="type-signature"></span>getBestNotePathString<span class="signature">(hoistedNoteId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
+<div class="description">
+ Returns note path considered to be the "best"
+</div>
+
@@ -1365,6 +1858,8 @@
+ <th>Default</th>
+
<th class="last">Description</th>
</tr>
@@ -1375,7 +1870,7 @@
<tr>
- <td class="name"><code>type</code></td>
+ <td class="name"><code>hoistedNoteId</code></td>
<td class="type">
@@ -1400,41 +1895,14 @@
-
- <td class="description last">(optional) attribute type to filter</td>
- </tr>
-
-
-
- <tr>
-
- <td class="name"><code>name</code></td>
-
-
- <td class="type">
-
-
-<span class="param-type">string</span>
-
-
-
- </td>
-
-
- <td class="attributes">
-
- &lt;optional><br>
+ <td class="default">
-
-
-
+ 'root'
</td>
-
-
- <td class="description last">(optional) attribute name to filter</td>
+ <td class="description last"></td>
</tr>
@@ -1475,7 +1943,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line242">line 242</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line378">line 378</a>
</li></ul></dd>
@@ -1504,7 +1972,7 @@
<div class="param-desc">
- all note's attributes, including inherited ones
+ serialized note path (e.g. 'root/a1h315/js725h')
</div>
@@ -1515,7 +1983,7 @@
</dt>
<dd>
-<span class="param-type">Array.&lt;<a href="FAttribute.html">FAttribute</a>></span>
+<span class="param-type">string</span>
</dd>
@@ -1583,7 +2051,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line146">line 146</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line150">line 150</a>
</li></ul></dd>
@@ -1687,7 +2155,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line163">line 163</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line167">line 167</a>
</li></ul></dd>
@@ -1789,7 +2257,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line173">line 173</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line177">line 177</a>
</li></ul></dd>
@@ -1891,7 +2359,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line215">line 215</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line219">line 219</a>
</li></ul></dd>
@@ -1993,7 +2461,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line220">line 220</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line224">line 224</a>
</li></ul></dd>
@@ -2144,7 +2612,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line616">line 616</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line656">line 656</a>
</li></ul></dd>
@@ -2299,7 +2767,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line640">line 640</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line680">line 680</a>
</li></ul></dd>
@@ -2466,7 +2934,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line435">line 435</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line459">line 459</a>
</li></ul></dd>
@@ -2576,7 +3044,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line776">line 776</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line823">line 823</a>
</li></ul></dd>
@@ -2678,7 +3146,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line682">line 682</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line722">line 722</a>
</li></ul></dd>
@@ -2852,7 +3320,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line543">line 543</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line569">line 569</a>
</li></ul></dd>
@@ -3030,7 +3498,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line565">line 565</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line591">line 591</a>
</li></ul></dd>
@@ -3230,7 +3698,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line229">line 229</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line233">line 233</a>
</li></ul></dd>
@@ -3385,7 +3853,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line610">line 610</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line650">line 650</a>
</li></ul></dd>
@@ -3540,7 +4008,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line634">line 634</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line674">line 674</a>
</li></ul></dd>
@@ -3707,7 +4175,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line427">line 427</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line451">line 451</a>
</li></ul></dd>
@@ -3862,7 +4330,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line622">line 622</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line662">line 662</a>
</li></ul></dd>
@@ -4017,7 +4485,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line646">line 646</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line686">line 686</a>
</li></ul></dd>
@@ -4184,7 +4652,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line508">line 508</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line532">line 532</a>
</li></ul></dd>
@@ -4290,7 +4758,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line138">line 138</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line142">line 142</a>
</li></ul></dd>
@@ -4392,7 +4860,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line153">line 153</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line157">line 157</a>
</li></ul></dd>
@@ -4494,7 +4962,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line181">line 181</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line185">line 185</a>
</li></ul></dd>
@@ -4596,7 +5064,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line186">line 186</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line190">line 190</a>
</li></ul></dd>
@@ -4747,7 +5215,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line628">line 628</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line668">line 668</a>
</li></ul></dd>
@@ -4902,7 +5370,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line658">line 658</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line698">line 698</a>
</li></ul></dd>
@@ -5072,7 +5540,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line668">line 668</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line708">line 708</a>
</li></ul></dd>
@@ -5223,7 +5691,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line652">line 652</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line692">line 692</a>
</li></ul></dd>
@@ -5326,35 +5794,141 @@
<td class="name"><code>name</code></td>
- <td class="type">
-
-
-<span class="param-type">string</span>
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last">relation name to filter</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line540">line 540</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ all note's relations (attributes with type relation), including inherited ones
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Array.&lt;<a href="FAttribute.html">FAttribute</a>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getScriptEnv"><span class="type-signature"></span>getScriptEnv<span class="signature">()</span><span class="type-signature"> &rarr; {string|null}</span></h4>
+
+
+
+
-
- </td>
-
- <td class="attributes">
-
- &lt;optional><br>
-
-
-
- </td>
-
-
- <td class="description last">relation name to filter</td>
- </tr>
-
- </tbody>
-</table>
@@ -5390,7 +5964,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line516">line 516</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line867">line 867</a>
</li></ul></dd>
@@ -5419,7 +5993,7 @@
<div class="param-desc">
- all note's relations (attributes with type relation), including inherited ones
+ JS script environment - either "frontend" or "backend"
</div>
@@ -5430,7 +6004,10 @@
</dt>
<dd>
-<span class="param-type">Array.&lt;<a href="FAttribute.html">FAttribute</a>></span>
+<span class="param-type">string</span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -5448,19 +6025,88 @@
- <h4 class="name" id="getScriptEnv"><span class="type-signature"></span>getScriptEnv<span class="signature">()</span><span class="type-signature"> &rarr; {string|null}</span></h4>
+ <h4 class="name" id="getSortedNotePathRecords"><span class="type-signature"></span>getSortedNotePathRecords<span class="signature">(hoistedNoteId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;{isArchived: boolean, isInHoistedSubTree: boolean, notePath: Array.&lt;string>, isHidden: boolean}>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+ <th>Default</th>
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <tr>
+
+ <td class="name"><code>hoistedNoteId</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+ </td>
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+ </td>
+
+
+ <td class="default">
+
+ 'root'
+
+ </td>
+
+ <td class="description last"></td>
+ </tr>
+
+ </tbody>
+</table>
@@ -5496,7 +6142,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line820">line 820</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line337">line 337</a>
</li></ul></dd>
@@ -5524,10 +6170,6 @@
<h5>Returns:</h5>
-<div class="param-desc">
- JS script environment - either "frontend" or "backend"
-</div>
-
<dl>
@@ -5536,10 +6178,7 @@
</dt>
<dd>
-<span class="param-type">string</span>
-|
-
-<span class="param-type">null</span>
+<span class="param-type">Array.&lt;{isArchived: boolean, isInHoistedSubTree: boolean, notePath: Array.&lt;string>, isHidden: boolean}></span>
</dd>
@@ -5609,7 +6248,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line765">line 765</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line812">line 812</a>
</li></ul></dd>
@@ -5715,7 +6354,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line755">line 755</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line802">line 802</a>
</li></ul></dd>
@@ -5889,7 +6528,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line525">line 525</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line549">line 549</a>
</li></ul></dd>
@@ -5995,7 +6634,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line168">line 168</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line172">line 172</a>
</li></ul></dd>
@@ -6146,7 +6785,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line592">line 592</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line618">line 618</a>
</li></ul></dd>
@@ -6324,7 +6963,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line534">line 534</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line560">line 560</a>
</li></ul></dd>
@@ -6479,7 +7118,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line586">line 586</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line612">line 612</a>
</li></ul></dd>
@@ -6634,7 +7273,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line598">line 598</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line638">line 638</a>
</li></ul></dd>
@@ -6789,7 +7428,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line604">line 604</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line644">line 644</a>
</li></ul></dd>
@@ -6897,7 +7536,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line748">line 748</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line795">line 795</a>
</li></ul></dd>
@@ -6981,7 +7620,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line370">line 370</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line387">line 387</a>
</li></ul></dd>
@@ -7075,7 +7714,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line815">line 815</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line862">line 862</a>
</li></ul></dd>
@@ -7181,7 +7820,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line807">line 807</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line854">line 854</a>
</li></ul></dd>
@@ -7287,7 +7926,158 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line111">line 111</a>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line115">line 115</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">boolean</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="isLabelTruthy"><span class="type-signature"></span>isLabelTruthy<span class="signature">(name)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <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>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">label name</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_fnote.js.html">entities/fnote.js</a>, <a href="entities_fnote.js.html#line624">line 624</a>
</li></ul></dd>
@@ -7315,6 +8105,10 @@
<h5>Returns:</h5>
+<div class="param-desc">
+ true if label exists (including inherited) and does not have "false" value.
+</div>
+
<dl>
@@ -7357,7 +8151,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/FNoteComplement.html b/docs/frontend_api/FNoteComplement.html
index 8c1bb3d940..1cac29fba6 100644
--- a/docs/frontend_api/FNoteComplement.html
+++ b/docs/frontend_api/FNoteComplement.html
@@ -781,7 +781,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html
index e866a8473e..5e94a32c20 100644
--- a/docs/frontend_api/FrontendScriptApi.html
+++ b/docs/frontend_api/FrontendScriptApi.html
@@ -342,115 +342,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line69">line 69</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-<h4 class="name" id="CollapsibleWidget"><span class="type-signature"></span>CollapsibleWidget<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">RightPanelWidget</span>
-
-
-
- </td>
-
-
-
-
-
- <td class="description last"></td>
- </tr>
-
-
- </tbody>
-</table>
-
-
-
-
-<dl class="details">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>use api.RightPanelWidget 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#line42">line 42</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line45">line 45</a>
</li></ul></dd>
@@ -556,115 +448,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line48">line 48</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-<h4 class="name" id="NoteContextCachingWidget"><span class="type-signature"></span>NoteContextCachingWidget<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">NoteContextAwareWidget</span>
-
-
-
- </td>
-
-
-
-
-
- <td class="description last"></td>
- </tr>
-
-
- </tbody>
-</table>
-
-
-
-
-<dl class="details">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>use NoteContextAwareWidget 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#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#line42">line 42</a>
</li></ul></dd>
@@ -770,223 +554,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line45">line 45</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-<h4 class="name" id="TabAwareWidget"><span class="type-signature"></span>TabAwareWidget<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">NoteContextAwareWidget</span>
-
-
-
- </td>
-
-
-
-
-
- <td class="description last"></td>
- </tr>
-
-
- </tbody>
-</table>
-
-
-
-
-<dl class="details">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>use NoteContextAwareWidget 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#line54">line 54</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-<h4 class="name" id="TabCachingWidget"><span class="type-signature"></span>TabCachingWidget<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">NoteContextAwareWidget</span>
-
-
-
- </td>
-
-
-
-
-
- <td class="description last"></td>
- </tr>
-
-
- </tbody>
-</table>
-
-
-
-
-<dl class="details">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>use NoteContextAwareWidget 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#line60">line 60</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line39">line 39</a>
</li></ul></dd>
@@ -1558,7 +1126,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line88">line 88</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>
@@ -1713,7 +1281,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line78">line 78</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line54">line 54</a>
</li></ul></dd>
@@ -2054,7 +1622,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line148">line 148</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line124">line 124</a>
</li></ul></dd>
@@ -2191,7 +1759,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line337">line 337</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line313">line 313</a>
</li></ul></dd>
@@ -2399,7 +1967,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line479">line 479</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line455">line 455</a>
</li></ul></dd>
@@ -2781,7 +2349,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line329">line 329</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>
@@ -2914,7 +2482,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line275">line 275</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line251">line 251</a>
</li></ul></dd>
@@ -3024,7 +2592,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line359">line 359</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line335">line 335</a>
</li></ul></dd>
@@ -3130,7 +2698,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line343">line 343</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line319">line 319</a>
</li></ul></dd>
@@ -3236,7 +2804,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line374">line 374</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>
@@ -3346,7 +2914,7 @@ available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.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#line351">line 351</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line327">line 327</a>
</li></ul></dd>
@@ -3457,7 +3025,7 @@ implementation of actual widget type.
<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#line368">line 368</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line344">line 344</a>
</li></ul></dd>
@@ -3612,7 +3180,7 @@ implementation of actual widget type.
<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#line383">line 383</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>
@@ -3767,7 +3335,7 @@ implementation of actual widget type.
<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#line427">line 427</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line403">line 403</a>
</li></ul></dd>
@@ -3874,7 +3442,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#line268">line 268</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line244">line 244</a>
</li></ul></dd>
@@ -4029,7 +3597,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#line445">line 445</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line421">line 421</a>
</li></ul></dd>
@@ -4185,7 +3753,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#line238">line 238</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line214">line 214</a>
</li></ul></dd>
@@ -4386,7 +3954,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#line251">line 251</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line227">line 227</a>
</li></ul></dd>
@@ -4492,7 +4060,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#line418">line 418</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line394">line 394</a>
</li></ul></dd>
@@ -4647,7 +4215,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#line436">line 436</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line412">line 412</a>
</li></ul></dd>
@@ -4802,7 +4370,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#line454">line 454</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line430">line 430</a>
</li></ul></dd>
@@ -4952,7 +4520,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#line519">line 519</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line495">line 495</a>
</li></ul></dd>
@@ -5130,7 +4698,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#line121">line 121</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line97">line 97</a>
</li></ul></dd>
@@ -5308,7 +4876,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#line103">line 103</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line79">line 79</a>
</li></ul></dd>
@@ -5459,7 +5027,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#line282">line 282</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line258">line 258</a>
</li></ul></dd>
@@ -5637,7 +5205,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#line398">line 398</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line374">line 374</a>
</li></ul></dd>
@@ -5811,7 +5379,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#line408">line 408</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>
@@ -5966,7 +5534,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#line508">line 508</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line484">line 484</a>
</li></ul></dd>
@@ -6120,7 +5688,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#line499">line 499</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line475">line 475</a>
</li></ul></dd>
@@ -6275,7 +5843,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#line259">line 259</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line235">line 235</a>
</li></ul></dd>
@@ -6436,7 +6004,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#line181">line 181</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line157">line 157</a>
</li></ul></dd>
@@ -6596,7 +6164,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#line225">line 225</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line201">line 201</a>
</li></ul></dd>
@@ -6752,7 +6320,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#line213">line 213</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line189">line 189</a>
</li></ul></dd>
@@ -6907,7 +6475,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#line463">line 463</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line439">line 439</a>
</li></ul></dd>
@@ -7058,7 +6626,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#line390">line 390</a>
+ <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>
</li></ul></dd>
@@ -7213,7 +6781,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#line298">line 298</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line274">line 274</a>
</li></ul></dd>
@@ -7350,7 +6918,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#line290">line 290</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line266">line 266</a>
</li></ul></dd>
@@ -7510,7 +7078,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#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#line283">line 283</a>
</li></ul></dd>
@@ -7670,7 +7238,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#line316">line 316</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line292">line 292</a>
</li></ul></dd>
@@ -7762,7 +7330,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#line491">line 491</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line467">line 467</a>
</li></ul></dd>
@@ -7832,7 +7400,7 @@ Typical use case is when new note has been created, we should wait until it is s
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/entities_fattribute.js.html b/docs/frontend_api/entities_fattribute.js.html
index dffe972bcd..a9cb49a5f4 100644
--- a/docs/frontend_api/entities_fattribute.js.html
+++ b/docs/frontend_api/entities_fattribute.js.html
@@ -121,7 +121,7 @@ export default FAttribute;
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/entities_fbranch.js.html b/docs/frontend_api/entities_fbranch.js.html
index 2b7ced98da..deae06846d 100644
--- a/docs/frontend_api/entities_fbranch.js.html
+++ b/docs/frontend_api/entities_fbranch.js.html
@@ -105,7 +105,7 @@ export default FBranch;
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/entities_fnote.js.html b/docs/frontend_api/entities_fnote.js.html
index a31f615a28..84616e2cbf 100644
--- a/docs/frontend_api/entities_fnote.js.html
+++ b/docs/frontend_api/entities_fnote.js.html
@@ -101,7 +101,7 @@ class FNote {
this.mime = row.mime;
}
- addParent(parentNoteId, branchId) {
+ addParent(parentNoteId, branchId, sort = true) {
if (parentNoteId === 'none') {
return;
}
@@ -111,6 +111,10 @@ class FNote {
}
this.parentToBranch[parentNoteId] = branchId;
+
+ if (sort) {
+ this.sortParents();
+ }
}
addChild(childNoteId, branchId, sort = true) {
@@ -217,7 +221,7 @@ class FNote {
// will sort the parents so that non-search &amp; non-archived are first and archived at the end
// this is done so that non-search &amp; non-archived paths are always explored as first when looking for note path
- resortParents() {
+ sortParents() {
this.parents.sort((aNoteId, bNoteId) => {
const aBranchId = this.parentToBranch[aNoteId];
@@ -225,7 +229,7 @@ class FNote {
return 1;
}
- const aNote = this.froca.getNoteFromCache([aNoteId]);
+ const aNote = this.froca.getNoteFromCache(aNoteId);
if (aNote.isArchived || aNote.isHiddenCompletely()) {
return 1;
@@ -271,6 +275,11 @@ class FNote {
return this.__filterAttrs(this.__getCachedAttributes([]), type, name);
}
+ /**
+ * @param {string[]} path
+ * @return {FAttribute[]}
+ * @private
+ */
__getCachedAttributes(path) {
// notes/clones cannot form tree cycles, it is possible to create attribute inheritance cycle via templates
// when template instance is a parent of template itself
@@ -323,63 +332,49 @@ class FNote {
return this.noteId === 'root';
}
- getAllNotePaths(encounteredNoteIds = null) {
+ /**
+ * Gives all possible note paths leading to this note. Paths containing search note are ignored (could form cycles)
+ *
+ * @returns {string[][]} - array of notePaths (each represented by array of noteIds constituting the particular note path)
+ */
+ getAllNotePaths() {
if (this.noteId === 'root') {
return [['root']];
}
- if (!encounteredNoteIds) {
- encounteredNoteIds = new Set();
- }
-
- encounteredNoteIds.add(this.noteId);
-
- const parentNotes = this.getParentNotes();
- let paths;
+ const parentNotes = this.getParentNotes().filter(note => note.type !== 'search');
+ let notePaths = [];
- if (parentNotes.length === 1) { // optimization for the most common case
- if (encounteredNoteIds.has(parentNotes[0].noteId)) {
- return [];
- }
- else {
- paths = parentNotes[0].getAllNotePaths(encounteredNoteIds);
- }
- }
- else {
- paths = [];
-
- for (const parentNote of parentNotes) {
- if (encounteredNoteIds.has(parentNote.noteId)) {
- continue;
- }
-
- const newSet = new Set(encounteredNoteIds);
-
- paths.push(...parentNote.getAllNotePaths(newSet));
- }
+ if (parentNotes.length === 1) { // optimization for most common case
+ notePaths = parentNotes[0].getAllNotePaths();
+ } else {
+ notePaths = parentNotes.flatMap(parentNote => parentNote.getAllNotePaths());
}
- for (const path of paths) {
- path.push(this.noteId);
+ for (const notePath of notePaths) {
+ notePath.push(this.noteId);
}
- return paths;
+ return notePaths;
}
- getSortedNotePaths(hoistedNotePath = 'root') {
+ /**
+ * @param {string} [hoistedNoteId='root']
+ * @return {Array&lt;{isArchived: boolean, isInHoistedSubTree: boolean, notePath: Array&lt;string>, isHidden: boolean}>}
+ */
+ getSortedNotePathRecords(hoistedNoteId = 'root') {
+ const isHoistedRoot = hoistedNoteId === 'root';
+
const notePaths = this.getAllNotePaths().map(path => ({
notePath: path,
- isInHoistedSubTree: path.includes(hoistedNotePath),
- isArchived: path.find(noteId => froca.notes[noteId].isArchived),
- isSearch: path.find(noteId => froca.notes[noteId].type === 'search'),
+ isInHoistedSubTree: isHoistedRoot || path.includes(hoistedNoteId),
+ isArchived: path.some(noteId => froca.notes[noteId].isArchived),
isHidden: path.includes('_hidden')
}));
notePaths.sort((a, b) => {
if (a.isInHoistedSubTree !== b.isInHoistedSubTree) {
return a.isInHoistedSubTree ? -1 : 1;
- } else if (a.isSearch !== b.isSearch) {
- return a.isSearch ? 1 : -1;
} else if (a.isArchived !== b.isArchived) {
return a.isArchived ? 1 : -1;
} else if (a.isHidden !== b.isHidden) {
@@ -392,6 +387,28 @@ class FNote {
return notePaths;
}
+ /**
+ * Returns note path considered to be the "best"
+ *
+ * @param {string} [hoistedNoteId='root']
+ * @return {string[]} array of noteIds constituting the particular note path
+ */
+ getBestNotePath(hoistedNoteId = 'root') {
+ return this.getSortedNotePathRecords(hoistedNoteId)[0]?.notePath;
+ }
+
+ /**
+ * Returns note path considered to be the "best"
+ *
+ * @param {string} [hoistedNoteId='root']
+ * @return {string} serialized note path (e.g. 'root/a1h315/js725h')
+ */
+ getBestNotePathString(hoistedNoteId = 'root') {
+ const notePath = this.getBestNotePath(hoistedNoteId);
+
+ return notePath?.join("/");
+ }
+
/**
* @return boolean - true if there's no non-hidden path, note is not cloned to the visible tree
*/
@@ -403,7 +420,7 @@ class FNote {
for (const parentNote of this.getParentNotes()) {
if (parentNote.noteId === 'root') {
return false;
- } else if (parentNote.noteId === '_hidden') {
+ } else if (parentNote.noteId === '_hidden' || parentNote.type === 'search') {
continue;
}
@@ -415,6 +432,13 @@ class FNote {
return true;
}
+ /**
+ * @param {FAttribute[]} attributes
+ * @param {string} type
+ * @param {string} name
+ * @return {FAttribute[]}
+ * @private
+ */
__filterAttrs(attributes, type, name) {
this.__validateTypeName(type, name);
@@ -551,7 +575,9 @@ class FNote {
* @returns {boolean} true if note has an attribute with given type and name (including inherited)
*/
hasAttribute(type, name) {
- return !!this.getAttribute(type, name);
+ const attributes = this.getAttributes();
+
+ return attributes.some(attr => attr.name === name &amp;&amp; attr.type === type);
}
/**
@@ -619,6 +645,20 @@ class FNote {
*/
hasLabel(name) { return this.hasAttribute(LABEL, name); }
+ /**
+ * @param {string} name - label name
+ * @returns {boolean} true if label exists (including inherited) and does not have "false" value.
+ */
+ isLabelTruthy(name) {
+ const label = this.getLabel(name);
+
+ if (!label) {
+ return false;
+ }
+
+ return label &amp;&amp; label.value !== 'false';
+ }
+
/**
* @param {string} name - relation name
* @returns {boolean} true if relation exists (excluding inherited)
@@ -730,7 +770,14 @@ class FNote {
});
// attrs are not resorted if position changes after initial load
- promotedAttrs.sort((a, b) => a.position &lt; b.position ? -1 : 1);
+ promotedAttrs.sort((a, b) => {
+ if (a.noteId === b.noteId) {
+ return a.position &lt; b.position ? -1 : 1;
+ } else {
+ // inherited promoted attributes should stay grouped: https://github.com/zadam/trilium/issues/3761
+ return a.noteId &lt; b.noteId ? -1 : 1;
+ }
+ });
return promotedAttrs;
}
@@ -930,7 +977,7 @@ export default FNote;
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/entities_fnote_complement.js.html b/docs/frontend_api/entities_fnote_complement.js.html
index 6ea35e95aa..252ea6a2fb 100644
--- a/docs/frontend_api/entities_fnote_complement.js.html
+++ b/docs/frontend_api/entities_fnote_complement.js.html
@@ -82,7 +82,7 @@ export default FNoteComplement;
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/index.html b/docs/frontend_api/index.html
index 08a8eb1598..6465f193ac 100644
--- a/docs/frontend_api/index.html
+++ b/docs/frontend_api/index.html
@@ -56,7 +56,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html
index a326810c3e..679f2e5eb1 100644
--- a/docs/frontend_api/services_frontend_script_api.js.html
+++ b/docs/frontend_api/services_frontend_script_api.js.html
@@ -63,36 +63,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
/** @property {dayjs} day.js library for date manipulation. See {@link https://day.js.org} for documentation */
this.dayjs = dayjs;
- /**
- * @property {RightPanelWidget}
- * @deprecated use api.RightPanelWidget instead
- */
- this.CollapsibleWidget = RightPanelWidget;
-
/** @property {RightPanelWidget} */
this.RightPanelWidget = RightPanelWidget;
/** @property {NoteContextAwareWidget} */
this.NoteContextAwareWidget = NoteContextAwareWidget;
- /**
- * @property {NoteContextAwareWidget}
- * @deprecated use NoteContextAwareWidget instead
- */
- this.TabAwareWidget = NoteContextAwareWidget;
-
- /**
- * @property {NoteContextAwareWidget}
- * @deprecated use NoteContextAwareWidget instead
- */
- this.TabCachingWidget = NoteContextAwareWidget;
-
- /**
- * @property {NoteContextAwareWidget}
- * @deprecated use NoteContextAwareWidget instead
- */
- this.NoteContextCachingWidget = NoteContextAwareWidget;
-
/** @property {BasicWidget} */
this.BasicWidget = BasicWidget;
@@ -117,7 +93,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
await ws.waitForMaxKnownEntityChangeId();
await appContext.tabManager.getActiveContext().setNote(notePath);
- appContext.triggerEvent('focusAndSelectTitle');
+ await appContext.triggerEvent('focusAndSelectTitle');
};
/**
@@ -134,7 +110,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
await appContext.tabManager.openContextWithNote(notePath, { activate });
if (activate) {
- appContext.triggerEvent('focusAndSelectTitle');
+ await appContext.triggerEvent('focusAndSelectTitle');
}
};
@@ -152,10 +128,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
const subContexts = appContext.tabManager.getActiveContext().getSubContexts();
const {ntxId} = subContexts[subContexts.length - 1];
- appContext.triggerCommand("openNewNoteSplit", {ntxId, notePath});
+ await appContext.triggerCommand("openNewNoteSplit", {ntxId, notePath});
if (activate) {
- appContext.triggerEvent('focusAndSelectTitle');
+ await appContext.triggerEvent('focusAndSelectTitle');
}
};
@@ -581,7 +557,7 @@ export default FrontendScriptApi;
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
</footer>
<script> prettyPrint(); </script>