mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	moving deleteNote and deleteBranch into entities to make them accessible to scripts, #2792
				
					
				
			This commit is contained in:
		| @@ -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> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -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> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -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"> → {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"> | ||||
|                  | ||||
|                     <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"> | ||||
|                  | ||||
|                     <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> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -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> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -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"> | ||||
|                  | ||||
|                     <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"> | ||||
|                  | ||||
|                     <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> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -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> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -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> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -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> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -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) { | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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 && !this.isDecrypted && protectedSessionService.isProtectedSessionAvailable()) { | ||||
|             try { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user