Merge remote-tracking branch 'upstream/master' into excalidraw

conflict in
- package-lock (accept incoming),
- routes (remove the option to have image without filename, since it is not really necessary for canvas_note)
- note_detail
This commit is contained in:
Tom 2022-05-03 21:56:52 +02:00
commit 8d510a3fdd
38 changed files with 867 additions and 283 deletions

Binary file not shown.

View File

@ -158,6 +158,8 @@
<div class="description">
Mark the entity as (soft) deleted. It will be completely erased later.
This is a low level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
</div>
@ -265,7 +267,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line116">line 116</a>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line118">line 118</a>
</li></ul></dd>

View File

@ -1030,6 +1030,8 @@ and relation (representing named relationship between source and target note)</d
<div class="description">
Mark the entity as (soft) deleted. It will be completely erased later.
This is a low level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
</div>
@ -1142,7 +1144,7 @@ and relation (representing named relationship between source and target note)</d
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line116">line 116</a>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line118">line 118</a>
</li></ul></dd>

View File

@ -94,7 +94,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line14">line 14</a>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line18">line 18</a>
</li></ul></dd>
@ -205,7 +205,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line45">line 45</a>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line49">line 49</a>
</li></ul></dd>
@ -263,7 +263,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line90">line 90</a>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line94">line 94</a>
</li></ul></dd>
@ -331,7 +331,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line55">line 55</a>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line59">line 59</a>
</li></ul></dd>
@ -399,7 +399,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line47">line 47</a>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line51">line 51</a>
</li></ul></dd>
@ -467,7 +467,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line53">line 53</a>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line57">line 57</a>
</li></ul></dd>
@ -525,7 +525,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line104">line 104</a>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line108">line 108</a>
</li></ul></dd>
@ -593,7 +593,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line49">line 49</a>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line53">line 53</a>
</li></ul></dd>
@ -661,7 +661,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line51">line 51</a>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line55">line 55</a>
</li></ul></dd>
@ -729,7 +729,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line57">line 57</a>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line61">line 61</a>
</li></ul></dd>
@ -757,6 +757,210 @@ parents.</div>
<h4 class="name" id="deleteBranch"><span class="type-signature"></span>deleteBranch<span class="signature">(deleteId<span class="signature-attributes">opt</span>, taskContext<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
Delete a branch. If this is a last note's branch, delete the note as well.
</div>
<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>deleteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">optional delete identified</td>
</tr>
<tr>
<td class="name"><code>taskContext</code></td>
<td class="type">
<span class="param-type">TaskContext</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line129">line 129</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- true if note has been deleted, false otherwise
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="markAsDeleted"><span class="type-signature"></span>markAsDeleted<span class="signature">(deleteId<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@ -766,6 +970,8 @@ parents.</div>
<div class="description">
Mark the entity as (soft) deleted. It will be completely erased later.
This is a low level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
</div>
@ -878,7 +1084,7 @@ parents.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line116">line 116</a>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line118">line 118</a>
</li></ul></dd>

View File

@ -587,6 +587,8 @@ from tokenHash and token.</div>
<div class="description">
Mark the entity as (soft) deleted. It will be completely erased later.
This is a low level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
</div>
@ -699,7 +701,7 @@ from tokenHash and token.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line116">line 116</a>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line118">line 118</a>
</li></ul></dd>

View File

@ -93,7 +93,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line20">line 20</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line21">line 21</a>
</li></ul></dd>
@ -204,7 +204,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line91">line 91</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line92">line 92</a>
</li></ul></dd>
@ -279,7 +279,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line117">line 117</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line118">line 118</a>
</li></ul></dd>
@ -347,7 +347,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line64">line 64</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line65">line 65</a>
</li></ul></dd>
@ -415,7 +415,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line66">line 66</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line67">line 67</a>
</li></ul></dd>
@ -486,7 +486,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line80">line 80</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line81">line 81</a>
</li></ul></dd>
@ -554,7 +554,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line75">line 75</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line76">line 76</a>
</li></ul></dd>
@ -622,7 +622,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line58">line 58</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line59">line 59</a>
</li></ul></dd>
@ -690,7 +690,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line62">line 62</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line63">line 63</a>
</li></ul></dd>
@ -758,7 +758,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line54">line 54</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line55">line 55</a>
</li></ul></dd>
@ -833,7 +833,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line122">line 122</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line123">line 123</a>
</li></ul></dd>
@ -901,7 +901,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line93">line 93</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line94">line 94</a>
</li></ul></dd>
@ -969,7 +969,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line87">line 87</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line88">line 88</a>
</li></ul></dd>
@ -1037,7 +1037,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line89">line 89</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line90">line 90</a>
</li></ul></dd>
@ -1112,7 +1112,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line127">line 127</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line128">line 128</a>
</li></ul></dd>
@ -1180,7 +1180,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line103">line 103</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line104">line 104</a>
</li></ul></dd>
@ -1248,7 +1248,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line56">line 56</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line57">line 57</a>
</li></ul></dd>
@ -1316,7 +1316,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line60">line 60</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line61">line 61</a>
</li></ul></dd>
@ -1384,7 +1384,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line68">line 68</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line69">line 69</a>
</li></ul></dd>
@ -1452,7 +1452,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line70">line 70</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line71">line 71</a>
</li></ul></dd>
@ -1528,7 +1528,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line404">line 404</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line405">line 405</a>
</li></ul></dd>
@ -1630,7 +1630,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1022">line 1022</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1023">line 1023</a>
</li></ul></dd>
@ -1678,6 +1678,188 @@
<h4 class="name" id="deleteNote"><span class="type-signature"></span>deleteNote<span class="signature">(deleteId<span class="signature-attributes">opt</span>, taskContext<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
(Soft) delete a note and all its descendants.
</div>
<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>deleteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">optional delete identified</td>
</tr>
<tr>
<td class="name"><code>taskContext</code></td>
<td class="type">
<span class="param-type">TaskContext</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1135">line 1135</a>
</li></ul></dd>
</dl>
@ -1732,7 +1914,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line944">line 944</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line945">line 945</a>
</li></ul></dd>
@ -1838,7 +2020,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line864">line 864</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line865">line 865</a>
</li></ul></dd>
@ -2012,7 +2194,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line522">line 522</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line523">line 523</a>
</li></ul></dd>
@ -2212,7 +2394,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line335">line 335</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line336">line 336</a>
</li></ul></dd>
@ -2390,7 +2572,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line533">line 533</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line534">line 534</a>
</li></ul></dd>
@ -2501,7 +2683,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line149">line 149</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line150">line 150</a>
</li></ul></dd>
@ -2603,7 +2785,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line169">line 169</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line170">line 170</a>
</li></ul></dd>
@ -2705,7 +2887,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line159">line 159</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line160">line 160</a>
</li></ul></dd>
@ -2807,7 +2989,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line183">line 183</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line184">line 184</a>
</li></ul></dd>
@ -2909,7 +3091,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line217">line 217</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line218">line 218</a>
</li></ul></dd>
@ -3017,7 +3199,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line659">line 659</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line660">line 660</a>
</li></ul></dd>
@ -3123,7 +3305,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line228">line 228</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line229">line 229</a>
</li></ul></dd>
@ -3274,7 +3456,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line464">line 464</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line465">line 465</a>
</li></ul></dd>
@ -3444,7 +3626,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line554">line 554</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line555">line 555</a>
</li></ul></dd>
@ -3599,7 +3781,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line488">line 488</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line489">line 489</a>
</li></ul></dd>
@ -3769,7 +3951,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line562">line 562</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line563">line 563</a>
</li></ul></dd>
@ -3875,7 +4057,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line628">line 628</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line629">line 629</a>
</li></ul></dd>
@ -4077,7 +4259,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line603">line 603</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line604">line 604</a>
</li></ul></dd>
@ -4255,7 +4437,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line544">line 544</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line545">line 545</a>
</li></ul></dd>
@ -4413,7 +4595,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line470">line 470</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line471">line 471</a>
</li></ul></dd>
@ -4583,7 +4765,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line570">line 570</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line571">line 571</a>
</li></ul></dd>
@ -4738,7 +4920,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line494">line 494</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line495">line 495</a>
</li></ul></dd>
@ -4908,7 +5090,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line578">line 578</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line579">line 579</a>
</li></ul></dd>
@ -5063,7 +5245,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line482">line 482</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line483">line 483</a>
</li></ul></dd>
@ -5233,7 +5415,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line594">line 594</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line595">line 595</a>
</li></ul></dd>
@ -5388,7 +5570,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line506">line 506</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line507">line 507</a>
</li></ul></dd>
@ -5497,7 +5679,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line141">line 141</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line142">line 142</a>
</li></ul></dd>
@ -5599,7 +5781,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line154">line 154</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line155">line 155</a>
</li></ul></dd>
@ -5750,7 +5932,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line476">line 476</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line477">line 477</a>
</li></ul></dd>
@ -5920,7 +6102,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line586">line 586</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line587">line 587</a>
</li></ul></dd>
@ -6075,7 +6257,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line500">line 500</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line501">line 501</a>
</li></ul></dd>
@ -6184,7 +6366,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line314">line 314</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line315">line 315</a>
</li></ul></dd>
@ -6293,7 +6475,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line807">line 807</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line808">line 808</a>
</li></ul></dd>
@ -6395,7 +6577,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line786">line 786</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line787">line 787</a>
</li></ul></dd>
@ -6497,7 +6679,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line755">line 755</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line756">line 756</a>
</li></ul></dd>
@ -6599,7 +6781,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line906">line 906</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line907">line 907</a>
</li></ul></dd>
@ -6706,7 +6888,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line890">line 890</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line891">line 891</a>
</li></ul></dd>
@ -6808,7 +6990,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line164">line 164</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line165">line 165</a>
</li></ul></dd>
@ -6959,7 +7141,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line440">line 440</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line441">line 441</a>
</li></ul></dd>
@ -7137,7 +7319,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line513">line 513</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line514">line 514</a>
</li></ul></dd>
@ -7292,7 +7474,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line446">line 446</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line447">line 447</a>
</li></ul></dd>
@ -7447,7 +7629,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line458">line 458</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line459">line 459</a>
</li></ul></dd>
@ -7602,7 +7784,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line452">line 452</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line453">line 453</a>
</li></ul></dd>
@ -7752,7 +7934,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line965">line 965</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line966">line 966</a>
</li></ul></dd>
@ -7858,7 +8040,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line303">line 303</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line304">line 304</a>
</li></ul></dd>
@ -7964,7 +8146,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line295">line 295</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line296">line 296</a>
</li></ul></dd>
@ -8070,7 +8252,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line290">line 290</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line291">line 291</a>
</li></ul></dd>
@ -8176,7 +8358,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line285">line 285</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line286">line 286</a>
</li></ul></dd>
@ -8282,7 +8464,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line309">line 309</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line310">line 310</a>
</li></ul></dd>
@ -8349,6 +8531,8 @@ This method can be significantly faster than the getAttribute()
<div class="description">
Mark the entity as (soft) deleted. It will be completely erased later.
This is a low level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
</div>
@ -8461,7 +8645,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line116">line 116</a>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line118">line 118</a>
</li></ul></dd>
@ -8672,7 +8856,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1009">line 1009</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1010">line 1010</a>
</li></ul></dd>
@ -8852,7 +9036,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1100">line 1100</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1101">line 1101</a>
</li></ul></dd>
@ -9032,7 +9216,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1108">line 1108</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1109">line 1109</a>
</li></ul></dd>
@ -9354,7 +9538,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line978">line 978</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line979">line 979</a>
</li></ul></dd>
@ -9534,7 +9718,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1084">line 1084</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1085">line 1085</a>
</li></ul></dd>
@ -9694,7 +9878,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1092">line 1092</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1093">line 1093</a>
</li></ul></dd>
@ -9936,7 +10120,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1051">line 1051</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1052">line 1052</a>
</li></ul></dd>
@ -10147,7 +10331,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1067">line 1067</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1068">line 1068</a>
</li></ul></dd>
@ -10358,7 +10542,7 @@ This method can be significantly faster than the getAttribute()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1076">line 1076</a>
<a href="becca_entities_note.js.html">becca/entities/note.js</a>, <a href="becca_entities_note.js.html#line1077">line 1077</a>
</li></ul></dd>

View File

@ -1300,6 +1300,8 @@ It's used for seamless note versioning.</div>
<div class="description">
Mark the entity as (soft) deleted. It will be completely erased later.
This is a low level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
</div>
@ -1412,7 +1414,7 @@ It's used for seamless note versioning.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line116">line 116</a>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line118">line 118</a>
</li></ul></dd>

View File

@ -445,6 +445,8 @@
<div class="description">
Mark the entity as (soft) deleted. It will be completely erased later.
This is a low level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
</div>
@ -557,7 +559,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line116">line 116</a>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line118">line 118</a>
</li></ul></dd>

View File

@ -377,6 +377,8 @@
<div class="description">
Mark the entity as (soft) deleted. It will be completely erased later.
This is a low level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
</div>
@ -489,7 +491,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line116">line 116</a>
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line118">line 118</a>
</li></ul></dd>

View File

@ -139,6 +139,8 @@ class AbstractEntity {
/**
* Mark the entity as (soft) deleted. It will be completely erased later.
*
* This is a low level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
*
* @param [deleteId=null]
*/
markAsDeleted(deleteId = null) {

View File

@ -32,6 +32,10 @@ const Note = require('./note');
const AbstractEntity = require("./abstract_entity");
const sql = require("../../services/sql");
const dateUtils = require("../../services/date_utils");
const utils = require("../../services/utils.js");
const TaskContext = require("../../services/task_context.js");
const cls = require("../../services/cls.js");
const log = require("../../services/log.js");
/**
* Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
@ -142,6 +146,63 @@ class Branch extends AbstractEntity {
return !(this.branchId in this.becca.branches);
}
/**
* Delete a branch. If this is a last note's branch, delete the note as well.
*
* @param {string} [deleteId] - optional delete identified
* @param {TaskContext} [taskContext]
*
* @return {boolean} - true if note has been deleted, false otherwise
*/
deleteBranch(deleteId, taskContext) {
if (!deleteId) {
deleteId = utils.randomString(10);
}
if (!taskContext) {
taskContext = new TaskContext('no-progress-reporting');
}
taskContext.increaseProgressCount();
if (this.branchId === 'root'
|| this.noteId === 'root'
|| this.noteId === cls.getHoistedNoteId()) {
throw new Error("Can't delete root or hoisted branch/note");
}
this.markAsDeleted(deleteId);
const note = this.getNote();
const notDeletedBranches = note.getParentBranches();
if (notDeletedBranches.length === 0) {
for (const childBranch of note.getChildBranches()) {
childBranch.deleteBranch(deleteId, taskContext);
}
// first delete children and then parent - this will show up better in recent changes
log.info("Deleting note " + note.noteId);
for (const attribute of note.getOwnedAttributes()) {
attribute.markAsDeleted(deleteId);
}
for (const relation of note.getTargetRelations()) {
relation.markAsDeleted(deleteId);
}
note.markAsDeleted(deleteId);
return true;
}
else {
return false;
}
}
beforeSaving() {
if (this.notePosition === undefined || this.notePosition === null) {
// TODO finding new position can be refactored into becca

View File

@ -36,6 +36,7 @@ const dateUtils = require('../../services/date_utils');
const entityChangesService = require('../../services/entity_changes');
const AbstractEntity = require("./abstract_entity");
const NoteRevision = require("./note_revision");
const TaskContext = require("../../services/task_context.js");
const LABEL = 'label';
const RELATION = 'relation';
@ -1153,6 +1154,26 @@ class Note extends AbstractEntity {
return cloningService.cloneNoteToBranch(this.noteId, branch.branchId);
}
/**
* (Soft) delete a note and all its descendants.
*
* @param {string} [deleteId] - optional delete identified
* @param {TaskContext} [taskContext]
*/
deleteNote(deleteId, taskContext) {
if (!deleteId) {
deleteId = utils.randomString(10);
}
if (!taskContext) {
taskContext = new TaskContext('no-progress-reporting');
}
for (const branch of this.getParentBranches()) {
branch.deleteBranch(deleteId, taskContext);
}
}
decrypt() {
if (this.isProtected &amp;&amp; !this.isDecrypted &amp;&amp; protectedSessionService.isProtectedSessionAvailable()) {
try {

91
package-lock.json generated
View File

@ -30,7 +30,7 @@
"express-partial-content": "1.0.2",
"express-rate-limit": "6.3.0",
"express-session": "1.17.2",
"fs-extra": "10.0.1",
"fs-extra": "10.1.0",
"helmet": "5.0.2",
"html": "1.0.0",
"html2plaintext": "2.1.4",
@ -45,7 +45,7 @@
"jsdom": "19.0.0",
"mime-types": "2.1.35",
"multer": "1.4.4",
"node-abi": "3.8.0",
"node-abi": "3.15.0",
"normalize-strings": "1.1.1",
"open": "8.4.0",
"portscanner": "2.2.0",
@ -75,7 +75,7 @@
"cross-env": "7.0.3",
"electron": "16.2.1",
"electron-builder": "23.0.3",
"electron-packager": "15.4.0",
"electron-packager": "15.5.0",
"electron-rebuild": "3.2.7",
"esm": "3.2.25",
"jasmine": "4.1.0",
@ -4211,12 +4211,13 @@
}
},
"node_modules/electron-packager": {
"version": "15.4.0",
"resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-15.4.0.tgz",
"integrity": "sha512-JrrLcBP15KGrPj0cZ/ALKGmaQ4gJkn3mocf0E3bRKdR3kxKWYcDRpCvdhksYDXw/r3I6tMEcZ7XzyApWFXdVpw==",
"version": "15.5.0",
"resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-15.5.0.tgz",
"integrity": "sha512-8mITLQgTm9xdrO8XL/PsK0EZGU7zK/ay7TI8M1C9pc1UZ++HlaWQJBRJHlOXf4TL/7FsiF4OciEhiqhMn+LKQQ==",
"dev": true,
"dependencies": {
"@electron/get": "^1.6.0",
"@electron/universal": "^1.2.1",
"asar": "^3.1.0",
"cross-spawn-windows-exe": "^1.2.0",
"debug": "^4.0.1",
@ -4245,25 +4246,22 @@
"url": "https://github.com/electron/electron-packager?sponsor=1"
}
},
"node_modules/electron-packager/node_modules/asar": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/asar/-/asar-3.1.0.tgz",
"integrity": "sha512-vyxPxP5arcAqN4F/ebHd/HhwnAiZtwhglvdmc7BR2f0ywbVNTOpSeyhLDbGXtE/y58hv1oC75TaNIXutnsOZsQ==",
"node_modules/electron-packager/node_modules/@electron/universal": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.2.1.tgz",
"integrity": "sha512-7323HyMh7KBAl/nPDppdLsC87G6RwRU02dy5FPeGB1eS7rUePh55+WNWiDPLhFQqqVPHzh77M69uhmoT8XnwMQ==",
"dev": true,
"dependencies": {
"chromium-pickle-js": "^0.2.0",
"commander": "^5.0.0",
"glob": "^7.1.6",
"minimatch": "^3.0.4"
},
"bin": {
"asar": "bin/asar.js"
"@malept/cross-spawn-promise": "^1.1.0",
"asar": "^3.1.0",
"debug": "^4.3.1",
"dir-compare": "^2.4.0",
"fs-extra": "^9.0.1",
"minimatch": "^3.0.4",
"plist": "^3.0.4"
},
"engines": {
"node": ">=10.12.0"
},
"optionalDependencies": {
"@types/glob": "^7.1.1"
"node": ">=8.6"
}
},
"node_modules/electron-packager/node_modules/cross-spawn-windows-exe": {
@ -5676,9 +5674,9 @@
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
},
"node_modules/fs-extra": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz",
"integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==",
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
@ -7785,9 +7783,9 @@
"dev": true
},
"node_modules/node-abi": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.8.0.tgz",
"integrity": "sha512-tzua9qWWi7iW4I42vUPKM+SfaF0vQSLAm4yO5J83mSwB7GeoWrDKC/K+8YCnYNwqP5duwazbw2X9l4m8SC2cUw==",
"version": "3.15.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.15.0.tgz",
"integrity": "sha512-Ic6z/j6I9RLm4ov7npo1I48UQr2BEyFCqh6p7S1dhEx9jPO0GPGq/e2Rb7x7DroQrmiVMz/Bw1vJm9sPAl2nxA==",
"dependencies": {
"semver": "^7.3.5"
},
@ -14795,12 +14793,13 @@
}
},
"electron-packager": {
"version": "15.4.0",
"resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-15.4.0.tgz",
"integrity": "sha512-JrrLcBP15KGrPj0cZ/ALKGmaQ4gJkn3mocf0E3bRKdR3kxKWYcDRpCvdhksYDXw/r3I6tMEcZ7XzyApWFXdVpw==",
"version": "15.5.0",
"resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-15.5.0.tgz",
"integrity": "sha512-8mITLQgTm9xdrO8XL/PsK0EZGU7zK/ay7TI8M1C9pc1UZ++HlaWQJBRJHlOXf4TL/7FsiF4OciEhiqhMn+LKQQ==",
"dev": true,
"requires": {
"@electron/get": "^1.6.0",
"@electron/universal": "^1.2.1",
"asar": "^3.1.0",
"cross-spawn-windows-exe": "^1.2.0",
"debug": "^4.0.1",
@ -14820,17 +14819,19 @@
"yargs-parser": "^20.0.0"
},
"dependencies": {
"asar": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/asar/-/asar-3.1.0.tgz",
"integrity": "sha512-vyxPxP5arcAqN4F/ebHd/HhwnAiZtwhglvdmc7BR2f0ywbVNTOpSeyhLDbGXtE/y58hv1oC75TaNIXutnsOZsQ==",
"@electron/universal": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.2.1.tgz",
"integrity": "sha512-7323HyMh7KBAl/nPDppdLsC87G6RwRU02dy5FPeGB1eS7rUePh55+WNWiDPLhFQqqVPHzh77M69uhmoT8XnwMQ==",
"dev": true,
"requires": {
"@types/glob": "^7.1.1",
"chromium-pickle-js": "^0.2.0",
"commander": "^5.0.0",
"glob": "^7.1.6",
"minimatch": "^3.0.4"
"@malept/cross-spawn-promise": "^1.1.0",
"asar": "^3.1.0",
"debug": "^4.3.1",
"dir-compare": "^2.4.0",
"fs-extra": "^9.0.1",
"minimatch": "^3.0.4",
"plist": "^3.0.4"
}
},
"cross-spawn-windows-exe": {
@ -15757,9 +15758,9 @@
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
},
"fs-extra": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz",
"integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==",
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"requires": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
@ -17411,9 +17412,9 @@
"dev": true
},
"node-abi": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.8.0.tgz",
"integrity": "sha512-tzua9qWWi7iW4I42vUPKM+SfaF0vQSLAm4yO5J83mSwB7GeoWrDKC/K+8YCnYNwqP5duwazbw2X9l4m8SC2cUw==",
"version": "3.15.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.15.0.tgz",
"integrity": "sha512-Ic6z/j6I9RLm4ov7npo1I48UQr2BEyFCqh6p7S1dhEx9jPO0GPGq/e2Rb7x7DroQrmiVMz/Bw1vJm9sPAl2nxA==",
"requires": {
"semver": "^7.3.5"
}

View File

@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.51.0-beta",
"version": "0.51.2",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {
@ -45,7 +45,7 @@
"express-partial-content": "1.0.2",
"express-rate-limit": "6.3.0",
"express-session": "1.17.2",
"fs-extra": "10.0.1",
"fs-extra": "10.1.0",
"helmet": "5.0.2",
"html": "1.0.0",
"html2plaintext": "2.1.4",
@ -60,7 +60,7 @@
"jsdom": "19.0.0",
"mime-types": "2.1.35",
"multer": "1.4.4",
"node-abi": "3.8.0",
"node-abi": "3.15.0",
"normalize-strings": "1.1.1",
"open": "8.4.0",
"portscanner": "2.2.0",
@ -87,7 +87,7 @@
"cross-env": "7.0.3",
"electron": "16.2.1",
"electron-builder": "23.0.3",
"electron-packager": "15.4.0",
"electron-packager": "15.5.0",
"electron-rebuild": "3.2.7",
"esm": "3.2.25",
"jasmine": "4.1.0",

View File

@ -67,7 +67,7 @@ function getNoteTitle(childNoteId, parentNoteId) {
const parentNote = becca.notes[parentNoteId];
if (!childNote) {
log.info(`Cannot find note in cache for noteId ${childNoteId}`);
log.info(`Cannot find note in cache for noteId '${childNoteId}'`);
return "[error fetching title]";
}
@ -162,7 +162,7 @@ function getNotePath(noteId) {
const note = becca.notes[noteId];
if (!note) {
console.trace(`Cannot find note ${noteId} in cache.`);
console.trace(`Cannot find note '${noteId}' in cache.`);
return;
}

View File

@ -111,6 +111,8 @@ class AbstractEntity {
/**
* Mark the entity as (soft) deleted. It will be completely erased later.
*
* This is a low level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
*
* @param [deleteId=null]
*/
markAsDeleted(deleteId = null) {

View File

@ -4,6 +4,10 @@ const Note = require('./note');
const AbstractEntity = require("./abstract_entity");
const sql = require("../../services/sql");
const dateUtils = require("../../services/date_utils");
const utils = require("../../services/utils.js");
const TaskContext = require("../../services/task_context.js");
const cls = require("../../services/cls.js");
const log = require("../../services/log.js");
/**
* Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
@ -114,6 +118,63 @@ class Branch extends AbstractEntity {
return !(this.branchId in this.becca.branches);
}
/**
* Delete a branch. If this is a last note's branch, delete the note as well.
*
* @param {string} [deleteId] - optional delete identified
* @param {TaskContext} [taskContext]
*
* @return {boolean} - true if note has been deleted, false otherwise
*/
deleteBranch(deleteId, taskContext) {
if (!deleteId) {
deleteId = utils.randomString(10);
}
if (!taskContext) {
taskContext = new TaskContext('no-progress-reporting');
}
taskContext.increaseProgressCount();
if (this.branchId === 'root'
|| this.noteId === 'root'
|| this.noteId === cls.getHoistedNoteId()) {
throw new Error("Can't delete root or hoisted branch/note");
}
this.markAsDeleted(deleteId);
const note = this.getNote();
const notDeletedBranches = note.getParentBranches();
if (notDeletedBranches.length === 0) {
for (const childBranch of note.getChildBranches()) {
childBranch.deleteBranch(deleteId, taskContext);
}
// first delete children and then parent - this will show up better in recent changes
log.info("Deleting note " + note.noteId);
for (const attribute of note.getOwnedAttributes()) {
attribute.markAsDeleted(deleteId);
}
for (const relation of note.getTargetRelations()) {
relation.markAsDeleted(deleteId);
}
note.markAsDeleted(deleteId);
return true;
}
else {
return false;
}
}
beforeSaving() {
if (this.notePosition === undefined || this.notePosition === null) {
// TODO finding new position can be refactored into becca

View File

@ -8,6 +8,7 @@ const dateUtils = require('../../services/date_utils');
const entityChangesService = require('../../services/entity_changes');
const AbstractEntity = require("./abstract_entity");
const NoteRevision = require("./note_revision");
const TaskContext = require("../../services/task_context.js");
const LABEL = 'label';
const RELATION = 'relation';
@ -237,7 +238,7 @@ class Note extends AbstractEntity {
setContent(content, ignoreMissingProtectedSession = false) {
if (content === null || content === undefined) {
throw new Error(`Cannot set null content to note ${this.noteId}`);
throw new Error(`Cannot set null content to note '${this.noteId}'`);
}
if (this.isStringNote()) {
@ -259,7 +260,7 @@ class Note extends AbstractEntity {
pojo.content = protectedSessionService.encrypt(pojo.content);
}
else if (!ignoreMissingProtectedSession) {
throw new Error(`Cannot update content of noteId=${this.noteId} since we're out of protected session.`);
throw new Error(`Cannot update content of noteId '${this.noteId}' since we're out of protected session.`);
}
}
@ -1125,6 +1126,26 @@ class Note extends AbstractEntity {
return cloningService.cloneNoteToBranch(this.noteId, branch.branchId);
}
/**
* (Soft) delete a note and all its descendants.
*
* @param {string} [deleteId] - optional delete identified
* @param {TaskContext} [taskContext]
*/
deleteNote(deleteId, taskContext) {
if (!deleteId) {
deleteId = utils.randomString(10);
}
if (!taskContext) {
taskContext = new TaskContext('no-progress-reporting');
}
for (const branch of this.getParentBranches()) {
branch.deleteBranch(deleteId, taskContext);
}
}
decrypt() {
if (this.isProtected && !this.isDecrypted && protectedSessionService.isProtectedSessionAvailable()) {
try {

View File

@ -71,7 +71,7 @@ function register(router) {
return res.sendStatus(204);
}
noteService.deleteBranch(branch, null, new TaskContext('no-progress-reporting'));
branch.deleteBranch();
res.sendStatus(204);
});

View File

@ -98,7 +98,7 @@ function register(router) {
return res.sendStatus(204);
}
noteService.deleteNote(note, null, new TaskContext('no-progress-reporting'));
note.deleteNote(null, new TaskContext('no-progress-reporting'));
res.sendStatus(204);
});

View File

@ -125,7 +125,7 @@ class NoteShort {
return JSON.parse(content);
}
catch (e) {
console.log(`Cannot parse content of note ${this.noteId}: `, e.message);
console.log(`Cannot parse content of note '${this.noteId}': `, e.message);
return null;
}

View File

@ -179,7 +179,7 @@ class Froca {
const searchResultNoteIds = await server.get('search-note/' + note.noteId);
if (!Array.isArray(searchResultNoteIds)) {
throw new Error(`Search note ${note.noteId} failed: ${searchResultNoteIds}`);
throw new Error(`Search note '${note.noteId}' failed: ${searchResultNoteIds}`);
}
// reset all the virtual branches from old search results
@ -254,7 +254,7 @@ class Froca {
return null;
}
else if (!noteId) {
console.trace(`Falsy noteId ${noteId}, returning null.`);
console.trace(`Falsy noteId '${noteId}', returning null.`);
return null;
}
@ -312,7 +312,7 @@ class Froca {
if (!this.noteComplementPromises[noteId]) {
this.noteComplementPromises[noteId] = server.get('notes/' + noteId)
.then(row => new NoteComplement(row))
.catch(e => console.error(`Cannot get note complement for note ${noteId}`));
.catch(e => console.error(`Cannot get note complement for note '${noteId}'`));
// we don't want to keep large payloads forever in memory so we clean that up quite quickly
// this cache is more meant to share the data between different components within one business transaction (e.g. loading of the note into the tab context and all the components)

View File

@ -71,7 +71,6 @@ export default class ButtonWidget extends NoteContextAwareWidget {
}
this.$widget
.attr("title", this.settings.title)
.addClass(this.settings.icon);
}

View File

@ -1,5 +1,7 @@
import ButtonWidget from "./button_widget.js";
import appContext from "../../services/app_context.js";
import attributeService from "../../services/attributes.js";
import protectedSessionHolder from "../../services/protected_session_holder.js";
export default class EditButton extends ButtonWidget {
isEnabled() {
@ -22,9 +24,29 @@ export default class EditButton extends ButtonWidget {
}
async refreshWithNote(note) {
// can't do this in isEnabled() since isReadOnly is async
this.toggleInt(await this.noteContext.isReadOnly());
if (note.isProtected && !protectedSessionHolder.isProtectedSessionAvailable()) {
this.toggleInt(false);
}
else {
// prevent flickering by assuming hidden before async operation
this.toggleInt(false);
// can't do this in isEnabled() since isReadOnly is async
this.toggleInt(await this.noteContext.isReadOnly());
}
await super.refreshWithNote(note);
}
entitiesReloadedEvent({loadResults}) {
if (loadResults.getAttributes().find(
attr => attr.type === 'label'
&& attr.name.toLowerCase().includes("readonly")
&& attributeService.isAffecting(attr, this.note)
)) {
this.noteContext.readOnlyTemporarilyDisabled = false;
this.refresh();
}
}
}

View File

@ -154,7 +154,8 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
// https://github.com/zadam/trilium/issues/2522
this.$widget.toggleClass("full-height",
!this.noteContext.hasNoteList()
&& ['editable-text', 'editable-code', 'canvas-note'].includes(this.type));
&& ['editable-text', 'editable-code', 'canvas-note'].includes(this.type)
&& this.mime !== 'text/x-sqlite;schema=trilium');
}
getTypeWidget() {

View File

@ -191,7 +191,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
await this.initialized;
this.textEditor.model.change(writer => {
const insertPosition = this.textEditor.model.document.selection.getFirstPosition();
const insertPosition = this.textEditor.model.document.selection.getLastPosition();
writer.insertText(text, insertPosition);
});
}

View File

@ -1,4 +1,5 @@
import NoteContextAwareWidget from "../note_context_aware_widget.js";
import appContext from "../../services/app_context.js";
export default class TypeWidget extends NoteContextAwareWidget {
// for overriding
@ -34,7 +35,7 @@ export default class TypeWidget extends NoteContextAwareWidget {
}
isActive() {
return this.$widget.is(":visible");
return this.$widget.is(":visible") && this.noteContext?.ntxId === appContext.tabManager.activeNtxId;
}
/**

View File

@ -194,7 +194,7 @@ function deleteBranch(req) {
const taskContext = TaskContext.getInstance(req.query.taskId, 'delete-notes');
const deleteId = utils.randomString(10);
const noteDeleted = noteService.deleteBranch(branch, deleteId, taskContext);
const noteDeleted = branch.deleteBranch(deleteId, taskContext);
if (eraseNotes) {
noteService.eraseNotesWithDeleteId(deleteId);

View File

@ -138,7 +138,7 @@ function processContent(images, note, content) {
value: imageNote.noteId
}).save();
log.info(`Replacing ${imageId} with ${url} in note ${note.noteId}`);
log.info(`Replacing '${imageId}' with '${url}' in note '${note.noteId}'`);
rewrittenContent = utils.replaceAll(rewrittenContent, imageId, url);
}

View File

@ -73,7 +73,7 @@ function deleteNote(req) {
const taskContext = TaskContext.getInstance(taskId, 'delete-notes');
noteService.deleteNote(note, deleteId, taskContext);
note.deleteNote(deleteId, taskContext);
if (eraseNotes) {
noteService.eraseNotesWithDeleteId(deleteId);
@ -96,7 +96,7 @@ function sortChildNotes(req) {
const noteId = req.params.noteId;
const {sortBy, sortDirection} = req.body;
log.info(`Sorting ${noteId} children with ${sortBy} ${sortDirection}`);
log.info(`Sorting '${noteId}' children with ${sortBy} ${sortDirection}`);
const reverse = sortDirection === 'desc';
@ -196,11 +196,11 @@ function changeTitle(req) {
const note = becca.getNote(noteId);
if (!note) {
return [404, `Note ${noteId} has not been found`];
return [404, `Note '${noteId}' has not been found`];
}
if (!note.isContentAvailable()) {
return [400, `Note ${noteId} is not available for change`];
return [400, `Note '${noteId}' is not available for change`];
}
const noteTitleChanged = note.title !== title;
@ -289,10 +289,10 @@ function uploadModifiedFile(req) {
const note = becca.getNote(noteId);
if (!note) {
return [404, `Note ${noteId} has not been found`];
return [404, `Note '${noteId}' has not been found`];
}
log.info(`Updating note ${noteId} with content from ${filePath}`);
log.info(`Updating note '${noteId}' with content from ${filePath}`);
noteRevisionService.createNoteRevision(note);

View File

@ -1 +1 @@
module.exports = { buildDate:"2022-04-10T14:13:51+02:00", buildRevision: "a04becc4ec653e21c2c80aa9d9ef5b7c9a8e1aa8" };
module.exports = { buildDate:"2022-05-01T23:18:35+02:00", buildRevision: "b3763eed610fa3f2aabbcbdbd21efca704a5dd08" };

View File

@ -89,8 +89,7 @@ function ensureNoteIsAbsentFromParent(noteId, parentNoteId) {
throw new Error(`Cannot remove branch ${branch.branchId} between child ${noteId} and parent ${parentNoteId} because this would delete the note as well.`);
}
const deleteId = utils.randomString(10);
noteService.deleteBranch(branch, deleteId, new TaskContext());
branch.deleteBranch();
log.info(`Ensured note ${noteId} is NOT in parent note ${parentNoteId}`);
}

View File

@ -56,41 +56,66 @@ class ConsistencyChecks {
childToParents[childNoteId].push(parentNoteId);
}
/** @returns {boolean} true if cycle was found and we should try again */
const checkTreeCycle = (noteId, path) => {
if (noteId === 'root') {
return;
}
if (!childToParents[noteId] || childToParents[noteId].length === 0) {
logError(`No parents found for note ${noteId}`);
this.unrecoveredConsistencyErrors = true;
return;
return false;
}
for (const parentNoteId of childToParents[noteId]) {
if (path.includes(parentNoteId)) {
logError(`Tree cycle detected at parent-child relationship: ${parentNoteId} - ${noteId}, whole path: ${path}`);
if (this.autoFix) {
const branch = becca.getBranchFromChildAndParent(noteId, parentNoteId);
branch.markAsDeleted('cycle-autofix');
logFix(`Branch '${branch.branchId}' between child '${noteId}' and parent '${parentNoteId}' has been deleted since it was causing a tree cycle.`);
this.unrecoveredConsistencyErrors = true;
return true;
}
else {
logError(`Tree cycle detected at parent-child relationship: ${parentNoteId} - ${noteId}, whole path: ${path}`);
this.unrecoveredConsistencyErrors = true;
}
} else {
const newPath = path.slice();
newPath.push(noteId);
checkTreeCycle(parentNoteId, newPath);
const retryNeeded = checkTreeCycle(parentNoteId, newPath);
if (retryNeeded) {
return true;
}
}
}
return false;
};
const noteIds = Object.keys(childToParents);
for (const noteId of noteIds) {
checkTreeCycle(noteId, []);
const retryNeeded = checkTreeCycle(noteId, []);
if (retryNeeded) {
return true;
}
}
if (childToParents['root'].length !== 1 || childToParents['root'][0] !== 'none') {
logError('Incorrect root parent: ' + JSON.stringify(childToParents['root']));
this.unrecoveredConsistencyErrors = true;
return false;
}
checkAndRepairTreeCycles() {
let treeFixed = false;
while (this.checkTreeCycles()) {
// fixing cycle means deleting branches, we might need to create a new branch to recover the note
this.findExistencyIssues();
treeFixed = true;
}
if (treeFixed) {
this.reloadNeeded = true;
}
}
@ -646,7 +671,7 @@ class ConsistencyChecks {
if (!this.unrecoveredConsistencyErrors) {
// we run this only if basic checks passed since this assumes basic data consistency
this.checkTreeCycles();
this.checkAndRepairTreeCycles();
}
if (this.reloadNeeded) {

View File

@ -17,6 +17,7 @@ const becca = require('../becca/becca');
const Branch = require('../becca/entities/branch');
const Note = require('../becca/entities/note');
const Attribute = require('../becca/entities/attribute');
const TaskContext = require("./task_context.js");
function getNewNotePosition(parentNoteId) {
const note = becca.notes[parentNoteId];
@ -138,7 +139,7 @@ function createNewNote(params) {
triggerNoteTitleChanged(note);
triggerChildNoteCreated(note, parentNote);
log.info(`Created new note ${note.noteId}, branch ${branch.branchId} of type ${note.type}, mime ${note.mime}`);
log.info(`Created new note '${note.noteId}', branch '${branch.branchId}' of type '${note.type}', mime '${note.mime}'`);
return {
note,
@ -284,10 +285,10 @@ async function downloadImage(noteId, imageUrl) {
imageUrlToNoteIdMapping[imageUrl] = note.noteId;
log.info(`Download of ${imageUrl} succeeded and was saved as image note ${note.noteId}`);
log.info(`Download of '${imageUrl}' succeeded and was saved as image note '${note.noteId}'`);
}
catch (e) {
log.error(`Download of ${imageUrl} for note ${noteId} failed with error: ${e.message} ${e.stack}`);
log.error(`Download of '${imageUrl}' for note '${noteId}' failed with error: ${e.message} ${e.stack}`);
}
}
@ -372,7 +373,7 @@ function downloadImages(noteId, content) {
const origNote = becca.getNote(noteId);
if (!origNote) {
log.error(`Cannot find note ${noteId} to replace image link.`);
log.error(`Cannot find note '${noteId}' to replace image link.`);
return;
}
@ -393,7 +394,7 @@ function downloadImages(noteId, content) {
scanForLinks(origNote);
console.log(`Fixed the image links for note ${noteId} to the offline saved.`);
console.log(`Fixed the image links for note '${noteId}' to the offline saved.`);
}
});
}, 5000);
@ -490,7 +491,7 @@ function updateNote(noteId, noteUpdates) {
const note = becca.getNote(noteId);
if (!note.isContentAvailable()) {
throw new Error(`Note ${noteId} is not available for change!`);
throw new Error(`Note '${noteId}' is not available for change!`);
}
saveNoteRevision(note);
@ -524,69 +525,6 @@ function updateNote(noteId, noteUpdates) {
};
}
/**
* @param {Branch} branch
* @param {string|null} deleteId
* @param {TaskContext} taskContext
*
* @return {boolean} - true if note has been deleted, false otherwise
*/
function deleteBranch(branch, deleteId, taskContext) {
taskContext.increaseProgressCount();
if (!branch) {
return false;
}
if (branch.branchId === 'root'
|| branch.noteId === 'root'
|| branch.noteId === cls.getHoistedNoteId()) {
throw new Error("Can't delete root or hoisted branch/note");
}
branch.markAsDeleted(deleteId);
const note = branch.getNote();
const notDeletedBranches = note.getParentBranches();
if (notDeletedBranches.length === 0) {
for (const childBranch of note.getChildBranches()) {
deleteBranch(childBranch, deleteId, taskContext);
}
// first delete children and then parent - this will show up better in recent changes
log.info("Deleting note " + note.noteId);
for (const attribute of note.getOwnedAttributes()) {
attribute.markAsDeleted(deleteId);
}
for (const relation of note.getTargetRelations()) {
relation.markAsDeleted(deleteId);
}
note.markAsDeleted(deleteId);
return true;
}
else {
return false;
}
}
/**
* @param {Note} note
* @param {string|null} deleteId
* @param {TaskContext} taskContext
*/
function deleteNote(note, deleteId, taskContext) {
for (const branch of note.getParentBranches()) {
deleteBranch(branch, deleteId, taskContext);
}
}
/**
* @param {string} noteId
* @param {TaskContext} taskContext
@ -595,7 +533,7 @@ function undeleteNote(noteId, taskContext) {
const note = sql.getRow("SELECT * FROM notes WHERE noteId = ?", [noteId]);
if (!note.isDeleted) {
log.error(`Note ${noteId} is not deleted and thus cannot be undeleted.`);
log.error(`Note '${noteId}' is not deleted and thus cannot be undeleted.`);
return;
}
@ -938,8 +876,6 @@ module.exports = {
createNewNote,
createNewNoteWithTarget,
updateNote,
deleteBranch,
deleteNote,
undeleteNote,
protectNoteRecursively,
scanForLinks,

View File

@ -10,7 +10,7 @@ const utils = require("../../utils");
// FIXME: create common subclass with NoteContentUnprotectedFulltextExp to avoid duplication
class NoteContentProtectedFulltextExp extends Expression {
constructor(operator, tokens, raw) {
constructor(operator, {tokens, raw, flatText}) {
super();
if (operator !== '*=*') {
@ -19,6 +19,7 @@ class NoteContentProtectedFulltextExp extends Expression {
this.tokens = tokens;
this.raw = !!raw;
this.flatText = !!flatText;
}
execute(inputNoteSet) {
@ -33,7 +34,7 @@ class NoteContentProtectedFulltextExp extends Expression {
for (let {noteId, type, mime, content} of sql.iterateRows(`
SELECT noteId, type, mime, content
FROM notes JOIN note_contents USING (noteId)
WHERE type IN ('text', 'code') AND isDeleted = 0 AND isProtected = 1`)) {
WHERE type IN ('text', 'code', 'mermaid') AND isDeleted = 0 AND isProtected = 1`)) {
if (!inputNoteSet.hasNoteId(noteId) || !(noteId in becca.notes)) {
continue;
@ -49,7 +50,17 @@ class NoteContentProtectedFulltextExp extends Expression {
content = this.preprocessContent(content, type, mime);
if (!this.tokens.find(token => !content.includes(token))) {
const nonMatchingToken = this.tokens.find(token =>
!content.includes(token) &&
(
// in case of default fulltext search we should consider both title, attrs and content
// so e.g. "hello world" should match when "hello" is in title and "world" in content
!this.flatText
|| !becca.notes[noteId].getFlatText().includes(token)
)
);
if (!nonMatchingToken) {
resultNoteSet.add(becca.notes[noteId]);
}
}

View File

@ -8,7 +8,7 @@ const utils = require("../../utils");
// FIXME: create common subclass with NoteContentProtectedFulltextExp to avoid duplication
class NoteContentUnprotectedFulltextExp extends Expression {
constructor(operator, tokens, raw) {
constructor(operator, {tokens, raw, flatText}) {
super();
if (operator !== '*=*') {
@ -17,6 +17,7 @@ class NoteContentUnprotectedFulltextExp extends Expression {
this.tokens = tokens;
this.raw = !!raw;
this.flatText = !!flatText;
}
execute(inputNoteSet) {
@ -27,7 +28,7 @@ class NoteContentUnprotectedFulltextExp extends Expression {
for (let {noteId, type, mime, content} of sql.iterateRows(`
SELECT noteId, type, mime, content
FROM notes JOIN note_contents USING (noteId)
WHERE type IN ('text', 'code') AND isDeleted = 0 AND isProtected = 0`)) {
WHERE type IN ('text', 'code', 'mermaid') AND isDeleted = 0 AND isProtected = 0`)) {
if (!inputNoteSet.hasNoteId(noteId) || !(noteId in becca.notes)) {
continue;
@ -35,7 +36,17 @@ class NoteContentUnprotectedFulltextExp extends Expression {
content = this.preprocessContent(content, type, mime);
if (!this.tokens.find(token => !content.includes(token))) {
const nonMatchingToken = this.tokens.find(token =>
!content.includes(token) &&
(
// in case of default fulltext search we should consider both title, attrs and content
// so e.g. "hello world" should match when "hello" is in title and "world" in content
!this.flatText
|| !becca.notes[noteId].getFlatText().includes(token)
)
);
if (!nonMatchingToken) {
resultNoteSet.add(becca.notes[noteId]);
}
}

View File

@ -32,8 +32,8 @@ function getFulltext(tokens, searchContext) {
if (!searchContext.fastSearch) {
return new OrExp([
new NoteFlatTextExp(tokens),
new NoteContentProtectedFulltextExp('*=*', tokens),
new NoteContentUnprotectedFulltextExp('*=*', tokens)
new NoteContentProtectedFulltextExp('*=*', {tokens, flatText: true}),
new NoteContentUnprotectedFulltextExp('*=*', {tokens, flatText: true})
]);
}
else {
@ -141,8 +141,8 @@ function getExpression(tokens, searchContext, level = 0) {
i++;
return new OrExp([
new NoteContentUnprotectedFulltextExp(operator, [tokens[i].token], raw),
new NoteContentProtectedFulltextExp(operator, [tokens[i].token], raw)
new NoteContentUnprotectedFulltextExp(operator, {tokens: [tokens[i].token], raw }),
new NoteContentProtectedFulltextExp(operator, {tokens: [tokens[i].token], raw })
]);
}
@ -196,8 +196,8 @@ function getExpression(tokens, searchContext, level = 0) {
return new OrExp([
new PropertyComparisonExp(searchContext, 'title', '*=*', tokens[i].token),
new NoteContentProtectedFulltextExp('*=*', [tokens[i].token]),
new NoteContentUnprotectedFulltextExp('*=*', [tokens[i].token])
new NoteContentProtectedFulltextExp('*=*', {tokens: [tokens[i].token]}),
new NoteContentUnprotectedFulltextExp('*=*', {tokens: [tokens[i].token]})
]);
}

View File

@ -62,21 +62,23 @@ function register(router) {
});
router.get('/share/:shareId', (req, res, next) => {
const {shareId} = req.params;
shacaLoader.ensureLoad();
const {shareId} = req.params;
const note = shaca.aliasToNote[shareId] || shaca.notes[shareId];
renderNote(note, res);
});
router.get('/share/api/notes/:noteId', (req, res, next) => {
shacaLoader.ensureLoad();
const {noteId} = req.params;
const note = shaca.getNote(noteId);
if (!note) {
return res.status(404).send(`Note ${noteId} not found`);
return res.status(404).send(`Note '${noteId}' not found`);
}
addNoIndexHeader(note, res);
@ -85,11 +87,13 @@ function register(router) {
});
router.get('/share/api/notes/:noteId/download', (req, res, next) => {
shacaLoader.ensureLoad();
const {noteId} = req.params;
const note = shaca.getNote(noteId);
if (!note) {
return res.status(404).send(`Note ${noteId} not found`);
return res.status(404).send(`Note '${noteId}' not found`);
}
addNoIndexHeader(note, res);
@ -106,11 +110,13 @@ function register(router) {
res.send(note.getContent());
});
router.get(['/share/api/images/:noteId/:filename', '/share/api/images/:noteId'], (req, res, next) => {
router.get('/share/api/images/:noteId/:filename', (req, res, next) => {
shacaLoader.ensureLoad();
const image = shaca.getNote(req.params.noteId);
if (!image) {
return res.status(404).send(`Note ${noteId} not found`);
return res.status(404).send(`Note '${req.params.noteId}' not found`);
}
else if (!["image", "canvas-note"].includes(image.type)) {
return res.status(400).send("Requested note is not a shareable image");
@ -123,6 +129,7 @@ function register(router) {
try {
const data = JSON.parse(content)
const svg = data.svg || '<svg />'
addNoIndexHeader(image, res);
res.set('Content-Type', "image/svg+xml");
res.set("Cache-Control", "no-cache, no-store, must-revalidate");
res.send(svg);
@ -132,19 +139,20 @@ function register(router) {
} else {
// normal image
res.set('Content-Type', image.mime);
addNoIndexHeader(image, res);
res.send(image.getContent());
}
});
// used for PDF viewing
router.get('/share/api/notes/:noteId/view', (req, res, next) => {
shacaLoader.ensureLoad();
const {noteId} = req.params;
const note = shaca.getNote(noteId);
if (!note) {
return res.status(404).send(`Note ${noteId} not found`);
return res.status(404).send(`Note '${noteId}' not found`);
}
addNoIndexHeader(note, res);