new frontend API - getCurrentNoteContent and onNoteChange

This commit is contained in:
azivner 2018-09-03 16:05:28 +02:00
parent a3feaa13b3
commit c7a609e349
42 changed files with 817 additions and 106 deletions

View File

@ -288,7 +288,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -426,7 +426,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -3814,7 +3814,7 @@ transactional by default.
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -384,6 +384,113 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line38">line 38</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Note.html">Note</a></span>
|
<span class="param-type">null</span>
</dd>
</dl>
@ -404,7 +511,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -216,7 +216,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -380,7 +380,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -613,7 +613,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line399">line 399</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line413">line 413</a>
</li></ul></dd> </li></ul></dd>
@ -809,7 +809,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line437">line 437</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line451">line 451</a>
</li></ul></dd> </li></ul></dd>
@ -1005,7 +1005,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line446">line 446</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line460">line 460</a>
</li></ul></dd> </li></ul></dd>
@ -1177,7 +1177,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line207">line 207</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line221">line 221</a>
</li></ul></dd> </li></ul></dd>
@ -1233,7 +1233,7 @@
<h4 class="name" id="getAttributes"><span class="type-signature">(async) </span>getAttributes<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4> <h4 class="name" id="getAttributes"><span class="type-signature">(async) </span>getAttributes<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
@ -1248,6 +1248,67 @@
<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>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">attribute name to filter</td>
</tr>
</tbody>
</table>
@ -1281,7 +1342,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line103">line 103</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line106">line 106</a>
</li></ul></dd> </li></ul></dd>
@ -1457,7 +1518,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line218">line 218</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line232">line 232</a>
</li></ul></dd> </li></ul></dd>
@ -1561,7 +1622,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line467">line 467</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line481">line 481</a>
</li></ul></dd> </li></ul></dd>
@ -1661,7 +1722,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line488">line 488</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line509">line 509</a>
</li></ul></dd> </li></ul></dd>
@ -1765,7 +1826,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line474">line 474</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line495">line 495</a>
</li></ul></dd> </li></ul></dd>
@ -1918,7 +1979,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line305">line 305</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line319">line 319</a>
</li></ul></dd> </li></ul></dd>
@ -1974,7 +2035,7 @@
<h4 class="name" id="getLabels"><span class="type-signature">(async) </span>getLabels<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4> <h4 class="name" id="getLabels"><span class="type-signature">(async) </span>getLabels<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
@ -1989,6 +2050,67 @@
<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>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">label name to filter</td>
</tr>
</tbody>
</table>
@ -2022,7 +2144,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line112">line 112</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line123">line 123</a>
</li></ul></dd> </li></ul></dd>
@ -2175,7 +2297,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line317">line 317</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line331">line 331</a>
</li></ul></dd> </li></ul></dd>
@ -2279,7 +2401,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line460">line 460</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line474">line 474</a>
</li></ul></dd> </li></ul></dd>
@ -2483,7 +2605,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line500">line 500</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line521">line 521</a>
</li></ul></dd> </li></ul></dd>
@ -2636,7 +2758,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line311">line 311</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line325">line 325</a>
</li></ul></dd> </li></ul></dd>
@ -2692,7 +2814,7 @@
<h4 class="name" id="getRelations"><span class="type-signature">(async) </span>getRelations<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4> <h4 class="name" id="getRelations"><span class="type-signature">(async) </span>getRelations<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
@ -2707,6 +2829,67 @@
<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>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">relation name to filter</td>
</tr>
</tbody>
</table>
@ -2740,7 +2923,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line117">line 117</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line131">line 131</a>
</li></ul></dd> </li></ul></dd>
@ -2893,7 +3076,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line385">line 385</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line399">line 399</a>
</li></ul></dd> </li></ul></dd>
@ -3049,7 +3232,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line323">line 323</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line337">line 337</a>
</li></ul></dd> </li></ul></dd>
@ -3157,7 +3340,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line453">line 453</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line467">line 467</a>
</li></ul></dd> </li></ul></dd>
@ -3433,7 +3616,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line198">line 198</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line212">line 212</a>
</li></ul></dd> </li></ul></dd>
@ -3489,6 +3672,110 @@
<h4 class="name" id="hasChildren"><span class="type-signature">(async) </span>hasChildren<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line488">line 488</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- true if note has children
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="hasLabel"><span class="type-signature">(async) </span>hasLabel<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4> <h4 class="name" id="hasLabel"><span class="type-signature">(async) </span>hasLabel<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
@ -3586,7 +3873,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line293">line 293</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line307">line 307</a>
</li></ul></dd> </li></ul></dd>
@ -3739,7 +4026,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line299">line 299</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line313">line 313</a>
</li></ul></dd> </li></ul></dd>
@ -3848,7 +4135,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line125">line 125</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line139">line 139</a>
</li></ul></dd> </li></ul></dd>
@ -4346,7 +4633,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line130">line 130</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line144">line 144</a>
</li></ul></dd> </li></ul></dd>
@ -4573,7 +4860,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line276">line 276</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line290">line 290</a>
</li></ul></dd> </li></ul></dd>
@ -4769,7 +5056,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line370">line 370</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line384">line 384</a>
</li></ul></dd> </li></ul></dd>
@ -4965,7 +5252,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line379">line 379</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line393">line 393</a>
</li></ul></dd> </li></ul></dd>
@ -5192,7 +5479,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line250">line 250</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line264">line 264</a>
</li></ul></dd> </li></ul></dd>
@ -5388,7 +5675,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line352">line 352</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line366">line 366</a>
</li></ul></dd> </li></ul></dd>
@ -5584,7 +5871,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line361">line 361</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line375">line 375</a>
</li></ul></dd> </li></ul></dd>
@ -5842,7 +6129,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line233">line 233</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line247">line 247</a>
</li></ul></dd> </li></ul></dd>
@ -6069,7 +6356,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line333">line 333</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line347">line 347</a>
</li></ul></dd> </li></ul></dd>
@ -6296,7 +6583,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line343">line 343</a> <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line357">line 357</a>
</li></ul></dd> </li></ul></dd>
@ -6364,7 +6651,7 @@ Cache is note instance scoped.
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -334,7 +334,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -403,7 +403,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -311,7 +311,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -288,7 +288,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -75,7 +75,7 @@ module.exports = ApiToken;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -134,7 +134,7 @@ module.exports = Attribute;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -55,6 +55,14 @@ class Branch extends Entity {
// notePosition is not part of hash because it would produce a lot of updates in case of reordering // notePosition is not part of hash because it would produce a lot of updates in case of reordering
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "prefix"]; } static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "prefix"]; }
constructor(row = {}) {
super(row);
// used to detect move in note tree
this.origParentNoteId = this.parentNoteId;
}
/** @returns {Note|null} */
async getNote() { async getNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]); return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
} }
@ -97,7 +105,7 @@ module.exports = Branch;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -93,7 +93,7 @@ module.exports = Entity;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -83,7 +83,7 @@ module.exports = Image;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -127,23 +127,37 @@ class Note extends Entity {
return await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]); return await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
} }
/** @returns {Promise&lt;Attribute[]>} all note's attributes, including inherited ones */ /**
async getAttributes() { * @param {string} [name] - attribute name to filter
* @returns {Promise&lt;Attribute[]>} all note's attributes, including inherited ones
*/
async getAttributes(name) {
if (!this.__attributeCache) { if (!this.__attributeCache) {
await this.loadAttributesToCache(); await this.loadAttributesToCache();
} }
if (name) {
return this.__attributeCache.filter(attr => attr.name === name);
}
else {
return this.__attributeCache; return this.__attributeCache;
} }
/** @returns {Promise&lt;Attribute[]>} all note's labels (attributes with type label), including inherited ones */
async getLabels() {
return (await this.getAttributes()).filter(attr => attr.type === LABEL);
} }
/** @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), including inherited ones */ /**
async getRelations() { * @param {string} [name] - label name to filter
return (await this.getAttributes()).filter(attr => attr.type === RELATION); * @returns {Promise&lt;Attribute[]>} all note's labels (attributes with type label), including inherited ones
*/
async getLabels(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), including inherited ones
*/
async getRelations(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION);
} }
/** /**
@ -496,6 +510,13 @@ class Note extends Entity {
return await repository.getEntities("SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ?", [this.noteId]); return await repository.getEntities("SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
} }
/**
* @returns {boolean} - true if note has children
*/
async hasChildren() {
return (await this.getChildNotes()).length > 0;
}
/** /**
* @returns {Promise&lt;Note[]>} child notes of this note * @returns {Promise&lt;Note[]>} child notes of this note
*/ */
@ -580,7 +601,7 @@ module.exports = Note;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -90,7 +90,7 @@ module.exports = NoteImage;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -91,7 +91,7 @@ module.exports = NoteRevision;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -78,7 +78,7 @@ module.exports = Option;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -75,7 +75,7 @@ module.exports = RecentNote;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -594,7 +594,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -56,7 +56,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -278,7 +278,7 @@ module.exports = BackendScriptApi;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:06 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -719,7 +719,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -81,7 +81,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line14">line 14</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line15">line 15</a>
</li></ul></dd> </li></ul></dd>
@ -221,7 +221,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line20">line 20</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line21">line 21</a>
</li></ul></dd> </li></ul></dd>
@ -334,7 +334,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line22">line 22</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line23">line 23</a>
</li></ul></dd> </li></ul></dd>
@ -444,7 +444,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line18">line 18</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line19">line 19</a>
</li></ul></dd> </li></ul></dd>
@ -573,7 +573,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line39">line 39</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line40">line 40</a>
</li></ul></dd> </li></ul></dd>
@ -726,7 +726,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line31">line 31</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line32">line 32</a>
</li></ul></dd> </li></ul></dd>
@ -879,7 +879,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line58">line 58</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line59">line 59</a>
</li></ul></dd> </li></ul></dd>
@ -1057,7 +1057,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line193">line 193</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line194">line 194</a>
</li></ul></dd> </li></ul></dd>
@ -1188,7 +1188,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line153">line 153</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line154">line 154</a>
</li></ul></dd> </li></ul></dd>
@ -1244,6 +1244,110 @@
<h4 class="name" id="getCurrentNoteContent"><span class="type-signature"></span>getCurrentNoteContent<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line200">line 200</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
content of currently loaded note in the editor (HTML, code etc.)
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="getInstanceName"><span class="type-signature"></span>getInstanceName<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4> <h4 class="name" id="getInstanceName"><span class="type-signature"></span>getInstanceName<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
@ -1297,7 +1401,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line146">line 146</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line147">line 147</a>
</li></ul></dd> </li></ul></dd>
@ -1496,7 +1600,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line138">line 138</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line139">line 139</a>
</li></ul></dd> </li></ul></dd>
@ -1544,6 +1648,137 @@ otherwise (by e.g. createNoteLink())
<h4 class="name" id="onNoteChange"><span class="type-signature"></span>onNoteChange<span class="signature">(func)</span><span class="type-signature"></span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>func</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">callback called on note change</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line206">line 206</a>
</li></ul></dd>
</dl>
@ -1645,7 +1880,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line160">line 160</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line161">line 161</a>
</li></ul></dd> </li></ul></dd>
@ -1753,7 +1988,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line184">line 184</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line185">line 185</a>
</li></ul></dd> </li></ul></dd>
@ -1930,7 +2165,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line106">line 106</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line107">line 107</a>
</li></ul></dd> </li></ul></dd>
@ -2087,7 +2322,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line176">line 176</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line177">line 177</a>
</li></ul></dd> </li></ul></dd>
@ -2222,7 +2457,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line168">line 168</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line169">line 169</a>
</li></ul></dd> </li></ul></dd>
@ -2272,7 +2507,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -279,7 +279,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -1316,7 +1316,7 @@ Its notable omission is the note content.</div>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -76,7 +76,7 @@ export default Branch;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -64,7 +64,7 @@ export default NoteFull;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -128,7 +128,7 @@ export default NoteShort;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -303,7 +303,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line45">line 45</a> <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line46">line 46</a>
</li></ul></dd> </li></ul></dd>
@ -339,7 +339,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -56,7 +56,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -32,6 +32,7 @@ import utils from './utils.js';
import infoService from './info.js'; import infoService from './info.js';
import linkService from './link.js'; import linkService from './link.js';
import treeCache from './tree_cache.js'; import treeCache from './tree_cache.js';
import noteDetailService from './note_detail.js';
/** /**
* This is the main frontend API interface for scripts. It's published in the local "api" object. * This is the main frontend API interface for scripts. It's published in the local "api" object.
@ -219,6 +220,18 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
* @param {string} [noteTitle] - if not present we'll use note title * @param {string} [noteTitle] - if not present we'll use note title
*/ */
this.createNoteLink = linkService.createNoteLink; this.createNoteLink = linkService.createNoteLink;
/**
* @method
* @returns {string} content of currently loaded note in the editor (HTML, code etc.)
*/
this.getCurrentNoteContent = noteDetailService.getCurrentNoteContent;
/**
* @method
* @param {function} func - callback called on note change
*/
this.onNoteChange = noteDetailService.onNoteChange;
} }
export default FrontendScriptApi;</code></pre> export default FrontendScriptApi;</code></pre>
@ -237,7 +250,7 @@ export default FrontendScriptApi;</code></pre>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST) Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer> </footer>
<script> prettyPrint(); </script> <script> prettyPrint(); </script>

View File

@ -4,6 +4,7 @@ import utils from './utils.js';
import infoService from './info.js'; import infoService from './info.js';
import linkService from './link.js'; import linkService from './link.js';
import treeCache from './tree_cache.js'; import treeCache from './tree_cache.js';
import noteDetailService from './note_detail.js';
/** /**
* This is the main frontend API interface for scripts. It's published in the local "api" object. * This is the main frontend API interface for scripts. It's published in the local "api" object.
@ -191,6 +192,18 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
* @param {string} [noteTitle] - if not present we'll use note title * @param {string} [noteTitle] - if not present we'll use note title
*/ */
this.createNoteLink = linkService.createNoteLink; this.createNoteLink = linkService.createNoteLink;
/**
* @method
* @returns {string} content of currently loaded note in the editor (HTML, code etc.)
*/
this.getCurrentNoteContent = noteDetailService.getCurrentNoteContent;
/**
* @method
* @param {function} func - callback called on note change
*/
this.onNoteChange = noteDetailService.onNoteChange;
} }
export default FrontendScriptApi; export default FrontendScriptApi;

View File

@ -49,6 +49,10 @@ const components = {
}; };
function getComponent(type) { function getComponent(type) {
if (!type) {
type = getCurrentNote().type;
}
if (components[type]) { if (components[type]) {
return components[type]; return components[type];
} }
@ -93,11 +97,19 @@ async function switchToNote(noteId) {
} }
} }
function getCurrentNoteContent() {
return getComponent().getContent();
}
function onNoteChange(func) {
return getComponent().onNoteChange(func);
}
async function saveNote() { async function saveNote() {
const note = getCurrentNote(); const note = getCurrentNote();
note.title = $noteTitle.val(); note.title = $noteTitle.val();
note.content = getComponent(note.type).getContent(); note.content = getCurrentNoteContent(note);
// it's important to set the flag back to false immediatelly after retrieving title and content // it's important to set the flag back to false immediatelly after retrieving title and content
// otherwise we might overwrite another change (especially async code) // otherwise we might overwrite another change (especially async code)
@ -107,7 +119,6 @@ async function saveNote() {
await server.put('notes/' + note.noteId, note.dto); await server.put('notes/' + note.noteId, note.dto);
if (note.isProtected) { if (note.isProtected) {
protectedSessionHolder.touchProtectedSession(); protectedSessionHolder.touchProtectedSession();
} }
@ -549,5 +560,7 @@ export default {
refreshAttributes, refreshAttributes,
saveNote, saveNote,
saveNoteIfChanged, saveNoteIfChanged,
noteChanged noteChanged,
getCurrentNoteContent,
onNoteChange
}; };

View File

@ -35,7 +35,7 @@ async function show() {
tabindex: 100 tabindex: 100
}); });
codeEditor.on('change', noteDetailService.noteChanged); onNoteChange(noteDetailService.noteChanged);
} }
$noteDetailCode.show(); $noteDetailCode.show();
@ -85,6 +85,10 @@ async function executeCurrentNote() {
infoService.showMessage("Note executed"); infoService.showMessage("Note executed");
} }
function onNoteChange(func) {
codeEditor.on('change', func);
}
$(document).bind('keydown', "ctrl+return", executeCurrentNote); $(document).bind('keydown', "ctrl+return", executeCurrentNote);
$executeScriptButton.click(executeCurrentNote); $executeScriptButton.click(executeCurrentNote);
@ -92,5 +96,6 @@ $executeScriptButton.click(executeCurrentNote);
export default { export default {
show, show,
getContent, getContent,
focus focus,
onNoteChange
} }

View File

@ -46,5 +46,6 @@ function getFileUrl() {
export default { export default {
show, show,
getContent: () => null, getContent: () => null,
focus: () => null focus: () => null,
onNoteChange: () => null
} }

View File

@ -34,5 +34,6 @@ $renderButton.click(render);
export default { export default {
show: render, show: render,
getContent: () => "", getContent: () => "",
focus: () => null focus: () => null,
onNoteChange: () => null
} }

View File

@ -28,5 +28,6 @@ function show() {
export default { export default {
getContent, getContent,
show, show,
focus: () => null focus: () => null,
onNoteChange: () => null
} }

View File

@ -29,7 +29,7 @@ async function show() {
} }
}); });
textEditor.model.document.on('change:data', noteDetailService.noteChanged); onNoteChange(noteDetailService.noteChanged);
} }
} }
@ -105,6 +105,10 @@ async function sendMarkdownDialog() {
$markdownImportTextarea.val(''); $markdownImportTextarea.val('');
} }
function onNoteChange(func) {
textEditor.model.document.on('change:data', func);
}
$markdownImportButton.click(sendMarkdownDialog); $markdownImportButton.click(sendMarkdownDialog);
$markdownImportDialog.bind('keydown', 'ctrl+return', sendMarkdownDialog); $markdownImportDialog.bind('keydown', 'ctrl+return', sendMarkdownDialog);
@ -115,5 +119,6 @@ export default {
show, show,
getEditor, getEditor,
getContent, getContent,
focus focus,
onNoteChange
} }

View File

@ -34,6 +34,7 @@ function NoteTypeModel() {
{ mime: 'application/javascript;env=backend', title: 'JavaScript backend' }, { mime: 'application/javascript;env=backend', title: 'JavaScript backend' },
{ mime: 'application/json', title: 'JSON' }, { mime: 'application/json', title: 'JSON' },
{ mime: 'text/x-kotlin', title: 'Kotlin' }, { mime: 'text/x-kotlin', title: 'Kotlin' },
{ mime: 'text/x-stex', title: 'LaTex' },
{ mime: 'text/x-lua', title: 'Lua' }, { mime: 'text/x-lua', title: 'Lua' },
{ mime: 'text/x-markdown', title: 'Markdown' }, { mime: 'text/x-markdown', title: 'Markdown' },
{ mime: 'text/x-objectivec', title: 'Objective C' }, { mime: 'text/x-objectivec', title: 'Objective C' },