mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 00:36:33 +01:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
185fb4b787 | ||
|
|
f2712e92bb | ||
|
|
763f885cc7 | ||
|
|
25f8df1e03 | ||
|
|
c7a609e349 | ||
|
|
a3feaa13b3 | ||
|
|
4a58357a9a | ||
|
|
c41b809720 | ||
|
|
9bdd4437f2 | ||
|
|
467ad79129 | ||
|
|
0daeb71869 | ||
|
|
708874a02c | ||
|
|
fa77132fe9 | ||
|
|
d3300df3d7 | ||
|
|
4984b06d9f | ||
|
|
66c908f2b2 | ||
|
|
7199208d9d | ||
|
|
8adc111b0a |
@@ -11,7 +11,7 @@ See other pictures in [screenshot tour](https://github.com/zadam/trilium/wiki/Sc
|
||||
|
||||
* Notes can be arranged into arbitrarily deep hierarchy (tree)
|
||||
* Notes can have more than 1 parents - see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes)
|
||||
* Rich WYSIWYG note editing including e.g. tables and images
|
||||
* Rich WYSIWYG note editing including e.g. tables and images with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-editor#autoformat)
|
||||
* Support for editing [notes with source code](https://raw.githubusercontent.com/wiki/zadam/trilium/images/code-note.png), including syntax highlighting
|
||||
* Fast and easy [navigation between notes](https://github.com/zadam/trilium/wiki/Note-navigation)
|
||||
* Seamless [note versioning](https://github.com/zadam/trilium/wiki/Note-revisions)
|
||||
@@ -20,6 +20,7 @@ See other pictures in [screenshot tour](https://github.com/zadam/trilium/wiki/Sc
|
||||
* Strong [note encryption](https://github.com/zadam/trilium/wiki/Protected-notes)
|
||||
* [Scripting](https://github.com/zadam/trilium/wiki/Scripts) - see [Advanced showcases](https://github.com/zadam/trilium/wiki/Advanced-showcases)
|
||||
* Scales well in both usability and performance upwards of 100 000 notes
|
||||
* [Night theme](https://github.com/zadam/trilium/wiki/Themes)
|
||||
|
||||
## Builds
|
||||
|
||||
|
||||
@@ -6,18 +6,18 @@ INSERT INTO branches VALUES('jvhKcwz4pYTr','ZC78NlmdXeC6','WdWZFuWNVDZk',0,NULL,
|
||||
INSERT INTO branches VALUES('CarTrwkGVcPz','NncfGH8dyNjJ','WdWZFuWNVDZk',1,NULL,1,0,'2017-12-23T04:06:24.012Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('6M7qPlr7at6N','eouCLkjbruai','NncfGH8dyNjJ',0,NULL,0,0,'2017-12-23T01:23:28.291Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('tQgognnAH9WI','C44aq4mkaX67','NncfGH8dyNjJ',1,NULL,0,0,'2017-12-23T01:23:31.879Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('xyAi7MmgvAgR','C44aq4mkaX67','ZC78NlmdXeC6',1,NULL,0,0,'2017-12-23T01:23:47.756Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('xyAi7MmgvAgR','C44aq4mkaX67','ZC78NlmdXeC6',1,NULL,1,0,'2017-12-23T01:23:47.756Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('xQ3fjRp9yaPq','I6Cw88AirBBl','C44aq4mkaX67',0,NULL,0,0,'2017-12-23T01:24:04.681Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('2GOsNT5LsvTP','mcEwFMSjhlvL','C44aq4mkaX67',1,NULL,0,0,'2017-12-23T01:29:35.974Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('RxUiraiR655R','CF2lUIJAr6Ey','NncfGH8dyNjJ',2,NULL,0,0,'2017-12-23T01:34:37.658Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('mZuSrZ18Zmv0','xkXwueRoDNeN','MG0wntwILQW6',0,NULL,0,0,'2017-12-23T01:35:40.306Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('hbcWTnEnXPwF','eXHZAKsMYgur','1Heh2acXfPNt',9,NULL,0,0,'2017-12-23T03:32:42.868Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('8a3aNxjG0nu7','2WU27ekfy07E','eXHZAKsMYgur',0,NULL,0,0,'2017-12-23T03:32:49.379Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('4Tu6vaPdCxCM','TjWEndYCCg7g','eXHZAKsMYgur',1,NULL,0,0,'2017-12-23T03:33:23.584Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('lBPOmhP12egP','8nRNDJGyGs2Z','TjWEndYCCg7g',0,NULL,0,0,'2017-12-23T03:33:37.327Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('4Tu6vaPdCxCM','TjWEndYCCg7g','eXHZAKsMYgur',1,NULL,1,0,'2017-12-23T03:33:23.584Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('lBPOmhP12egP','8nRNDJGyGs2Z','TjWEndYCCg7g',0,NULL,1,0,'2017-12-23T03:33:37.327Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('C5ipVqeDWySp','9zSwD89vgzNO','8nRNDJGyGs2Z',0,NULL,0,0,'2017-12-23T03:37:04.912Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('uSitzbGcSATJ','u5t1EvWa3CMO','TjWEndYCCg7g',1,NULL,0,0,'2017-12-23T03:39:21.918Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('GZ6aRI8rdSJt','8nRNDJGyGs2Z','MG0wntwILQW6',1,'',0,0,'2017-12-23T03:42:28.310Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('GZ6aRI8rdSJt','8nRNDJGyGs2Z','MG0wntwILQW6',1,'',1,0,'2017-12-23T03:42:28.310Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('uipfvAfwWRgx','6ZuXjCSWgjB4','HJusZTbBU494',0,NULL,0,0,'2017-12-23T03:44:54.096Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('nMRpPWWH8WRk','GpGnjmcAPeWG','6ZuXjCSWgjB4',1,NULL,0,0,'2017-12-23T03:44:57.036Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('c4wt27WNjepw','21K84UqGhqlt','GpGnjmcAPeWG',0,NULL,0,0,'2017-12-23T03:45:10.933Z','','1970-01-01T00:00:00.000Z');
|
||||
@@ -33,11 +33,11 @@ INSERT INTO branches VALUES('gSRkHpB7Bu3D','pOFVzbXLmzhX','R6pheWjdwmNU',2,NULL,
|
||||
INSERT INTO branches VALUES('6brdjeWDOB6w','0xtvjqrcGiRB','ZC78NlmdXeC6',0,NULL,0,0,'2017-12-23T04:02:06.650Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('AqKUM2zUVFUF','Zl69uXBSen0w','ZC78NlmdXeC6',2,NULL,1,0,'2017-12-23T04:02:16.685Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('Ez7NN2WVzRc4','62BKAQMVP2KW','Zl69uXBSen0w',1,NULL,0,0,'2017-12-23T04:02:39.164Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('t3vVElqMIQVa','h4OfLEAYspud','WdWZFuWNVDZk',2,NULL,0,0,'2017-12-23T04:06:25.769Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('t3vVElqMIQVa','h4OfLEAYspud','WdWZFuWNVDZk',2,NULL,1,0,'2017-12-23T04:06:25.769Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('O983DHtLpgmr','1hASbLRDL7oo','h4OfLEAYspud',0,NULL,0,0,'2017-12-23T16:42:26.347Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('RsvL795Mk1bp','1hASbLRDL7oo','GpGnjmcAPeWG',1,'',0,0,'2017-12-23T04:04:56.830Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('79e4hrHLFmx6','jyqG9GucsMdn','Iha4YwchR413',1,NULL,0,0,'2017-12-23T04:05:16.439Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('oWO8rctUjf7d','WdWZFuWNVDZk','1Heh2acXfPNt',13,NULL,1,0,'2017-12-23T04:06:16.179Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('oWO8rctUjf7d','WdWZFuWNVDZk','1Heh2acXfPNt',13,NULL,0,0,'2017-12-23T04:06:16.179Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('GOxcrZrxalFN','yK4SBJfwD3tY','1Heh2acXfPNt',18,NULL,0,0,'2017-12-23T04:06:32.833Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('bSPmEvjLzQKU','r4BnsmSQeVr1','yK4SBJfwD3tY',0,NULL,0,0,'2017-12-23T04:06:37.427Z','','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('bMtxCD6cwNR9','QbL3pTvhgzM8','yK4SBJfwD3tY',2,NULL,0,0,'2017-12-23T04:06:43.841Z','','1970-01-01T00:00:00.000Z');
|
||||
@@ -84,8 +84,8 @@ INSERT INTO branches VALUES('bryQseMhyzaI','IlULcDiOTI4K','1Heh2acXfPNt',2,NULL,
|
||||
INSERT INTO branches VALUES('u84s3tBBB92g','TlGCAdcfxkOT','eXHZAKsMYgur',2,NULL,0,0,'2018-08-29T17:11:16.550Z','Ei4ozqDMWi','2018-08-29T17:11:16.550Z');
|
||||
INSERT INTO branches VALUES('yMhwsE7uvEij','3oldoiMUPOlr','HJusZTbBU494',1,NULL,1,0,'2018-08-29T17:20:59.012Z','7U4pIRsbwO','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('NTlSXCbgt5Va','Lt8IUldw7d7H','3RkyK9LI18dO',3,NULL,0,0,'2018-08-29T17:23:45.198Z','QjebjIeHUj','2018-08-29T17:23:45.198Z');
|
||||
INSERT INTO branches VALUES('0fpnraUGs9Kl','rz5t0r9Qr2WC','HJusZTbBU494',2,NULL,0,0,'2018-08-29T17:26:27.928Z','rw9k0n9SUb','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('uMt25KxpV45Y','tX80udgxnW5n','3oldoiMUPOlr',1,NULL,0,0,'2018-08-29T17:29:24.554Z','XlDqz7PX7X','2018-08-29T17:29:24.554Z');
|
||||
INSERT INTO branches VALUES('0fpnraUGs9Kl','rz5t0r9Qr2WC','HJusZTbBU494',2,NULL,1,0,'2018-08-29T17:26:27.928Z','rw9k0n9SUb','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('uMt25KxpV45Y','tX80udgxnW5n','3oldoiMUPOlr',1,NULL,1,0,'2018-08-29T17:29:24.554Z','XlDqz7PX7X','2018-08-29T17:29:24.554Z');
|
||||
INSERT INTO branches VALUES('IsCUFfM1QzHl','rUsGgtpohm7T','3oldoiMUPOlr',21,NULL,0,0,'2018-08-29T17:29:32.942Z','o8ZNDOfGSB','2018-08-29T17:29:32.942Z');
|
||||
INSERT INTO branches VALUES('UozNcoXYDovC','sXti7HgialF2','3oldoiMUPOlr',23,NULL,1,0,'2018-08-29T17:29:43.138Z','mDyppB0lkz','2018-08-29T17:29:43.138Z');
|
||||
INSERT INTO branches VALUES('3B2q1J0jymcC','uP3V8BqwXC05','L9qettZi0csz',0,NULL,0,0,'2018-08-29T19:42:32.718Z','fgHfgNl00Y','2018-08-29T19:42:32.718Z');
|
||||
@@ -103,12 +103,12 @@ INSERT INTO branches VALUES('NnybbW5xPPHO','9HHqPxJkLAkl','IYKhW6LTUpwP',1,NULL,
|
||||
INSERT INTO branches VALUES('Fq4TqKTo93aK','EluAg7EiealE','L9qettZi0csz',2,NULL,0,0,'2018-08-29T19:53:44.530Z','mJCxaZ1mlW','2018-08-29T19:53:44.530Z');
|
||||
INSERT INTO branches VALUES('2dac99oNkdH3','vkoNZlNO5TO4','Dyahpf7LroQY',2,NULL,0,0,'2018-08-29T19:54:19.618Z','fN3DqnjcUb','2018-08-29T19:54:19.618Z');
|
||||
INSERT INTO branches VALUES('8aSc0sibmCZm','EluAg7EiealE','vkoNZlNO5TO4',0,NULL,0,0,'2018-08-29T19:54:19.637Z','RpUFzJs2RD','2018-08-29T19:54:19.637Z');
|
||||
INSERT INTO branches VALUES('uMnwVhwtdXZg','cUWgYJfpp8G8','3oldoiMUPOlr',24,NULL,0,0,'2018-08-29T19:55:04.661Z','ZMEYWKhIhB','2018-08-29T19:55:04.661Z');
|
||||
INSERT INTO branches VALUES('uMnwVhwtdXZg','cUWgYJfpp8G8','3oldoiMUPOlr',24,NULL,1,0,'2018-08-29T19:55:04.661Z','ZMEYWKhIhB','2018-08-29T19:55:04.661Z');
|
||||
INSERT INTO branches VALUES('kS7GsSvztE1J','EluAg7EiealE','cUWgYJfpp8G8',0,'TODO',NULL,0,'2018-08-29T19:55:04.691Z','72zbNyyFRw','2018-08-29T19:54:38.626Z');
|
||||
INSERT INTO branches VALUES('EjQTcVVHFmmZ','MG0wntwILQW6','3oldoiMUPOlr',19,NULL,1,0,'2018-08-29T19:55:53.824Z','bx2z9074Vi','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('HsN4600rQoL9','Iha4YwchR413','3oldoiMUPOlr',17,NULL,0,0,'2018-08-29T17:26:52.528Z','GBlVZxHhto','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('fQ2BsgDWdqoE','1Fi3MpUkZkLk','3oldoiMUPOlr',16,NULL,0,0,'2018-08-29T19:56:00.793Z','tk6763xjRL','2018-08-29T17:29:02.035Z');
|
||||
INSERT INTO branches VALUES('Sv77hHzVZvdw','cwPuYRAGKtUi','3oldoiMUPOlr',2,NULL,0,0,'2018-08-29T19:56:04.404Z','Uwn3W1Q8py','2018-08-29T17:29:16.635Z');
|
||||
INSERT INTO branches VALUES('EjQTcVVHFmmZ','MG0wntwILQW6','3oldoiMUPOlr',19,NULL,0,0,'2018-08-29T19:55:53.824Z','bx2z9074Vi','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('HsN4600rQoL9','Iha4YwchR413','3oldoiMUPOlr',17,NULL,1,0,'2018-08-29T17:26:52.528Z','GBlVZxHhto','1970-01-01T00:00:00.000Z');
|
||||
INSERT INTO branches VALUES('fQ2BsgDWdqoE','1Fi3MpUkZkLk','3oldoiMUPOlr',16,NULL,1,0,'2018-08-29T19:56:00.793Z','tk6763xjRL','2018-08-29T17:29:02.035Z');
|
||||
INSERT INTO branches VALUES('Sv77hHzVZvdw','cwPuYRAGKtUi','3oldoiMUPOlr',2,NULL,1,0,'2018-08-29T19:56:04.404Z','Uwn3W1Q8py','2018-08-29T17:29:16.635Z');
|
||||
INSERT INTO branches VALUES('kPZLi2VKVjQ1','2V9Zg9CXdNvn','nUgD4SYx2gt7',6,NULL,0,0,'2018-08-29T19:57:02.270Z','v0dB+4MnXy','2018-08-29T19:57:02.270Z');
|
||||
INSERT INTO branches VALUES('9nEK1jBKqdL7','cmYy3Z22F4MY','9HHqPxJkLAkl',1,NULL,0,0,'2018-08-29T19:57:11.828Z','P7AvZh6VlN','2018-08-29T19:57:11.828Z');
|
||||
INSERT INTO branches VALUES('HVvl5lR3Db7p','cmYy3Z22F4MY','cwPuYRAGKtUi',1,'DONE',NULL,0,'2018-08-29T19:57:39.314Z','dZK0rWy9IN','2018-08-29T19:57:11.876Z');
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -288,7 +288,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -426,7 +426,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -3814,7 +3814,7 @@ transactional by default.
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -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"> → {<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">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -380,7 +380,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -613,7 +613,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -809,7 +809,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -1005,7 +1005,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -1177,7 +1177,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -1233,7 +1233,7 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getAttributes"><span class="type-signature">(async) </span>getAttributes<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<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"> → {Promise.<Array.<<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">
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1457,7 +1518,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -1561,7 +1622,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -1661,7 +1722,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -1765,7 +1826,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -1918,7 +1979,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -1974,7 +2035,7 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getLabels"><span class="type-signature">(async) </span>getLabels<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<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"> → {Promise.<Array.<<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">
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -2175,7 +2297,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -2279,7 +2401,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -2483,7 +2605,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -2636,7 +2758,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -2692,7 +2814,7 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getRelations"><span class="type-signature">(async) </span>getRelations<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<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"> → {Promise.<Array.<<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">
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -2893,7 +3076,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -3049,7 +3232,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -3157,7 +3340,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -3433,7 +3616,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -3489,6 +3672,110 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="hasChildren"><span class="type-signature">(async) </span>hasChildren<span class="signature">()</span><span class="type-signature"> → {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"> → {Promise.<boolean>}</span></h4>
|
||||
|
||||
|
||||
@@ -3586,7 +3873,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -3739,7 +4026,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -3848,7 +4135,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -4346,7 +4633,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -4573,7 +4860,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -4769,7 +5056,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -4965,7 +5252,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -5192,7 +5479,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -5388,7 +5675,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -5584,7 +5871,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -5842,7 +6129,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -6069,7 +6356,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -6296,7 +6583,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#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>
|
||||
|
||||
|
||||
@@ -6364,7 +6651,7 @@ Cache is note instance scoped.
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -334,7 +334,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -403,7 +403,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -75,7 +75,7 @@ module.exports = ApiToken;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -134,7 +134,7 @@ module.exports = Attribute;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -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
|
||||
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() {
|
||||
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
||||
}
|
||||
@@ -97,7 +105,7 @@ module.exports = Branch;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -93,7 +93,7 @@ module.exports = Entity;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -83,7 +83,7 @@ module.exports = Image;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -127,23 +127,37 @@ class Note extends Entity {
|
||||
return await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
|
||||
}
|
||||
|
||||
/** @returns {Promise<Attribute[]>} all note's attributes, including inherited ones */
|
||||
async getAttributes() {
|
||||
/**
|
||||
* @param {string} [name] - attribute name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's attributes, including inherited ones
|
||||
*/
|
||||
async getAttributes(name) {
|
||||
if (!this.__attributeCache) {
|
||||
await this.loadAttributesToCache();
|
||||
}
|
||||
|
||||
return this.__attributeCache;
|
||||
if (name) {
|
||||
return this.__attributeCache.filter(attr => attr.name === name);
|
||||
}
|
||||
else {
|
||||
return this.__attributeCache;
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {Promise<Attribute[]>} all note's labels (attributes with type label), including inherited ones */
|
||||
async getLabels() {
|
||||
return (await this.getAttributes()).filter(attr => attr.type === LABEL);
|
||||
/**
|
||||
* @param {string} [name] - label name to filter
|
||||
* @returns {Promise<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);
|
||||
}
|
||||
|
||||
/** @returns {Promise<Attribute[]>} all note's relations (attributes with type relation), including inherited ones */
|
||||
async getRelations() {
|
||||
return (await this.getAttributes()).filter(attr => attr.type === RELATION);
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Promise<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]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean} - true if note has children
|
||||
*/
|
||||
async hasChildren() {
|
||||
return (await this.getChildNotes()).length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Note[]>} child notes of this note
|
||||
*/
|
||||
@@ -580,7 +601,7 @@ module.exports = Note;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -90,7 +90,7 @@ module.exports = NoteImage;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -91,7 +91,7 @@ module.exports = NoteRevision;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -78,7 +78,7 @@ module.exports = Option;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -75,7 +75,7 @@ module.exports = RecentNote;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -594,7 +594,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -278,7 +278,7 @@ module.exports = BackendScriptApi;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -719,7 +719,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -444,7 +444,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -573,7 +573,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -726,7 +726,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -879,7 +879,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -1057,7 +1057,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -1188,7 +1188,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -1244,6 +1244,110 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getCurrentNoteContent"><span class="type-signature"></span>getCurrentNoteContent<span class="signature">()</span><span class="type-signature"> → {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"> → {string}</span></h4>
|
||||
|
||||
|
||||
@@ -1297,7 +1401,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -1496,7 +1600,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1753,7 +1988,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -1930,7 +2165,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -2087,7 +2322,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -2222,7 +2457,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -2272,7 +2507,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -1316,7 +1316,7 @@ Its notable omission is the note content.</div>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -76,7 +76,7 @@ export default Branch;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -64,7 +64,7 @@ export default NoteFull;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -128,7 +128,7 @@ export default NoteShort;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -303,7 +303,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#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>
|
||||
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -32,6 +32,7 @@ import utils from './utils.js';
|
||||
import infoService from './info.js';
|
||||
import linkService from './link.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.
|
||||
@@ -219,6 +220,18 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
|
||||
* @param {string} [noteTitle] - if not present we'll use note title
|
||||
*/
|
||||
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>
|
||||
@@ -237,7 +250,7 @@ export default FrontendScriptApi;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
328
package-lock.json
generated
328
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "trilium",
|
||||
"version": "0.20.1",
|
||||
"version": "0.20.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -788,6 +788,11 @@
|
||||
"resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz",
|
||||
"integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE="
|
||||
},
|
||||
"array-equal": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz",
|
||||
"integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM="
|
||||
},
|
||||
"array-find-index": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
|
||||
@@ -2163,6 +2168,11 @@
|
||||
"repeat-element": "1.1.2"
|
||||
}
|
||||
},
|
||||
"browser-process-hrtime": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz",
|
||||
"integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44="
|
||||
},
|
||||
"browserslist": {
|
||||
"version": "1.7.7",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz",
|
||||
@@ -2752,6 +2762,24 @@
|
||||
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
|
||||
"dev": true
|
||||
},
|
||||
"commonmark": {
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/commonmark/-/commonmark-0.28.1.tgz",
|
||||
"integrity": "sha1-Buq41SM4uDn6Gi11rwCF7tGxvq4=",
|
||||
"requires": {
|
||||
"entities": "1.1.1",
|
||||
"mdurl": "1.0.1",
|
||||
"minimist": "1.2.0",
|
||||
"string.prototype.repeat": "0.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
|
||||
}
|
||||
}
|
||||
},
|
||||
"compare-version": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/compare-version/-/compare-version-0.1.2.tgz",
|
||||
@@ -3063,8 +3091,7 @@
|
||||
"cssom": {
|
||||
"version": "0.3.4",
|
||||
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz",
|
||||
"integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==",
|
||||
"dev": true
|
||||
"integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog=="
|
||||
},
|
||||
"cssstyle": {
|
||||
"version": "0.2.37",
|
||||
@@ -3103,6 +3130,51 @@
|
||||
"resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz",
|
||||
"integrity": "sha1-bYCcnNDPe7iVLYD8hPoT1H3bEwg="
|
||||
},
|
||||
"data-urls": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.0.1.tgz",
|
||||
"integrity": "sha512-0HdcMZzK6ubMUnsMmQmG0AcLQPvbvb47R0+7CCZQCYgcd8OUWG91CG7sM6GoXgjz+WLl4ArFzHtBMy/QqSF4eg==",
|
||||
"requires": {
|
||||
"abab": "2.0.0",
|
||||
"whatwg-mimetype": "2.1.0",
|
||||
"whatwg-url": "7.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"abab": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz",
|
||||
"integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w=="
|
||||
},
|
||||
"punycode": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
||||
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
|
||||
},
|
||||
"tr46": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz",
|
||||
"integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=",
|
||||
"requires": {
|
||||
"punycode": "2.1.1"
|
||||
}
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
|
||||
"integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz",
|
||||
"integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==",
|
||||
"requires": {
|
||||
"lodash.sortby": "4.7.0",
|
||||
"tr46": "1.0.1",
|
||||
"webidl-conversions": "4.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dateformat": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz",
|
||||
@@ -3459,8 +3531,7 @@
|
||||
"deep-is": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
|
||||
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
|
||||
"dev": true
|
||||
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ="
|
||||
},
|
||||
"deep-strict-equal": {
|
||||
"version": "0.2.0",
|
||||
@@ -3755,6 +3826,21 @@
|
||||
"integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=",
|
||||
"dev": true
|
||||
},
|
||||
"domexception": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz",
|
||||
"integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==",
|
||||
"requires": {
|
||||
"webidl-conversions": "4.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"webidl-conversions": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
|
||||
"integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"domhandler": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz",
|
||||
@@ -4435,8 +4521,7 @@
|
||||
"entities": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
|
||||
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=",
|
||||
"dev": true
|
||||
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA="
|
||||
},
|
||||
"env-editor": {
|
||||
"version": "0.3.1",
|
||||
@@ -4512,8 +4597,6 @@
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.10.0.tgz",
|
||||
"integrity": "sha512-fjUOf8johsv23WuIKdNQU4P9t9jhQ4Qzx6pC2uW890OloK3Zs1ZAoCNpg/2larNF501jLl3UNy0kIRcF6VI22g==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"esprima": "3.1.3",
|
||||
"estraverse": "4.2.0",
|
||||
@@ -4525,15 +4608,12 @@
|
||||
"esprima": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz",
|
||||
"integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM="
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
@@ -4788,14 +4868,12 @@
|
||||
"estraverse": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
|
||||
"integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
|
||||
"dev": true
|
||||
"integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM="
|
||||
},
|
||||
"esutils": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
|
||||
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
|
||||
"dev": true
|
||||
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs="
|
||||
},
|
||||
"etag": {
|
||||
"version": "1.8.1",
|
||||
@@ -5472,8 +5550,7 @@
|
||||
"fast-levenshtein": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
|
||||
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
|
||||
"dev": true
|
||||
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
|
||||
},
|
||||
"fd-slicer": {
|
||||
"version": "1.0.1",
|
||||
@@ -6568,6 +6645,14 @@
|
||||
"integrity": "sha1-ZouTd26q5V696POtRkswekljYl4=",
|
||||
"dev": true
|
||||
},
|
||||
"html-encoding-sniffer": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz",
|
||||
"integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==",
|
||||
"requires": {
|
||||
"whatwg-encoding": "1.0.4"
|
||||
}
|
||||
},
|
||||
"htmlparser2": {
|
||||
"version": "3.8.3",
|
||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz",
|
||||
@@ -7971,6 +8056,11 @@
|
||||
"invert-kv": "1.0.0"
|
||||
}
|
||||
},
|
||||
"left-pad": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz",
|
||||
"integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA=="
|
||||
},
|
||||
"less": {
|
||||
"version": "2.7.3",
|
||||
"resolved": "https://registry.npmjs.org/less/-/less-2.7.3.tgz",
|
||||
@@ -8122,7 +8212,6 @@
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
|
||||
"integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"prelude-ls": "1.1.2",
|
||||
"type-check": "0.3.2"
|
||||
@@ -8315,6 +8404,11 @@
|
||||
"integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=",
|
||||
"dev": true
|
||||
},
|
||||
"lodash.sortby": {
|
||||
"version": "4.7.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
|
||||
"integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg="
|
||||
},
|
||||
"lodash.template": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz",
|
||||
@@ -8510,6 +8604,11 @@
|
||||
"integrity": "sha1-3oGf282E3M2PrlnGrreWFbnSZqw=",
|
||||
"dev": true
|
||||
},
|
||||
"mdurl": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
|
||||
"integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4="
|
||||
},
|
||||
"media-typer": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||
@@ -9352,6 +9451,11 @@
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"nwsapi": {
|
||||
"version": "2.0.9",
|
||||
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.9.tgz",
|
||||
"integrity": "sha512-nlWFSCTYQcHk/6A9FFnfhKc14c3aFhfdNBXgo8Qgi9QTBu/qg3Ww+Uiz9wMzXd1T8GFxPc2QIHB6Qtf2XFryFQ=="
|
||||
},
|
||||
"oauth-sign": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
|
||||
@@ -9522,7 +9626,6 @@
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
|
||||
"integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"deep-is": "0.1.3",
|
||||
"fast-levenshtein": "2.0.6",
|
||||
@@ -10002,6 +10105,11 @@
|
||||
"integrity": "sha1-KYuJ34uTsCIdv0Ia0rGx6iP8Z3c=",
|
||||
"dev": true
|
||||
},
|
||||
"pn": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz",
|
||||
"integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA=="
|
||||
},
|
||||
"pngjs": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.3.3.tgz",
|
||||
@@ -10321,8 +10429,7 @@
|
||||
"prelude-ls": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
|
||||
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
|
||||
"dev": true
|
||||
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
|
||||
},
|
||||
"prepend-http": {
|
||||
"version": "1.0.4",
|
||||
@@ -10919,6 +11026,16 @@
|
||||
"lodash": "4.17.4"
|
||||
}
|
||||
},
|
||||
"request-promise-native": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz",
|
||||
"integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=",
|
||||
"requires": {
|
||||
"request-promise-core": "1.1.1",
|
||||
"stealthy-require": "1.1.1",
|
||||
"tough-cookie": "2.3.3"
|
||||
}
|
||||
},
|
||||
"require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
@@ -11798,6 +11915,11 @@
|
||||
"strip-ansi": "3.0.1"
|
||||
}
|
||||
},
|
||||
"string.prototype.repeat": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz",
|
||||
"integrity": "sha1-q6Nt4I3O5qWjN9SbLqHaGyj8Ds8="
|
||||
},
|
||||
"string.prototype.trim": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz",
|
||||
@@ -12025,9 +12147,7 @@
|
||||
"symbol-tree": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz",
|
||||
"integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY="
|
||||
},
|
||||
"synchronous-promise": {
|
||||
"version": "1.0.18",
|
||||
@@ -12518,6 +12638,107 @@
|
||||
"safe-buffer": "5.1.1"
|
||||
}
|
||||
},
|
||||
"turndown": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/turndown/-/turndown-5.0.1.tgz",
|
||||
"integrity": "sha512-OuNongGmx5vo1TWuSFmVa4Rkm/HxFNPU3dyP9OpOMF2RFTtl0RU+QLIIROcDvXWauFJaLpZaZeVMAsL8vrt3Tw==",
|
||||
"requires": {
|
||||
"jsdom": "11.12.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"abab": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz",
|
||||
"integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w=="
|
||||
},
|
||||
"acorn": {
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.2.tgz",
|
||||
"integrity": "sha512-cJrKCNcr2kv8dlDnbw+JPUGjHZzo4myaxOLmpOX8a+rgX94YeTcTMv/LFJUSByRpc+i4GgVnnhLxvMu/2Y+rqw=="
|
||||
},
|
||||
"acorn-globals": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.1.0.tgz",
|
||||
"integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==",
|
||||
"requires": {
|
||||
"acorn": "5.7.2"
|
||||
}
|
||||
},
|
||||
"cssstyle": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.1.1.tgz",
|
||||
"integrity": "sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog==",
|
||||
"requires": {
|
||||
"cssom": "0.3.4"
|
||||
}
|
||||
},
|
||||
"jsdom": {
|
||||
"version": "11.12.0",
|
||||
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz",
|
||||
"integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==",
|
||||
"requires": {
|
||||
"abab": "2.0.0",
|
||||
"acorn": "5.7.2",
|
||||
"acorn-globals": "4.1.0",
|
||||
"array-equal": "1.0.0",
|
||||
"cssom": "0.3.4",
|
||||
"cssstyle": "1.1.1",
|
||||
"data-urls": "1.0.1",
|
||||
"domexception": "1.0.1",
|
||||
"escodegen": "1.10.0",
|
||||
"html-encoding-sniffer": "1.0.2",
|
||||
"left-pad": "1.3.0",
|
||||
"nwsapi": "2.0.9",
|
||||
"parse5": "4.0.0",
|
||||
"pn": "1.1.0",
|
||||
"request": "2.88.0",
|
||||
"request-promise-native": "1.0.5",
|
||||
"sax": "1.2.4",
|
||||
"symbol-tree": "3.2.2",
|
||||
"tough-cookie": "2.4.3",
|
||||
"w3c-hr-time": "1.0.1",
|
||||
"webidl-conversions": "4.0.2",
|
||||
"whatwg-encoding": "1.0.4",
|
||||
"whatwg-mimetype": "2.1.0",
|
||||
"whatwg-url": "6.5.0",
|
||||
"ws": "5.2.2",
|
||||
"xml-name-validator": "3.0.0"
|
||||
}
|
||||
},
|
||||
"parse5": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz",
|
||||
"integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA=="
|
||||
},
|
||||
"tough-cookie": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
|
||||
"integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
|
||||
"requires": {
|
||||
"psl": "1.1.29",
|
||||
"punycode": "1.4.1"
|
||||
}
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
|
||||
"integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="
|
||||
},
|
||||
"ws": {
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz",
|
||||
"integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==",
|
||||
"requires": {
|
||||
"async-limiter": "1.0.0"
|
||||
}
|
||||
},
|
||||
"xml-name-validator": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
|
||||
"integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"tweetnacl": {
|
||||
"version": "0.14.5",
|
||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
|
||||
@@ -12528,7 +12749,6 @@
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
|
||||
"integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"prelude-ls": "1.1.2"
|
||||
}
|
||||
@@ -13066,6 +13286,14 @@
|
||||
"integrity": "sha512-x3LV3wdmmERhVCYy3quqA57NJW7F3i6faas++pJQWtknWT+n7k30F4TVdHvCLn48peTJFRvCpxs3UuFPqgeELg==",
|
||||
"dev": true
|
||||
},
|
||||
"w3c-hr-time": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz",
|
||||
"integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=",
|
||||
"requires": {
|
||||
"browser-process-hrtime": "0.1.2"
|
||||
}
|
||||
},
|
||||
"ware": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ware/-/ware-1.3.0.tgz",
|
||||
@@ -13081,6 +13309,49 @@
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"whatwg-encoding": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.4.tgz",
|
||||
"integrity": "sha512-vM9KWN6MP2mIHZ86ytcyIv7e8Cj3KTfO2nd2c8PFDqcI4bxFmQp83ibq4wadq7rL9l9sZV6o9B0LTt8ygGAAXg==",
|
||||
"requires": {
|
||||
"iconv-lite": "0.4.23"
|
||||
}
|
||||
},
|
||||
"whatwg-mimetype": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz",
|
||||
"integrity": "sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew=="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "6.5.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz",
|
||||
"integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==",
|
||||
"requires": {
|
||||
"lodash.sortby": "4.7.0",
|
||||
"tr46": "1.0.1",
|
||||
"webidl-conversions": "4.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"punycode": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
||||
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
|
||||
},
|
||||
"tr46": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz",
|
||||
"integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=",
|
||||
"requires": {
|
||||
"punycode": "2.1.1"
|
||||
}
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
|
||||
"integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"whatwg-url-compat": {
|
||||
"version": "0.6.5",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url-compat/-/whatwg-url-compat-0.6.5.tgz",
|
||||
@@ -13188,8 +13459,7 @@
|
||||
"wordwrap": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||
"integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
|
||||
"dev": true
|
||||
"integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus="
|
||||
},
|
||||
"wrap-ansi": {
|
||||
"version": "2.1.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "trilium",
|
||||
"description": "Trilium Notes",
|
||||
"version": "0.20.2",
|
||||
"version": "0.21.0",
|
||||
"license": "AGPL-3.0-only",
|
||||
"main": "electron.js",
|
||||
"bin": {
|
||||
@@ -30,6 +30,7 @@
|
||||
"axios": "0.18",
|
||||
"body-parser": "1.18.3",
|
||||
"cls-hooked": "4.2.2",
|
||||
"commonmark": "^0.28.1",
|
||||
"cookie-parser": "1.4.3",
|
||||
"debug": "3.1.0",
|
||||
"devtron": "1.4.0",
|
||||
@@ -65,6 +66,7 @@
|
||||
"simple-node-logger": "0.93.37",
|
||||
"sqlite": "3.0.0",
|
||||
"tar-stream": "1.6.1",
|
||||
"turndown": "^5.0.1",
|
||||
"unescape": "1.0.1",
|
||||
"ws": "6.0.0",
|
||||
"xml2js": "0.4.19"
|
||||
|
||||
@@ -34,6 +34,7 @@ class Branch extends Entity {
|
||||
this.origParentNoteId = this.parentNoteId;
|
||||
}
|
||||
|
||||
/** @returns {Note|null} */
|
||||
async getNote() {
|
||||
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
||||
}
|
||||
|
||||
@@ -482,6 +482,13 @@ class Note extends Entity {
|
||||
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<Note[]>} child notes of this note
|
||||
*/
|
||||
|
||||
4
src/public/javascripts/services/bootstrap.js
vendored
4
src/public/javascripts/services/bootstrap.js
vendored
@@ -8,7 +8,7 @@ import optionsDialog from '../dialogs/options.js';
|
||||
import sqlConsoleDialog from '../dialogs/sql_console.js';
|
||||
|
||||
import cloning from './cloning.js';
|
||||
import contextMenu from './context_menu.js';
|
||||
import contextMenu from './tree_context_menu.js';
|
||||
import dragAndDropSetup from './drag_and_drop.js';
|
||||
import exportService from './export.js';
|
||||
import link from './link.js';
|
||||
@@ -98,6 +98,8 @@ if (utils.isElectron()) {
|
||||
});
|
||||
}
|
||||
|
||||
$("#export-note-to-markdown-button").click(() => exportService.exportSubtree(noteDetailService.getCurrentNoteId(), 'markdown-single'));
|
||||
|
||||
treeService.showTree();
|
||||
|
||||
entrypoints.registerEntrypoints();
|
||||
|
||||
@@ -26,12 +26,17 @@ $("#import-upload").change(async function() {
|
||||
url: baseApiUrl + 'notes/' + importNoteId + '/import',
|
||||
headers: server.getHeaders(),
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
contentType: false, // NEEDED, DON'T OMIT THIS
|
||||
processData: false, // NEEDED, DON'T OMIT THIS
|
||||
}).fail((xhr, status, error) => alert('Import error: ' + xhr.responseText));
|
||||
})
|
||||
.fail((xhr, status, error) => alert('Import error: ' + xhr.responseText))
|
||||
.done(async note => {
|
||||
await treeService.reload();
|
||||
|
||||
await treeService.reload();
|
||||
await treeService.activateNote(note.noteId);
|
||||
});
|
||||
});
|
||||
|
||||
export default {
|
||||
|
||||
@@ -4,6 +4,7 @@ import utils from './utils.js';
|
||||
import infoService from './info.js';
|
||||
import linkService from './link.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.
|
||||
@@ -191,6 +192,18 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
|
||||
* @param {string} [noteTitle] - if not present we'll use note title
|
||||
*/
|
||||
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 as user is typing (not necessarily tied to save event)
|
||||
*/
|
||||
this.onNoteChange = noteDetailService.onNoteChange;
|
||||
}
|
||||
|
||||
export default FrontendScriptApi;
|
||||
@@ -20,6 +20,8 @@ const CODE_MIRROR = {
|
||||
|
||||
const ESLINT = {js: ["libraries/eslint.js"]};
|
||||
|
||||
const COMMONMARK = {js: ["libraries/commonmark.min.js"]};
|
||||
|
||||
async function requireLibrary(library) {
|
||||
if (library.css) {
|
||||
library.css.map(cssUrl => requireCss(cssUrl));
|
||||
@@ -61,5 +63,6 @@ export default {
|
||||
requireLibrary,
|
||||
CKEDITOR,
|
||||
CODE_MIRROR,
|
||||
ESLINT
|
||||
ESLINT,
|
||||
COMMONMARK
|
||||
}
|
||||
@@ -49,6 +49,10 @@ const components = {
|
||||
};
|
||||
|
||||
function getComponent(type) {
|
||||
if (!type) {
|
||||
type = getCurrentNote().type;
|
||||
}
|
||||
|
||||
if (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() {
|
||||
const note = getCurrentNote();
|
||||
|
||||
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
|
||||
// otherwise we might overwrite another change (especially async code)
|
||||
@@ -107,7 +119,6 @@ async function saveNote() {
|
||||
|
||||
await server.put('notes/' + note.noteId, note.dto);
|
||||
|
||||
|
||||
if (note.isProtected) {
|
||||
protectedSessionHolder.touchProtectedSession();
|
||||
}
|
||||
@@ -448,7 +459,7 @@ async function showAttributes() {
|
||||
$attributeListInner.append(utils.formatLabel(attribute) + " ");
|
||||
}
|
||||
else if (attribute.type === 'relation') {
|
||||
$attributeListInner.append(attribute.name + "=");
|
||||
$attributeListInner.append('@' + attribute.name + "=");
|
||||
$attributeListInner.append(await linkService.createNoteLink(attribute.value));
|
||||
$attributeListInner.append(" ");
|
||||
}
|
||||
@@ -549,5 +560,7 @@ export default {
|
||||
refreshAttributes,
|
||||
saveNote,
|
||||
saveNoteIfChanged,
|
||||
noteChanged
|
||||
noteChanged,
|
||||
getCurrentNoteContent,
|
||||
onNoteChange
|
||||
};
|
||||
@@ -35,7 +35,7 @@ async function show() {
|
||||
tabindex: 100
|
||||
});
|
||||
|
||||
codeEditor.on('change', noteDetailService.noteChanged);
|
||||
onNoteChange(noteDetailService.noteChanged);
|
||||
}
|
||||
|
||||
$noteDetailCode.show();
|
||||
@@ -85,6 +85,10 @@ async function executeCurrentNote() {
|
||||
infoService.showMessage("Note executed");
|
||||
}
|
||||
|
||||
function onNoteChange(func) {
|
||||
codeEditor.on('change', func);
|
||||
}
|
||||
|
||||
$(document).bind('keydown', "ctrl+return", executeCurrentNote);
|
||||
|
||||
$executeScriptButton.click(executeCurrentNote);
|
||||
@@ -92,5 +96,6 @@ $executeScriptButton.click(executeCurrentNote);
|
||||
export default {
|
||||
show,
|
||||
getContent,
|
||||
focus
|
||||
focus,
|
||||
onNoteChange
|
||||
}
|
||||
@@ -46,5 +46,6 @@ function getFileUrl() {
|
||||
export default {
|
||||
show,
|
||||
getContent: () => null,
|
||||
focus: () => null
|
||||
focus: () => null,
|
||||
onNoteChange: () => null
|
||||
}
|
||||
@@ -34,5 +34,6 @@ $renderButton.click(render);
|
||||
export default {
|
||||
show: render,
|
||||
getContent: () => "",
|
||||
focus: () => null
|
||||
focus: () => null,
|
||||
onNoteChange: () => null
|
||||
}
|
||||
@@ -28,5 +28,6 @@ function show() {
|
||||
export default {
|
||||
getContent,
|
||||
show,
|
||||
focus: () => null
|
||||
focus: () => null,
|
||||
onNoteChange: () => null
|
||||
}
|
||||
@@ -1,8 +1,14 @@
|
||||
import libraryLoader from "./library_loader.js";
|
||||
import noteDetailService from './note_detail.js';
|
||||
import utils from "./utils.js";
|
||||
import infoService from "./info.js";
|
||||
|
||||
const $noteDetailText = $('#note-detail-text');
|
||||
|
||||
const $markdownImportDialog = $('#markdown-import-dialog');
|
||||
const $markdownImportTextarea = $('#markdown-import-textarea');
|
||||
const $markdownImportButton = $('#markdown-import-button');
|
||||
|
||||
let textEditor = null;
|
||||
|
||||
async function show() {
|
||||
@@ -12,9 +18,18 @@ async function show() {
|
||||
// textEditor might have been initialized during previous await so checking again
|
||||
// looks like double initialization can freeze CKEditor pretty badly
|
||||
if (!textEditor) {
|
||||
textEditor = await BalloonEditor.create($noteDetailText[0], {});
|
||||
textEditor = await BalloonEditor.create($noteDetailText[0], {
|
||||
heading: {
|
||||
options: [
|
||||
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
|
||||
{ model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
|
||||
{ model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
|
||||
{ model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
textEditor.model.document.on('change:data', noteDetailService.noteChanged);
|
||||
onNoteChange(noteDetailService.noteChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,9 +58,67 @@ function getEditor() {
|
||||
return textEditor;
|
||||
}
|
||||
|
||||
async function convertMarkdownToHtml(text) {
|
||||
await libraryLoader.requireLibrary(libraryLoader.COMMONMARK);
|
||||
|
||||
const reader = new commonmark.Parser();
|
||||
const writer = new commonmark.HtmlRenderer();
|
||||
const parsed = reader.parse(text);
|
||||
|
||||
const result = writer.render(parsed);
|
||||
|
||||
const viewFragment = textEditor.data.processor.toView(result);
|
||||
const modelFragment = textEditor.data.toModel(viewFragment);
|
||||
|
||||
textEditor.model.insertContent(modelFragment, textEditor.model.document.selection);
|
||||
|
||||
infoService.showMessage("Markdown content has been imported into the document.");
|
||||
}
|
||||
|
||||
async function importMarkdownInline() {
|
||||
if (utils.isElectron()) {
|
||||
const {clipboard} = require('electron');
|
||||
const text = clipboard.readText();
|
||||
|
||||
convertMarkdownToHtml(text);
|
||||
}
|
||||
else {
|
||||
$("input[name='search-text']").focus();
|
||||
|
||||
glob.activeDialog = $markdownImportDialog;
|
||||
|
||||
$markdownImportDialog.dialog({
|
||||
modal: true,
|
||||
width: 700,
|
||||
height: 500
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function sendMarkdownDialog() {
|
||||
const text = $markdownImportTextarea.val();
|
||||
|
||||
$markdownImportDialog.dialog('close');
|
||||
|
||||
await convertMarkdownToHtml(text);
|
||||
|
||||
$markdownImportTextarea.val('');
|
||||
}
|
||||
|
||||
function onNoteChange(func) {
|
||||
textEditor.model.document.on('change:data', func);
|
||||
}
|
||||
|
||||
$markdownImportButton.click(sendMarkdownDialog);
|
||||
|
||||
$markdownImportDialog.bind('keydown', 'ctrl+return', sendMarkdownDialog);
|
||||
|
||||
window.glob.importMarkdownInline = importMarkdownInline;
|
||||
|
||||
export default {
|
||||
show,
|
||||
getEditor,
|
||||
getContent,
|
||||
focus
|
||||
focus,
|
||||
onNoteChange
|
||||
}
|
||||
@@ -34,6 +34,7 @@ function NoteTypeModel() {
|
||||
{ mime: 'application/javascript;env=backend', title: 'JavaScript backend' },
|
||||
{ mime: 'application/json', title: 'JSON' },
|
||||
{ mime: 'text/x-kotlin', title: 'Kotlin' },
|
||||
{ mime: 'text/x-stex', title: 'LaTex' },
|
||||
{ mime: 'text/x-lua', title: 'Lua' },
|
||||
{ mime: 'text/x-markdown', title: 'Markdown' },
|
||||
{ mime: 'text/x-objectivec', title: 'Objective C' },
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import contextMenuService from './context_menu.js';
|
||||
import treeContextMenuService from './tree_context_menu.js';
|
||||
import dragAndDropSetup from './drag_and_drop.js';
|
||||
import linkService from './link.js';
|
||||
import messagingService from './messaging.js';
|
||||
@@ -369,7 +369,7 @@ function initFancyTree(tree) {
|
||||
}
|
||||
});
|
||||
|
||||
$tree.contextmenu(contextMenuService.contextMenuOptions);
|
||||
$tree.contextmenu(treeContextMenuService.contextMenuOptions);
|
||||
}
|
||||
|
||||
function getTree() {
|
||||
|
||||
@@ -96,9 +96,10 @@ const contextMenuOptions = {
|
||||
{title: "----"},
|
||||
{title: "Export subtree", cmd: "exportSubtree", uiIcon: " ui-icon-arrowthick-1-ne", children: [
|
||||
{title: "Native Tar", cmd: "exportSubtreeToTar"},
|
||||
{title: "OPML", cmd: "exportSubtreeToOpml"}
|
||||
{title: "OPML", cmd: "exportSubtreeToOpml"},
|
||||
{title: "Markdown", cmd: "exportSubtreeToMarkdown"}
|
||||
]},
|
||||
{title: "Import into note (tar, opml)", cmd: "importIntoNote", uiIcon: "ui-icon-arrowthick-1-sw"},
|
||||
{title: "Import into note (tar, opml, md)", cmd: "importIntoNote", uiIcon: "ui-icon-arrowthick-1-sw"},
|
||||
{title: "----"},
|
||||
{title: "Collapse subtree <kbd>Alt+-</kbd>", cmd: "collapseSubtree", uiIcon: "ui-icon-minus"},
|
||||
{title: "Force note sync", cmd: "forceNoteSync", uiIcon: "ui-icon-refresh"},
|
||||
@@ -167,10 +168,13 @@ const contextMenuOptions = {
|
||||
treeChangesService.deleteNodes(treeService.getSelectedNodes(true));
|
||||
}
|
||||
else if (ui.cmd === "exportSubtreeToTar") {
|
||||
exportService.exportSubtree(node.data.noteId, 'tar');
|
||||
exportService.exportSubtree(node.data.branchId, 'tar');
|
||||
}
|
||||
else if (ui.cmd === "exportSubtreeToOpml") {
|
||||
exportService.exportSubtree(node.data.noteId, 'opml');
|
||||
exportService.exportSubtree(node.data.branchId, 'opml');
|
||||
}
|
||||
else if (ui.cmd === "exportSubtreeToMarkdown") {
|
||||
exportService.exportSubtree(node.data.branchId, 'markdown');
|
||||
}
|
||||
else if (ui.cmd === "importIntoNote") {
|
||||
exportService.importIntoNote(node.data.noteId);
|
||||
@@ -1,7 +1,7 @@
|
||||
import noteDetailService from "./note_detail.js";
|
||||
import utils from "./utils.js";
|
||||
import treeChangesService from "./branches.js";
|
||||
import contextMenuService from "./context_menu.js";
|
||||
import contextMenuService from "./tree_context_menu.js";
|
||||
import treeService from "./tree.js";
|
||||
import editBranchPrefixDialog from "../dialogs/branch_prefix.js";
|
||||
|
||||
|
||||
2
src/public/libraries/ckeditor/ckeditor.js
vendored
2
src/public/libraries/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
src/public/libraries/commonmark.min.js
vendored
Normal file
1
src/public/libraries/commonmark.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -58,11 +58,6 @@
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
#note-detail-text p {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
ul.fancytree-container {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
@@ -1,23 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
const sql = require('../../services/sql');
|
||||
const html = require('html');
|
||||
const tar = require('tar-stream');
|
||||
const sanitize = require("sanitize-filename");
|
||||
const repository = require("../../services/repository");
|
||||
const utils = require('../../services/utils');
|
||||
const TurndownService = require('turndown');
|
||||
|
||||
async function exportNote(req, res) {
|
||||
const noteId = req.params.noteId;
|
||||
// entityId maybe either noteId or branchId depending on format
|
||||
const entityId = req.params.entityId;
|
||||
const format = req.params.format;
|
||||
|
||||
const branchId = await sql.getValue('SELECT branchId FROM branches WHERE noteId = ?', [noteId]);
|
||||
|
||||
if (format === 'tar') {
|
||||
await exportToTar(branchId, res);
|
||||
await exportToTar(await repository.getBranch(entityId), res);
|
||||
}
|
||||
else if (format === 'opml') {
|
||||
await exportToOpml(branchId, res);
|
||||
await exportToOpml(await repository.getBranch(entityId), res);
|
||||
}
|
||||
else if (format === 'markdown') {
|
||||
await exportToMarkdown(await repository.getBranch(entityId), res);
|
||||
}
|
||||
// export single note without subtree
|
||||
else if (format === 'markdown-single') {
|
||||
await exportSingleMarkdown(await repository.getNote(entityId), res);
|
||||
}
|
||||
else {
|
||||
return [404, "Unrecognized export format " + format];
|
||||
@@ -43,8 +49,7 @@ function prepareText(text) {
|
||||
return escaped.replace(/\n/g, ' ');
|
||||
}
|
||||
|
||||
async function exportToOpml(branchId, res) {
|
||||
const branch = await repository.getBranch(branchId);
|
||||
async function exportToOpml(branch, res) {
|
||||
const note = await branch.getNote();
|
||||
const title = (branch.prefix ? (branch.prefix + ' - ') : '') + note.title;
|
||||
const sanitizedTitle = sanitize(title);
|
||||
@@ -76,21 +81,20 @@ async function exportToOpml(branchId, res) {
|
||||
</head>
|
||||
<body>`);
|
||||
|
||||
await exportNoteInner(branchId);
|
||||
await exportNoteInner(branch.branchId);
|
||||
|
||||
res.write(`</body>
|
||||
</opml>`);
|
||||
res.end();
|
||||
}
|
||||
|
||||
async function exportToTar(branchId, res) {
|
||||
async function exportToTar(branch, res) {
|
||||
const pack = tar.pack();
|
||||
|
||||
const exportedNoteIds = [];
|
||||
const name = await exportNoteInner(branchId, '');
|
||||
const name = await exportNoteInner(branch, '');
|
||||
|
||||
async function exportNoteInner(branchId, directory) {
|
||||
const branch = await repository.getBranch(branchId);
|
||||
async function exportNoteInner(branch, directory) {
|
||||
const note = await branch.getNote();
|
||||
const childFileName = directory + sanitize(note.title);
|
||||
|
||||
@@ -124,7 +128,7 @@ async function exportToTar(branchId, res) {
|
||||
})
|
||||
};
|
||||
|
||||
if (metadata.attributes.find(attributes => attributes.type === 'label' && attributes.name === 'excludeFromExport')) {
|
||||
if (await note.hasLabel('excludeFromExport')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,8 +137,14 @@ async function exportToTar(branchId, res) {
|
||||
|
||||
exportedNoteIds.push(note.noteId);
|
||||
|
||||
for (const child of await note.getChildBranches()) {
|
||||
await exportNoteInner(child.branchId, childFileName + "/");
|
||||
const childBranches = await note.getChildBranches();
|
||||
|
||||
if (childBranches.length > 0) {
|
||||
saveDirectory(childFileName);
|
||||
}
|
||||
|
||||
for (const childBranch of childBranches) {
|
||||
await exportNoteInner(childBranch, childFileName + "/");
|
||||
}
|
||||
|
||||
return childFileName;
|
||||
@@ -152,6 +162,10 @@ async function exportToTar(branchId, res) {
|
||||
pack.entry({name: childFileName + ".meta", size: metadataJson.length}, metadataJson);
|
||||
}
|
||||
|
||||
function saveDirectory(childFileName) {
|
||||
pack.entry({name: childFileName, type: 'directory'});
|
||||
}
|
||||
|
||||
pack.finalize();
|
||||
|
||||
res.setHeader('Content-Disposition', 'file; filename="' + name + '.tar"');
|
||||
@@ -160,6 +174,89 @@ async function exportToTar(branchId, res) {
|
||||
pack.pipe(res);
|
||||
}
|
||||
|
||||
async function exportToMarkdown(branch, res) {
|
||||
const note = await branch.getNote();
|
||||
|
||||
if (!await note.hasChildren()) {
|
||||
await exportSingleMarkdown(note, res);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const turndownService = new TurndownService();
|
||||
const pack = tar.pack();
|
||||
const name = await exportNoteInner(note, '');
|
||||
|
||||
async function exportNoteInner(note, directory) {
|
||||
const childFileName = directory + sanitize(note.title);
|
||||
|
||||
if (await note.hasLabel('excludeFromExport')) {
|
||||
return;
|
||||
}
|
||||
|
||||
saveDataFile(childFileName, note);
|
||||
|
||||
const childNotes = await note.getChildNotes();
|
||||
|
||||
if (childNotes.length > 0) {
|
||||
saveDirectory(childFileName);
|
||||
}
|
||||
|
||||
for (const childNote of childNotes) {
|
||||
await exportNoteInner(childNote, childFileName + "/");
|
||||
}
|
||||
|
||||
return childFileName;
|
||||
}
|
||||
|
||||
function saveDataFile(childFileName, note) {
|
||||
if (note.type !== 'text' && note.type !== 'code') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (note.content.trim().length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
let markdown;
|
||||
|
||||
if (note.type === 'code') {
|
||||
markdown = '```\n' + note.content + "\n```";
|
||||
}
|
||||
else if (note.type === 'text') {
|
||||
markdown = turndownService.turndown(note.content);
|
||||
}
|
||||
else {
|
||||
// other note types are not supported
|
||||
return;
|
||||
}
|
||||
|
||||
pack.entry({name: childFileName + ".md", size: markdown.length}, markdown);
|
||||
}
|
||||
|
||||
function saveDirectory(childFileName) {
|
||||
pack.entry({name: childFileName, type: 'directory'});
|
||||
}
|
||||
|
||||
pack.finalize();
|
||||
|
||||
res.setHeader('Content-Disposition', 'file; filename="' + name + '.tar"');
|
||||
res.setHeader('Content-Type', 'application/tar');
|
||||
|
||||
pack.pipe(res);
|
||||
}
|
||||
|
||||
async function exportSingleMarkdown(note, res) {
|
||||
const turndownService = new TurndownService();
|
||||
const markdown = turndownService.turndown(note.content);
|
||||
const name = sanitize(note.title);
|
||||
|
||||
res.setHeader('Content-Disposition', 'file; filename="' + name + '.md"');
|
||||
res.setHeader('Content-Type', 'text/markdown; charset=UTF-8');
|
||||
|
||||
res.send(markdown);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
exportNote
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
const repository = require('../../services/repository');
|
||||
const log = require('../../services/log');
|
||||
const attributeService = require('../../services/attributes');
|
||||
const noteService = require('../../services/notes');
|
||||
const Branch = require('../../entities/branch');
|
||||
@@ -8,6 +9,7 @@ const tar = require('tar-stream');
|
||||
const stream = require('stream');
|
||||
const path = require('path');
|
||||
const parseString = require('xml2js').parseString;
|
||||
const commonmark = require('commonmark');
|
||||
|
||||
async function importToBranch(req) {
|
||||
const parentNoteId = req.params.parentNoteId;
|
||||
@@ -22,11 +24,14 @@ async function importToBranch(req) {
|
||||
const extension = path.extname(file.originalname).toLowerCase();
|
||||
|
||||
if (extension === '.tar') {
|
||||
await importTar(file, parentNoteId);
|
||||
return await importTar(file, parentNoteId);
|
||||
}
|
||||
else if (extension === '.opml') {
|
||||
return await importOpml(file, parentNoteId);
|
||||
}
|
||||
else if (extension === '.md') {
|
||||
return await importMarkdown(file, parentNoteId);
|
||||
}
|
||||
else {
|
||||
return [400, `Unrecognized extension ${extension}, must be .tar or .opml`];
|
||||
}
|
||||
@@ -46,6 +51,8 @@ async function importOutline(outline, parentNoteId) {
|
||||
for (const childOutline of (outline.outline || [])) {
|
||||
await importOutline(childOutline, note.noteId);
|
||||
}
|
||||
|
||||
return note;
|
||||
}
|
||||
|
||||
async function importOpml(file, parentNoteId) {
|
||||
@@ -66,27 +73,37 @@ async function importOpml(file, parentNoteId) {
|
||||
}
|
||||
|
||||
const outlines = xml.opml.body[0].outline || [];
|
||||
let returnNote = null;
|
||||
|
||||
for (const outline of outlines) {
|
||||
await importOutline(outline, parentNoteId);
|
||||
const note = await importOutline(outline, parentNoteId);
|
||||
|
||||
// first created note will be activated after import
|
||||
returnNote = returnNote || note;
|
||||
}
|
||||
|
||||
return returnNote;
|
||||
}
|
||||
|
||||
async function importTar(file, parentNoteId) {
|
||||
const files = await parseImportFile(file);
|
||||
|
||||
// maps from original noteId (in tar file) to newly generated noteId
|
||||
const noteIdMap = {};
|
||||
const attributes = [];
|
||||
const ctx = {
|
||||
// maps from original noteId (in tar file) to newly generated noteId
|
||||
noteIdMap: {},
|
||||
attributes: [],
|
||||
reader: new commonmark.Parser(),
|
||||
writer: new commonmark.HtmlRenderer()
|
||||
};
|
||||
|
||||
await importNotes(files, parentNoteId, noteIdMap, attributes);
|
||||
const note = await importNotes(ctx, files, parentNoteId);
|
||||
|
||||
// we save attributes after importing notes because we need to have all the relation
|
||||
// targets already existing
|
||||
for (const attr of attributes) {
|
||||
for (const attr of ctx.attributes) {
|
||||
if (attr.type === 'relation') {
|
||||
// map to local noteId
|
||||
attr.value = noteIdMap[attr.value];
|
||||
attr.value = ctx.noteIdMap[attr.value];
|
||||
|
||||
if (!attr.value) {
|
||||
// relation is targeting note not present in the import
|
||||
@@ -96,6 +113,8 @@ async function importTar(file, parentNoteId) {
|
||||
|
||||
await attributeService.createAttribute(attr);
|
||||
}
|
||||
|
||||
return note;
|
||||
}
|
||||
|
||||
function getFileName(name) {
|
||||
@@ -105,13 +124,18 @@ function getFileName(name) {
|
||||
key = "data";
|
||||
name = name.substr(0, name.length - 4);
|
||||
}
|
||||
else if (name.endsWith(".md")) {
|
||||
key = "markdown";
|
||||
name = name.substr(0, name.length - 3);
|
||||
}
|
||||
else if (name.endsWith((".meta"))) {
|
||||
key = "meta";
|
||||
name = name.substr(0, name.length - 5);
|
||||
}
|
||||
else {
|
||||
throw new Error("Unknown file type in import archive: " + name);
|
||||
log.error("Unknown file type in import: " + name);
|
||||
}
|
||||
|
||||
return {name, key};
|
||||
}
|
||||
|
||||
@@ -122,12 +146,26 @@ async function parseImportFile(file) {
|
||||
const extract = tar.extract();
|
||||
|
||||
extract.on('entry', function(header, stream, next) {
|
||||
const {name, key} = getFileName(header.name);
|
||||
let name, key;
|
||||
|
||||
if (header.type === 'file') {
|
||||
({name, key} = getFileName(header.name));
|
||||
}
|
||||
else if (header.type === 'directory') {
|
||||
// directory entries in tar often end with directory separator
|
||||
name = (header.name.endsWith("/") || header.name.endsWith("\\")) ? header.name.substr(0, header.name.length - 1) : header.name;
|
||||
key = 'directory';
|
||||
}
|
||||
else {
|
||||
log.error("Unrecognized tar entry: " + JSON.stringify(header));
|
||||
return;
|
||||
}
|
||||
|
||||
let file = fileMap[name];
|
||||
|
||||
if (!file) {
|
||||
file = fileMap[name] = {
|
||||
name: path.basename(name),
|
||||
children: []
|
||||
};
|
||||
|
||||
@@ -176,49 +214,95 @@ async function parseImportFile(file) {
|
||||
});
|
||||
}
|
||||
|
||||
async function importNotes(files, parentNoteId, noteIdMap, attributes) {
|
||||
async function importNotes(ctx, files, parentNoteId) {
|
||||
let returnNote = null;
|
||||
|
||||
for (const file of files) {
|
||||
if (file.meta.version !== 1) {
|
||||
throw new Error("Can't read meta data version " + file.meta.version);
|
||||
}
|
||||
let note;
|
||||
|
||||
if (file.meta.clone) {
|
||||
await new Branch({
|
||||
parentNoteId: parentNoteId,
|
||||
noteId: noteIdMap[file.meta.noteId],
|
||||
if (!file.meta) {
|
||||
let content = '';
|
||||
|
||||
if (file.data) {
|
||||
content = file.data.toString("UTF-8");
|
||||
}
|
||||
else if (file.markdown) {
|
||||
const parsed = ctx.reader.parse(file.markdown.toString("UTF-8"));
|
||||
content = ctx.writer.render(parsed);
|
||||
}
|
||||
|
||||
note = (await noteService.createNote(parentNoteId, file.name, content, {
|
||||
type: 'text',
|
||||
mime: 'text/html'
|
||||
})).note;
|
||||
}
|
||||
else {
|
||||
if (file.meta.version !== 1) {
|
||||
throw new Error("Can't read meta data version " + file.meta.version);
|
||||
}
|
||||
|
||||
if (file.meta.clone) {
|
||||
await new Branch({
|
||||
parentNoteId: parentNoteId,
|
||||
noteId: ctx.noteIdMap[file.meta.noteId],
|
||||
prefix: file.meta.prefix
|
||||
}).save();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.meta.type !== 'file') {
|
||||
file.data = file.data.toString("UTF-8");
|
||||
}
|
||||
|
||||
note = (await noteService.createNote(parentNoteId, file.meta.title, file.data, {
|
||||
type: file.meta.type,
|
||||
mime: file.meta.mime,
|
||||
prefix: file.meta.prefix
|
||||
}).save();
|
||||
})).note;
|
||||
|
||||
return;
|
||||
ctx.noteIdMap[file.meta.noteId] = note.noteId;
|
||||
|
||||
for (const attribute of file.meta.attributes) {
|
||||
ctx.attributes.push({
|
||||
noteId: note.noteId,
|
||||
type: attribute.type,
|
||||
name: attribute.name,
|
||||
value: attribute.value,
|
||||
isInheritable: attribute.isInheritable,
|
||||
position: attribute.position
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (file.meta.type !== 'file') {
|
||||
file.data = file.data.toString("UTF-8");
|
||||
}
|
||||
|
||||
const {note} = await noteService.createNote(parentNoteId, file.meta.title, file.data, {
|
||||
type: file.meta.type,
|
||||
mime: file.meta.mime,
|
||||
prefix: file.meta.prefix
|
||||
});
|
||||
|
||||
noteIdMap[file.meta.noteId] = note.noteId;
|
||||
|
||||
for (const attribute of file.meta.attributes) {
|
||||
attributes.push({
|
||||
noteId: note.noteId,
|
||||
type: attribute.type,
|
||||
name: attribute.name,
|
||||
value: attribute.value,
|
||||
isInheritable: attribute.isInheritable,
|
||||
position: attribute.position
|
||||
});
|
||||
}
|
||||
// first created note will be activated after import
|
||||
returnNote = returnNote || note;
|
||||
|
||||
if (file.children.length > 0) {
|
||||
await importNotes(file.children, note.noteId, noteIdMap, attributes);
|
||||
await importNotes(ctx, file.children, note.noteId);
|
||||
}
|
||||
}
|
||||
|
||||
return returnNote;
|
||||
}
|
||||
|
||||
async function importMarkdown(file, parentNoteId) {
|
||||
const markdownContent = file.buffer.toString("UTF-8");
|
||||
|
||||
const reader = new commonmark.Parser();
|
||||
const writer = new commonmark.HtmlRenderer();
|
||||
|
||||
const parsed = reader.parse(markdownContent);
|
||||
const htmlContent = writer.render(parsed);
|
||||
|
||||
const title = file.originalname.substr(0, file.originalname.length - 3); // strip .md extension
|
||||
|
||||
const {note} = await noteService.createNote(parentNoteId, title, htmlContent, {
|
||||
type: 'text',
|
||||
mime: 'text/html'
|
||||
});
|
||||
|
||||
return note;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -124,7 +124,7 @@ function register(app) {
|
||||
apiRoute(PUT, '/api/notes/:noteId/clone-to/:parentNoteId', cloningApiRoute.cloneNoteToParent);
|
||||
apiRoute(PUT, '/api/notes/:noteId/clone-after/:afterBranchId', cloningApiRoute.cloneNoteAfter);
|
||||
|
||||
route(GET, '/api/notes/:noteId/export/:format', [auth.checkApiAuthOrElectron], exportRoute.exportNote);
|
||||
route(GET, '/api/notes/:entityId/export/:format', [auth.checkApiAuthOrElectron], exportRoute.exportNote);
|
||||
route(POST, '/api/notes/:parentNoteId/import', [auth.checkApiAuthOrElectron, uploadMiddleware], importRoute.importToBranch, apiResultHandler);
|
||||
|
||||
route(POST, '/api/notes/:parentNoteId/upload', [auth.checkApiAuthOrElectron, uploadMiddleware],
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
module.exports = { buildDate:"2018-09-01T14:08:37+02:00", buildRevision: "10ff504528fef652a4fb003c6e058f2fd8a911fc" };
|
||||
module.exports = { buildDate:"2018-09-03T20:18:28+02:00", buildRevision: "f2712e92bbf8ded9f4d56a6a64c92793b586df65" };
|
||||
|
||||
@@ -36,22 +36,27 @@ async function getEntity(query, params = []) {
|
||||
return entityConstructor.createEntityFromRow(row);
|
||||
}
|
||||
|
||||
/** @returns {Note|null} */
|
||||
async function getNote(noteId) {
|
||||
return await getEntity("SELECT * FROM notes WHERE noteId = ?", [noteId]);
|
||||
}
|
||||
|
||||
/** @returns {Branch|null} */
|
||||
async function getBranch(branchId) {
|
||||
return await getEntity("SELECT * FROM branches WHERE branchId = ?", [branchId]);
|
||||
}
|
||||
|
||||
/** @returns {Image|null} */
|
||||
async function getImage(imageId) {
|
||||
return await getEntity("SELECT * FROM images WHERE imageId = ?", [imageId]);
|
||||
}
|
||||
|
||||
/** @returns {Attribute|null} */
|
||||
async function getAttribute(attributeId) {
|
||||
return await getEntity("SELECT * FROM attributes WHERE attributeId = ?", [attributeId]);
|
||||
}
|
||||
|
||||
/** @returns {Option|null} */
|
||||
async function getOption(name) {
|
||||
return await getEntity("SELECT * FROM options WHERE name = ?", [name]);
|
||||
}
|
||||
|
||||
@@ -127,15 +127,15 @@ async function getScriptBundle(note, root = true, scriptEnv = null, includedNote
|
||||
if (note.isJavaScript()) {
|
||||
bundle.script += `
|
||||
apiContext.modules['${note.noteId}'] = {};
|
||||
${root ? 'return ' : ''}await (async function(exports, module, require, api` + (modules.length > 0 ? ', ' : '') +
|
||||
${root ? 'return ' : ''}await ((async function(exports, module, require, api` + (modules.length > 0 ? ', ' : '') +
|
||||
modules.map(child => sanitizeVariableName(child.title)).join(', ') + `) {
|
||||
try {
|
||||
${note.content};
|
||||
} catch (e) { throw new Error("Load of script note \\"${note.title}\\" (${note.noteId}) failed with: " + e.message); }
|
||||
if (!module.exports) module.exports = {};
|
||||
for (const exportKey in exports) module.exports[exportKey] = exports[exportKey];
|
||||
})({}, apiContext.modules['${note.noteId}'], apiContext.require(${JSON.stringify(moduleNoteIds)}), apiContext.apis['${note.noteId}']` + (modules.length > 0 ? ', ' : '') +
|
||||
modules.map(mod => `apiContext.modules['${mod.noteId}'].exports`).join(', ') + `);
|
||||
}).call({}, {}, apiContext.modules['${note.noteId}'], apiContext.require(${JSON.stringify(moduleNoteIds)}), apiContext.apis['${note.noteId}']` + (modules.length > 0 ? ', ' : '') +
|
||||
modules.map(mod => `apiContext.modules['${mod.noteId}'].exports`).join(', ') + `));
|
||||
`;
|
||||
}
|
||||
else if (note.isHtml()) {
|
||||
|
||||
@@ -167,6 +167,7 @@
|
||||
<li><a class="show-attributes-button"><kbd>Alt+A</kbd> Attributes</a></li>
|
||||
<li><a id="show-source-button">HTML source</a></li>
|
||||
<li><a id="upload-file-button">Upload file</a></li>
|
||||
<li><a id="export-note-to-markdown-button">Export as markdown</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -349,7 +350,7 @@
|
||||
<div id="options-dialog" title="Options" style="display: none;">
|
||||
<div id="options-tabs">
|
||||
<ul>
|
||||
<li><a href="#appearance">Apperance</a></li>
|
||||
<li><a href="#appearance">Appearance</a></li>
|
||||
<li><a href="#change-password">Change password</a></li>
|
||||
<li><a href="#protected-session-timeout">Protected session</a></li>
|
||||
<li><a href="#note-revision-snapshot-time-interval">Note revisions</a></li>
|
||||
@@ -711,6 +712,14 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="markdown-import-dialog" title="Markdown import" style="display: none; padding: 20px;">
|
||||
<p>Because of browser sandbox it's not possible to directly read clipboard from JavaScript. Please paste the Markdown to import to textarea below and click on Import button</p>
|
||||
|
||||
<textarea id="markdown-import-textarea" style="height: 340px; width: 100%"></textarea>
|
||||
|
||||
<button id="markdown-import-button" class="btn btn-primary">Import <kbd>CTRL+Enter</kbd></button>
|
||||
</div>
|
||||
|
||||
<div id="tooltip" style="display: none;"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
Reference in New Issue
Block a user