Compare commits

...

1174 Commits

Author SHA1 Message Date
zadam
5769587305 experimental hiding of images if they are included in the parent note 2020-04-27 23:27:45 +02:00
zadam
ffbfccb701 extra window now works in browsers too 2020-04-27 22:29:39 +02:00
zadam
907cdd8fcb fixes for extra window 2020-04-26 23:11:52 +02:00
zadam
7ea53d468e use local dates in the recent changes 2020-04-26 14:39:13 +02:00
zadam
586d6b4557 in web version use local client time instead of server time for recording dateModified etc. 2020-04-26 14:26:57 +02:00
zadam
8f68ff1932 tweaks for the code preview 2020-04-26 12:06:54 +02:00
zadam
a1ea2c9115 read only code notes WIP 2020-04-26 11:38:30 +02:00
zadam
e8ce81a133 organize widgets a bit 2020-04-26 09:40:02 +02:00
zadam
aff12950f0 Merge remote-tracking branch 'origin/master' into m42
# Conflicts:
#	src/public/app/services/app_context.js
2020-04-25 23:53:19 +02:00
zadam
75c58cbf79 refactored layouts for extra window 2020-04-25 23:52:13 +02:00
zadam
87a1e98fa2 default search should look also into attribute names and values, #980 2020-04-25 22:10:56 +02:00
zadam
d1eacbb574 more robust entering protected session and the following protection of a note 2020-04-25 17:15:57 +02:00
zadam
71d248cd87 touch protected session during note update 2020-04-25 11:09:07 +02:00
zadam
ac608b9334 small text changes 2020-04-24 21:21:22 +02:00
zadam
32020d78b5 prototype for new app window 2020-04-23 23:08:15 +02:00
zadam
ff853c7d0a implement lazy loading of tabs which speeds up especially initial startup with many tabs 2020-04-22 23:09:35 +02:00
zadam
8526cb2315 added collapsible widgets to the docs 2020-04-21 23:14:55 +02:00
zadam
dc89f72e75 fix display of text notes in note revisions 2020-04-21 22:59:37 +02:00
zadam
657ff16267 fix build webpack 2020-04-20 23:14:50 +02:00
zadam
ed759f5585 release 0.41.5 2020-04-20 22:40:02 +02:00
zadam
a86177bb59 release 0.41.5 2020-04-20 22:39:23 +02:00
zadam
9f1b3cc892 note paths widget has context menu too 2020-04-20 22:38:37 +02:00
zadam
8473f72ec8 fix support of multiple languages for spellchecking + list all available languages, closes #974 2020-04-20 22:26:31 +02:00
zadam
666d202a3a deps updates 2020-04-19 09:42:10 +02:00
zadam
988fae50cb fix help links and displayed shortcuts, closes #971 2020-04-18 11:14:09 +02:00
zadam
98bbd17920 release 0.41.4-beta 2020-04-15 23:00:13 +02:00
zadam
dadcc93ae3 focus and select title after creating a note 2020-04-15 22:06:52 +02:00
zadam
48e19d0149 fix webpack buidl 2020-04-15 21:49:36 +02:00
zadam
f97c9e3619 release 0.41.3-beta 2020-04-14 22:19:56 +02:00
zadam
61167f6646 make sure to close sqlite connection on exit 2020-04-14 22:15:55 +02:00
zadam
29cec8112e fix setup of new document, closes #966 2020-04-14 21:57:42 +02:00
zadam
48aadc8309 fix parsing of includeNote, closes #963 2020-04-13 18:12:41 +02:00
zadam
b2508db9af release 0.41.2-beta 2020-04-13 10:30:11 +02:00
zadam
87510fd72b include note styling changes 2020-04-13 10:13:03 +02:00
zadam
339f212e4c added webpack 2020-04-12 14:22:51 +02:00
zadam
3c311cd2a4 loading indicator and optimisations for mobile 2020-04-11 22:06:04 +02:00
zadam
b5bf581bd9 don't select tree node when dragging 2020-04-11 15:09:38 +02:00
zadam
242f139be4 allow specifying include note widget size 2020-04-11 11:49:58 +02:00
zadam
6c76d862d2 fix creating link with selection -> must by hyper link, closes #959 2020-04-11 09:47:19 +02:00
zadam
62bc05134e sqlite upgrade 2020-04-09 21:20:14 +02:00
zadam
50d3928dd5 release 0.41.1-beta 2020-04-08 22:10:55 +02:00
zadam
44d641617e fix relation map in demo document 2020-04-08 22:09:32 +02:00
zadam
f3b84e5185 use ckeditor content styles also for read only notes, tooltips and book notes 2020-04-08 21:38:11 +02:00
zadam
34b8979016 make note paths work better with hoisted note 2020-04-08 20:38:50 +02:00
zadam
6c188982b3 added some logging 2020-04-08 11:07:38 +02:00
zadam
1175a8ee49 display last noteId in the note path widget as well 2020-04-08 10:19:15 +02:00
zadam
9c04ef9fb7 note path widget tweaks 2020-04-08 10:13:11 +02:00
zadam
6cc3e3cdf6 note paths is now on the left side and showing current path 2020-04-07 22:53:03 +02:00
zadam
f8bd55374f support for included notes and reference links also in read only text views 2020-04-07 21:28:40 +02:00
zadam
3ccb1c6ac1 refactoring to editable_text 2020-04-07 21:04:28 +02:00
zadam
d34d265d01 API docs update 2020-04-07 19:19:20 +02:00
zadam
c063f75f48 fix ZIP import of notes with included note 2020-04-06 22:46:11 +02:00
zadam
2d1f3b7633 renamed text preview to read only text 2020-04-06 22:21:09 +02:00
zadam
3772d97dfa basic text preview implemented 2020-04-06 22:08:54 +02:00
zadam
5c0355718f repository has now first level cache 2020-04-06 20:59:04 +02:00
zadam
081693f263 not generating externalLink labels anymore since there can be too many and benefit is too small 2020-04-05 16:06:13 +02:00
zadam
8d312515dd small fixes 2020-04-05 15:35:01 +02:00
zadam
7bd05415fa revert fancytree upgrade which caused some issues (tree duplication) 2020-04-05 12:56:25 +02:00
zadam
8d7687f354 fix copying template's content, closes #943 2020-04-05 12:28:16 +02:00
zadam
42128c007f fix "search in subtree", closes #941 2020-04-04 22:49:30 +02:00
zadam
dfb97d64f7 fix showing promoted notes, closes #944 2020-04-04 22:40:32 +02:00
zadam
b1bed18331 significantly faster sync with transactions 2020-04-04 21:49:57 +02:00
zadam
ae50c9847d sync refactorings, added logging for performance tracking 2020-04-04 14:57:19 +02:00
zadam
6201dd70a0 small fixes in consistency_checks 2020-04-04 09:46:49 +02:00
zadam
451c408063 small fixes 2020-04-03 19:34:22 +02:00
zadam
3bbb213f82 fixes for web clipper 2020-04-02 22:55:11 +02:00
zadam
bab657e43d release 0.41.0-beta 2020-03-31 22:12:31 +02:00
zadam
4b24d9562c fix visibility of panels after startup with hidden state 2020-03-31 22:09:05 +02:00
zadam
a73739d03e small fixes 2020-03-31 21:47:15 +02:00
zadam
4485650cbc library upgrades 2020-03-31 20:52:41 +02:00
zadam
58f610b2c6 fix mobile frontend 2020-03-29 23:10:45 +02:00
zadam
5024454914 better activation behavior when move notes 2020-03-29 22:54:14 +02:00
zadam
ca0e36ea81 fix render type non-scrolling 2020-03-29 22:27:05 +02:00
zadam
c9b2ff05e9 book notes don't display images as separate children if the image is included in the parent text note, #892 2020-03-29 22:15:09 +02:00
zadam
0973498fe9 small fixes 2020-03-29 20:37:40 +02:00
zadam
189202b1f6 added context menu "recent changes in subtree" 2020-03-29 19:43:04 +02:00
zadam
cc298b1e7a recent changes respect hoisted note state 2020-03-29 19:37:34 +02:00
zadam
f8bd6183bf fix default document 2020-03-29 18:53:32 +02:00
zadam
ef60cb5395 fix placing notes onto relation map by drag & drop 2020-03-29 18:49:30 +02:00
zadam
b10c083560 check for images happens before other methods in utils.isHtmlEmpty() 2020-03-29 17:11:44 +02:00
zadam
8eeb395523 updated sqlite binaries from linux & mac 2020-03-29 17:06:35 +02:00
zadam
084882a50e fixes in ckeditor build 2020-03-29 15:58:18 +02:00
zadam
7c04521e9c Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	src/public/javascripts/mobile.js
#	src/public/stylesheets/mobile.css
2020-03-29 15:41:27 +02:00
zadam
0a0de7312c release 0.40.7 2020-03-28 20:58:20 +01:00
zadam
37255243f7 allow user to see their username in the options #934 2020-03-28 19:55:02 +01:00
zadam
b4b22d9353 workaround for overflowing component wrapper in landscape mobile frontend, fixes #933 2020-03-28 19:39:14 +01:00
zadam
d3eb640aa2 fix upload image from mobile frontend, closes #931 2020-03-28 19:25:19 +01:00
zadam
78d431387b updated win64 sqlite binary 2020-03-27 21:47:22 +01:00
zadam
c4bc53da59 updates to the demo document 2020-03-26 22:22:18 +01:00
zadam
34de8fb874 improved reference link handling 2020-03-26 20:40:15 +01:00
zadam
5a6ab68144 added a progress screen for setup of a new document 2020-03-26 17:47:56 +01:00
zadam
c4e5b35187 changed demo.tar to demo.zip 2020-03-26 17:05:17 +01:00
zadam
2e55d544f1 db setup fixes 2020-03-26 16:59:40 +01:00
zadam
b778985b5e minor fixes and upgrades 2020-03-26 16:21:17 +01:00
zadam
f9a79fa00f improvements and logging to local image storage 2020-03-25 21:01:42 +01:00
zadam
ef61e22f1f local image storage fixes 2020-03-25 18:21:55 +01:00
zadam
8a92786012 save paste images locally WIP 2020-03-25 11:28:44 +01:00
zadam
a856463173 correctly handle clicks on reference links 2020-03-23 20:18:54 +01:00
zadam
cb168218fb proper handling of deleted notes 2020-03-23 16:39:03 +01:00
zadam
978575498c reference insertion is now immediate 2020-03-23 12:31:10 +01:00
zadam
8584de27ab mentions also insert reference links 2020-03-22 18:27:13 +01:00
zadam
a36d6bf9be add link dialog now allows switching between reference link and normal hyperlink 2020-03-22 11:41:00 +01:00
zadam
9b17e9976e basic implementation of reference link functionality 2020-03-21 21:04:34 +01:00
zadam
d927865cbd fix import zip corner case where there are 2 independent notes with the same name 2020-03-21 15:14:44 +01:00
zadam
6de0b19569 add image through "include note" will just insert image instead of standard include note element, #922 2020-03-21 10:38:27 +01:00
zadam
84d7097b1a Merge remote-tracking branch 'origin/stable' 2020-03-21 10:05:15 +01:00
zadam
8ccc48c25d images in include note should have max 100% width, #922 2020-03-21 09:52:13 +01:00
zadam
438da7cfbb two pass import from zip file to guarantee that meta file is loaded before other files are process 2020-03-20 22:13:29 +01:00
zadam
af5c4b5859 zip import using yazl 2020-03-20 21:57:16 +01:00
zadam
04360381b6 reimplement export with yazl 2020-03-20 16:55:35 +01:00
zadam
45e2dc96fb export subtrees in ZIP instead of TAR format because of more widespread support (especially unicode) 2020-03-19 20:07:27 +01:00
zadam
ff426fc1fc added more placement points for custom widgets 2020-03-19 17:15:14 +01:00
zadam
6dfc2755e7 ckeditor 18 2020-03-19 16:29:48 +01:00
zadam
789f12ac8f Merge remote-tracking branch 'origin/stable' 2020-03-19 09:44:00 +01:00
zadam
9a1a76605a fix OPML export of book notes, closes #919 2020-03-19 09:42:41 +01:00
zadam
debce78c7f load ancestors and templates when receiving sync from backend 2020-03-19 09:18:36 +01:00
zadam
48c57c7ce7 always keep all the ancestors in the cache WIP 2020-03-18 22:42:29 +01:00
zadam
4a89df7ebf always keep all the ancestors in the tree WIP 2020-03-18 22:35:54 +01:00
zadam
6295a1825d fixes in setting/opening tabs 2020-03-18 10:08:16 +01:00
zadam
280955b3a2 fix events from keyboard shortcuts 2020-03-17 22:49:43 +01:00
zadam
72cc54a83f fixed global create new day note 2020-03-17 21:39:26 +01:00
zadam
c3b44b9a91 fixed & improved history navigation - context menu now indicates current, "future" and "past" items 2020-03-17 21:15:57 +01:00
zadam
8a9875ecfa fix filling or targetRelations during backend2frontend sync 2020-03-17 18:38:49 +01:00
zadam
9230b07adb focus created note 2020-03-17 12:48:09 +01:00
zadam
5a6066dcd1 fix "create note after" keyboard shortcut 2020-03-17 12:28:02 +01:00
zadam
d4d54c5f01 fix createNoteInto keyboard shortcut 2020-03-17 11:28:41 +01:00
zadam
141d4593ca fix loading of custom widgets 2020-03-16 23:25:52 +01:00
zadam
a7ddc33b6d sorting of widgets 2020-03-16 22:14:18 +01:00
zadam
173030e02e basic support for custom widgets 2020-03-16 21:16:09 +01:00
zadam
8ae78a9e23 Create FUNDING.yml 2020-03-16 08:25:20 +01:00
zadam
babc27f824 update dayjs 2020-03-16 08:21:53 +01:00
zadam
2c7eb723d5 fix note hoisting 2020-03-15 22:11:42 +01:00
zadam
40247a591e fix delete shortcut in note tree and protect notes recursively 2020-03-15 22:09:48 +01:00
zadam
3a4d32f163 fix clone-to, move-to keyboard shortcuts 2020-03-15 21:52:04 +01:00
zadam
7f2c859b94 fix detail font size setting 2020-03-15 21:40:26 +01:00
zadam
a5764c269f pdf preview is now also available in include note, book etc. 2020-03-15 21:35:43 +01:00
zadam
6a1bfdeab9 fix autobook switching back to text 2020-03-15 21:31:25 +01:00
zadam
6de0f75931 fix switching notes in the passive tabs 2020-03-15 18:57:03 +01:00
zadam
fcf72262bd Merge remote-tracking branch 'origin/stable' 2020-03-15 18:23:21 +01:00
zadam
114017147f fix load results isEmpty method 2020-03-15 17:18:50 +01:00
zadam
a717ee00fb release 0.40.6 2020-03-15 11:21:43 +01:00
zadam
f5e27278ab fix migration script to preserve sync IDs 2020-03-15 11:19:30 +01:00
zadam
2cc0442ef2 fix new tab open hiding 2020-03-15 11:08:16 +01:00
zadam
687a466a35 Merge remote-tracking branch 'origin/stable' 2020-03-15 09:57:57 +01:00
zadam
20c24e26cc added entity constructors for "content" tables 2020-03-14 21:09:07 +01:00
zadam
3bafc396fc fix consistency checks 2020-03-14 13:13:27 +01:00
zadam
08606f7d88 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	src/services/sync_table.js
2020-03-14 12:58:47 +01:00
zadam
3fa3e912a4 not sending ping to clients after every sync addition, only after commit which significantly speeds up imports 2020-03-14 12:39:55 +01:00
zadam
44219e7ccc do not load the note content during ENEX import again since it's already available 2020-03-13 22:23:44 +01:00
zadam
48abd765c6 fix sync issues 2020-03-11 22:43:20 +01:00
zadam
2d38706ba8 wip 2020-03-10 23:33:39 +01:00
zadam
8d45662bee clear history in the code mirror after setting a value, closes #766 2020-03-10 22:51:44 +01:00
zadam
dc4024b6de Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	src/public/javascripts/services/note_detail_code.js
2020-03-10 22:51:02 +01:00
zadam
5b67854cbe clear history in the code mirror after setting a value, closes #766 2020-03-10 22:48:21 +01:00
zadam
72745aca29 fix unnecessary scroll to parent when opening new tab 2020-03-10 22:25:57 +01:00
zadam
e6e41adad0 fix backend to frontend sync with waitForSyncId() 2020-03-10 21:33:03 +01:00
zadam
bcbf1b79c3 fixed waitForSync 2020-03-09 22:32:26 +01:00
zadam
1d78432df4 Merge remote-tracking branch 'origin/stable' 2020-03-09 22:16:43 +01:00
zadam
c6d912dcb7 sync only changes with isSynced = true 2020-03-09 21:34:03 +01:00
zadam
eb287917c1 set sync.isSynced correctly 2020-03-09 21:28:41 +01:00
zadam
da53c1eaa8 updated schema.sql 2020-03-09 21:23:11 +01:00
zadam
c67613a557 Merge remote-tracking branch 'origin/stable' 2020-03-09 21:00:38 +01:00
zadam
0ca107ff48 fix event listener for resize 2020-03-09 21:00:31 +01:00
zadam
73bf2dcb02 added isSynced to sync table to allow forward compatibility with 0.41 2020-03-09 20:56:43 +01:00
zadam
719f10981e fix sync 2020-03-08 22:00:12 +01:00
zadam
1774f48d07 fix sync 2020-03-08 21:59:19 +01:00
zadam
deb67d6275 release 0.40.5 2020-03-08 21:05:52 +01:00
zadam
bafd829ff6 updated electron 9.0 binary dependencies 2020-03-08 20:17:28 +01:00
zadam
e7aa84435b render PDF preview in electron for pdf notes 2020-03-08 18:06:24 +01:00
zadam
493d088d80 better back/forward navigation 2020-03-08 17:17:18 +01:00
zadam
5f4d963580 better back/forward navigation WIP 2020-03-08 11:41:42 +01:00
zadam
5114f3f782 fixes after merge 2020-03-08 09:38:49 +01:00
zadam
53f5df4e88 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	src/public/javascripts/desktop.js
#	src/public/stylesheets/style.css
#	src/views/details/image.ejs
#	src/views/details/relation_map.ejs
2020-03-08 09:26:34 +01:00
zadam
e4039ea5e1 fixed printing relation map 2020-03-08 09:24:03 +01:00
zadam
95fef8d2e5 fixes after merge 2020-03-07 22:29:49 +01:00
zadam
7105b61aab Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	src/public/javascripts/desktop.js
#	src/views/desktop.ejs
#	src/views/mobile.ejs
2020-03-07 22:21:55 +01:00
zadam
78a50be663 don't print control buttons 2020-03-07 22:18:12 +01:00
zadam
3d3ad3b99b include themes.css for printing to have default CSS variables available 2020-03-07 22:14:07 +01:00
zadam
0d9cdcac85 load appropriate styles for printing book notes, closes #899 2020-03-07 22:01:34 +01:00
zadam
c4f7bb37db removed sidebar widget settings 2020-03-07 21:34:39 +01:00
zadam
81ec85083a link map widget always rendered centered map 2020-03-07 20:41:03 +01:00
zadam
62da383623 only one update 2020-03-07 15:01:48 +01:00
zadam
8513e0201c collapsed state is now synchronized across tab-cached instances 2020-03-07 14:31:25 +01:00
zadam
abd60581be right pane is now scrollable 2020-03-07 14:18:58 +01:00
zadam
aff02184f8 removed last tab should activate second to last 2020-03-07 13:57:31 +01:00
zadam
8909d175d0 event fixes 2020-03-07 13:40:46 +01:00
zadam
091eb8f791 event fixes WIP 2020-03-06 23:34:39 +01:00
zadam
e10d23289e event fixes WIP 2020-03-06 22:17:07 +01:00
zadam
26599f057c collapsible widget remember their collapsed state 2020-03-01 20:49:11 +01:00
zadam
4e0e2e8926 fixes in side pane toggling 2020-03-01 20:11:40 +01:00
zadam
9c631e4398 Merge remote-tracking branch 'origin/master' into m41
# Conflicts:
#	.idea/dataSources/a2c75661-f9e2-478f-a69f-6a9409e69997.xml
#	src/public/stylesheets/desktop.css
2020-03-01 19:20:08 +01:00
zadam
687539cc95 fix zen mode 2020-03-01 19:16:30 +01:00
zadam
03e0c98066 migrated desktop CSS to the desktop layout 2020-03-01 19:06:26 +01:00
zadam
77f358b846 migrated mobile CSS to the mobile layout 2020-03-01 18:57:13 +01:00
zadam
4c82e882e0 bit better right pane layout 2020-03-01 18:47:20 +01:00
zadam
0f4ba43463 mobile frontend is working again 2020-03-01 15:19:16 +01:00
zadam
f15239c006 mobile layout fixes 2020-03-01 12:50:02 +01:00
zadam
ed1b5e3843 mobile layout fixes 2020-03-01 12:05:10 +01:00
zadam
607bdfef92 mobile global buttons 2020-03-01 11:53:02 +01:00
zadam
4f744564f2 start of mobile layout 2020-03-01 11:04:42 +01:00
zadam
f64b343d8d ref 2020-03-01 10:41:23 +01:00
zadam
47b803920b keep body hidden until rendered 2020-02-29 22:13:54 +01:00
zadam
8888d04878 fixes 2020-02-29 22:04:46 +01:00
zadam
49398f5374 refactoring of component event system + little docs 2020-02-29 19:43:19 +01:00
zadam
95d1952896 wip 2020-02-29 16:26:46 +01:00
zadam
3ab2b41e8c open links in new tab without activation 2020-02-29 15:00:35 +01:00
zadam
e5155130e7 ckeditor with table/cell properties 2020-02-29 14:32:26 +01:00
zadam
724ba352e6 refactored existing context menus 2020-02-29 13:03:05 +01:00
zadam
1239293435 spell check context menu 2020-02-29 11:28:30 +01:00
zadam
16f42dd4ab use electron 8 spellchecker instead of electron-spellchecker, WIP 2020-02-28 22:07:08 +01:00
zadam
350331e2ef fix 500px constant height of relation maps, closes #882 2020-02-28 15:20:54 +01:00
zadam
a2d6a5c3e9 fixes 2020-02-28 11:46:35 +01:00
zadam
cb35284d37 wip 2020-02-28 00:31:12 +01:00
zadam
2af37640d8 small refactoring of search code 2020-02-28 00:11:34 +01:00
zadam
4bd298a55b refactor data-kb-command 2020-02-27 23:12:22 +01:00
zadam
cd4b1235a7 wip 2020-02-27 14:35:12 +01:00
zadam
5e3c85f891 fix issues 2020-02-27 12:41:15 +01:00
zadam
b2a3e1cc04 fixed double refresh of note detail 2020-02-27 12:26:42 +01:00
zadam
d71763aedb title row spacing 2020-02-27 10:08:21 +01:00
zadam
368d0c55da refactoring of layout finished 2020-02-27 10:03:14 +01:00
zadam
637010577b layout changes WIP 2020-02-27 00:58:10 +01:00
zadam
7bcae9981b unified/simplified protecting notes & subtree 2020-02-26 16:37:17 +01:00
zadam
3752cf8cba layout fixes 2020-02-25 19:19:10 +01:00
zadam
7270bf287d fixes and right pane layout changes 2020-02-25 16:31:44 +01:00
zadam
d821ea4095 fix closing all tabs except current 2020-02-25 12:32:21 +01:00
zadam
41d1d83dc2 fix showing/hiding of type widgets 2020-02-25 12:24:37 +01:00
zadam
a2fe110400 unified global variable handling between mobile and desktop 2020-02-25 11:02:59 +01:00
zadam
fdc99bb6f9 adapt merged changes from master 2020-02-25 10:47:49 +01:00
zadam
36eac6badd Merge remote-tracking branch 'origin/master' into m41
# Conflicts:
#	src/public/javascripts/mobile.js
#	src/public/stylesheets/style.css
2020-02-25 09:42:27 +01:00
zadam
7cac2521ef fix css class handling 2020-02-25 09:40:49 +01:00
zadam
e8a9e49e9e release 0.40.4 2020-02-24 22:59:22 +01:00
zadam
fb55cdaea6 release 0.40.4 2020-02-24 22:58:18 +01:00
zadam
b9b2cc8364 make sure $rendered is always jquery object 2020-02-24 22:55:12 +01:00
zadam
8dfdd090f5 use note's css class also in book and included note, closes #879 2020-02-24 22:46:27 +01:00
zadam
fe7705524a fix include note in mobile frontend, closes #878 2020-02-24 22:37:45 +01:00
zadam
8e77d729e5 ckeditor 17 2020-02-20 17:01:18 +01:00
zadam
2b1b7774f8 make images in text notes rendered responsively in a book, fixes #871 2020-02-19 22:24:31 +01:00
zadam
2d58019d6e allow to setup web version as a sync client 2020-02-19 22:10:40 +01:00
zadam
fe31f08c0d show setup window if DB is not initialized 2020-02-19 22:09:49 +01:00
zadam
d9fb36a9a6 fixes 2020-02-19 22:09:02 +01:00
zadam
52f4876f2d camelCase keyboard action names 2020-02-19 20:54:14 +01:00
zadam
ad7a55d305 always autofix note_contents.content = NULL sync issue after note erasion 2020-02-19 19:51:36 +01:00
zadam
2e3534dfb7 small fixes 2020-02-18 22:16:20 +01:00
zadam
d288c1b052 small fixes 2020-02-17 22:47:50 +01:00
zadam
f2cf361acf small fixes 2020-02-17 22:38:46 +01:00
zadam
e7af24c139 small fixes 2020-02-17 22:14:39 +01:00
zadam
9797942b8e small cleanups 2020-02-17 19:42:52 +01:00
zadam
32d60a7eb9 refactored tree context menu to reduce duplication 2020-02-16 22:56:40 +01:00
zadam
4330dc47a0 converted tree_keybindings.js into proper commands 2020-02-16 22:14:28 +01:00
zadam
8ca9ad3497 fixes 2020-02-16 20:09:59 +01:00
zadam
a679fedb58 refactored keyboard actions into commands 2020-02-16 19:54:11 +01:00
zadam
880f4ad711 renamed Listener() to Event() 2020-02-16 19:23:49 +01:00
zadam
e000fb4579 appContext is now component 2020-02-16 19:21:17 +01:00
zadam
22c042e21f remove appContext as copied dependency across components 2020-02-16 18:11:32 +01:00
zadam
2c3f07521d fixes 2020-02-16 11:22:37 +01:00
zadam
e06f3ef97e refactorings for add link and include note 2020-02-16 10:50:48 +01:00
zadam
7e41a2750c refactored KB handling and add link dialog 2020-02-15 22:12:05 +01:00
zadam
b2a48a1f3a fix clone notes dialog 2020-02-15 18:41:32 +01:00
zadam
e1bf4dcbc9 basic executor / command mechanism 2020-02-15 10:41:21 +01:00
zadam
6d847d22d3 components now track their parent 2020-02-15 09:43:47 +01:00
zadam
9337564075 boxicons 2.0.5 2020-02-15 09:16:23 +01:00
zadam
2fa41b44c5 fix branch prefix dialog 2020-02-14 21:21:47 +01:00
zadam
8d2c2202fa refactoring and fixes for saved note 2020-02-14 20:18:09 +01:00
zadam
380bb0cd01 fix deleting 2020-02-12 22:25:52 +01:00
zadam
789f62267c changes in note detail handling 2020-02-12 22:09:25 +01:00
zadam
25553c9e67 simplification of sync event API 2020-02-12 20:31:31 +01:00
zadam
81a54cd4a0 messaging now uses mutex so each component processes only single message at each time 2020-02-12 20:07:04 +01:00
zadam
1d2fc773c2 fix for delete note sync etc. 2020-02-10 20:57:56 +01:00
zadam
7767edd82f fixes 2020-02-09 22:31:52 +01:00
zadam
99ea238c3f frontend sync fixes 2020-02-09 21:53:10 +01:00
zadam
826c434630 fixes in closing tabs and elsewhere 2020-02-09 21:13:05 +01:00
zadam
4401a8e1e8 Merge branch 'master' into m41
# Conflicts:
#	src/public/javascripts/dialogs/add_link.js
#	src/public/javascripts/dialogs/export.js
#	src/public/javascripts/dialogs/import.js
#	src/public/javascripts/dialogs/note_info.js
#	src/public/javascripts/services/search_notes.js
2020-02-09 18:54:56 +01:00
zadam
4ce4ac9584 release 0.40.3 2020-02-09 10:48:23 +01:00
zadam
88bd65c679 external links are also parsed and label is created for them, closes #851 2020-02-09 10:45:07 +01:00
zadam
9eab3026bb display advanced item in the tree context menu in the middle to avoid being hidden, closes #853 2020-02-09 10:15:35 +01:00
zadam
7abaedbf31 add possibility to change clipper parent to a fixed note instead of day notes, fixes #854 2020-02-09 10:12:02 +01:00
zadam
402718d293 return focus to the previously focused element after closing the dialog, fixes #861 2020-02-09 10:00:13 +01:00
zadam
990a84c202 Merge remote-tracking branch 'origin/master' 2020-02-09 08:38:47 +01:00
zadam
d8e181a828 Merge branch 'stable'
# Conflicts:
#	package.json
#	src/services/build.js
2020-02-09 08:38:29 +01:00
zadam
4ec671d199 fixes in enabling / disabling widgets in runtime 2020-02-08 21:54:39 +01:00
zadam
9f4a514562 fix setting path 2020-02-08 21:23:42 +01:00
zadam
18ee239362 fixes 2020-02-08 20:53:07 +01:00
zadam
08687b76ea fix title bar buttons visibility 2020-02-08 18:25:07 +01:00
zadam
60d07a6871 fix duplicated cached widgets 2020-02-08 17:44:34 +01:00
zadam
81f4966a1a fixes, cleaned up noise in the developer console 2020-02-08 10:40:58 +01:00
zadam
9acf723a9a fixes 2020-02-07 22:19:35 +01:00
zadam
47f7f5f4d9 refactoring 2020-02-07 21:43:02 +01:00
zadam
14d6372bd8 moved tab related stuff to tab manager from app context 2020-02-07 21:08:55 +01:00
zadam
6d912c4897 removed dependency on note tree widget from app context 2020-02-07 20:56:49 +01:00
zadam
62e1284790 untangled tabrow dependencies 2020-02-06 22:39:31 +01:00
zadam
d79ae261e1 refactored layout out of app context 2020-02-06 21:47:31 +01:00
zadam
92f6558e55 the whole view is now composed from a single root widget 2020-02-06 21:16:02 +01:00
zadam
8d49249ed7 fix lazy initialization of the sidebar 2020-02-06 20:04:43 +01:00
zadam
d1bb62c40e fixes 2020-02-05 22:46:20 +01:00
zadam
42017fde5f refactored access to options on frontend 2020-02-05 22:08:45 +01:00
zadam
786bbbc160 sidebars are now represented as widgets 2020-02-04 22:46:17 +01:00
zadam
0cc013c13f left sidebar can now be also collapsible 2020-02-04 20:42:40 +01:00
zadam
c5475765e5 disable --disable-gpu flag 2020-02-03 22:41:01 +01:00
zadam
9ea91f821c update to electron 8 2020-02-03 22:23:23 +01:00
zadam
b757dfcf79 various fixes and small refactorings 2020-02-03 21:56:45 +01:00
zadam
44ddcdd852 various widget optimizations for faster note switching 2020-02-03 21:16:33 +01:00
zadam
66204811cf refactored note creation methods into a separate service 2020-02-03 20:07:34 +01:00
zadam
822a8509b3 fix 2020-02-02 22:33:50 +01:00
zadam
9f62490a75 refactorings of note creation code 2020-02-02 22:32:44 +01:00
zadam
b63ecba695 clean up tree service WIP 2020-02-02 22:04:28 +01:00
zadam
d5ae3802d1 various widget refactorings 2020-02-02 21:16:20 +01:00
zadam
7c6cd63a53 various widget refactorings 2020-02-02 20:02:08 +01:00
zadam
62a80ef016 standard widget => collapsible widget 2020-02-02 18:46:50 +01:00
zadam
27ab55d26a fixed switch between autobook and text 2020-02-02 11:44:08 +01:00
zadam
34150e7177 fix inserting link 2020-02-02 11:14:44 +01:00
zadam
b946599320 Merge remote-tracking branch 'origin/master' into m41
# Conflicts:
#	src/public/javascripts/services/tree.js
2020-02-02 10:45:27 +01:00
zadam
3cd4be4e48 removed note detail service 2020-02-02 10:41:43 +01:00
zadam
96e2b9bc18 fix tree keyboard shortcuts propagating outside of tree 2020-02-02 10:10:37 +01:00
jasontan056
adb8caa8a2 Fix corner case preventing notes from being created before ckeditor is initialized (#849)
* Pass deleteId to deleteBranch in ensureNoteIsAbsentFromParent

* Add checks for whether window.cutToNote is defined.

* check ckEditor initialized.
2020-02-02 09:28:19 +01:00
zadam
0054a32dc7 treecache now manages reloading when starting protected session 2020-02-01 22:29:32 +01:00
zadam
513ce1a183 Merge branch 'master' into m41
# Conflicts:
#	src/public/javascripts/services/sidebar.js
#	src/public/javascripts/services/tab_context.js
#	src/public/javascripts/services/tree.js
2020-02-01 20:01:30 +01:00
zadam
9f38ea6ee7 update tab title upon its change 2020-02-01 19:25:37 +01:00
zadam
0e13678f7c note complement is now loaded through tree cache 2020-02-01 18:29:18 +01:00
zadam
f0cbca2838 lazy loading of note complement 2020-02-01 11:33:31 +01:00
zadam
f6f7836b8e renamed notefull to notecomplement 2020-02-01 11:15:58 +01:00
zadam
7651c53363 release 0.40.2 2020-02-01 10:17:51 +01:00
zadam
0f25c8a95f autobook should not be active on the mobile interface 2020-02-01 10:17:03 +01:00
zadam
1a49894adf fix tree loading on mobile interface, closes #839 2020-02-01 10:04:18 +01:00
zadam
bd8c078fb9 Merge remote-tracking branch 'origin/master' 2020-02-01 09:30:14 +01:00
zadam
6e060b87b8 fix date parsing in local timezone, closes #845 2020-02-01 09:29:56 +01:00
jasontan056
2375b170ba Pass deleteId to deleteBranch in ensureNoteIsAbsentFromParent (#846) 2020-02-01 09:05:23 +01:00
zadam
eeedb91ef7 sync are sent upon DB commit 2020-01-31 22:32:24 +01:00
zadam
05b51c0f68 frontend sync through websocket 2020-01-31 20:52:31 +01:00
zadam
8bf794f13b wip 2020-01-30 22:38:31 +01:00
zadam
48b401164a wip 2020-01-29 22:32:22 +01:00
zadam
b65631be7e tree change listener and others 2020-01-29 21:38:58 +01:00
zadam
439b45b0b8 refactored entity reloading 2020-01-29 20:14:02 +01:00
zadam
976b2aa6f5 got rid of "origParentNoteId" since it's not needed anymore 2020-01-28 22:39:44 +01:00
zadam
88213c1bbd attributes are now updated only if their type and name does not change, in case of relation not even value must change. If they do, the old attribute is deleted and new is created instead 2020-01-28 22:37:06 +01:00
zadam
d2e3aedf7f moving notes across parents now deletes the old branch and creates new which makes detecting changes much easier 2020-01-28 22:15:33 +01:00
zadam
368d3b1b97 wip 2020-01-28 21:54:28 +01:00
zadam
9301679707 wip 2020-01-27 22:58:03 +01:00
zadam
865f7e1ee1 fix propagating note reloads 2020-01-27 20:07:33 +01:00
zadam
c243d2e85c sync changes wip 2020-01-26 11:41:40 +01:00
zadam
97a35d6fba wip 2020-01-26 10:42:24 +01:00
zadam
3f0974d3d2 smaller fixes 2020-01-25 18:29:32 +01:00
zadam
48a7c0235f fixed iconClass and cssClass 2020-01-25 14:48:53 +01:00
zadam
ac7d5f2e81 fixes, separation of notefull from noteshort 2020-01-25 14:37:12 +01:00
zadam
516e6c35da fixes 2020-01-25 13:46:55 +01:00
zadam
7cad386a56 frontend attribute cache refactoring WIP 2020-01-25 13:27:23 +01:00
zadam
60c908cd63 frontend attribute cache refactoring WIP 2020-01-25 11:52:45 +01:00
zadam
52a907651e reduce unnecessary tab activation events 2020-01-25 10:25:06 +01:00
zadam
3254b551d8 merged tree utils into tree service 2020-01-25 09:56:08 +01:00
zadam
7a62d1636b fixes 2020-01-24 22:30:17 +01:00
zadam
7d9b720ea8 fix note switching in current tab 2020-01-24 21:15:40 +01:00
zadam
ba500a3a80 fixes 2020-01-24 20:15:53 +01:00
zadam
606d5afcab refactoring of note detail API 2020-01-24 17:54:47 +01:00
zadam
4b66765cc1 refactoring 2020-01-24 15:44:24 +01:00
zadam
8651e47118 small fixes 2020-01-22 22:29:55 +01:00
zadam
34bc02965f book and search fixes 2020-01-22 22:05:28 +01:00
zadam
eacefeb08b converted remaining type widgets 2020-01-22 21:38:00 +01:00
zadam
11a61325f9 removed last global keyboard handlers 2020-01-22 20:48:56 +01:00
zadam
370c63986d converting more keyboard shortcuts 2020-01-22 19:41:19 +01:00
zadam
d103b16d9a updated generate-cert script, #835 2020-01-22 19:12:03 +01:00
zadam
c63bb7ce8a converted more keyboard actions 2020-01-21 22:54:16 +01:00
zadam
af5c623671 simplification of triggering events from links 2020-01-21 22:08:41 +01:00
zadam
55d1f9e9f0 import & export fixed 2020-01-21 21:43:23 +01:00
zadam
96a7b4e45e fix dialogs 2020-01-21 20:54:00 +01:00
zadam
c83ca78565 keyboard handlers for dialogs 2020-01-20 22:35:52 +01:00
zadam
c5eac8f438 keyboard handlers for tabs 2020-01-20 20:51:22 +01:00
zadam
9bc1f5af45 WIP 2020-01-19 22:05:45 +01:00
zadam
423a70d102 saving note detail 2020-01-19 21:40:23 +01:00
zadam
562c729ed6 more refactorings 2020-01-19 21:24:14 +01:00
zadam
0760dc742b refactored tab activation 2020-01-19 21:12:53 +01:00
zadam
1098d75ce0 synchronous events, updating title works fully 2020-01-19 20:18:02 +01:00
zadam
bd8e5f255b wip 2020-01-19 19:33:35 +01:00
zadam
8da094cd3c events for updating title (no saving yet) 2020-01-19 18:05:06 +01:00
zadam
44dc3c28de Merge branch 'master' into m41 2020-01-19 17:29:45 +01:00
zadam
828cce0d78 release 0.40.1 2020-01-19 15:45:06 +01:00
zadam
49c0d3199d progress 2020-01-19 15:44:18 +01:00
zadam
416d733510 got rid of .renderTo(), tab caching widgets use hidden marker element 2020-01-19 15:36:42 +01:00
zadam
6de4914ea6 extracted widgets from note title 2020-01-19 13:19:40 +01:00
zadam
9f1e777e6d introduction of refreshWithNote 2020-01-19 11:37:24 +01:00
zadam
adb9ce5e93 empty widget type works 2020-01-19 11:20:02 +01:00
zadam
746181689f component => type widget refactoring 2020-01-19 11:03:34 +01:00
zadam
a99c016818 file note layout tweaks 2020-01-19 10:29:21 +01:00
zadam
37f279fab0 Merge branch 'master' into m41
# Conflicts:
#	src/public/javascripts/services/entrypoints.js
2020-01-19 09:30:38 +01:00
zadam
ab535bf147 fixes of the new CopyWithoutFormatting 2020-01-19 09:25:35 +01:00
Heniker
1876664dfb add hotkey to copy contents with line breaks, fixes #349 (#831) 2020-01-19 09:16:36 +01:00
zadam
1690248e24 migration script to fix contentLength = -1 in new notes 2020-01-19 09:08:33 +01:00
zadam
cbeb8ea17e fix setting contentLength 2020-01-19 09:03:26 +01:00
zadam
e355b449c4 code and file note types now sort of work now as well 2020-01-19 09:02:18 +01:00
zadam
4fdea77c57 fix setting contentLength 2020-01-19 09:01:51 +01:00
zadam
9a13edd490 release 0.39.6 2020-01-18 20:52:14 +01:00
zadam
6d276582cb switching notes and tabs now work for most widgets 2020-01-18 20:49:49 +01:00
zadam
493730dff6 working note type and note paths widgets 2020-01-18 19:46:30 +01:00
zadam
b00a9f4415 progress 2020-01-18 18:01:16 +01:00
zadam
b25c1d6fa8 Merge branch 'master' into m41 2020-01-18 09:25:18 +01:00
zadam
c9113ae752 Merge branch 'stable' 2020-01-18 09:24:39 +01:00
zadam
0ec11d29ba fix creating root calendar note when missing, #752 2020-01-18 08:59:46 +01:00
zadam
a6cd25071e more robust handling of sync error, fixes #830 2020-01-18 08:48:36 +01:00
zadam
97b13ae91d refactroring WIP 2020-01-16 22:44:36 +01:00
zadam
0178232f26 more tab row refactoring 2020-01-15 22:35:15 +01:00
zadam
cc138ef9f8 more tab row refactoring 2020-01-15 22:27:52 +01:00
zadam
1552c3804d tab row refactoring WIP 2020-01-15 22:11:30 +01:00
zadam
7963de0abc continuing refactoring 2020-01-15 21:36:01 +01:00
zadam
f98a20928c widgetized standard toolbar 2020-01-15 20:10:54 +01:00
zadam
209b1610f6 widgetizing tab pane 2020-01-15 19:40:17 +01:00
zadam
bd0f7d3680 move components 2020-01-14 21:52:18 +01:00
zadam
f852e1de81 removed sidebar code 2020-01-14 21:48:19 +01:00
zadam
c9770573b2 converting sidebar widgets to normal widgets 2020-01-14 21:23:32 +01:00
zadam
23701219e1 added TabCachingWidget 2020-01-14 20:27:40 +01:00
zadam
c9bc4ad108 widgetizing note detail WIP 2020-01-13 21:48:44 +01:00
zadam
8b9c235465 widgetizing promoted attributes 2020-01-13 20:25:56 +01:00
zadam
20fdeee048 better error handling for search notes 2020-01-13 19:35:06 +01:00
zadam
657d01da95 fix 2020-01-12 23:05:31 +01:00
zadam
17e2627a34 more refactoring ... 2020-01-12 23:03:55 +01:00
zadam
bf7541bfb9 more refactoring ... 2020-01-12 20:15:05 +01:00
zadam
9d81bf030d tab row widgetizing 2020-01-12 19:05:09 +01:00
zadam
f25d735b9d further tab management moved to app context 2020-01-12 12:48:17 +01:00
zadam
4d16018f6c fixes 2020-01-12 12:37:44 +01:00
zadam
5e11840137 moved tab management to app context 2020-01-12 12:30:30 +01:00
zadam
61474defff widgetizing tree WIP 2020-01-12 11:15:23 +01:00
zadam
b12e38c231 widgetizing tree WIP 2020-01-12 10:35:33 +01:00
zadam
d1f679ab90 refactoring clipboard WIP 2020-01-12 09:57:28 +01:00
zadam
0f8a7bad06 moved tree initialization into the widget 2020-01-12 09:12:13 +01:00
zadam
9e031dcd60 start of the refactoring to widget system 2020-01-11 21:19:56 +01:00
zadam
51c3f98dde pane rename 2020-01-11 18:33:43 +01:00
zadam
a79a063d17 release 0.40.0-beta 2020-01-11 09:54:31 +01:00
zadam
5e91b1b5e0 package updates 2020-01-11 09:50:05 +01:00
zadam
7877443fb4 Merge branch 'stable' 2020-01-11 09:41:42 +01:00
zadam
759e47bfcf using included note should create a relation, closes #820 2020-01-10 21:41:00 +01:00
zadam
67bdffb27b expose text editor instance and method to add text to editor, closes #819 2020-01-10 20:10:17 +01:00
zadam
3386dace3b provide context menu in text editor also with disabled spellcheck 2020-01-10 19:56:27 +01:00
zadam
f3a2e2cbde Merge branch 'stable' 2020-01-08 21:39:17 +01:00
zadam
3cf3fc13b9 release 0.39.5 2020-01-08 21:01:24 +01:00
zadam
2b69abf8ab fix filter parser for >=, <=, *=* 2020-01-08 20:23:41 +01:00
zadam
3e49a7dbfa all consistency checkers have now fixers 2020-01-08 19:28:22 +01:00
zadam
4c7c3105e8 Merge branch 'stable'
# Conflicts:
#	src/services/notes.js
2020-01-07 22:29:54 +01:00
zadam
f782d2bef9 don't empty script area on save 2020-01-07 22:29:15 +01:00
zadam
ccaa9eae3a fix context submenus, closes #810 2020-01-07 20:53:41 +01:00
zadam
24c5388e0c protection against text note initialization race conditions 2020-01-07 19:48:26 +01:00
zadam
1cd2711097 Merge branch 'stable' 2020-01-05 20:02:19 +01:00
zadam
f0dfe7d552 release 0.39.4 2020-01-04 22:01:20 +01:00
zadam
3b8b4da149 task context progress fixes 2020-01-04 21:59:28 +01:00
zadam
2150619d62 activateNewNote does not reload whole tree anymore 2020-01-04 21:53:49 +01:00
zadam
acb76e0630 added notification to empty book notes otherwise they look suspiciously empty 2020-01-04 21:24:39 +01:00
zadam
fdb46f9329 fallback image saving without optimization will still compress image 2020-01-04 20:10:30 +01:00
zadam
ca587cccf6 book note type has automatically empty mime type 2020-01-04 19:34:01 +01:00
zadam
571772069a force SQLite to choose particular index for attribute search since it sometimes led to very inefficient query plans 2020-01-04 19:22:16 +01:00
zadam
79e7762c72 indent data notes 2020-01-04 18:44:54 +01:00
zadam
d025cfee1b empty note with just included note should be saved, closes #807 2020-01-04 13:22:07 +01:00
zadam
7793552443 fix display of show sidebar button 2020-01-04 10:05:03 +01:00
zadam
f377a84fa1 hide/show button z-index tweak 2020-01-04 09:21:42 +01:00
zadam
b8f2797abf better behavior of note info widget in tight width 2020-01-04 09:04:08 +01:00
zadam
54d89a9f47 allow configuring the time period before deleted notes are erased (and changed the default to 7 days) 2020-01-03 22:32:49 +01:00
zadam
1699646b39 fix undelete info messages 2020-01-03 21:32:41 +01:00
zadam
94a0a31f17 refactoring of tree handling to recommended fancytree 2020-01-03 21:15:45 +01:00
zadam
10219fb9dd Merge branch 'stable' 2020-01-03 20:13:13 +01:00
zadam
50431dd55a hide "show/hide sidebar" button in zen mode, fixes #805 2020-01-03 20:12:19 +01:00
zadam
17b23d92ef delete/undelete fixes 2020-01-03 13:41:44 +01:00
zadam
14f3c783f2 undelete note WIP 2020-01-03 13:14:43 +01:00
zadam
c1d0a1e07b undelete note WIP 2020-01-03 10:48:36 +01:00
zadam
1d3608b7bf fix recent note dialog for deleted notes 2020-01-03 09:04:38 +01:00
zadam
d0c655f66a fix removeAttribute to take into account attribute name, closes #804 2020-01-03 08:55:13 +01:00
zadam
ac75fd2ca3 focus and activate should work together 2020-01-02 19:07:50 +01:00
zadam
3b98428c8c change order of execution to mitigate race conditions 2020-01-02 19:03:54 +01:00
zadam
7d877d0fef release 0.39.3 2020-01-02 10:43:41 +01:00
zadam
cb79f2c7eb updated ckeditor build to support cuttonote 2020-01-02 10:38:29 +01:00
zadam
547a5714ae fancytree 2.34.0 2020-01-01 23:13:49 +01:00
zadam
82420fe5f6 reactivate "cut to note", closes #795 2020-01-01 22:59:51 +01:00
zadam
395913d1bb API docs update 2020-01-01 22:03:27 +01:00
zadam
f3a29b55ba remove @child🧒sorted label from calendar root in demo document since currently @sorted is added automatically in the code, closes #799 2020-01-01 20:58:59 +01:00
zadam
232321f3a4 fix searching multi-valued attributes, closes #800 2020-01-01 20:49:26 +01:00
zadam
51dddb0bbb fix scrolling behavior in firefox 2020-01-01 19:57:57 +01:00
zadam
8b9bf6e46f expand to note to be able to activate note 2020-01-01 19:46:27 +01:00
zadam
631a75deec release 0.39.2-beta 2019-12-30 19:48:54 +01:00
zadam
3f1d0e5872 small template refactoring 2019-12-30 19:46:48 +01:00
zadam
0fe91d0184 include note feature 2019-12-30 19:32:45 +01:00
zadam
2f711a12f8 added "include note" widget to text notes, WIP 2019-12-29 23:46:40 +01:00
zadam
64f32ba38f fix zen mode with new layout, closes #794 2019-12-29 20:48:24 +01:00
zadam
7db4859fb9 Merge remote-tracking branch 'origin/master' 2019-12-29 10:19:11 +01:00
zadam
eee9fcae5c set timeout for the initial sync seed request 2019-12-29 10:19:00 +01:00
zadam
9c4a976342 added some statistic scripts to demo document 2019-12-28 21:52:35 +01:00
zadam
e4a09c6207 fix left pane scrolling, closes #788 2019-12-28 21:37:13 +01:00
zadam
d467db2227 unify API for creating note links 2019-12-28 21:10:02 +01:00
zadam
b8d6ff0542 reset file inputs to allow reuploading the same file again 2019-12-28 19:29:52 +01:00
zadam
a9b8e65c9b force scrolling when width of the content overflows 2019-12-28 19:18:44 +01:00
zadam
bb8b563ece relaunch app after successful sync 2019-12-28 12:55:53 +01:00
zadam
05a8ffb944 small fixes 2019-12-28 10:28:12 +01:00
zadam
2502646a64 release 0.39.1-beta 2019-12-27 21:21:57 +01:00
zadam
3d95d69f80 styling hack for the design to look correct in both FF and chrome 2019-12-27 21:18:14 +01:00
zadam
df751f5d67 fix icon 2019-12-27 21:11:56 +01:00
zadam
4f06b6de78 fix registration of global shortcuts, fixes #786 2019-12-27 20:28:27 +01:00
zadam
d2177cd517 fix detection of desktop build in setup page, closes #787 2019-12-27 20:22:46 +01:00
zadam
0affcf5ad2 move electron-installer-debian to optional dependencies since it can't be installed on windows, #783 2019-12-26 10:02:55 +01:00
zadam
7a416b107b fix electron dep issue in the server version, closes #784 2019-12-25 19:38:28 +01:00
zadam
1ff124dab7 release 0.39.0-beta 2019-12-25 12:18:52 +01:00
zadam
4cb511bad0 fix import with style.css 2019-12-25 12:09:49 +01:00
zadam
73c8d145fa tar export fixes + added code block example to the demo document 2019-12-25 11:56:55 +01:00
zadam
ab79f24729 added content style to tar html export as well 2019-12-25 11:34:45 +01:00
zadam
cec71f65b3 load ckeditor content style for printing to have more similar look to the in-editor, #782 2019-12-25 10:59:45 +01:00
zadam
f75c008154 more sync recovery fixes 2019-12-24 17:49:44 +01:00
zadam
474baa7d95 sync recovery fixes 2019-12-24 16:00:31 +01:00
zadam
a155b6e8d5 create separate window for setup and then main window 2019-12-24 14:42:03 +01:00
zadam
229974e543 added option to enable native title bar (disabled by default) 2019-12-24 12:10:32 +01:00
zadam
6fc19bfb93 Merge branch 'stable' 2019-12-24 11:55:27 +01:00
zadam
ccaa108faa release 0.38.3 2019-12-24 10:51:51 +01:00
zadam
0a72383495 make opening new links from ckeditor more consistent for internal and external links, closes #779 2019-12-24 10:49:16 +01:00
zadam
d389100611 properly cleanup sidebar content after closing tab 2019-12-23 21:46:37 +01:00
zadam
ea7257a5b2 cleaned up experimental attribute pane 2019-12-23 21:13:56 +01:00
zadam
0ebc947fbd visual tweaks 2019-12-23 21:05:47 +01:00
zadam
c89514f9bb saving size and visibility state of the panes 2019-12-23 20:34:29 +01:00
zadam
e0368e395c removed left and right sidebar sizing options 2019-12-23 19:45:59 +01:00
zadam
6986c201dd removed hideTabRowForOneTab option 2019-12-23 19:39:48 +01:00
zadam
bcf163f8a1 css alignment 2019-12-23 17:12:17 +01:00
zadam
15aaead7b9 show/hide switcher for the sidebar 2019-12-23 16:48:34 +01:00
zadam
d29c5c4758 sidebar pulled outside of the tab content and added splitter 2019-12-23 15:50:24 +01:00
zadam
81e2baeee5 blur title buttons after clicking 2019-12-23 13:46:26 +01:00
zadam
4cececafc9 added title bar buttons 2019-12-23 13:34:54 +01:00
zadam
7c8e7a3f4b frameless design with tabs on top, split for left panel 2019-12-23 11:52:45 +01:00
zadam
613d5f93e8 convert css grid design to flex based one 2019-12-23 08:52:57 +01:00
zadam
4f5b23fbf8 tar file export now sets mtime to tar records based on utcDateCreated of a note, closes #487 2019-12-22 10:57:55 +01:00
zadam
a37b9cfc7b steel blue tweaks in demo document 2019-12-21 15:48:36 +01:00
zadam
2bc18bc214 use main border color for tab border 2019-12-21 15:37:51 +01:00
zadam
f31a998c5d path list contains a button to add a new path, closes #611 2019-12-21 13:55:13 +01:00
zadam
5552917533 Merge branch 'stable' 2019-12-21 13:39:12 +01:00
zadam
a9702aa6a2 fix empty checkbox visibility, closes #775 2019-12-21 12:37:24 +01:00
zadam
d1941cc650 Merge branch 'stable' 2019-12-20 21:00:30 +01:00
zadam
f98fa4098f clearer WS error message 2019-12-20 20:17:58 +01:00
zadam
5350496ed4 fix creating note from global ctrl+alt+p shortcut, closes #773 2019-12-20 20:13:21 +01:00
zadam
b62d79044a fix creating note from relation map, closes #771 2019-12-20 19:02:52 +01:00
zadam
0db3722ec2 package updates 2019-12-20 18:04:05 +01:00
zadam
d47403c0e7 implemented sync hash check recovery process 2019-12-18 22:58:30 +01:00
zadam
77311954a1 added sectors for contect check computation 2019-12-18 22:24:13 +01:00
zadam
b7cf4fe96b more general filter parsing 2019-12-18 20:51:48 +01:00
zadam
6d9b702d4c Merge branch 'master' into stable 2019-12-18 20:49:24 +01:00
zadam
6e4c30571c release 0.38.2 2019-12-18 20:21:06 +01:00
zadam
5988776b7e styling of active button 2019-12-18 20:16:11 +01:00
zadam
384da60953 fix regex for parsing out the filters 2019-12-18 19:56:53 +01:00
zadam
21fab412cb sync error mitigation 2019-12-17 22:17:03 +01:00
zadam
eb4dfbad92 sync fixes 2019-12-16 22:47:07 +01:00
zadam
aff9ce97ee small sync fixes 2019-12-16 22:00:44 +01:00
zadam
b0a3f828fb release 0.38.1-beta 2019-12-10 23:09:02 +01:00
zadam
76f5736255 update demo document 2019-12-10 23:08:50 +01:00
zadam
a82066d899 ability to define a keyboard shortcut for paste markdown, closes #761 2019-12-10 23:04:18 +01:00
zadam
45c5287d53 protection against note switching race conditions 2019-12-10 22:35:24 +01:00
zadam
dce54c7af3 run consistency checks on demand 2019-12-10 22:03:00 +01:00
zadam
ee15db0ae1 for title/content search does not make sense to search for protected notes 2019-12-10 21:40:53 +01:00
zadam
c48dbb0913 more debugging info for problems after sync 2019-12-10 21:31:24 +01:00
zadam
882ebdbd8f revert unicode regex since it's still not supported by ff 2019-12-09 23:08:32 +01:00
zadam
6f32d6fabe new mechanism to wait for sync after interaction with backend in Script API using api.waitForMaxKnownSyncId() 2019-12-09 23:07:45 +01:00
zadam
1e123f2390 sql console tweaks 2019-12-09 21:31:38 +01:00
zadam
b29155775e Merge branch 'stable'
# Conflicts:
#	package-lock.json
2019-12-09 20:23:22 +01:00
zadam
b821ed28fc refactor mention setup 2019-12-09 20:09:55 +01:00
zadam
fdb8959aa1 move mime types loading to avoid race conditions 2019-12-09 20:06:36 +01:00
zadam
7554cb057b support unicode characters in filters without quotes, fixes #757 2019-12-09 19:38:48 +01:00
zadam
fab959539a ability to run multiple queries (and get multiple result sets) from SQL console 2019-12-08 11:20:44 +01:00
zadam
afe44a6fe8 Merge branch 'stable' 2019-12-08 10:37:19 +01:00
zadam
7ed526beb7 fix clipper, closes #752 2019-12-08 09:41:31 +01:00
zadam
af695802e3 codeNotesMimeTypes option has not been created for new documents, fixes #755 2019-12-08 09:12:42 +01:00
zadam
156f040880 added "backend log" dialog 2019-12-05 21:25:36 +01:00
zadam
cf6f04defb better port error logging 2019-12-04 22:59:26 +01:00
zadam
a890b91079 release 0.38.0-beta 2019-12-04 22:40:31 +01:00
zadam
e0aabe4f9c fix docs 2019-12-04 22:40:20 +01:00
zadam
01cd9d8fb3 ckeditor 16 with code blocks plugin 2019-12-04 21:21:07 +01:00
zadam
af10f0f52a API docs updates 2019-12-03 22:53:17 +01:00
zadam
aa5ede5039 Merge branch 'stable' 2019-12-03 22:52:37 +01:00
zadam
21e77c83fc release 0.37.8 2019-12-03 22:31:20 +01:00
zadam
b0310e34e2 fix CSS loading from subdomain, #741 2019-12-03 22:13:02 +01:00
zadam
9812b9c272 (mostly) backwards compatible .createNote() backend API 2019-12-03 21:31:46 +01:00
zadam
92d5f91aa6 Merge branch 'stable' 2019-12-03 20:33:42 +01:00
zadam
b0368c7f17 Merge remote-tracking branch 'origin/master' 2019-12-03 20:32:01 +01:00
zadam
8e1f8c869b new @parentCount virtual search attribute, closes #738 2019-12-03 20:31:34 +01:00
nil0x42
4688cda493 [DOC] createNewNote(): Add missing render type (#740) 2019-12-03 19:49:27 +01:00
zadam
761c51069a use max-height for promoted attributes, #739 2019-12-03 19:47:53 +01:00
zadam
4dc285d84f serve favicon from relative path 2019-12-03 19:31:58 +01:00
zadam
0e2f8b5734 don't set date modified on erasing 2019-12-03 19:10:40 +01:00
zadam
a1402c7c66 release 0.37.7 2019-12-02 23:09:42 +01:00
zadam
6ba3e5ab7f backport fix from master to avoid doubled attributes inherited from multiple paths 2019-12-02 23:07:19 +01:00
zadam
f740e52ebf correctly respect label @disableVersioning
(cherry picked from commit dc063983ea)
2019-12-02 23:06:06 +01:00
zadam
e9454e4db7 fix SQL console scrolling
(cherry picked from commit 749bb90713)
2019-12-02 23:05:05 +01:00
zadam
749bb90713 fix SQL console scrolling 2019-12-02 23:04:22 +01:00
zadam
eb8c296e62 attempt to make updating clients via websocket faster 2019-12-02 22:27:06 +01:00
zadam
dc063983ea correctly respect label @disableVersioning 2019-12-02 20:21:52 +01:00
zadam
2595c3ac31 fix attribute loading CTE + don't duplicate attributes in case of cloning, fixes #735 2019-12-02 20:10:10 +01:00
zadam
9cb8bc5dd8 generate document now creates note revisions as well 2019-12-02 19:52:58 +01:00
zadam
3b690f5456 mini optimizations 2019-12-01 15:01:09 +01:00
zadam
7ef2e7769f added index to source_ids 2019-12-01 14:39:24 +01:00
zadam
4c07ac4c4c optimized edited notes on day query 2019-12-01 14:30:59 +01:00
zadam
35cd7f3261 optimization of recursive CTE attribute query 2019-12-01 13:29:39 +01:00
zadam
8c3e2e5eb7 better placement of slow query detection 2019-12-01 12:51:47 +01:00
zadam
d57caee0d3 drop unnecessary indexes 2019-12-01 12:38:07 +01:00
zadam
6e83980784 aligning frontend attributes API with the backend one 2019-12-01 12:22:22 +01:00
zadam
295af1f43e adding file length limit to tar export 2019-12-01 11:49:14 +01:00
zadam
ed2afe5c20 Merge branch 'stable' 2019-12-01 11:32:33 +01:00
zadam
bfc7570e14 don't convert MD to HTML if "import markdown as text" is not selected, closes #733 2019-12-01 11:27:22 +01:00
zadam
d9b9d730bb moving from inherited attribute queries to owned one where it makes sense 2019-12-01 11:10:04 +01:00
zadam
ba8a8dca7b adding more "owned" attribute methods to Note entity 2019-12-01 10:57:28 +01:00
zadam
29eb5a8435 Merge branch 'stable'
# Conflicts:
#	src/services/notes.js
#	src/tools/generate_document.js
2019-12-01 10:32:30 +01:00
zadam
5de92171a7 use owned attributes where it's a better fit 2019-12-01 10:28:05 +01:00
zadam
29c5e394ab generate document now creates also labels and relations 2019-12-01 10:20:18 +01:00
zadam
07b3d11fe5 fix generate new document script 2019-12-01 09:19:16 +01:00
zadam
67663fba50 fixes 2019-11-30 11:36:36 +01:00
zadam
995ebbf577 removed foreign keys PRAGMAs since foreign key constraints are not used anymore 2019-11-30 10:41:53 +01:00
zadam
d0e6be3e0c entity stat as part of consistency checks 2019-11-30 09:15:08 +01:00
zadam
01370a5968 fix anonymization according to latest schema 2019-11-29 21:42:24 +01:00
zadam
6c561b5764 rename API .createNote() to .createNewNote() to allow future backwards compatibility 2019-11-28 22:35:55 +01:00
zadam
2953f1bdb8 adding some standard classes for tree items 2019-11-28 22:05:27 +01:00
zadam
1c057cac75 small script API additions 2019-11-27 23:07:10 +01:00
zadam
0415efd33b create year/month/date labels/relation only when the note is created 2019-11-27 19:42:10 +01:00
zadam
e58dc829f5 bootstrap 4.4.0 2019-11-27 18:59:42 +01:00
zadam
90d10c1ff3 Merge branch 'stable'
# Conflicts:
#	package-lock.json
#	src/public/javascripts/services/tree_context_menu.js
#	src/services/import/enex.js
2019-11-27 18:54:49 +01:00
zadam
5b30291601 release 0.37.6 2019-11-26 22:50:08 +01:00
zadam
5193f073e9 if there's no updated field use created #725 2019-11-26 22:47:54 +01:00
zadam
6c7d8a9667 preserve dateCreated and dateModified in ENEX import, fixes #725 2019-11-26 22:02:21 +01:00
zadam
5e9bedd903 fixed sidebar switch in the options dialog 2019-11-26 20:46:49 +01:00
zadam
e712990c03 don't remove active tab after deleting note to preserve tab state, fixes #727 2019-11-26 20:42:34 +01:00
zadam
91487b338a make the context menu scrollable when exceeding total window height, closes #723 2019-11-26 19:55:52 +01:00
zadam
3ff24d53e5 fix decrypting note titles on the server installation, closes #724 2019-11-26 19:49:52 +01:00
zadam
94c904fb40 fix context menu over root, closes #726 2019-11-26 19:42:47 +01:00
zadam
5f258fbbbf release 0.37.5 2019-11-25 22:46:15 +01:00
zadam
56c7b7f5bd API docs update 2019-11-25 22:45:09 +01:00
zadam
bf9ad976b9 fixing non-root path issues, #404 2019-11-25 21:44:46 +01:00
zadam
19206d1e0d backend API note creation updates 2019-11-25 21:24:41 +01:00
zadam
420be6d8c6 fix demo document relation map and shortcuts before db initialization 2019-11-24 22:42:54 +01:00
zadam
dbd2040bee shortcut fixes 2019-11-24 22:15:33 +01:00
zadam
1e979d71c7 changed note selection in tree using keyboard - now only sibling nodes are selected 2019-11-24 22:01:10 +01:00
zadam
6bbd4c59bc reduce flicker of "create new day note" 2019-11-24 21:40:50 +01:00
zadam
3a54d00e2b added shortcut filter in the options dialog 2019-11-24 20:20:13 +01:00
zadam
499c9a7381 separated some context menu items into "advanced" 2019-11-24 20:00:54 +01:00
zadam
cd139bdd76 note can be activated through 'keyboardShortcut' label 2019-11-24 18:32:18 +01:00
zadam
60c3b5cccc Merge remote-tracking branch 'origin/master' 2019-11-24 14:10:19 +01:00
zadam
540f9f933a update demo.tar with correct system links 2019-11-24 14:10:11 +01:00
Benoit Stahl
a59943094e this input is text (#719) 2019-11-24 10:44:09 +01:00
zadam
c400a7143c reorganization of shortcuts in the options 2019-11-24 10:40:18 +01:00
zadam
1f37d00e42 updating also shortcuts in element titles 2019-11-24 10:14:30 +01:00
zadam
d21e824343 binding remaining actions 2019-11-24 09:50:19 +01:00
zadam
ff3f0ee0a0 Merge branch 'stable' 2019-11-23 23:07:07 +01:00
zadam
01ff34b5d4 moving edit branch prefix, search in subtree and toggle note hoisting to global entrypoints instead of being tree specific 2019-11-23 23:06:25 +01:00
zadam
0cde7ede24 updated note menu with current shortcuts 2019-11-23 22:56:35 +01:00
zadam
92cb723d0c updated inapp help with current shortcuts 2019-11-23 22:17:08 +01:00
zadam
e4bec265c1 system links (internal, image, relation map) should follow camelCase convention used for other attributes 2019-11-23 20:54:49 +01:00
zadam
434d8ef48c added extra autofixers for completely missing note_contents or note_revision_contents row 2019-11-23 19:56:52 +01:00
zadam
c8ba07a4ae fix migration script in case of not fully consistent database (missing note_contents for note). closes #717 2019-11-23 11:13:57 +01:00
zadam
4da6234911 Merge branch 'stable' 2019-11-22 22:59:08 +01:00
zadam
38e7649ac3 release 0.37.4 2019-11-22 22:38:03 +01:00
zadam
ff0245f05f dynamically translating kbd based on actions 2019-11-22 22:35:59 +01:00
zadam
7a2c7edd7e allow multiple instances of @in operator, closes #716 2019-11-22 21:17:46 +01:00
zadam
98c81faedb Merge branch 'stable' 2019-11-22 20:36:47 +01:00
zadam
cfb850acb2 download fixes for the sub-domain web deployment 2019-11-22 20:35:17 +01:00
zadam
a16aaf7a81 fix setup on non-root paths #404 2019-11-22 20:24:49 +01:00
zadam
465c3b87a7 tree keyboard shortcuts 2019-11-21 22:24:07 +01:00
zadam
0e5028acd3 support global shortcuts with global: prefix 2019-11-21 21:12:07 +01:00
zadam
00c295e4bf upgrade to electron 8.0.0-beta.3 2019-11-21 19:36:34 +01:00
zadam
7084ed4fb1 Merge branch 'stable' 2019-11-20 23:11:21 +01:00
zadam
587134c2f8 separators and fixes 2019-11-20 23:10:41 +01:00
zadam
5fac2c7633 saving options keyboard shortcuts 2019-11-20 22:48:32 +01:00
zadam
08a518479b keyboard shortcuts options pane 2019-11-20 21:35:18 +01:00
zadam
522f71cb91 fix tree clipboard 2019-11-20 19:24:23 +01:00
zadam
bcdfb47939 Merge branch 'stable' 2019-11-19 23:34:35 +01:00
zadam
667471e7bb toggle zen mode in the global menu 2019-11-19 23:33:07 +01:00
zadam
d357943ebb release 0.37.3 2019-11-19 23:05:54 +01:00
zadam
07043fb177 switch search in subtree to ctrl+shift+s to stay consistent with ctrl+s 2019-11-19 23:04:43 +01:00
zadam
3c4ec7fe1a keyboard shortcuts WIP 2019-11-19 23:02:54 +01:00
zadam
1f8d382b1f added "search in subtree" context menu, #534 2019-11-19 21:11:20 +01:00
zadam
4bd7438fca shortcuts WIP 2019-11-19 20:53:04 +01:00
zadam
0ae9c8da17 Merge branch 'stable' 2019-11-19 19:32:49 +01:00
zadam
61e8cbbcba add log for content hash failures 2019-11-19 19:07:14 +01:00
zadam
86c5dd6494 fix recent changes, closes #713 2019-11-19 19:02:16 +01:00
zadam
f921562346 Merge branch 'm38'
# Conflicts:
#	docs/backend_api/Note.html
#	docs/frontend_api/NoteShort.html
#	src/services/import/enex.js
2019-11-18 23:26:29 +01:00
zadam
c5acb7fc9b release 0.37.2 2019-11-18 23:04:09 +01:00
zadam
643d9077fc configurable keyboard shortcuts WIP 2019-11-18 23:01:31 +01:00
zadam
b4709e8ee5 "distraction free mode" renamed to more standard "zen mode" 2019-11-18 19:32:27 +01:00
zadam
a1181623b7 hide sidebar button styling 2019-11-17 11:58:05 +01:00
zadam
73a6c66379 header styling changes 2019-11-17 11:39:06 +01:00
zadam
1d5daa8dfd action icons now have hover border as well 2019-11-17 11:30:11 +01:00
zadam
834e1f7253 fix activating tab when app was closed last time with "new tab" 2019-11-17 10:24:06 +01:00
zadam
c141f4b2c0 tab row styling change 2019-11-17 10:22:26 +01:00
zadam
1a87190f43 added IN operator to search, closes #534 2019-11-17 09:07:35 +01:00
zadam
a1262aaaf3 release 0.37.1-beta 2019-11-16 19:09:52 +01:00
zadam
1838f097e5 added getAllNotePaths, fixes #708 2019-11-16 19:07:32 +01:00
zadam
95d0ad1cad simpler ENEX parsing 2019-11-16 18:13:00 +01:00
zadam
767aaa18f4 fix OPML import 2019-11-16 18:04:13 +01:00
zadam
8a7228146c simpler ENEX parsing 2019-11-16 17:56:49 +01:00
zadam
f9b5e473f2 added missing options 2019-11-16 17:03:18 +01:00
zadam
3d294c5163 refactoring of note creation APIs WIP 2019-11-16 17:00:22 +01:00
zadam
60231de0ed refactoring of note creation APIs WIP 2019-11-16 12:28:47 +01:00
zadam
35e9df6170 fixes in the handling of cssClass and iconClass when working with newly created / single note 2019-11-16 11:23:28 +01:00
zadam
13c0411533 refactoring of note creation APIs WIP 2019-11-16 11:09:52 +01:00
zadam
c5e040c4a4 updated demo document with icon classes 2019-11-16 09:57:19 +01:00
zadam
e00ab5dbf9 new "iconClass" property on note_short, now together with cssClass respecting template relationship, #707 2019-11-16 08:59:27 +01:00
zadam
95c37cfdd1 release 0.37.0-beta 2019-11-14 23:12:28 +01:00
zadam
de02e9e889 redesign of createNote APIs, WIP 2019-11-14 23:10:56 +01:00
zadam
e143becb7a styling changes 2019-11-14 20:27:28 +01:00
zadam
c0eb30472e note and note_content has been needlesly updated when utcDateModified has been the same 2019-11-13 22:33:19 +01:00
zadam
8b320bb85f force note sync now really forces update on other instances by updating utcDateModified 2019-11-13 22:32:14 +01:00
zadam
d93b9b8a23 force note sync now syncs also note revision contents and attributes 2019-11-13 21:53:04 +01:00
zadam
69b53fdfb3 expander styling again 2019-11-13 21:46:52 +01:00
zadam
920d71a5a6 small fixes 2019-11-13 20:28:14 +01:00
zadam
d4a277321c styling of mobile expanders 2019-11-13 19:38:34 +01:00
zadam
4068691078 better expander positioning 2019-11-12 23:02:47 +01:00
zadam
86d7e139a4 correctly handle 0 notes to erase 2019-11-12 22:26:25 +01:00
zadam
44add751b2 fix horizontal wrap of pre elements 2019-11-12 22:22:49 +01:00
zadam
c49c69f824 fix migration script 2019-11-12 21:32:35 +01:00
zadam
7bd1d8feb4 fix setting isErased after note migration 2019-11-11 23:37:46 +01:00
zadam
4ba7e74b58 fix note revision's isErased initial value after migration 2019-11-11 23:26:46 +01:00
zadam
4cda661c1b add move to dialog 2019-11-11 22:57:51 +01:00
zadam
5b4a2bd71c Merge branch 'stable'
# Conflicts:
#	src/entities/note.js
2019-11-11 20:43:00 +01:00
zadam
a808e12d31 fix .setAttribute in stable, #703 2019-11-11 20:42:03 +01:00
zadam
1f3f9a4037 release 0.36.5 2019-11-10 22:20:54 +01:00
zadam
77ac8df1e6 keyboard shortcut ctrl+shift+c for "clone to..." dialog 2019-11-10 22:19:22 +01:00
zadam
b53e2a3570 clone to notes now has overview of notes to clone and is available from context menu 2019-11-10 22:06:43 +01:00
zadam
7539e6a616 Merge branch 'stable'
# Conflicts:
#	src/services/consistency_checks.js
2019-11-10 21:35:11 +01:00
zadam
b5a0cadcf4 fix showing up of render note help view if no renderNote relations have been found 2019-11-10 21:34:15 +01:00
zadam
b8db842788 added frontend API methods to refresh tabs 2019-11-10 19:34:15 +01:00
zadam
dea5195223 fix setNoteToParent and deprecate it 2019-11-10 19:29:51 +01:00
zadam
c3ea2ae1b3 added new auto fixers to consistency checks 2019-11-10 14:16:12 +01:00
zadam
1fddd6f318 added non-autoFix variants to fixer methods 2019-11-10 11:43:33 +01:00
zadam
466a4802b6 introduced 'autoFixConsistencyIssues' option to control whether consistency issues should be auto fixed or note 2019-11-10 11:25:41 +01:00
zadam
8f2d2b189c Merge branch 'stable' 2019-11-10 11:24:08 +01:00
zadam
0837cabb41 fix module name for prompt dialog, fixes #698 2019-11-10 10:10:49 +01:00
zadam
5646218be8 release 0.36.4 2019-11-09 21:19:34 +01:00
zadam
169551c6a8 note revisions as a bootstrap list instead of <select> 2019-11-09 20:59:49 +01:00
zadam
3a1c80c189 refactoring of legacy js events 2019-11-09 17:45:22 +01:00
zadam
31bcc037f1 refactoring of legacy js events 2019-11-09 17:39:48 +01:00
zadam
179d530ea9 note revision sync fix 2019-11-09 16:51:51 +01:00
zadam
da92809299 Merge branch 'stable' 2019-11-09 15:33:04 +01:00
zadam
c2ebd4b308 show notes in a book including their prefix, closes #695 2019-11-09 15:31:47 +01:00
zadam
9b24ae0600 erasing note revisions 2019-11-09 15:21:14 +01:00
zadam
7cd75cebfc fix icons in context menu 2019-11-09 13:32:06 +01:00
zadam
664485ccd5 file revisions preview 2019-11-09 13:01:05 +01:00
zadam
60ac1a04f4 uploading new file revisions 2019-11-09 11:58:52 +01:00
zadam
7c7beb5502 added contentLength to note entity 2019-11-09 09:36:08 +01:00
zadam
5aa5ec3af1 downloading note revisions 2019-11-09 08:53:13 +01:00
zadam
58a857cf79 note revisions for images, WIP 2019-11-08 23:09:57 +01:00
zadam
712f67e983 uploading new image revisions, WIP 2019-11-08 22:34:30 +01:00
zadam
3149dff880 Merge branch 'stable' 2019-11-08 19:11:18 +01:00
zadam
d58e98e361 fix not being able to rename a note when in auto-book mode, closes #694 2019-11-07 23:25:58 +01:00
zadam
744855d4f5 linking notes through CKEditor mentiones 2019-11-07 22:43:01 +01:00
zadam
8a9f2ff1d8 Merge remote-tracking branch 'origin/master' 2019-11-07 20:09:57 +01:00
zadam
f539aedd25 Merge branch 'stable' 2019-11-07 20:09:40 +01:00
zadam
05547845cb including confirm and prompt dialog to mobile frontend to allow deleting notes, closes #689 2019-11-07 19:58:40 +01:00
zadam
9b905563c3 fix ensureNoteIsAbsentFromParent, closes #691 2019-11-07 19:51:38 +01:00
zadam
894c888d87 including ckeditor mentions plugin for easy linking 2019-11-06 22:58:32 +01:00
zadam
34d4274032 separate cloning dialog 2019-11-05 23:11:25 +01:00
zadam
b685d7ffb5 simplification of "add link" dialog 2019-11-05 22:40:44 +01:00
zadam
d87c469fbb Merge branch 'stable' 2019-11-05 22:28:27 +01:00
zadam
d8730f1722 release 0.36.3 2019-11-05 21:49:16 +01:00
zadam
72fda89360 fix loading of the search note results 2019-11-05 21:47:22 +01:00
zadam
7075842954 expose bindGlobalShortcut to frontend script API 2019-11-05 21:26:54 +01:00
zadam
a2c78e2c5c disabling link map animation, closes #684 2019-11-05 20:59:20 +01:00
zadam
9c9ef1c7b4 added more careful handling of search note operations, fixes #683 2019-11-04 22:41:06 +01:00
zadam
df40accdd4 fix bug when context menu sometimes does not show up, closes #682 2019-11-04 20:20:21 +01:00
zadam
b67aa99b86 small fixes in context menu item visibility 2019-11-04 19:37:03 +01:00
zadam
5ecb881cec options template is handled directly in the option classes which fixes multiple binding of elements inside options dialog 2019-11-03 19:06:22 +01:00
zadam
fcb6a06d68 fix refreshing notes after import / delete
(cherry picked from commit 5b5ab0b044)
2019-11-03 18:34:07 +01:00
zadam
5b5ab0b044 fix refreshing notes after import / delete 2019-11-03 18:33:43 +01:00
zadam
ab04bde5fb options UI for image quality 2019-11-03 17:59:11 +01:00
zadam
c9e4261930 options for basic image quality control 2019-11-03 11:43:04 +01:00
zadam
9ea8209d4e separating some options to "startup" options which allows not creating new DB version for each new option 2019-11-03 10:43:40 +01:00
zadam
56e50cc850 boxicons 2019-11-02 13:50:17 +01:00
zadam
fc87bcf10c using boxicons instead of jam icons WIP 2019-11-02 12:17:00 +01:00
zadam
b471d51cb4 reloading of notes in tree cache when attribute changes 2019-11-02 08:04:22 +01:00
zadam
b7b583ff04 use decryptString() 2019-11-02 07:50:23 +01:00
zadam
475fddeec1 fixes 2019-11-01 23:05:33 +01:00
zadam
2af86927b0 added flag for the erased notes 2019-11-01 22:09:51 +01:00
zadam
2e58e32112 note revision sync and other fixes 2019-11-01 20:00:56 +01:00
zadam
5c05963bd9 Merge branch 'stable' 2019-11-01 19:21:55 +01:00
zadam
4e5e3e4675 note revisions changes WIP 2019-11-01 19:21:48 +01:00
zadam
f7c59700a5 release 0.36.2 2019-10-31 22:04:44 +01:00
zadam
f1a7fce277 fix creating branch without isExpanded, fixes initial document initialization 2019-10-31 22:02:55 +01:00
zadam
cf53cbf1dd moving out note revision content into separate table, refactoring, WIP 2019-10-31 21:58:34 +01:00
zadam
1a182d1b58 final fix for the ws issue 2019-10-30 19:43:17 +01:00
zadam
8bd52f349a small refactorings and defensive programming in note cache 2019-10-29 20:54:08 +01:00
zadam
68faa47c6f fix not sending latest syncs to client 2019-10-29 20:19:28 +01:00
zadam
2f2a14d4b8 shoutouts in the README 2019-10-29 19:59:19 +01:00
zadam
a2a53deb94 fancytree 2.33.0 2019-10-29 19:07:05 +01:00
zadam
d50e072ea4 fix not-updating lastSyncId in ws handler 2019-10-29 19:03:39 +01:00
zadam
904eb25f64 fix persistent toasts lingering after disposal in DOM 2019-10-29 18:59:56 +01:00
zadam
205081c804 actual fix for the not disappearing toasts 2019-10-28 20:44:11 +01:00
zadam
c4d5060a0b fix non disappearing persistent toast 2019-10-28 20:26:40 +01:00
zadam
5bba18191f small fixes 2019-10-28 19:45:36 +01:00
zadam
5e3538669d sending ws messages doesn't need await 2019-10-28 18:42:22 +01:00
zadam
23c449ca0c fix ordering of new notes 2019-10-27 22:39:38 +01:00
zadam
b7344329f4 date note fixes 2019-10-27 22:13:38 +01:00
zadam
e04845335b fixed search notes with new treecache 2019-10-27 19:17:32 +01:00
zadam
86a330c8c3 delete notes are now in cache as well which allows simplified update of the tree after deletion 2019-10-26 22:50:46 +02:00
zadam
f82e99b5ed fix "clone note after" 2019-10-26 21:14:06 +02:00
zadam
bdf42749f3 fixes 2019-10-26 20:48:56 +02:00
zadam
7ccbf45569 update to ckeditor 15 2019-10-26 10:09:48 +02:00
zadam
c0b30e603a updated API docs 2019-10-26 10:00:26 +02:00
zadam
d3c957768f branches in tree cache should always be loaded if some branchId reference exists 2019-10-26 09:58:00 +02:00
zadam
ed9ecf2a57 simplification of tree cache 2019-10-26 09:51:08 +02:00
zadam
22d48b0586 sync update persistent notification 2019-10-25 22:20:14 +02:00
zadam
edc23940d0 promise for loaded note cache 2019-10-25 21:57:08 +02:00
zadam
c72ea2ed60 changes in retrieval of initial note tree and then updates 2019-10-25 21:47:14 +02:00
zadam
4570319517 WS debugging messages and small changes 2019-10-24 23:02:29 +02:00
zadam
69d739400c refresh notes/branches sorted 2019-10-22 22:27:32 +02:00
zadam
ec7c0f0723 added sync mutex to ping messages 2019-10-22 21:59:51 +02:00
zadam
3de124748d fix a bug where render note content could be set to null during renaming 2019-10-21 22:56:43 +02:00
zadam
41d47c5d33 release 0.36.1-beta 2019-10-21 21:59:17 +02:00
zadam
132360b46b expose note hoisting to frontend API, closes #663 2019-10-21 21:22:53 +02:00
zadam
f0496cb42c generating simple frame based index page in html export 2019-10-21 21:00:27 +02:00
zadam
1522297700 generate navigation file in the tar export 2019-10-20 19:02:48 +02:00
zadam
2a5ab3a5e1 script can wait until the sync data has been applied 2019-10-20 17:49:58 +02:00
zadam
358fd13c8d small refactorings 2019-10-20 13:09:00 +02:00
zadam
2305ad7405 reloading notes after script changes 2019-10-20 12:29:34 +02:00
zadam
78f5b7b288 rename info service to toast service 2019-10-20 10:00:18 +02:00
zadam
1903c59163 scripts should have different sourceId 2019-10-19 15:12:25 +02:00
zadam
b16c2d19b6 duplicate (single) note 2019-10-19 12:36:16 +02:00
zadam
00bb1236ce protect/unprotect tree reports progress via notifications 2019-10-19 09:58:18 +02:00
zadam
82bbf4173b fixes to delete notifications 2019-10-19 00:11:07 +02:00
zadam
9f4ca279aa delete progress 2019-10-18 23:19:16 +02:00
zadam
b890859025 further refactoring of export notifications 2019-10-18 22:44:03 +02:00
zadam
56e4f4f5ac refactor exportcontext to taskcontext 2019-10-18 22:27:38 +02:00
zadam
157bd3816d add hideTabRowForOneTab if missing, fixes #660 2019-10-18 21:04:20 +02:00
zadam
21588829c7 correctly use taskId in toasts 2019-10-17 21:15:27 +02:00
zadam
9689029c4b ImportContext generalized to TaskContext 2019-10-17 21:11:35 +02:00
zadam
992d174b23 import uses persistent toasts 2019-10-17 20:44:51 +02:00
zadam
8886e95847 replaced bootstrap-notify.min.js with bootstrap toasts 2019-10-17 20:03:05 +02:00
zadam
6d5762fac8 open update to 7.0 2019-10-16 19:42:42 +02:00
zadam
e9ab044e46 fix docker build 2019-10-15 21:53:46 +02:00
zadam
fda219d070 release 0.36.0-beta 2019-10-15 20:42:17 +02:00
zadam
2be1aca2f3 build fixes 2019-10-15 20:32:43 +02:00
zadam
1b318d6a30 fix tab cleanup 2019-10-15 19:42:39 +02:00
zadam
22c4859d42 grey out archived items in the tree 2019-10-15 19:16:44 +02:00
zadam
80a6361cf1 update to demo db 2019-10-14 12:11:27 +02:00
zadam
8439effeeb Merge remote-tracking branch 'origin/master' into master2 2019-10-14 12:06:18 +02:00
zadam
fafab95a07 auto-book has variable number of columns based on the right pane width 2019-10-14 12:06:10 +02:00
Johannes Wünsch
24c8e8fc2b fix gitpod (#658) 2019-10-14 11:55:12 +02:00
zadam
1923bf7dda added some basic book examples to demo document 2019-10-14 11:15:38 +02:00
zadam
2ee94a3a69 changed import progress notification so it shows up for drag & drop as well 2019-10-14 10:31:58 +02:00
zadam
2fb3a3eff9 force note sync will sync also note content 2019-10-11 21:24:49 +02:00
zadam
bcbbf4dc3e improvements to build process 2019-10-11 21:22:59 +02:00
zadam
7dc793920f fix spellcheck build on windows 2019-10-10 23:24:25 +02:00
zadam
0b43eceb2d Merge branch 'stable'
# Conflicts:
#	package-lock.json
#	package.json
2019-10-10 21:26:57 +02:00
zadam
85f736139b fix opening note revisions from the sidebar 2019-10-10 20:00:06 +02:00
zadam
98a6670cb4 prevent default context menu on tab right click, closes #656 2019-10-10 19:34:55 +02:00
zadam
a15be82f00 release 0.35.2 2019-10-09 23:09:38 +02:00
zadam
6c3809e1db calendar widget styling for dark themes
(cherry picked from commit c9432990b7)
2019-10-09 23:07:15 +02:00
zadam
33a2cd21a3 fix double import of auto generated link relations
(cherry picked from commit 144e75da9e)
2019-10-09 23:05:52 +02:00
zadam
3eebce22e7 fix incorrect import of relations from tar
(cherry picked from commit 8d14a0d687)
2019-10-09 23:05:51 +02:00
zadam
adae0625b9 rename var so it's not misleading
(cherry picked from commit dd147a7209)
2019-10-09 23:05:14 +02:00
Arne
5063cfb979 BackendAPI: Return Note created within createNoteAndRefresh (#647)
(cherry picked from commit 334a38c493)
2019-10-09 23:05:14 +02:00
zadam
0835930a8a fix creating child in relation map, closes #655 2019-10-09 23:04:01 +02:00
zadam
c9432990b7 calendar widget styling for dark themes 2019-10-08 20:25:54 +02:00
zadam
9ad521822d mac spellchecker build 2019-10-07 22:17:22 +02:00
zadam
824fb08511 Merge remote-tracking branch 'origin/master' 2019-10-07 20:58:58 +02:00
zadam
cc4c15daf0 spellchecker binaries for windows 2019-10-07 20:58:48 +02:00
Logan Gorence
7718778013 Fix typo in note export screen. (#654) 2019-10-07 08:49:53 +02:00
zadam
a25260353d spellcheck binaries for linux-x64 2019-10-06 22:33:19 +02:00
zadam
c1e8a4b384 spell check support + small options tabs reorganization 2019-10-06 21:35:26 +02:00
zadam
3f2229d9e1 better handling of not detected mime type 2019-10-06 18:28:53 +02:00
FliegendeWurst
8561227622 Import: use upload mime type if mime cannot be detected from filename (#651) 2019-10-06 18:23:39 +02:00
zadam
8859e2ac40 fix opening links from book 2019-10-06 12:33:47 +02:00
zadam
7423b2f4fd book handling of protected notes 2019-10-06 11:21:12 +02:00
zadam
d23e9f1bc4 tar import will sort notes if there is no meta file 2019-10-06 09:49:47 +02:00
zadam
516277a478 added "auto book" displayed on the empty text pages as a replacement for children overview 2019-10-05 20:27:30 +02:00
zadam
cbc7710d81 removed children overview (will be replaced by book) 2019-10-05 12:06:06 +02:00
zadam
ea71e96f72 ability to set book zoom level via label 2019-10-05 12:01:00 +02:00
zadam
59d1cb1833 expand all children button 2019-10-05 11:22:42 +02:00
zadam
7c54ba63ce render notes in book 2019-10-05 10:55:29 +02:00
zadam
5892b5b851 nested note rendering in book 2019-10-05 09:33:31 +02:00
zadam
02eb737b9d book has now zoom 2019-10-04 22:21:14 +02:00
zadam
144e75da9e fix double import of auto generated link relations 2019-10-02 23:28:29 +02:00
zadam
8d14a0d687 fix incorrect import of relations from tar 2019-10-02 23:22:58 +02:00
zadam
dec2c218f7 basic book rendering of code and image notes 2019-10-02 19:40:22 +02:00
zadam
dd147a7209 rename var so it's not misleading 2019-10-01 21:42:36 +02:00
zadam
c3fabcb666 Merge remote-tracking branch 'origin/master' 2019-10-01 21:41:26 +02:00
zadam
35e825b376 fix tooltips 2019-10-01 21:41:20 +02:00
Arne
334a38c493 BackendAPI: Return Note created within createNoteAndRefresh (#647) 2019-10-01 21:40:57 +02:00
zadam
8ec01c73cd skeleton implementation of new "book" note type 2019-10-01 21:11:11 +02:00
zadam
0ef6634d41 release 0.35.1 2019-09-30 22:18:23 +02:00
zadam
f6fc24d11d use GFM extensions for markdown export, closes #638 2019-09-30 20:56:32 +02:00
zadam
ed24e32305 fix typo in shell, closes #639 2019-09-30 20:43:56 +02:00
zadam
86df60bb74 "code as code" and "text as text" import settings are respected also with tar import 2019-09-30 20:22:09 +02:00
zadam
42cf02e9a4 library updates 2019-09-30 19:35:00 +02:00
zadam
3add997b49 release 0.35.0-beta 2019-09-09 21:32:48 +02:00
zadam
649862b01c fixed mobile layout 2019-09-09 21:31:50 +02:00
zadam
f5228f87f0 widgets can have a help link with title 2019-09-09 21:23:04 +02:00
zadam
76f3e87790 small fixes 2019-09-09 20:29:07 +02:00
zadam
30c56cd8af template can now contain also content 2019-09-08 16:57:41 +02:00
zadam
16be0c1014 calendar now indicates whether date note already exists or not + tooltip 2019-09-08 16:30:33 +02:00
zadam
c82de8b6b2 calendar widget implementation 2019-09-08 16:06:42 +02:00
zadam
d3f2b71803 calendar widget setup 2019-09-08 13:08:01 +02:00
zadam
f3955bcbdc various small fixes 2019-09-08 11:25:57 +02:00
zadam
90afb2a1ee improvements in widgets rendering - individual widget render is now async while composing them together to the sidebar is sync which solves some race problems 2019-09-08 09:40:29 +02:00
zadam
2dae9b9621 note revisions widget shows content length 2019-09-08 09:17:16 +02:00
zadam
521a9b0b2c link map will try to display max possible number of links 2019-09-07 22:36:08 +02:00
zadam
2cfe9b3c03 note revision widget displays only date and time, no time offset 2019-09-07 22:03:08 +02:00
zadam
45ee959c11 date notes are now created with template relations 2019-09-07 21:40:18 +02:00
zadam
3bf8546d51 added getOwnedAttribute() without attr inheritance which can speed up bulk operations significantly 2019-09-07 20:43:59 +02:00
zadam
ca8b603bd9 fix attr invalidation after note change 2019-09-07 13:09:32 +02:00
zadam
faae11f070 template attributes don't need isInheritable flag to take effect 2019-09-07 11:00:15 +02:00
zadam
b069436039 added "edited notes on date" widget 2019-09-07 10:11:59 +02:00
zadam
e828ef370d note short can lazy load note content 2019-09-06 23:36:08 +02:00
zadam
50a0400616 fix note type selection 2019-09-06 22:18:03 +02:00
zadam
0226b1e9a8 fixes 2019-09-06 20:50:57 +02:00
zadam
135102d2b5 fixes to note loading. Sidebar flickers way less after note change 2019-09-04 22:45:12 +02:00
zadam
a17b8a053e refactoring of note loading 2019-09-04 22:13:22 +02:00
zadam
fdc86bab50 lazy loading of opened tabs to speed up initial startup 2019-09-04 21:30:11 +02:00
zadam
f885388bf7 avoid overflowing of long mime type 2019-09-03 22:06:49 +02:00
zadam
aa96b33bc2 initial load of tabs can run partially asynchronously to speed things up 2019-09-03 22:01:45 +02:00
zadam
e36d636f93 cloned notes are less conspicuous in the tree with only asterisk after a title 2019-09-03 21:34:20 +02:00
zadam
2e05cb1764 similar notes is getting updated automatically after the title change 2019-09-03 21:31:39 +02:00
zadam
9404e27cba similar notes is async'd a bit to not block the event loop too much 2019-09-03 21:16:14 +02:00
zadam
494ec0b051 introduction of @isArchived special filter. Fulltext now by default filters with @!isArchived, label search without filtering for archived 2019-09-03 20:16:38 +02:00
zadam
36b575c286 optimize length of type/mime type labels 2019-09-02 22:08:50 +02:00
zadam
d1992b061c fix drag & drop for chrome and code editor 2019-09-02 21:58:03 +02:00
zadam
a79aec85b5 speedup of similar notes widget 2019-09-02 21:36:24 +02:00
zadam
76dce5197f fix inline markdown import dialog 2019-09-02 21:23:55 +02:00
zadam
5d80df398b removed event log 2019-09-02 20:30:28 +02:00
zadam
a6f57d7761 recent changes now display also newly created notes without any revisions, some extra improvements to the dialog 2019-09-02 20:26:18 +02:00
zadam
a981df6282 fix dialog opening 2019-09-02 19:56:52 +02:00
zadam
ae8a2bfb1b updated demo document based on changes in tar format 2019-09-01 22:43:16 +02:00
zadam
15a2fe2570 fixes in import & export related to the protected session 2019-09-01 22:09:55 +02:00
zadam
8dadc7e518 allow deleting notes including all the clones, closes #629 2019-09-01 20:57:25 +02:00
zadam
c614bc3263 importing a note now creates internal link relations 2019-09-01 20:35:55 +02:00
zadam
1e50d88166 clones in export are now also md/html pages with link to the primary location 2019-09-01 16:46:36 +02:00
zadam
c9cc2cb4f3 refactoring of similar notes path handling 2019-09-01 13:42:10 +02:00
zadam
c8a5c71ec2 tweaks to similar notes + missing options init 2019-09-01 11:37:43 +02:00
zadam
55356963dd improvements to similar notes - now using dice's coefficient for better results 2019-09-01 11:33:45 +02:00
zadam
0e867a995f include linux-x64 pngquant binary to fix build issues 2019-09-01 10:11:29 +02:00
zadam
3ca37b2f42 widget can be also enabled/disabled using labels 2019-09-01 09:52:07 +02:00
zadam
0c78fda531 collpase type and mime to same row in note info widget 2019-09-01 09:16:08 +02:00
zadam
7c60080772 basic implementation of "similar notes" widget 2019-09-01 08:58:13 +02:00
zadam
bf5a31dcdb strip out HTML headers during the import 2019-08-31 22:52:07 +02:00
zadam
a5e38165ef remove H1 from the text during import if it matches note title 2019-08-31 22:45:57 +02:00
zadam
fe6f19e611 imported notes from tar now have correct links even without meta file 2019-08-31 22:39:25 +02:00
zadam
576a07bcb7 export to tar now preserves image and note links 2019-08-31 11:15:32 +02:00
zadam
4be7ac7ae1 export fixing links WIP 2019-08-31 10:12:42 +02:00
zadam
a81b00e130 fix link map zoom after reload and some tweaks to springy 2019-08-30 22:01:49 +02:00
zadam
d4e27c1b76 fixed CSS lazy loading (same file could be loaded multiple times) 2019-08-30 21:22:52 +02:00
zadam
be477f178b custom per-theme modal backdrop color 2019-08-30 20:34:32 +02:00
zadam
de95b92f90 link map tweaks 2019-08-30 20:15:59 +02:00
zadam
89ed9027da updated export + image link parsing fix 2019-08-29 23:11:59 +02:00
zadam
1c0b55e422 fixes to link parsing and tweaks 2019-08-29 23:08:30 +02:00
zadam
10d089240a updated DB schema and initial options 2019-08-29 22:32:53 +02:00
zadam
84b1f1f24e text editor now support font size, color, background 2019-08-29 22:20:08 +02:00
zadam
c8f59ea547 options UI for selecting support code note MIME types 2019-08-29 21:08:53 +02:00
zadam
9d958e1860 link map is kept centered on the active note box 2019-08-28 23:08:05 +02:00
zadam
ec06b940f4 when hovering over a note, outgoing and incoming connections are highlighted, set limit 3 seconds to the layout 2019-08-28 22:16:12 +02:00
zadam
f331172c7d fixes & tweaks 2019-08-28 21:15:16 +02:00
zadam
650d9e0b27 state management fixes 2019-08-28 20:29:10 +02:00
zadam
ff1d312a43 link map fixes 2019-08-27 22:47:10 +02:00
zadam
a4acbf3aea fixes for link map 2019-08-27 22:19:32 +02:00
zadam
242bea236f removed link remnants 2019-08-27 21:24:31 +02:00
zadam
ca2f14a2d0 extracted link map into a service 2019-08-27 20:20:00 +02:00
zadam
48a654630f added checkboxes/todo lists and image resize, closes #264, #587 2019-08-27 19:50:57 +02:00
zadam
cf5c1c1be1 implemented new way of adding extra languages to note type picker 2019-08-26 21:43:28 +02:00
zadam
0558c30b56 updated to ckeditor 12.4.0 2019-08-26 20:34:50 +02:00
zadam
36c87b7fa0 renamed "messagingService" to "ws" 2019-08-26 20:21:43 +02:00
zadam
d039a5f24e widgets are respecting positions 2019-08-26 20:19:14 +02:00
zadam
3e3d111d76 lazy loading of note detail components 2019-08-26 19:49:19 +02:00
zadam
ecb485c8bc removed frontend APIs to modify code note types 2019-08-25 23:12:58 +02:00
zadam
02ab59c9e0 render note type dropdown lazily 2019-08-25 23:09:22 +02:00
zadam
8e4e0bd543 fix global ko references 2019-08-25 22:31:02 +02:00
zadam
bbe0e9e425 lazy loading of knockout (used only in attribute dialog) 2019-08-25 21:59:54 +02:00
zadam
24a3f814ed fix ctrl+enter in sql console 2019-08-25 21:55:36 +02:00
zadam
233a50dbb7 reimplementation of note type with jquery only 2019-08-25 21:48:56 +02:00
zadam
6d8f11d533 fix code editor sometimes not rendering 2019-08-25 19:11:42 +02:00
zadam
4e4beb26c6 codemirro 5.48.4 2019-08-25 18:46:32 +02:00
zadam
1f092c2656 widgets now use options object 2019-08-25 17:41:08 +02:00
zadam
9622b046e0 refactored options_init to options on frontend 2019-08-25 17:36:13 +02:00
zadam
f9abea83f3 refactoring of access to options in frontend 2019-08-22 23:31:02 +02:00
zadam
b84542064c saving of widget configuration 2019-08-22 22:14:01 +02:00
zadam
8ab2c924c4 widget ordering WIP 2019-08-22 20:58:43 +02:00
zadam
4b9415a619 widget config WIP 2019-08-21 23:16:13 +02:00
zadam
c11479de58 options split into individual classes 2019-08-21 20:24:37 +02:00
zadam
dddb02a286 sorting widgets in options WIP 2019-08-20 23:30:19 +02:00
zadam
fab4c59f9b using dynamic import for dialogs and widgets to speed up initial load 2019-08-20 21:40:47 +02:00
zadam
b818f020a7 option to configure if sidebar should be enabled in new tab 2019-08-19 23:29:42 +02:00
zadam
9888850c22 resizing sidebar in options 2019-08-19 23:02:19 +02:00
zadam
04209182c1 options dialog view split up 2019-08-19 21:55:08 +02:00
zadam
02c9dabcff added "what links here" widget 2019-08-19 20:59:40 +02:00
zadam
c9d0b8cc40 link fixes 2019-08-19 20:19:42 +02:00
zadam
3cb421143f Link entity migrated to Attribute, WIP 2019-08-19 20:12:00 +02:00
zadam
fd9b79e115 loading of custom widgets 2019-08-17 11:28:36 +02:00
zadam
53c4bb8a94 refactor widget constructor 2019-08-17 10:45:20 +02:00
zadam
723fc42d88 reverted some experimental changes regarding sidebar resizing 2019-08-17 09:21:30 +02:00
zadam
1882b089ab delete confirmation lists notes for deletion in a UL list, #438 2019-08-17 09:00:53 +02:00
zadam
ad7a6c4d79 Merge remote-tracking branch 'origin/master' 2019-08-17 08:49:42 +02:00
zadam
48e0e797da hide tabContent during tab init to prevent flickering 2019-08-17 08:49:39 +02:00
parsehex
fbb77d3e55 List note titles in delete confirmation (#619)
* list note titles in delete confirmation

* typo
2019-08-17 08:49:08 +02:00
zadam
d1d8e54d20 fixed state persisting and loading 2019-08-16 21:52:36 +02:00
zadam
f259c60b54 state is now applied to sidebar widgets 2019-08-16 21:29:44 +02:00
zadam
aa981d3cd4 convert other widgets to StandardWidget base class 2019-08-15 21:18:33 +02:00
zadam
f8118444f9 introduced a StandardWidget base class 2019-08-15 21:08:41 +02:00
zadam
59da25ef55 sidebar & widget state management WIP 2019-08-15 10:04:03 +02:00
zadam
61520bc3b3 Merge branch 'stable'
# Conflicts:
#	package-lock.json
#	package.json
2019-08-15 08:52:34 +02:00
zadam
5406b09f3a release 0.34.3 2019-08-13 21:48:56 +02:00
zadam
90f1bfb3e4 electron 6.0.2 2019-08-13 21:48:45 +02:00
zadam
f30eec7737 make sure all keyboard shortcuts use utility methods to not break mobile frontend 2019-08-12 22:41:53 +02:00
zadam
493cd1a7e0 better behavior of activateNote frontend script 2019-08-12 22:25:42 +02:00
zadam
dfa1ab65c6 allow requiring native node modules from backend scripts 2019-08-12 20:41:38 +02:00
zadam
963ed32ce4 allow user to choose theme during initial setup 2019-08-11 10:28:49 +02:00
zadam
de4733e848 updating attributes widget based on sync data changes 2019-08-06 23:20:27 +02:00
zadam
bfbc124e78 widgets can now listen to sync data changes 2019-08-06 22:39:27 +02:00
zadam
fcd87b3e2d instantiate widgets dynamically 2019-08-06 21:36:54 +02:00
zadam
7bee93bb73 allow showing inherited attributes in the sidebar as well 2019-08-06 20:43:07 +02:00
zadam
c0c36d10e5 add attributes to the sidebar and remove them from the bottom 2019-08-06 20:05:05 +02:00
zadam
6e260ee563 Merge branch 'stable' 2019-08-06 19:28:11 +02:00
zadam
b1075d956f release 0.34.2 2019-08-01 21:37:59 +02:00
zadam
4dd6352aec use overflow-wrap instead of word-break which doesn't break words unless they really don't fit 2019-08-01 21:36:55 +02:00
zadam
6fe8bde720 package updates 2019-08-01 21:26:09 +02:00
zadam
0556ab5e66 Merge branch 'stable'
# Conflicts:
#	package.json
2019-07-30 22:11:20 +02:00
zadam
7060700225 fix mobile tree not expanding automatically on load 2019-07-30 21:18:43 +02:00
zadam
385b79ad34 Merge remote-tracking branch 'origin/t35'
# Conflicts:
#	src/views/tabs.ejs
2019-07-28 22:38:02 +02:00
zadam
b8509c487d release 0.34.1 2019-07-28 15:02:36 +02:00
zadam
083dee9bdd note activation from API will also scroll to it / focus 2019-07-28 14:47:35 +02:00
zadam
0c2dd6aa35 fix distraction free mode 2019-07-28 14:36:40 +02:00
zadam
743c15aacc fix code editor in mobile 2019-07-28 14:23:41 +02:00
zadam
263bff903c mobile frontend shows only the active tab 2019-07-28 14:08:05 +02:00
zadam
741dfaf2de hide tab row in distraction free mode 2019-07-28 13:50:46 +02:00
zadam
e4e4f73638 styling card header 2019-07-28 13:45:50 +02:00
zadam
85e4bd817b note revisions sidebar 2019-07-25 22:31:09 +02:00
zadam
78ffac8232 logging API auth rejections 2019-07-25 21:05:16 +02:00
zadam
b488adc330 sidebar POC WIP 2019-07-24 22:52:51 +02:00
zadam
a06bd877c9 Merge branch 'master' into t35 2019-07-24 21:25:21 +02:00
zadam
b3834324f6 fix sync proxy with TLS 2019-07-24 20:47:41 +02:00
zadam
d351134b75 Merge branch 'master' into t35 2019-07-22 22:46:47 +02:00
zadam
ea0835561c option to use node's http client for sync without proxy 2019-07-22 22:46:06 +02:00
zadam
b0c0c5f56b release 0.34.0-beta 2019-07-21 21:57:35 +02:00
zadam
849fad0421 link map in sidebar POC 2019-07-21 21:55:48 +02:00
zadam
eb28a3b0c9 note info sidebar widget 2019-07-21 11:32:38 +02:00
zadam
5283b489dc sidebar skeleton 2019-07-21 10:17:08 +02:00
zadam
d54f848572 use dev icon in dev environment 2019-07-21 09:14:56 +02:00
zadam
1ac0c4f874 fix scrollbar styling in both ff and chrome (white corner in dark themes when both scrollbars are present) 2019-07-20 22:14:40 +02:00
zadam
3850f52401 add ResizeObserver to tabs with fallback for older firefox 2019-07-20 22:01:50 +02:00
zadam
6d5f8e0562 added web clipper to readme 2019-07-20 14:27:36 +02:00
zadam
04633bdf3a set clip type from the incoming param 2019-07-19 21:03:47 +02:00
zadam
97219aa12e removed unused clipper image API (migrated to clippings) 2019-07-18 22:35:16 +02:00
zadam
e825abf893 Merge remote-tracking branch 'origin/master' 2019-07-18 20:20:45 +02:00
zadam
63b655cff4 package updates 2019-07-18 20:20:38 +02:00
Yevhen Kolomeiko
0524942d11 fix typo (#592) 2019-07-12 07:16:37 +02:00
zadam
b5d75f183a update to ckeditor 12.3.1 2019-07-11 22:30:40 +02:00
zadam
706fc647ff Merge branch 'stable'
# Conflicts:
#	package.json
2019-07-11 22:27:27 +02:00
zadam
13e9f9f9e7 release 0.33.7 2019-07-11 20:55:56 +02:00
zadam
a76dcb44ae improvements in the exported file extensions 2019-07-11 20:54:57 +02:00
zadam
b9373806cf fix doubling of extension 2019-07-11 20:40:40 +02:00
zadam
9de2927304 image import/export related fixes 2019-07-10 23:01:30 +02:00
zadam
c3e1126489 backported image fixes 2019-07-10 20:38:27 +02:00
zadam
3413c9ed64 backport notePath handling fixes from master 2019-07-10 20:35:01 +02:00
Xavier NUNN
dcebcb0e73 Add host option (#588)
* Added option to configure host

* Updated sample config
2019-07-09 22:50:20 +02:00
zadam
3d7a5f20e7 make it again possible to open notes through URL hash 2019-07-09 22:12:05 +02:00
zadam
6a99af64a8 added clipper protocol version 2019-07-07 22:27:06 +02:00
zadam
7d57961ab2 make clipper api authenticated for server and unauthenticated for local electron 2019-07-07 13:12:40 +02:00
zadam
95a773e5c9 clipper doesn't open new tab if the note is already loaded in existing tab 2019-07-07 11:15:55 +02:00
zadam
a912b2f23d choose port dynamically from range based on environment 2019-07-07 10:49:34 +02:00
zadam
36b581489c saving selections adds to the existing date note instead of creating new one each time 2019-07-06 23:54:48 +02:00
zadam
976684a3a8 save note in clipper 2019-07-06 16:48:06 +02:00
zadam
093dfb4a39 Merge branch 'stable' 2019-07-06 13:14:46 +02:00
zadam
ddf381f92d fixed duplicated notes after creating into a folder which wasn't yet loaded 2019-07-06 13:14:33 +02:00
zadam
2b44f3bc76 fixed websocket reconnection 2019-07-06 12:03:51 +02:00
zadam
7b1fdfabf8 upgrade ckeditor to 12.3.0 2019-07-04 19:53:10 +02:00
zadam
070e8d9647 Merge branch 'stable' 2019-07-03 20:51:34 +02:00
zadam
bf3360572a nest code editor instance to avoid visibility issues 2019-07-03 20:37:59 +02:00
zadam
e5036318af fix enter on title to the code editor 2019-07-03 20:29:55 +02:00
zadam
6d2394a9da release 0.33.6 2019-07-02 22:26:05 +02:00
zadam
427a266c57 Merge branch 'stable' 2019-07-02 21:56:23 +02:00
zadam
196264b8c2 use bootstrap modal to confirm note deletion which fixes #582 2019-07-02 21:54:37 +02:00
zadam
afe24866f0 some debug logging for duplicated nodes 2019-07-02 20:35:06 +02:00
zadam
d18a20cc06 fix focus issue from title to the text content with tab/enter 2019-07-02 20:28:57 +02:00
zadam
e94669de03 Merge branch 'stable' 2019-07-01 21:36:02 +02:00
zadam
9c91b0459e release 0.33.5 2019-06-30 21:47:04 +02:00
zadam
b161db064e choose only desired context menu items 2019-06-30 21:34:19 +02:00
zadam
ec4abe0d81 Merge branch 'stable' 2019-06-30 20:15:37 +02:00
zadam
af21dd4463 fix mobile text editor display 2019-06-30 20:14:57 +02:00
zadam
ef46727870 Merge branch 'stable' 2019-06-30 19:58:56 +02:00
zadam
1ea0d283de fix text instance sometimes remaining displayed when switching to e.g. image 2019-06-30 19:41:26 +02:00
zadam
ed380e09c9 context menu WIP 2019-06-30 18:56:46 +02:00
zadam
b5daa83d69 upgrades + removal of unused test 2019-06-30 11:22:10 +02:00
zadam
c4b957427d implement print, closes #581 2019-06-29 22:57:47 +02:00
zadam
2f3b256272 Merge branch 'stable' 2019-06-29 20:37:51 +02:00
zadam
6e3d8472e1 avoid duplicate key error 2019-06-28 21:50:15 +02:00
zadam
2a9f36a027 fix activating parent note after delete 2019-06-27 22:58:04 +02:00
zadam
cf3726289c attempt to fix the duplicate issue 2019-06-27 21:24:25 +02:00
zadam
c8e4a5c9e7 release 0.33.4 2019-06-26 21:20:30 +02:00
zadam
3851bedb57 Merge branch 't34' 2019-06-26 21:11:27 +02:00
zadam
a3951f1cce make sure autocomplete is closed when navigating to note 2019-06-26 21:08:54 +02:00
zadam
7c77ae758b fix frontend reload again 2019-06-26 20:49:17 +02:00
zadam
20d3d61cec release 0.33.3 2019-06-24 20:47:50 +02:00
zadam
1b831f94a9 fix orphan note autocomplete, closes #569 2019-06-24 20:45:35 +02:00
zadam
3f241553aa fix pngquant for linux-x64 2019-06-24 20:27:28 +02:00
zadam
8624c83108 use 127.0.0.1 instead of localhost, #577 2019-06-24 20:26:28 +02:00
zadam
d49cae9cea fix update of window title during note renaming 2019-06-24 20:12:04 +02:00
zadam
174128447b token auth to /login 2019-06-23 21:22:08 +02:00
zadam
5d213eea7e basic webp support 2019-06-23 15:22:05 +02:00
zadam
f45e25172b opening links from the clipper 2019-06-23 13:25:00 +02:00
zadam
ec87856ef4 save image 2019-06-23 12:16:26 +02:00
zadam
6feb7ad1d5 selection clipping now supports images 2019-06-23 11:25:15 +02:00
zadam
6833e84d55 fix pngquant for linux-x64 2019-06-23 09:10:06 +02:00
zadam
154a575701 cleanup + context menu clip now works 2019-06-22 19:49:48 +02:00
zadam
504b2e2c4a Merge pull request #574 from maurerit/master
Build failed without python for arm
2019-06-21 09:10:17 +02:00
Matt Maurer
2c5292222f Build failed without python for arm 2019-06-20 23:45:31 +00:00
zadam
989da8877b added link map 2019-06-20 10:20:44 +02:00
zadam
70591eadd5 release 0.33.2-beta 2019-06-20 09:39:11 +02:00
zadam
fead3cd7ad fix note export/import/branch prefix to use right-clicked note as opposed to current active 2019-06-20 09:37:18 +02:00
zadam
a7cf3cdf05 fix unloading protected session after the timeout, fixes #571 2019-06-19 22:23:55 +02:00
zadam
5372f71faa hide menu bar 2019-06-19 20:45:19 +02:00
zadam
3b76939f17 distinction between unfocused active and hovered node - unfocused active has dashed border 2019-06-17 22:30:26 +02:00
zadam
c827d38f39 when single note is selected and it's the same that was right clicked for context menu, then we treat it as no-selection action 2019-06-17 22:25:22 +02:00
zadam
1e7586fae4 context menu items are now disabled when there are selected notes and the item does not support actions on multiple items 2019-06-17 20:34:00 +02:00
zadam
ee89111bfb fix clipboard operation for single nodes 2019-06-16 18:07:22 +02:00
zadam
288b3077b2 context menu items are now disabled when there are selected notes and the item does not support actions on multiple items 2019-06-16 12:06:06 +02:00
zadam
5c1922ac9f release 0.33.1-beta 2019-06-16 11:13:37 +02:00
zadam
93f1d46104 fix tree activation/focus after deleting node 2019-06-16 11:12:07 +02:00
zadam
c5daaf541a active note has also border to make it more prominent 2019-06-16 10:53:30 +02:00
zadam
12b17b1e9e fix ctrl+. to switch focus to note tree 2019-06-16 10:41:22 +02:00
zadam
ad46ba7d0f fix fancytree navigation bug before official release, use unminified build in the meantime 2019-06-16 09:44:23 +02:00
zadam
44f592c6cb fix reload 2019-06-16 09:15:37 +02:00
zadam
943b35fb7d fix delete with keyboard and context menu regarding the selection 2019-06-13 22:55:06 +02:00
zadam
f1967fd466 fix unhoisting note 2019-06-13 22:45:55 +02:00
zadam
ce2404b18a add link to link map to README 2019-06-12 22:10:05 +02:00
zadam
cdd53a39f1 release 0.33.0-beta 2019-06-12 21:45:05 +02:00
zadam
c646019536 ignore electron error 2019-06-12 21:44:33 +02:00
zadam
c8049f0efe small fixes 2019-06-12 19:59:52 +02:00
zadam
f2c497049b node updated to 12, electron to 6 2019-06-11 21:56:21 +02:00
zadam
d713274ae2 link map tweaks 2019-06-11 21:52:00 +02:00
zadam
a72eeb9a98 check sync version before setting up the sync, fixes #559 2019-06-11 20:42:06 +02:00
zadam
41cdd5c640 npm updates 2019-06-10 23:00:50 +02:00
zadam
4cde65d171 close currently active dialog if a different one is activated 2019-06-10 22:45:03 +02:00
zadam
27659805f6 redesign of drag & drop, separation of active, focused and active notes in the tree, fixes #565 2019-06-10 21:47:08 +02:00
zadam
8ab081a3fd configuration of displayed link types + max number of links 2019-06-10 14:33:59 +02:00
zadam
ccbb2e2e12 link map visual tweaks 2019-06-10 11:22:52 +02:00
zadam
2bf2ec5a6c link map WIP 2019-06-09 21:48:30 +02:00
zadam
4329675c60 dynamic display of link map 2019-06-09 19:18:14 +02:00
zadam
412b0377e9 added panzoom to link map 2019-06-09 11:50:11 +02:00
zadam
69e48ff4d7 fix links table reference 2019-06-09 11:16:00 +02:00
zadam
4cacd1dfa2 Merge branch 'stable'
# Conflicts:
#	libraries/ckeditor/ckeditor.js
#	libraries/ckeditor/ckeditor.js.map
2019-06-09 10:20:45 +02:00
zadam
0c8ad1b46e disable media embed in ckeditor, fixes #564 2019-06-09 09:58:25 +02:00
zadam
d3ac7b0939 fix disappearing expander in some cases, closes #562 2019-06-07 22:37:10 +02:00
zadam
e0306d4ad7 ckeditor upgraded to 12.2.0 2019-06-06 21:33:59 +02:00
zadam
1f3d726048 Merge branch 'stable'
# Conflicts:
#	package-lock.json
2019-06-06 21:24:25 +02:00
zadam
f3ed7e936d focus input on shown modal in branch prefix dialog, fixes #560 2019-06-06 21:16:12 +02:00
zadam
547ad7221d release 0.32.4 2019-06-05 22:53:34 +02:00
zadam
97a258c0c6 include sync version in sync seed request, #559 2019-06-05 22:50:03 +02:00
zadam
19a154c2f4 fix direct migration from 0.30 to 0.32, closes #557 2019-06-05 22:07:12 +02:00
zadam
b389ec5ea3 enter/leave protected session button is not refreshed after entering from note detail (not dialog), fixes #555
(cherry picked from commit 0a0663be69)
2019-06-05 21:42:58 +02:00
zadam
412375e92f import should recognize all suported code note file types, fixes #554 2019-06-05 21:27:07 +02:00
zadam
4b96ada781 link map WIP 2019-06-04 22:57:10 +02:00
zadam
87b16f3325 link map WIP 2019-06-03 22:55:59 +02:00
zadam
0a0663be69 enter/leave protected session button is not refreshed after entering from note detail (not dialog), fixes #555 2019-06-03 20:36:37 +02:00
zadam
7eed076674 link router/loading 2019-06-02 17:12:18 +02:00
zadam
b5143c152b link map empty dialog 2019-06-02 15:35:57 +02:00
zadam
6ef8a4c018 Merge branch 'next'
# Conflicts:
#	package.json
2019-06-02 15:22:15 +02:00
zadam
ebd26f85bd release 0.32.3 2019-06-02 14:04:32 +02:00
zadam
fbfb7b3b30 sync endpoints should not set csrf cookie, #541 2019-06-02 13:52:31 +02:00
zadam
cfb313b60e sync endpoints should not set csrf cookie, #541 2019-06-02 13:47:59 +02:00
zadam
54e37dea20 codemirror updated to 5.47.0 2019-06-02 09:59:07 +02:00
zadam
5b14358620 fix folder status rendering issues when opening not-yet-loaded notes 2019-06-01 20:54:39 +02:00
zadam
c4669cbaa3 fallback to display empty tab if the requested note doesn't exist anymore 2019-06-01 20:32:11 +02:00
zadam
74b41c9911 tree reloads should preserve activated node, fixes #552 2019-06-01 14:12:27 +02:00
zadam
d08a36174d attribute sync should trigger note reload, fixes #551 2019-06-01 12:14:09 +02:00
zadam
e845b80e10 fancytree upgrade to 2.31.0 2019-05-31 18:50:41 +02:00
zadam
b0303ef529 updated sqlite binaries for electron 6 / node 12 2019-05-31 18:46:23 +02:00
zadam
68f67ec6ee package upgrades 2019-05-31 18:39:18 +02:00
zadam
20ae67f510 Merge branch 'master' into next
# Conflicts:
#	package-lock.json
#	package.json
2019-05-31 18:30:16 +02:00
zadam
237749e4af make recent notes dialog scrollable 2019-05-30 20:58:01 +02:00
zadam
15f4782947 make node activation after load clearer 2019-05-30 20:55:39 +02:00
zadam
d48efd1925 FIXME 2019-05-29 23:34:23 +02:00
zadam
883d726622 release 0.32.2-beta 2019-05-29 23:14:59 +02:00
zadam
0a0cac5f41 added extra logging for debugging CSRF issues 2019-05-29 23:13:15 +02:00
zadam
012a18be00 put tabContext into frontend script API 2019-05-29 21:48:48 +02:00
zadam
890c00d4ba make frontendStartup event deterministic after the tree and tabs are loaded, fixes #543 2019-05-29 21:10:28 +02:00
zadam
bb43014230 hide search help tooltip on executed search 2019-05-29 20:27:48 +02:00
zadam
53a995fecb fix database anonymization 2019-05-29 19:57:50 +02:00
zadam
8d3262d232 fix setting the title bar when switching note 2019-05-29 19:55:05 +02:00
zadam
373ec4ac50 Merge pull request #542 from spantaleev/exit-on-sigint
Exit on SIGINT
2019-05-29 19:40:04 +02:00
zadam
3fdecee95f fix bug with unresponsive tree after tree reload 2019-05-28 20:22:16 +02:00
Slavi Pantaleev
86b9f5a8b0 Exit on SIGINT
Pressing Ctrl+C used to not exit the application
(at least when running the Docker image).

Explicitly catching the `SIGINT` interrupt signal and exiting
fixes the problem.

We currently make it exit immediately as soon as the signal arrives.

In the future, it may be preferable to do dispatch some event and
try to exit more gracefully (finish any ongoing synchronization work,
etc.)
Still, I think it's better to exit directly than to not do anything at
all, in which case `SIGKILL` is likely to follow and kill the process
even more abruptly.
2019-05-28 13:38:32 +03:00
zadam
873b60b00d release 0.32.1-beta 2019-05-27 21:39:43 +02:00
zadam
fc58086f6e fix super long line in code editor blowing up / overflowing the content grid cell width 2019-05-27 21:02:09 +02:00
zadam
40cec31099 schema update 2019-05-27 19:34:18 +02:00
zadam
33733d3ab7 use node 12 for server/docker builds 2019-05-27 19:12:34 +02:00
zadam
f08bf0be15 upgrade to electron 6.0.0-beta.4 2019-05-23 19:59:23 +02:00
zadam
296cb7236f Merge branch 'stable'
# Conflicts:
#	package.json
#	src/services/build.js
2019-05-23 19:32:04 +02:00
zadam
f9f4148e8c release 0.31.6 2019-05-13 23:12:12 +02:00
593 changed files with 64751 additions and 49805 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
# These are supported funding model platforms
github: [zadam]

2
.gitignore vendored
View File

@@ -1,9 +1,11 @@
.DS_Store
node_modules/
dist/
src/public/app-dist/
npm-debug.log
yarn-error.log
*.db
config.ini
cert.key
cert.crt
server-package.json

15
.gitpod.dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM gitpod/workspace-full
RUN sudo apt-get update \
&& sudo apt-get install -yq --no-install-recommends \
libpng16-16 \
libpng-dev \
pkg-config \
autoconf \
libtool \
build-essential \
nasm \
libx11-dev \
libxkbfile-dev \
&& sudo rm -rf /var/lib/apt/lists/*

View File

@@ -1,7 +1,11 @@
image:
file: .gitpod.dockerfile
tasks:
- before: nvm install 10 && nvm use 10
init: npm install
command: npm run start
command: npm run start-server
ports:
- port: 8080
onOpen: open-preview

6
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,6 @@
# Default ignored files
/workspace.xml
# Datasource local storage ignored files
/dataSources.local.xml
/dataSources/

View File

@@ -6,5 +6,8 @@
<option name="TAB_SIZE" value="2" />
</value>
</option>
<JSCodeStyleSettings version="0">
<option name="USE_EXPLICIT_JS_EXTENSION" value="TRUE" />
</JSCodeStyleSettings>
</code_scheme>
</component>

5
.idea/dataSources.xml generated
View File

@@ -5,10 +5,7 @@
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/../trilium-data/document.db</jdbc-url>
<driver-properties>
<property name="enable_load_extension" value="true" />
</driver-properties>
<jdbc-url>jdbc:sqlite:$USER_HOME$/trilium-data/document.db</jdbc-url>
</data-source>
</component>
</project>

View File

@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<dataSource name="document.db">
<database-model serializer="dbm" dbms="SQLITE" family-id="SQLITE" format-version="4.15">
<database-model serializer="dbm" dbms="SQLITE" family-id="SQLITE" format-version="4.18">
<root id="1">
<ServerVersion>3.25.1</ServerVersion>
<ServerVersion>3.16.1</ServerVersion>
</root>
<schema id="2" parent="1" name="main">
<Current>1</Current>
<Visible>1</Visible>
</schema>
<collation id="3" parent="1" name="BINARY"/>
<collation id="4" parent="1" name="NOCASE"/>
@@ -14,635 +13,678 @@
<table id="6" parent="2" name="api_tokens"/>
<table id="7" parent="2" name="attributes"/>
<table id="8" parent="2" name="branches"/>
<table id="9" parent="2" name="event_log"/>
<table id="10" parent="2" name="links"/>
<table id="11" parent="2" name="note_contents"/>
<table id="12" parent="2" name="note_revisions"/>
<table id="13" parent="2" name="notes"/>
<table id="14" parent="2" name="options"/>
<table id="15" parent="2" name="recent_notes"/>
<table id="16" parent="2" name="source_ids"/>
<table id="17" parent="2" name="sqlite_master">
<table id="9" parent="2" name="note_contents"/>
<table id="10" parent="2" name="note_revision_contents"/>
<table id="11" parent="2" name="note_revisions"/>
<table id="12" parent="2" name="notes"/>
<table id="13" parent="2" name="options"/>
<table id="14" parent="2" name="recent_notes"/>
<table id="15" parent="2" name="source_ids"/>
<table id="16" parent="2" name="sqlite_master">
<System>1</System>
</table>
<table id="18" parent="2" name="sqlite_sequence">
<table id="17" parent="2" name="sqlite_sequence">
<System>1</System>
</table>
<table id="19" parent="2" name="sync"/>
<column id="20" parent="6" name="apiTokenId">
<table id="18" parent="2" name="sync"/>
<column id="19" parent="6" name="apiTokenId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="21" parent="6" name="token">
<column id="20" parent="6" name="token">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="22" parent="6" name="utcDateCreated">
<column id="21" parent="6" name="utcDateCreated">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="23" parent="6" name="isDeleted">
<column id="22" parent="6" name="isDeleted">
<Position>4</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="24" parent="6" name="hash">
<column id="23" parent="6" name="hash">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<index id="25" parent="6" name="sqlite_autoindex_api_tokens_1">
<index id="24" parent="6" name="sqlite_autoindex_api_tokens_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>apiTokenId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="26" parent="6">
<key id="25" parent="6">
<ColNames>apiTokenId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_api_tokens_1</UnderlyingIndexName>
</key>
<column id="27" parent="7" name="attributeId">
<column id="26" parent="7" name="attributeId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="28" parent="7" name="noteId">
<column id="27" parent="7" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="29" parent="7" name="type">
<column id="28" parent="7" name="type">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="30" parent="7" name="name">
<column id="29" parent="7" name="name">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="31" parent="7" name="value">
<column id="30" parent="7" name="value">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="32" parent="7" name="position">
<column id="31" parent="7" name="position">
<Position>6</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="33" parent="7" name="utcDateCreated">
<column id="32" parent="7" name="utcDateCreated">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="34" parent="7" name="utcDateModified">
<column id="33" parent="7" name="utcDateModified">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="35" parent="7" name="isDeleted">
<column id="34" parent="7" name="isDeleted">
<Position>9</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="36" parent="7" name="hash">
<column id="35" parent="7" name="deleteId">
<Position>10</Position>
<DataType>TEXT|0s</DataType>
<DefaultExpression>NULL</DefaultExpression>
</column>
<column id="36" parent="7" name="hash">
<Position>11</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="37" parent="7" name="isInheritable">
<Position>11</Position>
<Position>12</Position>
<DataType>int|0s</DataType>
<DefaultExpression>0</DefaultExpression>
</column>
<index id="38" parent="7" name="sqlite_autoindex_attributes_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>attributeId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="39" parent="7" name="IDX_attributes_noteId_index">
<ColNames>noteId</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="40" parent="7" name="IDX_attributes_name_value">
<ColNames>name
value</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="41" parent="7" name="IDX_attributes_name_index">
<ColNames>name</ColNames>
</index>
<index id="42" parent="7" name="IDX_attributes_value_index">
<index id="41" parent="7" name="IDX_attributes_value_index">
<ColNames>value</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="43" parent="7">
<key id="42" parent="7">
<ColNames>attributeId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_attributes_1</UnderlyingIndexName>
</key>
<column id="44" parent="8" name="branchId">
<column id="43" parent="8" name="branchId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="45" parent="8" name="noteId">
<column id="44" parent="8" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="46" parent="8" name="parentNoteId">
<column id="45" parent="8" name="parentNoteId">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="47" parent="8" name="notePosition">
<column id="46" parent="8" name="notePosition">
<Position>4</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="48" parent="8" name="prefix">
<column id="47" parent="8" name="prefix">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="49" parent="8" name="isExpanded">
<column id="48" parent="8" name="isExpanded">
<Position>6</Position>
<DataType>BOOLEAN|0s</DataType>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="50" parent="8" name="isDeleted">
<column id="49" parent="8" name="isDeleted">
<Position>7</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="51" parent="8" name="utcDateModified">
<column id="50" parent="8" name="deleteId">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>NULL</DefaultExpression>
</column>
<column id="52" parent="8" name="utcDateCreated">
<column id="51" parent="8" name="utcDateModified">
<Position>9</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="53" parent="8" name="hash">
<column id="52" parent="8" name="utcDateCreated">
<Position>10</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="53" parent="8" name="hash">
<Position>11</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<index id="54" parent="8" name="sqlite_autoindex_branches_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>branchId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="55" parent="8" name="IDX_branches_noteId_parentNoteId">
<ColNames>noteId
parentNoteId</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="56" parent="8" name="IDX_branches_noteId">
<ColNames>noteId</ColNames>
</index>
<index id="57" parent="8" name="IDX_branches_parentNoteId">
<index id="56" parent="8" name="IDX_branches_parentNoteId">
<ColNames>parentNoteId</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="58" parent="8">
<key id="57" parent="8">
<ColNames>branchId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_branches_1</UnderlyingIndexName>
</key>
<column id="59" parent="9" name="eventId">
<column id="58" parent="9" name="noteId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="60" parent="9" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="61" parent="9" name="comment">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="62" parent="9" name="utcDateCreated">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="63" parent="9" name="sqlite_autoindex_event_log_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>eventId</ColNames>
<Unique>1</Unique>
</index>
<key id="64" parent="9">
<ColNames>eventId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_event_log_1</UnderlyingIndexName>
</key>
<column id="65" parent="10" name="linkId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="66" parent="10" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="67" parent="10" name="targetNoteId">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="68" parent="10" name="type">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="69" parent="10" name="hash">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="70" parent="10" name="isDeleted">
<Position>6</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="71" parent="10" name="utcDateCreated">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="72" parent="10" name="utcDateModified">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="73" parent="10" name="sqlite_autoindex_links_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>linkId</ColNames>
<Unique>1</Unique>
</index>
<index id="74" parent="10" name="IDX_links_noteId_index">
<ColNames>noteId</ColNames>
</index>
<index id="75" parent="10" name="IDX_links_targetNoteId_index">
<ColNames>targetNoteId</ColNames>
</index>
<key id="76" parent="10">
<ColNames>linkId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_links_1</UnderlyingIndexName>
</key>
<column id="77" parent="11" name="noteId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="78" parent="11" name="content">
<column id="59" parent="9" name="content">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<DefaultExpression>NULL</DefaultExpression>
</column>
<column id="79" parent="11" name="hash">
<column id="60" parent="9" name="hash">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="80" parent="11" name="utcDateModified">
<column id="61" parent="9" name="utcDateModified">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="81" parent="11" name="sqlite_autoindex_note_contents_1">
<index id="62" parent="9" name="sqlite_autoindex_note_contents_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="82" parent="11">
<key id="63" parent="9">
<ColNames>noteId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_note_contents_1</UnderlyingIndexName>
</key>
<column id="83" parent="12" name="noteRevisionId">
<column id="64" parent="10" name="noteRevisionId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="84" parent="12" name="noteId">
<column id="65" parent="10" name="content">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="66" parent="10" name="hash">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="67" parent="10" name="utcDateModified">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="68" parent="10" name="sqlite_autoindex_note_revision_contents_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteRevisionId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="69" parent="10">
<ColNames>noteRevisionId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_note_revision_contents_1</UnderlyingIndexName>
</key>
<column id="70" parent="11" name="noteRevisionId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="71" parent="11" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="85" parent="12" name="title">
<column id="72" parent="11" name="title">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="86" parent="12" name="content">
<column id="73" parent="11" name="contentLength">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="87" parent="12" name="isProtected">
<column id="74" parent="11" name="isErased">
<Position>5</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="88" parent="12" name="utcDateModifiedFrom">
<column id="75" parent="11" name="isProtected">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="89" parent="12" name="utcDateModifiedTo">
<column id="76" parent="11" name="utcDateLastEdited">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="90" parent="12" name="dateModifiedFrom">
<column id="77" parent="11" name="utcDateCreated">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="91" parent="12" name="dateModifiedTo">
<column id="78" parent="11" name="utcDateModified">
<Position>9</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="92" parent="12" name="type">
<column id="79" parent="11" name="dateLastEdited">
<Position>10</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="93" parent="12" name="mime">
<column id="80" parent="11" name="dateCreated">
<Position>11</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="94" parent="12" name="hash">
<column id="81" parent="11" name="type">
<Position>12</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<index id="95" parent="12" name="sqlite_autoindex_note_revisions_1">
<column id="82" parent="11" name="mime">
<Position>13</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="83" parent="11" name="hash">
<Position>14</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<index id="84" parent="11" name="sqlite_autoindex_note_revisions_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteRevisionId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="96" parent="12" name="IDX_note_revisions_noteId">
<index id="85" parent="11" name="IDX_note_revisions_noteId">
<ColNames>noteId</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="97" parent="12" name="IDX_note_revisions_dateModifiedFrom">
<ColNames>utcDateModifiedFrom</ColNames>
<index id="86" parent="11" name="IDX_note_revisions_utcDateLastEdited">
<ColNames>utcDateLastEdited</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="98" parent="12" name="IDX_note_revisions_dateModifiedTo">
<ColNames>utcDateModifiedTo</ColNames>
<index id="87" parent="11" name="IDX_note_revisions_utcDateCreated">
<ColNames>utcDateCreated</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="99" parent="12">
<index id="88" parent="11" name="IDX_note_revisions_dateLastEdited">
<ColNames>dateLastEdited</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="89" parent="11" name="IDX_note_revisions_dateCreated">
<ColNames>dateCreated</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="90" parent="11">
<ColNames>noteRevisionId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_note_revisions_1</UnderlyingIndexName>
</key>
<column id="100" parent="13" name="noteId">
<column id="91" parent="12" name="noteId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="101" parent="13" name="title">
<column id="92" parent="12" name="title">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;note&quot;</DefaultExpression>
</column>
<column id="102" parent="13" name="isProtected">
<column id="93" parent="12" name="contentLength">
<Position>3</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="94" parent="12" name="isProtected">
<Position>4</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="103" parent="13" name="type">
<Position>4</Position>
<column id="95" parent="12" name="type">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;text&apos;</DefaultExpression>
</column>
<column id="104" parent="13" name="mime">
<Position>5</Position>
<column id="96" parent="12" name="mime">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;text/html&apos;</DefaultExpression>
</column>
<column id="105" parent="13" name="hash">
<Position>6</Position>
<column id="97" parent="12" name="hash">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="106" parent="13" name="isDeleted">
<Position>7</Position>
<column id="98" parent="12" name="isDeleted">
<Position>8</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="107" parent="13" name="dateCreated">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="108" parent="13" name="dateModified">
<column id="99" parent="12" name="deleteId">
<Position>9</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>NULL</DefaultExpression>
</column>
<column id="109" parent="13" name="utcDateCreated">
<column id="100" parent="12" name="isErased">
<Position>10</Position>
<DataType>TEXT|0s</DataType>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="110" parent="13" name="utcDateModified">
<column id="101" parent="12" name="dateCreated">
<Position>11</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="111" parent="13" name="sqlite_autoindex_notes_1">
<column id="102" parent="12" name="dateModified">
<Position>12</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="103" parent="12" name="utcDateCreated">
<Position>13</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="104" parent="12" name="utcDateModified">
<Position>14</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="105" parent="12" name="sqlite_autoindex_notes_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="112" parent="13">
<index id="106" parent="12" name="IDX_notes_title">
<ColNames>title</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="107" parent="12" name="IDX_notes_type">
<ColNames>type</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="108" parent="12" name="IDX_notes_isDeleted">
<ColNames>isDeleted</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="109" parent="12" name="IDX_notes_dateCreated">
<ColNames>dateCreated</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="110" parent="12" name="IDX_notes_dateModified">
<ColNames>dateModified</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="111" parent="12" name="IDX_notes_utcDateCreated">
<ColNames>utcDateCreated</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="112" parent="12" name="IDX_notes_utcDateModified">
<ColNames>utcDateModified</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="113" parent="12">
<ColNames>noteId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_notes_1</UnderlyingIndexName>
</key>
<column id="113" parent="14" name="name">
<column id="114" parent="13" name="name">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="114" parent="14" name="value">
<column id="115" parent="13" name="value">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="115" parent="14" name="isSynced">
<column id="116" parent="13" name="isSynced">
<Position>3</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="116" parent="14" name="hash">
<column id="117" parent="13" name="hash">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="117" parent="14" name="utcDateCreated">
<column id="118" parent="13" name="utcDateCreated">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="118" parent="14" name="utcDateModified">
<column id="119" parent="13" name="utcDateModified">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="119" parent="14" name="sqlite_autoindex_options_1">
<index id="120" parent="13" name="sqlite_autoindex_options_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>name</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="120" parent="14">
<key id="121" parent="13">
<ColNames>name</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_options_1</UnderlyingIndexName>
</key>
<column id="121" parent="15" name="branchId">
<column id="122" parent="14" name="noteId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="122" parent="15" name="notePath">
<column id="123" parent="14" name="notePath">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="123" parent="15" name="hash">
<column id="124" parent="14" name="hash">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="124" parent="15" name="utcDateCreated">
<column id="125" parent="14" name="utcDateCreated">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="125" parent="15" name="isDeleted">
<column id="126" parent="14" name="isDeleted">
<Position>5</Position>
<DataType>INT|0s</DataType>
</column>
<index id="126" parent="15" name="sqlite_autoindex_recent_notes_1">
<index id="127" parent="14" name="sqlite_autoindex_recent_notes_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>branchId</ColNames>
<ColNames>noteId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="127" parent="15">
<ColNames>branchId</ColNames>
<key id="128" parent="14">
<ColNames>noteId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_recent_notes_1</UnderlyingIndexName>
</key>
<column id="128" parent="16" name="sourceId">
<column id="129" parent="15" name="sourceId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="129" parent="16" name="utcDateCreated">
<column id="130" parent="15" name="utcDateCreated">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="130" parent="16" name="sqlite_autoindex_source_ids_1">
<index id="131" parent="15" name="sqlite_autoindex_source_ids_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>sourceId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="131" parent="16">
<index id="132" parent="15" name="IDX_source_ids_utcDateCreated">
<ColNames>utcDateCreated</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="133" parent="15">
<ColNames>sourceId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_source_ids_1</UnderlyingIndexName>
</key>
<column id="132" parent="17" name="type">
<column id="134" parent="16" name="type">
<Position>1</Position>
<DataType>text|0s</DataType>
</column>
<column id="133" parent="17" name="name">
<column id="135" parent="16" name="name">
<Position>2</Position>
<DataType>text|0s</DataType>
</column>
<column id="134" parent="17" name="tbl_name">
<column id="136" parent="16" name="tbl_name">
<Position>3</Position>
<DataType>text|0s</DataType>
</column>
<column id="135" parent="17" name="rootpage">
<column id="137" parent="16" name="rootpage">
<Position>4</Position>
<DataType>int|0s</DataType>
<DataType>integer|0s</DataType>
</column>
<column id="136" parent="17" name="sql">
<column id="138" parent="16" name="sql">
<Position>5</Position>
<DataType>text|0s</DataType>
</column>
<column id="137" parent="18" name="name">
<column id="139" parent="17" name="name">
<Position>1</Position>
</column>
<column id="138" parent="18" name="seq">
<column id="140" parent="17" name="seq">
<Position>2</Position>
</column>
<column id="139" parent="19" name="id">
<column id="141" parent="18" name="id">
<Position>1</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="140" parent="19" name="entityName">
<column id="142" parent="18" name="entityName">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="141" parent="19" name="entityId">
<column id="143" parent="18" name="entityId">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="142" parent="19" name="sourceId">
<column id="144" parent="18" name="sourceId">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="143" parent="19" name="utcSyncDate">
<column id="145" parent="18" name="isSynced">
<Position>5</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="146" parent="18" name="utcSyncDate">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="144" parent="19" name="IDX_sync_entityName_entityId">
<index id="147" parent="18" name="IDX_sync_entityName_entityId">
<ColNames>entityName
entityId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="145" parent="19" name="IDX_sync_utcSyncDate">
<index id="148" parent="18" name="IDX_sync_utcSyncDate">
<ColNames>utcSyncDate</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="146" parent="19">
<key id="149" parent="18">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>

6
.idea/jsLibraryMappings.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="PROJECT" libraries="{@types/jquery}" />
</component>
</project>

1
.idea/vcs.xml generated
View File

@@ -2,5 +2,6 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@@ -1,11 +1,9 @@
FROM node:10.15.3-alpine
FROM node:12.16.2-alpine
# Create app directory
WORKDIR /usr/src/app
# Copy both package.json and package-lock.json
# where available (npm@5+)
COPY package.json package-lock.json ./
COPY server-package.json package.json
# Install app dependencies
RUN set -x \
@@ -18,6 +16,7 @@ RUN set -x \
make \
nasm \
libpng-dev \
python \
&& npm install --production \
&& apk del .build-dependencies

View File

@@ -8,23 +8,24 @@ Trilium Notes is a hierarchical note taking application with focus on building l
## Features
* Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes))
* Rich WYSIWYG note editing including e.g. tables and images with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-editor#autoformat)
* Rich WYSIWYG note editing including e.g. tables and images with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-notes#autoformat)
* Support for editing [notes with source code](https://github.com/zadam/trilium/wiki/Code-notes), including syntax highlighting
* Fast and easy [navigation between notes](https://github.com/zadam/trilium/wiki/Note-navigation), full text search and [note hoisting](https://github.com/zadam/trilium/wiki/Note-hoisting)
* Seamless [note versioning](https://github.com/zadam/trilium/wiki/Note-revisions)
* Note [attributes](https://github.com/zadam/trilium/wiki/Attributes) can be used for note organization, querying and advanced [scripting](https://github.com/zadam/trilium/wiki/Scripts)
* [Synchronization](https://github.com/zadam/trilium/wiki/Synchronization) with self-hosted sync server
* Strong [note encryption](https://github.com/zadam/trilium/wiki/Protected-notes) with per-note granularity
* [Relation maps](https://github.com/zadam/trilium/wiki/Relation-map) for visualizing notes and their relations
* [Relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map) for visualizing notes and their relations
* [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
* Touch optimized [mobile frontend](https://github.com/zadam/trilium/wiki/Mobile-frontend) for smartphones and tablets
* [Night theme](https://github.com/zadam/trilium/wiki/Themes)
* [Evernote](https://github.com/zadam/trilium/wiki/Evernote-import) and [Markdown import & export](https://github.com/zadam/trilium/wiki/Markdown)
* [Web Clipper](https://github.com/zadam/trilium/wiki/Web-clipper) for easy saving of web content
## Builds
Trilium is provided as either desktop application (Linux, Windows, Mac) or web application hosted on your server (Linux).
Trilium is provided as either desktop application (Linux and Windows) or web application hosted on your server (Linux). Mac OS desktop build is available, but it is [unsupported](https://github.com/zadam/trilium/wiki/FAQ#mac-os-support).
* If you want to use Trilium on the desktop, download binary release for your platform from [latest release](https://github.com/zadam/trilium/releases/latest), unzip the package and run ```trilium``` executable.
* If you want to install Trilium on server, follow [this page](https://github.com/zadam/trilium/wiki/Server-installation).
@@ -45,5 +46,12 @@ Use a browser based dev environment
Or clone locally and run
```
npm install
npm run start
```
npm run start-server
```
## Shoutouts
* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - best WYSIWYG editor on the market, very interactive and listening team
* [FancyTree](https://github.com/mar10/fancytree) - very feature rich tree library without real competition. Trilium Notes would not be the same without it.
* [CodeMirror](https://github.com/codemirror/CodeMirror) - code editor with support for huge amount of languages
* [jsPlumb](https://github.com/jsplumb/jsplumb) - visual connectivity library without competition. Used in [relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map)

View File

@@ -3,6 +3,8 @@
VERSION=`jq -r ".version" package.json`
SERIES=${VERSION:0:4}-latest
cat package.json | grep -v electron > server-package.json
sudo docker build -t zadam/trilium:$VERSION -t zadam/trilium:$SERIES .
if [[ $VERSION != *"beta"* ]]; then

View File

@@ -1,14 +1,27 @@
#!/usr/bin/env bash
SRC_DIR=./dist/trilium-linux-x64-src
if [ "$1" != "DONTCOPY" ]
then
./bin/copy-trilium.sh $SRC_DIR
fi
echo "Copying required linux-x64 binaries"
rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
cp -r bin/deps/linux-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
cp bin/deps/linux-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=linux --arch=x64 --overwrite
BUILD_DIR=./dist/trilium-linux-x64
rm -rf $BUILD_DIR
rm -r node_modules/sqlite3/lib/binding/*
cp -r bin/deps/linux-x64/sqlite/* node_modules/sqlite3/lib/binding/
./node_modules/.bin/electron-packager . --asar --out=dist --executable-name=trilium --platform=linux --arch=x64 --overwrite
mv "./dist/Trilium Notes-linux-x64" $BUILD_DIR
cp images/app-icons/png/128x128.png $BUILD_DIR/icon.png
@@ -22,3 +35,7 @@ VERSION=`jq -r ".version" package.json`
cd dist
tar cJf trilium-linux-x64-${VERSION}.tar.xz trilium-linux-x64
cd ..
bin/build-debian.sh

View File

@@ -1,27 +1,34 @@
#!/usr/bin/env bash
SRC_DIR=./dist/trilium-mac-x64-src
if [ "$1" != "DONTCOPY" ]
then
./bin/copy-trilium.sh $SRC_DIR
fi
echo "Copying required mac binaries"
rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
rm -r $SRC_DIR/node_modules/mozjpeg/vendor/*
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
rm -r $SRC_DIR/node_modules/giflossy/vendor/*
cp -r bin/deps/mac-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
cp bin/deps/mac-x64/image/cjpeg $SRC_DIR/node_modules/mozjpeg/vendor/
cp bin/deps/mac-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/
cp bin/deps/mac-x64/image/gifsicle $SRC_DIR/node_modules/giflossy/vendor/
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns
BUILD_DIR=./dist/trilium-mac-x64
rm -rf $BUILD_DIR
echo "Copying required mac binaries"
rm -r node_modules/sqlite3/lib/binding/*
rm -r node_modules/mozjpeg/vendor/*
rm -r node_modules/pngquant-bin/vendor/*
rm -r node_modules/giflossy/vendor/*
cp -r bin/deps/mac-x64/sqlite/* node_modules/sqlite3/lib/binding/
cp bin/deps/mac-x64/image/cjpeg node_modules/mozjpeg/vendor/
cp bin/deps/mac-x64/image/pngquant node_modules/pngquant-bin/vendor/
cp bin/deps/mac-x64/image/gifsicle node_modules/giflossy/vendor/
./node_modules/.bin/electron-packager . --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns
# Mac build has by default useless directory level
mv "./dist/Trilium Notes-darwin-x64" $BUILD_DIR
./bin/reset-local.sh
echo "Zipping mac x64 electron distribution..."
VERSION=`jq -r ".version" package.json`

View File

@@ -1,40 +1,32 @@
#!/usr/bin/env bash
PKG_DIR=dist/trilium-linux-x64-server
NODE_VERSION=10.15.3
NODE_VERSION=12.16.2
rm -r $PKG_DIR
mkdir $PKG_DIR
cd $PKG_DIR
if [ "$1" != "DONTCOPY" ]
then
./bin/copy-trilium.sh $PKG_DIR
fi
cd dist
wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz
tar xvfJ node-v${NODE_VERSION}-linux-x64.tar.xz
rm node-v${NODE_VERSION}-linux-x64.tar.xz
mv node-v${NODE_VERSION}-linux-x64 node
cp -r ../../node_modules/ ./
cp -r ../../images/ ./
cp -r ../../libraries/ ./
cp -r ../../src/ ./
cp -r ../../db/ ./
cp -r ../../package.json ./
cp -r ../../package-lock.json ./
cp -r ../../README.md ./
cp -r ../../LICENSE ./
cp -r ../../config-sample.ini ./
rm -r ./node_modules/electron*
rm -r ./node_modules/sqlite3/lib/binding/*
cp -r ../../bin/deps/linux-x64/sqlite/node* ./node_modules/sqlite3/lib/binding/
printf "#/bin/sh\n./node/bin/node src/www" > trilium.sh
chmod 755 trilium.sh
cd ..
VERSION=`jq -r ".version" ../package.json`
mv dist/node-v${NODE_VERSION}-linux-x64 $PKG_DIR/node
tar cJf trilium-linux-x64-server-${VERSION}.tar.xz trilium-linux-x64-server
rm -r $PKG_DIR/node_modules/electron*
rm -r $PKG_DIR/node_modules/sqlite3/lib/binding/*
cp -r ./bin/deps/linux-x64/sqlite/node* $PKG_DIR/node_modules/sqlite3/lib/binding/
printf "#!/bin/sh\n./node/bin/node src/www" > $PKG_DIR/trilium.sh
chmod 755 $PKG_DIR/trilium.sh
VERSION=`jq -r ".version" package.json`
cd dist
tar cJf trilium-linux-x64-server-${VERSION}.tar.xz trilium-linux-x64-server

View File

@@ -1,29 +1,36 @@
#!/usr/bin/env bash
BUILD_DIR=./dist/trilium-windows-x64
rm -rf $BUILD_DIR
SRC_DIR=./dist/trilium-windows-x64-src
if [ "$1" != "DONTCOPY" ]
then
./bin/copy-trilium.sh $SRC_DIR
fi
echo "Copying required windows binaries"
rm -r node_modules/sqlite3/lib/binding/*
rm -r node_modules/mozjpeg/vendor/*
rm -r node_modules/pngquant-bin/vendor/*
rm -r node_modules/giflossy/vendor/*
rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
rm -r $SRC_DIR/node_modules/mozjpeg/vendor/*
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
rm -r $SRC_DIR/node_modules/giflossy/vendor/*
cp -r bin/deps/win-x64/sqlite/* node_modules/sqlite3/lib/binding/
cp bin/deps/win-x64/image/cjpeg.exe node_modules/mozjpeg/vendor/
cp bin/deps/win-x64/image/pngquant.exe node_modules/pngquant-bin/vendor/
cp bin/deps/win-x64/image/gifsicle.exe node_modules/giflossy/vendor/
cp -r bin/deps/win-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
cp bin/deps/win-x64/image/cjpeg.exe $SRC_DIR/node_modules/mozjpeg/vendor/
cp bin/deps/win-x64/image/pngquant.exe $SRC_DIR/node_modules/pngquant-bin/vendor/
cp bin/deps/win-x64/image/gifsicle.exe $SRC_DIR/node_modules/giflossy/vendor/
./node_modules/.bin/electron-packager . --asar --out=dist --executable-name=trilium --platform=win32 --arch=x64 --overwrite --icon=images/app-icons/win/icon.ico
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=win32 --arch=x64 --overwrite --icon=images/app-icons/win/icon.ico
BUILD_DIR=./dist/trilium-windows-x64
rm -rf $BUILD_DIR
mv "./dist/Trilium Notes-win32-x64" $BUILD_DIR
# removing software WebGL binaries because they are pretty huge and not necessary
rm -r $BUILD_DIR/swiftshader
./bin/reset-local.sh
echo "Zipping windows x64 electron distribution..."
VERSION=`jq -r ".version" package.json`

View File

@@ -1,21 +1,23 @@
#!/usr/bin/env bash
rm -r node_modules
npm install
echo "Deleting existing builds"
rm -r dist/*
rm -rf dist/*
bin/build-win-x64.sh
SRC_DIR=dist/trilium-src
bin/build-mac-x64.sh
bin/copy-trilium.sh $SRC_DIR
# building X64 linux as the last so electron-rebuild will prepare X64 binaries for local development
bin/build-linux-x64.sh
# we'll just copy the same SRC dir to all the builds so we don't have to do npm install in each separately
cp -r $SRC_DIR ./dist/trilium-linux-x64-src
cp -r $SRC_DIR ./dist/trilium-linux-x64-server
cp -r $SRC_DIR ./dist/trilium-windows-x64-src
cp -r $SRC_DIR ./dist/trilium-mac-x64-src
# this needs to be run after linux build
bin/build-debian.sh
bin/build-win-x64.sh DONTCOPY
bin/build-server.sh
bin/build-mac-x64.sh DONTCOPY
bin/build-linux-x64.sh DONTCOPY
bin/build-server.sh DONTCOPY

37
bin/copy-trilium.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
if [[ $# -eq 0 ]] ; then
echo "Missing argument of target directory"
exit 1
fi
npm run webpack
DIR=$1
rm -rf $DIR
mkdir $DIR
echo "Copying Trilium to build directory $DIR"
cp -r images $DIR/
cp -r libraries $DIR/
cp -r src $DIR/
cp -r db $DIR/
cp -r package.json $DIR/
cp -r package-lock.json $DIR/
cp -r README.md $DIR/
cp -r LICENSE $DIR/
cp -r config-sample.ini $DIR/
cp -r electron.js $DIR/
cp webpack-* $DIR/
# run in subshell (so we return to original dir)
(cd $DIR && npm install --only=prod)
find $DIR/libraries -name "*.map" -type f -delete
rm -r $DIR/src/public/app
sed -i -e 's/app\/desktop.js/app-dist\/desktop.js/g' $DIR/src/views/desktop.ejs
sed -i -e 's/app\/mobile.js/app-dist\/mobile.js/g' $DIR/src/views/mobile.ejs

BIN
bin/deps/linux-x64/image/pngquant Executable file

Binary file not shown.

0
bin/deps/mac-x64/image/pngquant Normal file → Executable file
View File

0
bin/deps/win-x64/image/pngquant.exe Normal file → Executable file
View File

View File

@@ -12,5 +12,4 @@ fi
mkdir -p "$DIR"
cd "$DIR"
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 2000 -nodes
openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out cert.crt -keyout key.key

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env bash
export GITHUB_REPO=trilium
if [[ $# -eq 0 ]] ; then
echo "Missing argument of new version"
exit 1

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
./node_modules/.bin/electron-rebuild --arch=x64

View File

@@ -2,8 +2,13 @@
# Instance name can be used to distinguish between different instances
instanceName=
# Disable automatically generating desktop icon
# noDesktopIcon=true
[Network]
# port setting is relevant only for web deployments, desktop builds run on random free port
# host setting is relevant only for web deployments - set the host on which the server will listen
# host=0.0.0.0
# port setting is relevant only for web deployments, desktop builds run on a fixed port (changeable with TRILIUM_PORT environment variable)
port=8080
# true for TLS/SSL/HTTPS (secure), false for HTTP (unsecure).
https=false

Binary file not shown.

BIN
db/demo.zip Normal file

Binary file not shown.

View File

@@ -0,0 +1,10 @@
UPDATE links SET type = 'internal-link' WHERE type = 'hyper';
UPDATE links SET type = 'image-link' WHERE type = 'image';
UPDATE links SET type = 'relation-map-link' WHERE type = 'relation-map';
INSERT INTO attributes (attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, hash, isInheritable)
SELECT linkId, noteId, 'relation', type, targetNoteId, 0, utcDateCreated, utcDateModified, isDeleted, hash, 0 FROM links;
UPDATE sync SET entityName = 'attributes' WHERE entityName = 'links';
DROP TABLE links;

View File

@@ -0,0 +1,5 @@
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('sidebarMinWidth', '350', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('sidebarWidthPercent', '25', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);

View File

@@ -0,0 +1,2 @@
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('showSidebarInNewTab', 'true', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);

View File

@@ -0,0 +1,14 @@
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('noteInfoWidget', '{"enabled":true,"expanded":true,"position":100}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('attributesWidget', '{"enabled":true,"expanded":true,"position":200}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('linkMapWidget', '{"enabled":true,"expanded":true,"position":300}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('noteRevisionsWidget', '{"enabled":true,"expanded":true,"position":400}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('whatLinksHereWidget', '{"enabled":false,"expanded":true,"position":500}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);

View File

@@ -0,0 +1,5 @@
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('codeNotesMimeTypes', '["text/x-csrc","text/x-c++src","text/x-csharp","text/css","text/x-go","text/x-groovy","text/x-haskell","text/html","message/http","text/x-java","application/javascript;env=frontend","application/javascript;env=backend","application/json","text/x-kotlin","text/x-markdown","text/x-perl","text/x-php","text/x-python","text/x-ruby",null,"text/x-sql","text/x-swift","text/xml","text/x-yaml"]', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 1);
INSERT INTO sync (entityName, entityId, sourceId, utcSyncDate)
VALUES ('options' ,'codeNotesMimeTypes', 'SYNC_FILL', '2018-01-01T00:00:00.000Z');

View File

@@ -0,0 +1,2 @@
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('similarNotesWidget', '{"enabled":true,"expanded":true,"position":600}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);

View File

@@ -0,0 +1 @@
DROP TABLE event_log;

View File

@@ -0,0 +1,2 @@
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('editedNotesWidget', '{"enabled":true,"expanded":true,"position":50}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);

View File

@@ -0,0 +1,2 @@
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('calendarWidget', '{"enabled":true,"expanded":true,"position":20}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);

View File

@@ -0,0 +1,5 @@
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('spellCheckEnabled', 'true', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('spellCheckLanguageCode', 'en-US', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);

View File

@@ -0,0 +1,3 @@
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
SELECT 'hideTabRowForOneTab', 'false', '2019-05-01T18:31:00.874Z', '2019-05-01T18:31:00.874Z', 0
WHERE NOT EXISTS(SELECT 1 FROM options WHERE name = 'hideTabRowForOneTab');

View File

@@ -0,0 +1,22 @@
CREATE TABLE IF NOT EXISTS "mig_branches" (
`branchId` TEXT NOT NULL,
`noteId` TEXT NOT NULL,
`parentNoteId` TEXT NOT NULL,
`notePosition` INTEGER NOT NULL,
`prefix` TEXT,
`isExpanded` INTEGER NOT NULL DEFAULT 0,
`isDeleted` INTEGER NOT NULL DEFAULT 0,
`utcDateModified` TEXT NOT NULL,
utcDateCreated TEXT NOT NULL,
hash TEXT DEFAULT "" NOT NULL,
PRIMARY KEY(`branchId`));
INSERT INTO mig_branches (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated, hash)
SELECT branchId, noteId, parentNoteId, notePosition, prefix, COALESCE(isExpanded, 0), isDeleted, utcDateModified, utcDateCreated, hash FROM branches;
DROP TABLE branches;
ALTER TABLE mig_branches RENAME TO branches;
CREATE INDEX `IDX_branches_noteId` ON `branches` (`noteId`);
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);

View File

@@ -0,0 +1,2 @@
UPDATE branches SET notePosition = notePosition * 10;
UPDATE attributes SET position = position * 10;

View File

@@ -0,0 +1,36 @@
CREATE TABLE IF NOT EXISTS "note_revisions_mig" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
`noteId` TEXT NOT NULL,
`title` TEXT,
`contentLength` INT NOT NULL,
`isProtected` INT NOT NULL DEFAULT 0,
`utcDateLastEdited` TEXT NOT NULL,
`utcDateCreated` TEXT NOT NULL,
`utcDateModified` TEXT NOT NULL,
`dateLastEdited` TEXT NOT NULL,
`dateCreated` TEXT NOT NULL,
type TEXT DEFAULT '' NOT NULL,
mime TEXT DEFAULT '' NOT NULL,
hash TEXT DEFAULT '' NOT NULL);
CREATE TABLE IF NOT EXISTS "note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
`content` TEXT,
hash TEXT DEFAULT '' NOT NULL,
`utcDateModified` TEXT NOT NULL);
INSERT INTO note_revision_contents (noteRevisionId, content, hash, utcDateModified)
SELECT noteRevisionId, content, hash, utcDateModifiedTo FROM note_revisions;
INSERT INTO note_revisions_mig (noteRevisionId, noteId, title, contentLength, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash)
SELECT noteRevisionId, noteId, title, COALESCE(LENGTH(content), 0), isProtected, utcDateModifiedFrom, utcDateModifiedTo, utcDateModifiedTo, dateModifiedFrom, dateModifiedTo, type, mime, hash FROM note_revisions;
DROP TABLE note_revisions;
ALTER TABLE note_revisions_mig RENAME TO note_revisions;
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
INSERT INTO sync (entityName, entityId, sourceId, utcSyncDate)
SELECT 'note_revision_contents', entityId, sourceId, utcSyncDate FROM sync WHERE entityName = 'note_revisions';

View File

@@ -0,0 +1,31 @@
CREATE TABLE IF NOT EXISTS "notes_mig" (
`noteId` TEXT NOT NULL,
`title` TEXT NOT NULL DEFAULT "note",
`isProtected` INT NOT NULL DEFAULT 0,
`type` TEXT NOT NULL DEFAULT 'text',
`mime` TEXT NOT NULL DEFAULT 'text/html',
`hash` TEXT DEFAULT "" NOT NULL,
`isDeleted` INT NOT NULL DEFAULT 0,
`isErased` INT NOT NULL DEFAULT 0,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
`utcDateCreated` TEXT NOT NULL,
`utcDateModified` TEXT NOT NULL,
PRIMARY KEY(`noteId`));
INSERT INTO notes_mig (noteId, title, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified)
SELECT noteId, title, isProtected, type, mime, hash, isDeleted, 0, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
DROP TABLE notes;
ALTER TABLE notes_mig RENAME TO notes;
UPDATE notes SET isErased = 1 WHERE isDeleted = 1
AND 1=(SELECT CASE WHEN content IS NULL THEN 1 ELSE 0 END FROM note_contents WHERE note_contents.noteId = notes.noteId);
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);

View File

@@ -0,0 +1,34 @@
CREATE TABLE IF NOT EXISTS "notes_mig" (
`noteId` TEXT NOT NULL,
`title` TEXT NOT NULL DEFAULT "note",
`contentLength` INT NOT NULL,
`isProtected` INT NOT NULL DEFAULT 0,
`type` TEXT NOT NULL DEFAULT 'text',
`mime` TEXT NOT NULL DEFAULT 'text/html',
`hash` TEXT DEFAULT "" NOT NULL,
`isDeleted` INT NOT NULL DEFAULT 0,
`isErased` INT NOT NULL DEFAULT 0,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
`utcDateCreated` TEXT NOT NULL,
`utcDateModified` TEXT NOT NULL,
PRIMARY KEY(`noteId`));
INSERT INTO notes_mig (noteId, title, contentLength, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified)
SELECT noteId, title, -1, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
DROP TABLE notes;
ALTER TABLE notes_mig RENAME TO notes;
UPDATE notes SET contentLength = COALESCE((SELECT COALESCE(LENGTH(content), 0) FROM note_contents WHERE note_contents.noteId = notes.noteId), -1);
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
-- should be OK since sync protocol changes so all instances must upgrade
UPDATE attributes SET isDeleted = 1 WHERE name = 'fileSize';

View File

@@ -0,0 +1,28 @@
CREATE TABLE IF NOT EXISTS "note_revisions_mig" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
`noteId` TEXT NOT NULL,
`title` TEXT,
`contentLength` INT NOT NULL,
`isErased` INT NOT NULL DEFAULT 0,
`isProtected` INT NOT NULL DEFAULT 0,
`utcDateLastEdited` TEXT NOT NULL,
`utcDateCreated` TEXT NOT NULL,
`utcDateModified` TEXT NOT NULL,
`dateLastEdited` TEXT NOT NULL,
`dateCreated` TEXT NOT NULL,
type TEXT DEFAULT '' NOT NULL,
mime TEXT DEFAULT '' NOT NULL,
hash TEXT DEFAULT '' NOT NULL);
INSERT INTO note_revisions_mig (noteRevisionId, noteId, title, contentLength, isErased, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash)
SELECT noteRevisionId, noteId, title, contentLength, 0, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash FROM note_revisions;
DROP TABLE note_revisions;
ALTER TABLE note_revisions_mig RENAME TO note_revisions;
UPDATE note_revisions SET isErased = (SELECT isErased FROM notes WHERE notes.noteId = note_revisions.noteId);
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);

View File

@@ -0,0 +1,3 @@
UPDATE attributes SET name = 'internalLink' WHERE name = 'internal-link';
UPDATE attributes SET name = 'imageLink' WHERE name = 'image-link';
UPDATE attributes SET name = 'relationMapLink' WHERE name = 'relation-map-link';

View File

@@ -0,0 +1,5 @@
DROP INDEX IF EXISTS IDX_attributes_name_index;
DROP INDEX IF EXISTS IDX_branches_noteId;
CREATE INDEX IDX_source_ids_utcDateCreated
on source_ids (utcDateCreated);

View File

@@ -0,0 +1,81 @@
CREATE TABLE IF NOT EXISTS "notes_mig" (
`noteId` TEXT NOT NULL,
`title` TEXT NOT NULL DEFAULT "note",
`contentLength` INT NOT NULL,
`isProtected` INT NOT NULL DEFAULT 0,
`type` TEXT NOT NULL DEFAULT 'text',
`mime` TEXT NOT NULL DEFAULT 'text/html',
`hash` TEXT DEFAULT "" NOT NULL,
`isDeleted` INT NOT NULL DEFAULT 0,
`deleteId` TEXT DEFAULT NULL,
`isErased` INT NOT NULL DEFAULT 0,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
`utcDateCreated` TEXT NOT NULL,
`utcDateModified` TEXT NOT NULL,
PRIMARY KEY(`noteId`));
INSERT INTO notes_mig (noteId, title, contentLength, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified)
SELECT noteId, title, -1, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
DROP TABLE notes;
ALTER TABLE notes_mig RENAME TO notes;
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
CREATE TABLE IF NOT EXISTS "branches_mig" (
`branchId` TEXT NOT NULL,
`noteId` TEXT NOT NULL,
`parentNoteId` TEXT NOT NULL,
`notePosition` INTEGER NOT NULL,
`prefix` TEXT,
`isExpanded` INTEGER NOT NULL DEFAULT 0,
`isDeleted` INTEGER NOT NULL DEFAULT 0,
`deleteId` TEXT DEFAULT NULL,
`utcDateModified` TEXT NOT NULL,
utcDateCreated TEXT NOT NULL,
hash TEXT DEFAULT "" NOT NULL,
PRIMARY KEY(`branchId`));
INSERT INTO branches_mig (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated, hash)
SELECT branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated, hash FROM branches;
DROP TABLE branches;
ALTER TABLE branches_mig RENAME TO branches;
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
CREATE TABLE IF NOT EXISTS "attributes_mig"
(
attributeId TEXT not null primary key,
noteId TEXT not null,
type TEXT not null,
name TEXT not null,
value TEXT default '' not null,
position INT default 0 not null,
utcDateCreated TEXT not null,
utcDateModified TEXT not null,
isDeleted INT not null,
`deleteId` TEXT DEFAULT NULL,
hash TEXT default "" not null,
isInheritable int DEFAULT 0 NULL);
INSERT INTO attributes_mig (attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, hash, isInheritable)
SELECT attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, hash, isInheritable FROM attributes;
DROP TABLE attributes;
ALTER TABLE attributes_mig RENAME TO attributes;
CREATE INDEX IDX_attributes_name_value
on attributes (name, value);
CREATE INDEX IDX_attributes_noteId_index
on attributes (noteId);
CREATE INDEX IDX_attributes_value_index
on attributes (value);

View File

@@ -0,0 +1 @@
UPDATE notes SET contentLength = COALESCE((SELECT COALESCE(LENGTH(content), 0) FROM note_contents WHERE note_contents.noteId = notes.noteId), -1);

View File

@@ -0,0 +1,22 @@
CREATE TABLE IF NOT EXISTS "sync_mig" (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`entityName` TEXT NOT NULL,
`entityId` TEXT NOT NULL,
`sourceId` TEXT NOT NULL,
`isSynced` INTEGER default 0 not null,
`utcSyncDate` TEXT NOT NULL);
INSERT INTO sync_mig (id, entityName, entityId, sourceId, isSynced, utcSyncDate)
SELECT id, entityName, entityId, sourceId, 1, utcSyncDate FROM sync;
DROP TABLE sync;
ALTER TABLE sync_mig RENAME TO sync;
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
`entityName`,
`entityId`
);
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
`utcSyncDate`
);

View File

@@ -1,27 +1,8 @@
CREATE TABLE IF NOT EXISTS "sync" (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`entityName` TEXT NOT NULL,
`entityId` TEXT NOT NULL,
`sourceId` TEXT NOT NULL,
`utcSyncDate` TEXT NOT NULL);
CREATE TABLE IF NOT EXISTS "source_ids" (
`sourceId` TEXT NOT NULL,
`utcDateCreated` TEXT NOT NULL,
PRIMARY KEY(`sourceId`)
);
CREATE TABLE IF NOT EXISTS "note_revisions" (
`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
`noteId` TEXT NOT NULL,
`title` TEXT,
`content` TEXT,
`isProtected` INT NOT NULL DEFAULT 0,
`utcDateModifiedFrom` TEXT NOT NULL,
`utcDateModifiedTo` TEXT NOT NULL,
`dateModifiedFrom` TEXT NOT NULL,
`dateModifiedTo` TEXT NOT NULL,
type TEXT DEFAULT '' NOT NULL,
mime TEXT DEFAULT '' NOT NULL,
hash TEXT DEFAULT "" NOT NULL);
CREATE TABLE IF NOT EXISTS "api_tokens"
(
apiTokenId TEXT PRIMARY KEY NOT NULL,
@@ -29,32 +10,6 @@ CREATE TABLE IF NOT EXISTS "api_tokens"
utcDateCreated TEXT NOT NULL,
isDeleted INT NOT NULL DEFAULT 0,
hash TEXT DEFAULT "" NOT NULL);
CREATE TABLE IF NOT EXISTS "branches" (
`branchId` TEXT NOT NULL,
`noteId` TEXT NOT NULL,
`parentNoteId` TEXT NOT NULL,
`notePosition` INTEGER NOT NULL,
`prefix` TEXT,
`isExpanded` BOOLEAN,
`isDeleted` INTEGER NOT NULL DEFAULT 0,
`utcDateModified` TEXT NOT NULL,
utcDateCreated TEXT NOT NULL,
hash TEXT DEFAULT "" NOT NULL,
PRIMARY KEY(`branchId`)
);
CREATE TABLE IF NOT EXISTS "recent_notes" (
`branchId` TEXT NOT NULL PRIMARY KEY,
`notePath` TEXT NOT NULL,
hash TEXT DEFAULT "" NOT NULL,
`utcDateCreated` TEXT NOT NULL,
isDeleted INT
);
CREATE TABLE IF NOT EXISTS "event_log" (
`eventId` TEXT NOT NULL PRIMARY KEY,
`noteId` TEXT,
`comment` TEXT,
`utcDateCreated` TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS "options"
(
name TEXT not null PRIMARY KEY,
@@ -64,80 +19,6 @@ CREATE TABLE IF NOT EXISTS "options"
utcDateCreated TEXT not null,
utcDateModified TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS "attributes"
(
attributeId TEXT not null primary key,
noteId TEXT not null,
type TEXT not null,
name TEXT not null,
value TEXT default '' not null,
position INT default 0 not null,
utcDateCreated TEXT not null,
utcDateModified TEXT not null,
isDeleted INT not null,
hash TEXT default "" not null,
isInheritable int DEFAULT 0 NULL);
CREATE TABLE IF NOT EXISTS "links" (
`linkId` TEXT NOT NULL,
`noteId` TEXT NOT NULL,
`targetNoteId` TEXT NOT NULL,
`type` TEXT NOT NULL,
`hash` TEXT DEFAULT "" NOT NULL,
`isDeleted` INTEGER NOT NULL DEFAULT 0,
`utcDateCreated` TEXT NOT NULL,
`utcDateModified` TEXT NOT NULL,
PRIMARY KEY(`linkId`)
);
CREATE TABLE IF NOT EXISTS "notes" (
`noteId` TEXT NOT NULL,
`title` TEXT NOT NULL DEFAULT "note",
`isProtected` INT NOT NULL DEFAULT 0,
`type` TEXT NOT NULL DEFAULT 'text',
`mime` TEXT NOT NULL DEFAULT 'text/html',
`hash` TEXT DEFAULT "" NOT NULL,
`isDeleted` INT NOT NULL DEFAULT 0,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
`utcDateCreated` TEXT NOT NULL,
`utcDateModified` TEXT NOT NULL,
PRIMARY KEY(`noteId`)
);
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
`entityName`,
`entityId`
);
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
`utcSyncDate`
);
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (
`noteId`
);
CREATE INDEX `IDX_note_revisions_dateModifiedFrom` ON `note_revisions` (
`utcDateModifiedFrom`
);
CREATE INDEX `IDX_note_revisions_dateModifiedTo` ON `note_revisions` (
`utcDateModifiedTo`
);
CREATE INDEX `IDX_branches_noteId` ON `branches` (
`noteId`
);
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (
`noteId`,
`parentNoteId`
);
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
CREATE INDEX IDX_attributes_name_value
on attributes (name, value);
CREATE INDEX IDX_links_noteId_index
on links (noteId);
CREATE INDEX IDX_links_targetNoteId_index
on links (targetNoteId);
CREATE INDEX IDX_attributes_name_index
on attributes (name);
CREATE INDEX IDX_attributes_noteId_index
on attributes (noteId);
CREATE INDEX IDX_attributes_value_index
on attributes (value);
CREATE TABLE IF NOT EXISTS "note_contents" (
`noteId` TEXT NOT NULL,
`content` TEXT NULL DEFAULT NULL,
@@ -145,3 +26,108 @@ CREATE TABLE IF NOT EXISTS "note_contents" (
`utcDateModified` TEXT NOT NULL,
PRIMARY KEY(`noteId`)
);
CREATE TABLE recent_notes
(
noteId TEXT not null primary key,
notePath TEXT not null,
hash TEXT default "" not null,
utcDateCreated TEXT not null,
isDeleted INT
);
CREATE TABLE IF NOT EXISTS "note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
`content` TEXT,
hash TEXT DEFAULT '' NOT NULL,
`utcDateModified` TEXT NOT NULL);
CREATE TABLE IF NOT EXISTS "note_revisions" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
`noteId` TEXT NOT NULL,
`title` TEXT,
`contentLength` INT NOT NULL,
`isErased` INT NOT NULL DEFAULT 0,
`isProtected` INT NOT NULL DEFAULT 0,
`utcDateLastEdited` TEXT NOT NULL,
`utcDateCreated` TEXT NOT NULL,
`utcDateModified` TEXT NOT NULL,
`dateLastEdited` TEXT NOT NULL,
`dateCreated` TEXT NOT NULL,
type TEXT DEFAULT '' NOT NULL,
mime TEXT DEFAULT '' NOT NULL,
hash TEXT DEFAULT '' NOT NULL);
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
CREATE INDEX IDX_source_ids_utcDateCreated
on source_ids (utcDateCreated);
CREATE TABLE IF NOT EXISTS "notes" (
`noteId` TEXT NOT NULL,
`title` TEXT NOT NULL DEFAULT "note",
`contentLength` INT NOT NULL,
`isProtected` INT NOT NULL DEFAULT 0,
`type` TEXT NOT NULL DEFAULT 'text',
`mime` TEXT NOT NULL DEFAULT 'text/html',
`hash` TEXT DEFAULT "" NOT NULL,
`isDeleted` INT NOT NULL DEFAULT 0,
`deleteId` TEXT DEFAULT NULL,
`isErased` INT NOT NULL DEFAULT 0,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
`utcDateCreated` TEXT NOT NULL,
`utcDateModified` TEXT NOT NULL,
PRIMARY KEY(`noteId`));
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
CREATE TABLE IF NOT EXISTS "branches" (
`branchId` TEXT NOT NULL,
`noteId` TEXT NOT NULL,
`parentNoteId` TEXT NOT NULL,
`notePosition` INTEGER NOT NULL,
`prefix` TEXT,
`isExpanded` INTEGER NOT NULL DEFAULT 0,
`isDeleted` INTEGER NOT NULL DEFAULT 0,
`deleteId` TEXT DEFAULT NULL,
`utcDateModified` TEXT NOT NULL,
utcDateCreated TEXT NOT NULL,
hash TEXT DEFAULT "" NOT NULL,
PRIMARY KEY(`branchId`));
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
CREATE TABLE IF NOT EXISTS "attributes"
(
attributeId TEXT not null primary key,
noteId TEXT not null,
type TEXT not null,
name TEXT not null,
value TEXT default '' not null,
position INT default 0 not null,
utcDateCreated TEXT not null,
utcDateModified TEXT not null,
isDeleted INT not null,
`deleteId` TEXT DEFAULT NULL,
hash TEXT default "" not null,
isInheritable int DEFAULT 0 NULL);
CREATE INDEX IDX_attributes_name_value
on attributes (name, value);
CREATE INDEX IDX_attributes_noteId_index
on attributes (noteId);
CREATE INDEX IDX_attributes_value_index
on attributes (value);
CREATE TABLE IF NOT EXISTS "sync" (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`entityName` TEXT NOT NULL,
`entityId` TEXT NOT NULL,
`sourceId` TEXT NOT NULL,
`isSynced` INTEGER default 0 not null,
`utcSyncDate` TEXT NOT NULL);
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
`entityName`,
`entityId`
);
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
`utcSyncDate`
);

View File

@@ -28,7 +28,7 @@
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>ApiToken<span class="signature">(apiTokenId, token, isDeleted, utcDateCreated)</span><span class="type-signature"></span></h2>
<h2><span class="attribs"><span class="type-signature"></span></span>ApiToken<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender.</div>
@@ -45,7 +45,7 @@
<h4 class="name" id="ApiToken"><span class="type-signature"></span>new ApiToken<span class="signature">(apiTokenId, token, isDeleted, utcDateCreated)</span><span class="type-signature"></span></h4>
<h4 class="name" id="ApiToken"><span class="type-signature"></span>new ApiToken<span class="signature">()</span><span class="type-signature"></span></h4>
@@ -60,10 +60,15 @@
<h5>Parameters:</h5>
<h5 class="subsection-title">Properties:</h5>
<table class="params">
<table class="props">
<thead>
<tr>
@@ -180,8 +185,6 @@
<dl class="details">
@@ -239,6 +242,8 @@
</div>
@@ -282,13 +287,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -28,7 +28,7 @@
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>Attribute<span class="signature">(attributeId, noteId, type, name, value, position, isInheritable, isDeleted, utcDateCreated, utcDateModified)</span><span class="type-signature"></span></h2>
<h2><span class="attribs"><span class="type-signature"></span></span>Attribute<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">Attribute is key value pair owned by a note.</div>
@@ -45,7 +45,7 @@
<h4 class="name" id="Attribute"><span class="type-signature"></span>new Attribute<span class="signature">(attributeId, noteId, type, name, value, position, isInheritable, isDeleted, utcDateCreated, utcDateModified)</span><span class="type-signature"></span></h4>
<h4 class="name" id="Attribute"><span class="type-signature"></span>new Attribute<span class="signature">()</span><span class="type-signature"></span></h4>
@@ -60,10 +60,15 @@
<h5>Parameters:</h5>
<h5 class="subsection-title">Properties:</h5>
<table class="params">
<table class="props">
<thead>
<tr>
@@ -267,6 +272,32 @@
<tr>
<td class="name"><code>deleteId</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">null</span>
</td>
<td class="description last">ID identifying delete transaction</td>
</tr>
<tr>
<td class="name"><code>utcDateCreated</code></td>
@@ -318,8 +349,6 @@
<dl class="details">
@@ -349,7 +378,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line24">line 24</a>
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line30">line 30</a>
</li></ul></dd>
@@ -377,6 +406,8 @@
</div>
@@ -462,7 +493,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line46">line 46</a>
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line47">line 47</a>
</li></ul></dd>
@@ -485,6 +516,8 @@
<h5>Returns:</h5>
@@ -562,7 +595,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line57">line 57</a>
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line54">line 54</a>
</li></ul></dd>
@@ -585,6 +618,8 @@
<h5>Returns:</h5>
@@ -662,7 +697,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line76">line 76</a>
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line69">line 69</a>
</li></ul></dd>
@@ -685,6 +720,8 @@
<h5>Returns:</h5>
@@ -724,13 +761,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>Branch<span class="signature">(branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated)</span><span class="type-signature"></span></h2>
<h2><span class="attribs"><span class="type-signature"></span></span>Branch<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">Branch represents note's placement in the tree - it's essentially pair of noteId and parentNoteId.
Each note can have multiple (at least one) branches, meaning it can be placed into multiple places in the tree.</div>
@@ -46,7 +46,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<h4 class="name" id="Branch"><span class="type-signature"></span>new Branch<span class="signature">(branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated)</span><span class="type-signature"></span></h4>
<h4 class="name" id="Branch"><span class="type-signature"></span>new Branch<span class="signature">()</span><span class="type-signature"></span></h4>
@@ -61,10 +61,15 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<h5>Parameters:</h5>
<h5 class="subsection-title">Properties:</h5>
<table class="params">
<table class="props">
<thead>
<tr>
@@ -245,6 +250,32 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<tr>
<td class="name"><code>deleteId</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">null</span>
</td>
<td class="description last">ID identifying delete transaction</td>
</tr>
<tr>
<td class="name"><code>utcDateModified</code></td>
@@ -296,8 +327,6 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<dl class="details">
@@ -327,7 +356,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<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#line24">line 24</a>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line25">line 25</a>
</li></ul></dd>
@@ -355,6 +384,8 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
</div>
@@ -392,7 +423,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
<h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
@@ -440,7 +471,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<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>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line32">line 32</a>
</li></ul></dd>
@@ -463,6 +494,8 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<h5>Returns:</h5>
@@ -474,10 +507,109 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
</dt>
<dd>
<span class="param-type"><a href="Note.html">Note</a></span>
|
<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
<span class="param-type">null</span>
</dd>
</dl>
<h4 class="name" id="getParentNote"><span class="type-signature">(async) </span>getParentNote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;(<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#line37">line 37</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
</dd>
@@ -505,13 +637,13 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -178,6 +178,8 @@
</div>
@@ -210,13 +212,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>NoteRevision<span class="signature">(noteRevisionId, noteId, type, mime, title, content, isProtected, dateModifiedFrom, dateModifiedTo, utcDateModifiedFrom, utcDateModifiedTo)</span><span class="type-signature"></span></h2>
<h2><span class="attribs"><span class="type-signature"></span></span>NoteRevision<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.</div>
@@ -45,7 +45,7 @@
<h4 class="name" id="NoteRevision"><span class="type-signature"></span>new NoteRevision<span class="signature">(noteRevisionId, noteId, type, mime, title, content, isProtected, dateModifiedFrom, dateModifiedTo, utcDateModifiedFrom, utcDateModifiedTo)</span><span class="type-signature"></span></h4>
<h4 class="name" id="NoteRevision"><span class="type-signature"></span>new NoteRevision<span class="signature">()</span><span class="type-signature"></span></h4>
@@ -60,10 +60,15 @@
<h5>Parameters:</h5>
<h5 class="subsection-title">Properties:</h5>
<table class="params">
<table class="props">
<thead>
<tr>
@@ -200,13 +205,36 @@
<tr>
<td class="name"><code>content</code></td>
<td class="name"><code>contentLength</code></td>
<td class="type">
<span class="param-type">string</span>
<span class="param-type">int</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>isErased</code></td>
<td class="type">
<span class="param-type">boolean</span>
@@ -229,7 +257,7 @@
<td class="type">
<span class="param-type">string</span>
<span class="param-type">boolean</span>
@@ -246,7 +274,7 @@
<tr>
<td class="name"><code>dateModifiedFrom</code></td>
<td class="name"><code>dateLastEdited</code></td>
<td class="type">
@@ -269,7 +297,7 @@
<tr>
<td class="name"><code>dateModifiedTo</code></td>
<td class="name"><code>dateCreated</code></td>
<td class="type">
@@ -292,7 +320,7 @@
<tr>
<td class="name"><code>utcDateModifiedFrom</code></td>
<td class="name"><code>utcDateLastEdited</code></td>
<td class="type">
@@ -315,7 +343,30 @@
<tr>
<td class="name"><code>utcDateModifiedTo</code></td>
<td class="name"><code>utcDateCreated</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>utcDateModified</code></td>
<td class="type">
@@ -341,8 +392,6 @@
<dl class="details">
@@ -372,7 +421,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line24">line 24</a>
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line35">line 35</a>
</li></ul></dd>
@@ -400,6 +449,8 @@
</div>
@@ -429,6 +480,320 @@
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="getContent"><span class="type-signature">(async) </span>getContent<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line69">line 69</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;*></span>
</dd>
</dl>
<h4 class="name" id="isStringNote"><span class="type-signature"></span>isStringNote<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line55">line 55</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
true if the note has string content (not binary)
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="setContent"><span class="type-signature">(async) </span>setContent<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line105">line 105</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
@@ -443,13 +808,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -28,7 +28,7 @@
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>Option<span class="signature">(name, value, isSynced, utcDateModified, utcDateCreated)</span><span class="type-signature"></span></h2>
<h2><span class="attribs"><span class="type-signature"></span></span>Option<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">Option represents name-value pair, either directly configurable by the user or some system property.</div>
@@ -45,7 +45,7 @@
<h4 class="name" id="Option"><span class="type-signature"></span>new Option<span class="signature">(name, value, isSynced, utcDateModified, utcDateCreated)</span><span class="type-signature"></span></h4>
<h4 class="name" id="Option"><span class="type-signature"></span>new Option<span class="signature">()</span><span class="type-signature"></span></h4>
@@ -60,10 +60,15 @@
<h5>Parameters:</h5>
<h5 class="subsection-title">Properties:</h5>
<table class="params">
<table class="props">
<thead>
<tr>
@@ -203,8 +208,6 @@
<dl class="details">
@@ -234,7 +237,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_option.js.html">entities/option.js</a>, <a href="entities_option.js.html#line17">line 17</a>
<a href="entities_option.js.html">entities/option.js</a>, <a href="entities_option.js.html#line22">line 22</a>
</li></ul></dd>
@@ -262,6 +265,8 @@
</div>
@@ -305,13 +310,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -28,7 +28,7 @@
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>RecentNote<span class="signature">(noteId, notePath, isDeleted, utcDateModified)</span><span class="type-signature"></span></h2>
<h2><span class="attribs"><span class="type-signature"></span></span>RecentNote<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">RecentNote represents recently visited note.</div>
@@ -45,7 +45,7 @@
<h4 class="name" id="RecentNote"><span class="type-signature"></span>new RecentNote<span class="signature">(noteId, notePath, isDeleted, utcDateModified)</span><span class="type-signature"></span></h4>
<h4 class="name" id="RecentNote"><span class="type-signature"></span>new RecentNote<span class="signature">()</span><span class="type-signature"></span></h4>
@@ -60,10 +60,15 @@
<h5>Parameters:</h5>
<h5 class="subsection-title">Properties:</h5>
<table class="params">
<table class="props">
<thead>
<tr>
@@ -180,8 +185,6 @@
<dl class="details">
@@ -239,6 +242,8 @@
</div>
@@ -282,13 +287,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -34,10 +34,10 @@ const dateUtils = require('../services/date_utils');
/**
* ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender.
*
* @param {string} apiTokenId - primary key
* @param {string} token
* @param {boolean} isDeleted - true if API token is deleted
* @param {string} utcDateCreated
* @property {string} apiTokenId - primary key
* @property {string} token
* @property {boolean} isDeleted - true if API token is deleted
* @property {string} utcDateCreated
*
* @extends Entity
*/
@@ -69,13 +69,13 @@ module.exports = ApiToken;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -36,16 +36,17 @@ const sql = require('../services/sql');
/**
* Attribute is key value pair owned by a note.
*
* @param {string} attributeId
* @param {string} noteId
* @param {string} type
* @param {string} name
* @param {string} value
* @param {int} position
* @param {boolean} isInheritable
* @param {boolean} isDeleted
* @param {string} utcDateCreated
* @param {string} utcDateModified
* @property {string} attributeId
* @property {string} noteId
* @property {string} type
* @property {string} name
* @property {string} value
* @property {int} position
* @property {boolean} isInheritable
* @property {boolean} isDeleted
* @property {string|null} deleteId - ID identifying delete transaction
* @property {string} utcDateCreated
* @property {string} utcDateModified
*
* @extends Entity
*/
@@ -72,11 +73,7 @@ class Attribute extends Entity {
* @returns {Promise&lt;Note|null>}
*/
async getNote() {
if (!this.__note) {
this.__note = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
}
return this.__note;
return await repository.getNote(this.noteId);
}
/**
@@ -91,11 +88,7 @@ class Attribute extends Entity {
return null;
}
if (!this.__targetNote) {
this.__targetNote = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.value]);
}
return this.__targetNote;
return await repository.getNote(this.value);
}
/**
@@ -107,6 +100,10 @@ class Attribute extends Entity {
async beforeSaving() {
if (!this.value) {
if (this.type === 'relation') {
throw new Error(`Cannot save relation ${this.name} since it does not target any note.`);
}
// null value isn't allowed
this.value = "";
}
@@ -137,6 +134,21 @@ class Attribute extends Entity {
// cannot be static!
updatePojo(pojo) {
delete pojo.isOwned;
delete pojo.__note;
}
createClone(type, name, value) {
return new Attribute({
noteId: this.noteId,
type: type,
name: name,
value: value,
position: this.position,
isInheritable: this.isInheritable,
isDeleted: false,
utcDateCreated: this.utcDateCreated,
utcDateModified: this.utcDateModified
});
}
}
@@ -150,13 +162,13 @@ module.exports = Attribute;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -37,15 +37,16 @@ const sql = require('../services/sql');
* Branch represents note's placement in the tree - it's essentially pair of noteId and parentNoteId.
* Each note can have multiple (at least one) branches, meaning it can be placed into multiple places in the tree.
*
* @param {string} branchId - primary key
* @param {string} noteId
* @param {string} parentNoteId
* @param {int} notePosition
* @param {string} prefix
* @param {boolean} isExpanded
* @param {boolean} isDeleted
* @param {string} utcDateModified
* @param {string} utcDateCreated
* @property {string} branchId - primary key
* @property {string} noteId
* @property {string} parentNoteId
* @property {int} notePosition
* @property {string} prefix
* @property {boolean} isExpanded
* @property {boolean} isDeleted
* @property {string|null} deleteId - ID identifying delete transaction
* @property {string} utcDateModified
* @property {string} utcDateCreated
*
* @extends Entity
*/
@@ -53,24 +54,26 @@ class Branch extends Entity {
static get entityName() { return "branches"; }
static get primaryKeyName() { return "branchId"; }
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "prefix"]; }
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "deleteId", "prefix"]; }
constructor(row = {}) {
super(row);
// used to detect move in note tree
this.origParentNoteId = this.parentNoteId;
/** @returns {Promise&lt;Note|null>} */
async getNote() {
return await repository.getNote(this.noteId);
}
/** @returns {Note|null} */
async getNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
/** @returns {Promise&lt;Note|null>} */
async getParentNote() {
return await repository.getNote(this.parentNoteId);
}
async beforeSaving() {
if (this.notePosition === undefined) {
const maxNotePos = await sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 1;
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 10;
}
if (!this.isExpanded) {
this.isExpanded = false;
}
if (!this.isDeleted) {
@@ -88,9 +91,17 @@ class Branch extends Entity {
}
}
// cannot be static!
updatePojo(pojo) {
delete pojo.origParentNoteId;
createClone(parentNoteId, notePosition) {
return new Branch({
noteId: this.noteId,
parentNoteId: parentNoteId,
notePosition: notePosition,
prefix: this.prefix,
isExpanded: this.isExpanded,
isDeleted: false,
utcDateCreated: this.utcDateCreated,
utcDateModified: this.utcDateModified
});
}
}
@@ -104,13 +115,13 @@ module.exports = Branch;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -96,13 +96,13 @@ module.exports = Entity;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -42,8 +42,6 @@ const LABEL_DEFINITION = 'label-definition';
const RELATION = 'relation';
const RELATION_DEFINITION = 'relation-definition';
const STRING_MIME_TYPES = ["application/x-javascript"];
/**
* This represents a Note which is a central object in the Trilium Notes project.
*
@@ -51,8 +49,11 @@ const STRING_MIME_TYPES = ["application/x-javascript"];
* @property {string} type - one of "text", "code", "file" or "render"
* @property {string} mime - MIME type, e.g. "text/html"
* @property {string} title - note title
* @property {int} contentLength - length of content
* @property {boolean} isProtected - true if note is protected
* @property {boolean} isDeleted - true if note is deleted
* @property {string|null} deleteId - ID identifying delete transaction
* @property {boolean} isErased - true if note's content is erased after it has been deleted
* @property {string} dateCreated - local date time (with offset)
* @property {string} dateModified - local date time (with offset)
* @property {string} utcDateCreated
@@ -63,7 +64,7 @@ const STRING_MIME_TYPES = ["application/x-javascript"];
class Note extends Entity {
static get entityName() { return "notes"; }
static get primaryKeyName() { return "noteId"; }
static get hashedProperties() { return ["noteId", "title", "type", "isProtected", "isDeleted"]; }
static get hashedProperties() { return ["noteId", "title", "type", "mime", "isProtected", "isDeleted", "deleteId"]; }
/**
* @param row - object containing database row from "notes" table
@@ -72,7 +73,7 @@ class Note extends Entity {
super(row);
this.isProtected = !!this.isProtected;
/* true if content (meaning any kind of potentially encrypted content) is either not encrypted
/* true if content is either not encrypted
* or encrypted, but with available protected session (so effectively decrypted) */
this.isContentAvailable = true;
@@ -81,7 +82,7 @@ class Note extends Entity {
this.isContentAvailable = protectedSessionService.isProtectedSessionAvailable();
if (this.isContentAvailable) {
protectedSessionService.decryptNote(this);
this.title = protectedSessionService.decryptString(this.title);
}
else {
this.title = "[protected]";
@@ -116,34 +117,46 @@ class Note extends Entity {
if (this.isProtected) {
if (this.isContentAvailable) {
protectedSessionService.decryptNoteContent(this);
this.content = this.content === null ? null : protectedSessionService.decrypt(this.content);
}
else {
this.content = "";
}
}
if (this.isStringNote()) {
this.content = this.content === null
? ""
: this.content.toString("UTF-8");
}
}
return this.content;
if (this.isStringNote()) {
return this.content === null
? ""
: this.content.toString("UTF-8");
}
else {
return this.content;
}
}
/** @returns {Promise&lt;*>} */
async getJsonContent() {
const content = await this.getContent();
if (!content || !content.trim()) {
return null;
}
return JSON.parse(content);
}
/** @returns {Promise} */
async setContent(content) {
// force updating note itself so that dateChanged is represented correctly even for the content
if (content === null || content === undefined) {
throw new Error(`Cannot set null content to note ${this.noteId}`);
}
content = Buffer.isBuffer(content) ? content : Buffer.from(content);
// force updating note itself so that dateModified is represented correctly even for the content
this.forcedChange = true;
this.contentLength = content.byteLength;
await this.save();
this.content = content;
@@ -152,12 +165,12 @@ class Note extends Entity {
noteId: this.noteId,
content: content,
utcDateModified: dateUtils.utcNowDateTime(),
hash: utils.hash(this.noteId + "|" + content)
hash: utils.hash(this.noteId + "|" + content.toString())
};
if (this.isProtected) {
if (this.isContentAvailable) {
protectedSessionService.encryptNoteContent(pojo);
pojo.content = protectedSessionService.encrypt(pojo.content);
}
else {
throw new Error(`Cannot update content of noteId=${this.noteId} since we're out of protected session.`);
@@ -199,9 +212,7 @@ class Note extends Entity {
/** @returns {boolean} true if the note has string content (not binary) */
isStringNote() {
return ["text", "code", "relation-map", "search"].includes(this.type)
|| this.mime.startsWith('text/')
|| STRING_MIME_TYPES.includes(this.mime);
return utils.isStringNote(this.type, this.mime);
}
/** @returns {string} JS script environment - either "frontend" or "backend" */
@@ -221,11 +232,47 @@ class Note extends Entity {
return null;
}
async loadOwnedAttributesToCache() {
this.__ownedAttributeCache = await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
return this.__ownedAttributeCache;
}
/**
* @returns {Promise&lt;Attribute[]>} attributes belonging to this specific note (excludes inherited attributes)
* This method is a faster variant of getAttributes() which looks for only owned attributes.
* Use when inheritance is not needed and/or in batch/performance sensitive operations.
*
* @param {string} [type] - (optional) attribute type to filter
* @param {string} [name] - (optional) attribute name to filter
* @returns {Promise&lt;Attribute[]>} note's "owned" attributes - excluding inherited ones
*/
async getOwnedAttributes() {
return await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
async getOwnedAttributes(type, name) {
if (!this.__ownedAttributeCache) {
await this.loadOwnedAttributesToCache();
}
if (type &amp;&amp; name) {
return this.__ownedAttributeCache.filter(attr => attr.type === type &amp;&amp; attr.name === name);
}
else if (type) {
return this.__ownedAttributeCache.filter(attr => attr.type === type);
}
else if (name) {
return this.__ownedAttributeCache.filter(attr => attr.name === name);
}
else {
return this.__ownedAttributeCache.slice();
}
}
/**
* @returns {Promise&lt;Attribute>} attribute belonging to this specific note (excludes inherited attributes)
*
* This method can be significantly faster than the getAttribute()
*/
async getOwnedAttribute(type, name) {
const attrs = await this.getOwnedAttributes(type, name);
return attrs.length > 0 ? attrs[0] : null;
}
/**
@@ -236,19 +283,26 @@ class Note extends Entity {
}
/**
* @param {string} [name] - attribute name to filter
* @param {string} [type] - (optional) attribute type to filter
* @param {string} [name] - (optional) attribute name to filter
* @returns {Promise&lt;Attribute[]>} all note's attributes, including inherited ones
*/
async getAttributes(name) {
async getAttributes(type, name) {
if (!this.__attributeCache) {
await this.loadAttributesToCache();
}
if (name) {
if (type &amp;&amp; name) {
return this.__attributeCache.filter(attr => attr.type === type &amp;&amp; attr.name === name);
}
else if (type) {
return this.__attributeCache.filter(attr => attr.type === type);
}
else if (name) {
return this.__attributeCache.filter(attr => attr.name === name);
}
else {
return this.__attributeCache;
return this.__attributeCache.slice();
}
}
@@ -257,7 +311,15 @@ class Note extends Entity {
* @returns {Promise&lt;Attribute[]>} all note's labels (attributes with type label), including inherited ones
*/
async getLabels(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL);
return await this.getAttributes(LABEL, name);
}
/**
* @param {string} [name] - label name to filter
* @returns {Promise&lt;Attribute[]>} all note's labels (attributes with type label), excluding inherited ones
*/
async getOwnedLabels(name) {
return await this.getOwnedAttributes(LABEL, name);
}
/**
@@ -265,7 +327,7 @@ class Note extends Entity {
* @returns {Promise&lt;Attribute[]>} all note's label definitions, including inherited ones
*/
async getLabelDefinitions(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL_DEFINITION);
return await this.getAttributes(LABEL_DEFINITION, name);
}
/**
@@ -273,7 +335,30 @@ class Note extends Entity {
* @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), including inherited ones
*/
async getRelations(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION);
return await this.getAttributes(RELATION, name);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), excluding inherited ones
*/
async getOwnedRelations(name) {
return await this.getOwnedAttributes(RELATION, name);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;Note[]>}
*/
async getRelationTargets(name) {
const relations = await this.getRelations(name);
const targets = [];
for (const relation of relations) {
targets.push(await relation.getTargetNote());
}
return targets;
}
/**
@@ -281,7 +366,7 @@ class Note extends Entity {
* @returns {Promise&lt;Attribute[]>} all note's relation definitions including inherited ones
*/
async getRelationDefinitions(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION_DEFINITION);
return await this.getAttributes(RELATION_DEFINITION, name);
}
/**
@@ -290,6 +375,7 @@ class Note extends Entity {
*/
invalidateAttributeCache() {
this.__attributeCache = null;
this.__ownedAttributeCache = null;
}
/** @returns {Promise&lt;void>} */
@@ -299,29 +385,33 @@ class Note extends Entity {
tree(noteId, level) AS (
SELECT ?, 0
UNION
SELECT branches.parentNoteId, tree.level + 1 FROM branches
SELECT branches.parentNoteId, tree.level + 1
FROM branches
JOIN tree ON branches.noteId = tree.noteId
JOIN notes ON notes.noteId = branches.parentNoteId
WHERE notes.isDeleted = 0
AND branches.isDeleted = 0
WHERE branches.isDeleted = 0
),
treeWithAttrs(noteId, level) AS (
SELECT * FROM tree
UNION
SELECT attributes.value, treeWithAttrs.level + 1 FROM attributes
SELECT attributes.value, treeWithAttrs.level FROM attributes
JOIN treeWithAttrs ON treeWithAttrs.noteId = attributes.noteId
WHERE attributes.isDeleted = 0
AND attributes.type = 'relation'
AND attributes.name = 'template'
AND (attributes.noteId = ? OR attributes.isInheritable = 1)
AND (treeWithAttrs.level = 0 OR attributes.isInheritable = 1)
)
SELECT attributes.* FROM attributes JOIN treeWithAttrs ON attributes.noteId = treeWithAttrs.noteId
WHERE attributes.isDeleted = 0 AND (attributes.isInheritable = 1 OR attributes.noteId = ?)
ORDER BY level, noteId, position`, [this.noteId, this.noteId, this.noteId]);
WHERE attributes.isDeleted = 0 AND (attributes.isInheritable = 1 OR treeWithAttrs.level = 0)
ORDER BY level, noteId, position`, [this.noteId]);
// attributes are ordered so that "closest" attributes are first
// we order by noteId so that attributes from same note stay together. Actual noteId ordering doesn't matter.
const filteredAttributes = attributes.filter((attr, index) => {
// if this exact attribute already appears then don't include it (can happen via cloning)
if (attributes.findIndex(it => it.attributeId === attr.attributeId) !== index) {
return false;
}
if (attr.isDefinition()) {
const firstDefinitionIndex = attributes.findIndex(el => el.type === attr.type &amp;&amp; el.name === attr.name);
@@ -365,6 +455,15 @@ class Note extends Entity {
return !!await this.getAttribute(type, name);
}
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @returns {Promise&lt;boolean>} true if note has an attribute with given type and name (excluding inherited)
*/
async hasOwnedAttribute(type, name) {
return !!await this.getOwnedAttribute(type, name);
}
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
@@ -379,7 +478,7 @@ class Note extends Entity {
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @returns {Promise&lt;string>} attribute value of given type and name or null if no such attribute exists.
* @returns {Promise&lt;string|null>} attribute value of given type and name or null if no such attribute exists.
*/
async getAttributeValue(type, name) {
const attr = await this.getAttribute(type, name);
@@ -387,6 +486,17 @@ class Note extends Entity {
return attr ? attr.value : null;
}
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @returns {Promise&lt;string|null>} attribute value of given type and name or null if no such attribute exists.
*/
async getOwnedAttributeValue(type, name) {
const attr = await this.getOwnedAttribute(type, name);
return attr ? attr.value : null;
}
/**
* Based on enabled, attribute is either set or removed.
*
@@ -406,7 +516,7 @@ class Note extends Entity {
}
/**
* Creates given attribute name-value pair if it doesn't exist.
* Update's given attribute's value or creates it if it doesn't exist
*
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
@@ -414,10 +524,18 @@ class Note extends Entity {
* @returns {Promise&lt;void>}
*/
async setAttribute(type, name, value) {
const attributes = await this.getOwnedAttributes();
let attr = attributes.find(attr => attr.type === type &amp;&amp; (value === undefined || attr.value === value));
const attributes = await this.loadOwnedAttributesToCache();
let attr = attributes.find(attr => attr.type === type &amp;&amp; attr.name === name);
if (!attr) {
if (attr) {
if (attr.value !== value) {
attr.value = value;
await attr.save();
this.invalidateAttributeCache();
}
}
else {
attr = new Attribute({
noteId: this.noteId,
type: type,
@@ -440,10 +558,10 @@ class Note extends Entity {
* @returns {Promise&lt;void>}
*/
async removeAttribute(type, name, value) {
const attributes = await this.getOwnedAttributes();
const attributes = await this.loadOwnedAttributesToCache();
for (const attribute of attributes) {
if (attribute.type === type &amp;&amp; (value === undefined || value === attribute.value)) {
if (attribute.type === type &amp;&amp; attribute.name === name &amp;&amp; (value === undefined || value === attribute.value)) {
attribute.isDeleted = true;
await attribute.save();
@@ -452,42 +570,104 @@ class Note extends Entity {
}
}
/**
* @return {Promise&lt;Attribute>}
*/
async addAttribute(type, name, value = "") {
const attr = new Attribute({
noteId: this.noteId,
type: type,
name: name,
value: value
});
await attr.save();
this.invalidateAttributeCache();
return attr;
}
async addLabel(name, value = "") {
return await this.addAttribute(LABEL, name, value);
}
async addRelation(name, targetNoteId) {
return await this.addAttribute(RELATION, name, targetNoteId);
}
/**
* @param {string} name - label name
* @returns {Promise&lt;boolean>} true if label exists (including inherited)
*/
async hasLabel(name) { return await this.hasAttribute(LABEL, name); }
/**
* @param {string} name - label name
* @returns {Promise&lt;boolean>} true if label exists (excluding inherited)
*/
async hasOwnedLabel(name) { return await this.hasOwnedAttribute(LABEL, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;boolean>} true if relation exists (including inherited)
*/
async hasRelation(name) { return await this.hasAttribute(RELATION, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;boolean>} true if relation exists (excluding inherited)
*/
async hasOwnedRelation(name) { return await this.hasOwnedAttribute(RELATION, name); }
/**
* @param {string} name - label name
* @returns {Promise&lt;Attribute>} label if it exists, null otherwise
* @returns {Promise&lt;Attribute|null>} label if it exists, null otherwise
*/
async getLabel(name) { return await this.getAttribute(LABEL, name); }
/**
* @param {string} name - label name
* @returns {Promise&lt;Attribute|null>} label if it exists, null otherwise
*/
async getOwnedLabel(name) { return await this.getOwnedAttribute(LABEL, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;Attribute>} relation if it exists, null otherwise
* @returns {Promise&lt;Attribute|null>} relation if it exists, null otherwise
*/
async getRelation(name) { return await this.getAttribute(RELATION, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;Attribute|null>} relation if it exists, null otherwise
*/
async getOwnedRelation(name) { return await this.getOwnedAttribute(RELATION, name); }
/**
* @param {string} name - label name
* @returns {Promise&lt;string>} label value if label exists, null otherwise
* @returns {Promise&lt;string|null>} label value if label exists, null otherwise
*/
async getLabelValue(name) { return await this.getAttributeValue(LABEL, name); }
/**
* @param {string} name - label name
* @returns {Promise&lt;string|null>} label value if label exists, null otherwise
*/
async getOwnedLabelValue(name) { return await this.getOwnedAttributeValue(LABEL, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;string>} relation value if relation exists, null otherwise
* @returns {Promise&lt;string|null>} relation value if relation exists, null otherwise
*/
async getRelationValue(name) { return await this.getAttributeValue(RELATION, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;string|null>} relation value if relation exists, null otherwise
*/
async getOwnedRelationValue(name) { return await this.getOwnedAttributeValue(RELATION, name); }
/**
* @param {string} name
* @returns {Promise&lt;Note>|null} target note of the relation or null (if target is empty or note was not found)
@@ -498,6 +678,16 @@ class Note extends Entity {
return relation ? await repository.getNote(relation.value) : null;
}
/**
* @param {string} name
* @returns {Promise&lt;Note>|null} target note of the relation or null (if target is empty or note was not found)
*/
async getOwnedRelationTarget(name) {
const relation = await this.getOwnedRelation(name);
return relation ? await repository.getNote(relation.value) : null;
}
/**
* Based on enabled, label is either set or removed.
*
@@ -519,7 +709,7 @@ class Note extends Entity {
async toggleRelation(enabled, name, value) { return await this.toggleAttribute(RELATION, enabled, name, value); }
/**
* Create label name-value pair if it doesn't exist yet.
* Update's given label's value or creates it if it doesn't exist
*
* @param {string} name - label name
* @param {string} [value] - label value
@@ -528,7 +718,7 @@ class Note extends Entity {
async setLabel(name, value) { return await this.setAttribute(LABEL, name, value); }
/**
* Create relation name-value pair if it doesn't exist yet.
* Update's given relation's value or creates it if it doesn't exist
*
* @param {string} name - relation name
* @param {string} [value] - relation value (noteId)
@@ -641,28 +831,17 @@ class Note extends Entity {
/**
* Get list of links coming out of this note.
*
* @returns {Promise&lt;Link[]>}
* @deprecated - not intended for general use
* @returns {Promise&lt;Attribute[]>}
*/
async getLinks() {
return await repository.getEntities("SELECT * FROM links WHERE noteId = ? AND isDeleted = 0", [this.noteId]);
}
/**
* Get list of links targetting this note.
*
* @returns {Promise&lt;Link[]>}
*/
async getTargetLinks() {
return await repository.getEntities("SELECT * FROM links WHERE targetNoteId = ? AND isDeleted = 0", [this.noteId]);
}
/**
* Return all links from this note, including deleted ones.
*
* @returns {Promise&lt;Link[]>}
*/
async getLinksWithDeleted() {
return await repository.getEntities("SELECT * FROM links WHERE noteId = ?", [this.noteId]);
return await repository.getEntities(`
SELECT *
FROM attributes
WHERE noteId = ? AND
isDeleted = 0 AND
type = 'relation' AND
name IN ('internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink')`, [this.noteId]);
}
/**
@@ -719,6 +898,36 @@ class Note extends Entity {
AND parent_notes.isDeleted = 0`, [this.noteId]);
}
/**
* @return {Promise&lt;string[][]>} - array of notePaths (each represented by array of noteIds constituting the particular note path)
*/
async getAllNotePaths() {
if (this.noteId === 'root') {
return [['root']];
}
const notePaths = [];
for (const parentNote of await this.getParentNotes()) {
for (const parentPath of await parentNote.getAllNotePaths()) {
parentPath.push(this.noteId);
notePaths.push(parentPath);
}
}
return notePaths;
}
/**
* @param ancestorNoteId
* @return {Promise&lt;boolean>} - true if ancestorNoteId occurs in at least one of the note's paths
*/
async isDescendantOfNote(ancestorNoteId) {
const notePaths = await this.getAllNotePaths();
return notePaths.some(path => path.includes(ancestorNoteId));
}
beforeSaving() {
if (!this.isDeleted) {
this.isDeleted = false;
@@ -732,6 +941,10 @@ class Note extends Entity {
this.utcDateCreated = dateUtils.utcNowDateTime();
}
if (this.contentLength === undefined) {
this.contentLength = -1;
}
super.beforeSaving();
if (this.isChanged) {
@@ -744,7 +957,7 @@ class Note extends Entity {
updatePojo(pojo) {
if (pojo.isProtected) {
if (this.isContentAvailable) {
protectedSessionService.encryptNote(pojo);
pojo.title = protectedSessionService.encrypt(pojo.title);
}
else {
// updating protected note outside of protected session means we will keep original ciphertexts
@@ -754,7 +967,9 @@ class Note extends Entity {
delete pojo.isContentAvailable;
delete pojo.__attributeCache;
delete pojo.__ownedAttributeCache;
delete pojo.content;
/** zero references to contentHash, probably can be removed */
delete pojo.contentHash;
}
}
@@ -769,13 +984,13 @@ module.exports = Note;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -31,28 +31,34 @@
const Entity = require('./entity');
const protectedSessionService = require('../services/protected_session');
const repository = require('../services/repository');
const utils = require('../services/utils');
const sql = require('../services/sql');
const dateUtils = require('../services/date_utils');
const syncTableService = require('../services/sync_table');
/**
* NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.
*
* @param {string} noteRevisionId
* @param {string} noteId
* @param {string} type
* @param {string} mime
* @param {string} title
* @param {string} content
* @param {string} isProtected
* @param {string} dateModifiedFrom
* @param {string} dateModifiedTo
* @param {string} utcDateModifiedFrom
* @param {string} utcDateModifiedTo
* @property {string} noteRevisionId
* @property {string} noteId
* @property {string} type
* @property {string} mime
* @property {string} title
* @property {int} contentLength
* @property {boolean} isErased
* @property {boolean} isProtected
* @property {string} dateLastEdited
* @property {string} dateCreated
* @property {string} utcDateLastEdited
* @property {string} utcDateCreated
* @property {string} utcDateModified
*
* @extends Entity
*/
class NoteRevision extends Entity {
static get entityName() { return "note_revisions"; }
static get primaryKeyName() { return "noteRevisionId"; }
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "content", "isProtected", "dateModifiedFrom", "dateModifiedTo", "utcDateModifiedFrom", "utcDateModifiedTo"]; }
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "contentLength", "isErased", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
constructor(row) {
super(row);
@@ -60,20 +66,120 @@ class NoteRevision extends Entity {
this.isProtected = !!this.isProtected;
if (this.isProtected) {
protectedSessionService.decryptNoteRevision(this);
if (protectedSessionService.isProtectedSessionAvailable()) {
this.title = protectedSessionService.decryptString(this.title);
}
else {
this.title = "[Protected]";
}
}
}
async getNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
return await repository.getNote(this.noteId);
}
/** @returns {boolean} true if the note has string content (not binary) */
isStringNote() {
return utils.isStringNote(this.type, this.mime);
}
/*
* Note revision content has quite special handling - it's not a separate entity, but a lazily loaded
* part of NoteRevision entity with it's own sync. Reason behind this hybrid design is that
* content can be quite large and it's not necessary to load it / fill memory for any note access even
* if we don't need a content, especially for bulk operations like search.
*
* This is the same approach as is used for Note's content.
*/
/** @returns {Promise&lt;*>} */
async getContent(silentNotFoundError = false) {
if (this.content === undefined) {
const res = await sql.getRow(`SELECT content, hash FROM note_revision_contents WHERE noteRevisionId = ?`, [this.noteRevisionId]);
if (!res) {
if (silentNotFoundError) {
return undefined;
}
else {
throw new Error("Cannot find note revision content for noteRevisionId=" + this.noteRevisionId);
}
}
this.content = res.content;
if (this.isProtected) {
if (protectedSessionService.isProtectedSessionAvailable()) {
this.content = protectedSessionService.decrypt(this.content);
}
else {
this.content = "";
}
}
}
if (this.isStringNote()) {
return this.content === null
? ""
: this.content.toString("UTF-8");
}
else {
return this.content;
}
}
/** @returns {Promise} */
async setContent(content) {
// force updating note itself so that utcDateModified is represented correctly even for the content
this.forcedChange = true;
this.contentLength = content === null ? 0 : content.length;
await this.save();
this.content = content;
const pojo = {
noteRevisionId: this.noteRevisionId,
content: content,
utcDateModified: dateUtils.utcNowDateTime(),
hash: utils.hash(this.noteRevisionId + "|" + content)
};
if (this.isProtected) {
if (protectedSessionService.isProtectedSessionAvailable()) {
pojo.content = protectedSessionService.encrypt(pojo.content);
}
else {
throw new Error(`Cannot update content of noteRevisionId=${this.noteRevisionId} since we're out of protected session.`);
}
}
await sql.upsert("note_revision_contents", "noteRevisionId", pojo);
await syncTableService.addNoteRevisionContentSync(this.noteRevisionId);
}
beforeSaving() {
if (this.isProtected) {
protectedSessionService.encryptNoteRevision(this);
super.beforeSaving();
if (this.isChanged) {
this.utcDateModified = dateUtils.utcNowDateTime();
}
}
// cannot be static!
updatePojo(pojo) {
if (pojo.isProtected) {
if (protectedSessionService.isProtectedSessionAvailable()) {
pojo.title = protectedSessionService.encrypt(pojo.title);
}
else {
// updating protected note outside of protected session means we will keep original ciphertexts
delete pojo.title;
}
}
super.beforeSaving();
delete pojo.content;
}
}
@@ -87,13 +193,13 @@ module.exports = NoteRevision;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -34,11 +34,11 @@ const dateUtils = require('../services/date_utils');
/**
* Option represents name-value pair, either directly configurable by the user or some system property.
*
* @param {string} name
* @param {string} value
* @param {boolean} isSynced
* @param {string} utcDateModified
* @param {string} utcDateCreated
* @property {string} name
* @property {string} value
* @property {boolean} isSynced
* @property {string} utcDateModified
* @property {string} utcDateCreated
*
* @extends Entity
*/
@@ -76,13 +76,13 @@ module.exports = Option;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -34,10 +34,10 @@ const dateUtils = require('../services/date_utils');
/**
* RecentNote represents recently visited note.
*
* @param {string} noteId
* @param {string} notePath
* @param {boolean} isDeleted
* @param {string} utcDateModified
* @property {string} noteId
* @property {string} notePath
* @property {boolean} isDeleted
* @property {string} utcDateModified
*
* @extends Entity
*/
@@ -69,13 +69,13 @@ module.exports = RecentNote;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -102,6 +102,313 @@
<h4 class="name" id="CreateNewNoteParams">CreateNewNoteParams</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>parentNoteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">MANDATORY</td>
</tr>
<tr>
<td class="name"><code>title</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">MANDATORY</td>
</tr>
<tr>
<td class="name"><code>content</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">buffer</span>
</td>
<td class="description last">MANDATORY</td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">text, code, file, image, search, book, relation-map - MANDATORY</td>
</tr>
<tr>
<td class="name"><code>mime</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">value is derived from default mimes for type</td>
</tr>
<tr>
<td class="name"><code>isProtected</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">default is false</td>
</tr>
<tr>
<td class="name"><code>isExpanded</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">default is false</td>
</tr>
<tr>
<td class="name"><code>prefix</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">default is empty string</td>
</tr>
<tr>
<td class="name"><code>notePosition</code></td>
<td class="type">
<span class="param-type">int</span>
</td>
<td class="description last">default is last existing notePosition in a parent + 10</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line212">line 212</a>
</li></ul></dd>
</dl>
<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>
@@ -290,6 +597,194 @@
<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">attribute type - label, relation etc.</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">attribute name</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">attribute value</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line233">line 233</a>
</li></ul></dd>
</dl>
<h4 class="name" id="CreateNoteExtraOptions">CreateNoteExtraOptions</h4>
@@ -558,7 +1053,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line180">line 180</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line240">line 240</a>
</li></ul></dd>
@@ -588,13 +1083,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -50,13 +50,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -1,12 +1,12 @@
/*global document */
(function() {
var source = document.getElementsByClassName('prettyprint source linenums');
var i = 0;
var lineNumber = 0;
var lineId;
var lines;
var totalLines;
var anchorHash;
(() => {
const source = document.getElementsByClassName('prettyprint source linenums');
let i = 0;
let lineNumber = 0;
let lineId;
let lines;
let totalLines;
let anchorHash;
if (source && source[0]) {
anchorHash = document.location.hash.substring(1);
@@ -15,7 +15,7 @@
for (; i < totalLines; i++) {
lineNumber++;
lineId = 'line' + lineNumber;
lineId = `line${lineNumber}`;
lines[i].id = lineId;
if (lineId === anchorHash) {
lines[i].className += ' selected';

View File

@@ -38,7 +38,7 @@ const repository = require('./repository');
const axios = require('axios');
const dayjs = require('dayjs');
const cloningService = require('./cloning');
const messagingService = require('./messaging');
const ws = require('./ws.js');
const appInfo = require('./app_info');
const searchService = require('./search');
@@ -198,6 +198,66 @@ function BackendScriptApi(currentNote, apiParams) {
*/
this.toggleNoteInParent = cloningService.toggleNoteInParent;
/**
* @typedef {object} CreateNoteAttribute
* @property {string} type - attribute type - label, relation etc.
* @property {string} name - attribute name
* @property {string} [value] - attribute value
*/
/**
* Create text note. See also createNewNote() for more options.
*
* @param {string} parentNoteId
* @param {string} title
* @param {string} content
* @return {Promise&lt;{note: Note, branch: Branch}>}
*/
this.createTextNote = async (parentNoteId, title, content = '') => await noteService.createNewNote({
parentNoteId,
title,
content,
type: 'text'
});
/**
* Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
* JSON MIME type. See also createNewNote() for more options.
*
* @param {string} parentNoteId
* @param {string} title
* @param {object} content
* @return {Promise&lt;{note: Note, branch: Branch}>}
*/
this.createDataNote = async (parentNoteId, title, content = {}) => await noteService.createNewNote({
parentNoteId,
title,
content: JSON.stringify(content, null, '\t'),
type: 'code',
mime: 'application/json'
});
/**
* @typedef {object} CreateNewNoteParams
* @property {string} parentNoteId - MANDATORY
* @property {string} title - MANDATORY
* @property {string|buffer} content - MANDATORY
* @property {string} type - text, code, file, image, search, book, relation-map - MANDATORY
* @property {string} mime - value is derived from default mimes for type
* @property {boolean} isProtected - default is false
* @property {boolean} isExpanded - default is false
* @property {string} prefix - default is empty string
* @property {int} notePosition - default is last existing notePosition in a parent + 10
*/
/**
* @method
*
* @param {CreateNewNoteParams} [params]
* @returns {Promise&lt;{note: Note, branch: Branch}>} object contains newly created entities note and branch
*/
this.createNewNote = noteService.createNewNote;
/**
* @typedef {object} CreateNoteAttribute
* @property {string} type - attribute type - label, relation etc.
@@ -216,6 +276,7 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
* @deprecated please use createNote() API method instead
*
* @param {string} parentNoteId - create new note under this parent
* @param {string} title
@@ -223,23 +284,38 @@ function BackendScriptApi(currentNote, apiParams) {
* @param {CreateNoteExtraOptions} [extraOptions={}]
* @returns {Promise&lt;{note: Note, branch: Branch}>} object contains newly created entities note and branch
*/
this.createNote = noteService.createNote;
this.createNote = async (parentNoteId, title, content = "", extraOptions= {}) => {
extraOptions.parentNoteId = parentNoteId;
extraOptions.title = title;
/**
* Creates new note according to given params and force all connected clients to refresh their tree.
*
* @method
*
* @param {string} parentNoteId - create new note under this parent
* @param {string} title
* @param {string} [content=""]
* @param {CreateNoteExtraOptions} [extraOptions={}]
* @returns {Promise&lt;{note: Note, branch: Branch}>} object contains newly created entities note and branch
*/
this.createNoteAndRefresh = async function(parentNoteId, title, content, extraOptions) {
await noteService.createNote(parentNoteId, title, content, extraOptions);
const parentNote = await repository.getNote(parentNoteId);
messagingService.refreshTree();
// code note type can be inherited, otherwise text is default
extraOptions.type = parentNote.type === 'code' ? 'code' : 'text';
extraOptions.mime = parentNote.type === 'code' ? parentNote.mime : 'text/html';
if (extraOptions.json) {
extraOptions.content = JSON.stringify(content || {}, null, '\t');
extraOptions.type = 'code';
extraOptions.mime = 'application/json';
}
else {
extraOptions.content = content;
}
const {note, branch} = await noteService.createNewNote(extraOptions);
for (const attr of extraOptions.attributes || []) {
await attributeService.createAttribute({
noteId: note.noteId,
type: attr.type,
name: attr.name,
value: attr.value,
isInheritable: !!attr.isInheritable
});
}
return {note, branch};
};
/**
@@ -266,6 +342,14 @@ function BackendScriptApi(currentNote, apiParams) {
*/
this.getDateNote = dateNoteService.getDateNote;
/**
* Returns today's day note. If such note doesn't exist, it is created.
*
* @method
* @returns {Promise&lt;Note|null>}
*/
this.getTodayNote = dateNoteService.getTodayNote;
/**
* Returns note for the first date of the week of the given date.
*
@@ -308,9 +392,10 @@ function BackendScriptApi(currentNote, apiParams) {
* This method looks similar to toggleNoteInParent() but differs because we're looking up branch by prefix.
*
* @method
* @deprecated - this method is pretty confusing and serves specialized purpose only
* @param {string} noteId
* @param {string} prefix
* @param {string} [parentNoteId]
* @param {string|null} parentNoteId
*/
this.setNoteToParent = treeService.setNoteToParent;
@@ -330,12 +415,10 @@ function BackendScriptApi(currentNote, apiParams) {
this.sql = sql;
/**
* Trigger tree refresh in all connected clients. This is required when some tree change happens in
* the backend.
*
* @returns {Promise&lt;void>}
* @method
* @deprecated - this is now no-op since all the changes should be gracefully handled per widget
*/
this.refreshTree = messagingService.refreshTree;
this.refreshTree = () => {};
/**
* @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
@@ -343,7 +426,8 @@ function BackendScriptApi(currentNote, apiParams) {
this.getAppInfo = () => appInfo
}
module.exports = BackendScriptApi;</code></pre>
module.exports = BackendScriptApi;
</code></pre>
</article>
</section>
@@ -353,13 +437,13 @@ module.exports = BackendScriptApi;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -273,7 +273,7 @@ tr > th:last-child { border-right: 1px solid #ddd; }
margin: 0;
}
.prettyprint
.source
{
border: 1px solid #ddd;
width: 80%;
@@ -284,7 +284,7 @@ tr > th:last-child { border-right: 1px solid #ddd; }
width: inherit;
}
.prettyprint code
.source code
{
font-size: 100%;
line-height: 18px;

View File

@@ -93,7 +93,7 @@
<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#line2">line 2</a>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line3">line 3</a>
</li></ul></dd>
@@ -121,6 +121,8 @@
</div>
@@ -181,7 +183,65 @@
<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#line6">line 6</a>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line11">line 11</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isDeleted"><span class="type-signature"></span>isDeleted<span class="type-signature"></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#line23">line 23</a>
</li></ul></dd>
@@ -239,7 +299,7 @@
<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#line17">line 17</a>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line21">line 21</a>
</li></ul></dd>
@@ -297,7 +357,7 @@
<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#line8">line 8</a>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line13">line 13</a>
</li></ul></dd>
@@ -355,7 +415,7 @@
<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#line13">line 13</a>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line17">line 17</a>
</li></ul></dd>
@@ -413,7 +473,7 @@
<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#line11">line 11</a>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line15">line 15</a>
</li></ul></dd>
@@ -471,7 +531,7 @@
<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#line15">line 15</a>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line19">line 19</a>
</li></ul></dd>
@@ -547,7 +607,7 @@
<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#line21">line 21</a>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line27">line 27</a>
</li></ul></dd>
@@ -570,6 +630,110 @@
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
</dd>
</dl>
<h4 class="name" id="getParentNote"><span class="type-signature">(async) </span>getParentNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="NoteShort.html">NoteShort</a>}</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#line32">line 32</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
@@ -647,7 +811,7 @@
<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#line26">line 26</a>
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line37">line 37</a>
</li></ul></dd>
@@ -670,6 +834,8 @@
<h5>Returns:</h5>
@@ -713,13 +879,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,280 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: KeyboardActions</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: KeyboardActions</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>KeyboardActions<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">blaa vlaa</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="KeyboardActions"><span class="type-signature"></span>new KeyboardActions<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_keyboard_actions.js.html">services/keyboard_action.js</a>, <a href="services_keyboard_actions.js.html#line5">line 5</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="JUMP_TO"><span class="type-signature"></span>JUMP_TO<span class="type-signature"></span></h4>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_keyboard_actions.js.html">services/keyboard_action.js</a>, <a href="services_keyboard_actions.js.html#line7">line 7</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="KeyboardActions.html">KeyboardActions</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@@ -0,0 +1,522 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: NoteComplement</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: NoteComplement</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>NoteComplement<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">Complements the NoteShort with the main note content and other extra attributes</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="NoteComplement"><span class="type-signature"></span>new NoteComplement<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line5">line 5</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="content"><span class="type-signature"></span>content<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line10">line 10</a>
</li></ul></dd>
</dl>
<h4 class="name" id="dateCreated"><span class="type-signature"></span>dateCreated<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line13">line 13</a>
</li></ul></dd>
</dl>
<h4 class="name" id="dateModified"><span class="type-signature"></span>dateModified<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line16">line 16</a>
</li></ul></dd>
</dl>
<h4 class="name" id="noteId"><span class="type-signature"></span>noteId<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line7">line 7</a>
</li></ul></dd>
</dl>
<h4 class="name" id="utcDateCreated"><span class="type-signature"></span>utcDateCreated<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line19">line 19</a>
</li></ul></dd>
</dl>
<h4 class="name" id="utcDateModified"><span class="type-signature"></span>utcDateModified<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line22">line 22</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@@ -93,7 +93,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_full.js.html">entities/note_full.js</a>, <a href="entities_note_full.js.html#line6">line 6</a>
<a href="entities_note_full.js.html">entities/note_full.js</a>, <a href="entities_note_full.js.html#line7">line 7</a>
</li></ul></dd>
@@ -121,6 +121,8 @@
</div>
@@ -453,7 +455,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
</footer>
<script> prettyPrint(); </script>

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,11 @@
<pre class="prettyprint source linenums"><code>class Attribute {
constructor(treeCache, row) {
this.treeCache = treeCache;
this.update(row);
}
update(row) {
/** @param {string} attributeId */
this.attributeId = row.attributeId;
/** @param {string} noteId */
@@ -43,12 +48,6 @@
this.position = row.position;
/** @param {boolean} isInheritable */
this.isInheritable = row.isInheritable;
/** @param {boolean} isDeleted */
this.isDeleted = row.isDeleted;
/** @param {string} utcDateCreated */
this.utcDateCreated = row.utcDateCreated;
/** @param {string} utcDateModified */
this.utcDateModified = row.utcDateModified;
}
/** @returns {NoteShort} */
@@ -56,8 +55,17 @@
return await this.treeCache.getNote(this.noteId);
}
get jsonValue() {
try {
return JSON.parse(this.value);
}
catch (e) {
return null;
}
}
get toString() {
return `Attribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name})`;
return `Attribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name}, value=${this.value})`;
}
}
@@ -71,13 +79,13 @@ export default Attribute;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -30,11 +30,15 @@
class Branch {
constructor(treeCache, row) {
this.treeCache = treeCache;
this.update(row);
}
update(row) {
/** @param {string} primary key */
this.branchId = row.branchId;
/** @param {string} */
this.noteId = row.noteId;
this.note = null;
/** @param {string} */
this.parentNoteId = row.parentNoteId;
/** @param {int} */
@@ -43,11 +47,18 @@ class Branch {
this.prefix = row.prefix;
/** @param {boolean} */
this.isExpanded = !!row.isExpanded;
/** @param {boolean} */
this.isDeleted = !!row.isDeleted;
}
/** @returns {NoteShort} */
async getNote() {
return await this.treeCache.getNote(this.noteId);
return this.treeCache.getNote(this.noteId);
}
/** @returns {NoteShort} */
async getParentNote() {
return this.treeCache.getNote(this.parentNoteId);
}
/** @returns {boolean} true if it's top level, meaning its parent is root note */
@@ -70,13 +81,13 @@ export default Branch;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: entities/note_complement.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: entities/note_complement.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* Complements the NoteShort with the main note content and other extra attributes
*/
class NoteComplement {
constructor(row) {
/** @param {string} */
this.noteId = row.noteId;
/** @param {string} */
this.content = row.content;
/** @param {string} */
this.dateCreated = row.dateCreated;
/** @param {string} */
this.dateModified = row.dateModified;
/** @param {string} */
this.utcDateCreated = row.utcDateCreated;
/** @param {string} */
this.utcDateModified = row.utcDateModified;
}
}
export default NoteComplement;</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@@ -32,8 +32,8 @@
* Represents full note, specifically including note's content.
*/
class NoteFull extends NoteShort {
constructor(treeCache, row) {
super(treeCache, row);
constructor(treeCache, row, noteShort) {
super(treeCache, row, []);
/** @param {string} */
this.content = row.content;
@@ -49,6 +49,12 @@ class NoteFull extends NoteShort {
/** @param {string} */
this.utcDateModified = row.utcDateModified;
/* ugly */
this.parents = noteShort.parents;
this.parentToBranch = noteShort.parentToBranch;
this.children = noteShort.children;
this.childToBranch = noteShort.childToBranch;
}
}
@@ -68,7 +74,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>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -27,6 +27,7 @@
<section>
<article>
<pre class="prettyprint source linenums"><code>import server from '../services/server.js';
import Attribute from './attribute.js';
const LABEL = 'label';
const LABEL_DEFINITION = 'label-definition';
@@ -35,24 +36,74 @@ const RELATION_DEFINITION = 'relation-definition';
/**
* This note's representation is used in note tree and is kept in TreeCache.
* Its notable omission is the note content.
*/
class NoteShort {
/**
* @param {TreeCache} treeCache
* @param {Object.&lt;string, Object>} row
*/
constructor(treeCache, row) {
this.treeCache = treeCache;
/** @type {string[]} */
this.attributes = [];
/** @type {string[]} */
this.targetRelations = [];
/** @type {string[]} */
this.parents = [];
/** @type {string[]} */
this.children = [];
/** @type {Object.&lt;string, string>} */
this.parentToBranch = {};
/** @type {Object.&lt;string, string>} */
this.childToBranch = {};
this.update(row);
}
update(row) {
/** @param {string} */
this.noteId = row.noteId;
/** @param {string} */
this.title = row.title;
/** @param {int} */
this.contentLength = row.contentLength;
/** @param {boolean} */
this.isProtected = row.isProtected;
this.isProtected = !!row.isProtected;
/** @param {string} one of 'text', 'code', 'file' or 'render' */
this.type = row.type;
/** @param {string} content-type, e.g. "application/json" */
this.mime = row.mime;
/** @param {boolean} */
this.archived = row.archived;
this.cssClass = row.cssClass;
this.isDeleted = row.isDeleted;
}
addParent(parentNoteId, branchId) {
if (!this.parents.includes(parentNoteId)) {
this.parents.push(parentNoteId);
}
this.parentToBranch[parentNoteId] = branchId;
}
addChild(childNoteId, branchId) {
if (!this.children.includes(childNoteId)) {
this.children.push(childNoteId);
}
this.childToBranch[childNoteId] = branchId;
const branchIdPos = {};
for (const branchId of Object.values(this.childToBranch)) {
branchIdPos[branchId] = this.treeCache.getBranch(branchId).notePosition;
}
this.children.sort((a, b) => branchIdPos[this.childToBranch[a]] &lt; branchIdPos[this.childToBranch[b]] ? -1 : 1);
}
/** @returns {boolean} */
@@ -60,176 +111,341 @@ class NoteShort {
return this.mime === "application/json";
}
/** @returns {Promise&lt;Branch[]>} */
async getBranches() {
const branchIds = this.treeCache.parents[this.noteId].map(
parentNoteId => this.treeCache.getBranchIdByChildParent(this.noteId, parentNoteId));
async getContent() {
// we're not caching content since these objects are in treeCache and as such pretty long lived
const note = await server.get("notes/" + this.noteId);
return note.content;
}
async getJsonContent() {
const content = await this.getContent();
try {
return JSON.parse(content);
}
catch (e) {
console.log(`Cannot parse content of note ${this.noteId}: `, e.message);
return null;
}
}
/** @returns {string[]} */
getBranchIds() {
return Object.values(this.parentToBranch);
}
/** @returns {Branch[]} */
getBranches() {
const branchIds = Object.values(this.parentToBranch);
return this.treeCache.getBranches(branchIds);
}
/** @returns {boolean} */
hasChildren() {
return this.treeCache.children[this.noteId]
&amp;&amp; this.treeCache.children[this.noteId].length > 0;
return this.children.length > 0;
}
/** @returns {Promise&lt;Branch[]>} */
async getChildBranches() {
if (!this.treeCache.children[this.noteId]) {
return [];
}
/** @returns {Branch[]} */
getChildBranches() {
// don't use Object.values() to guarantee order
const branchIds = this.children.map(childNoteId => this.childToBranch[childNoteId]);
const branchIds = this.treeCache.children[this.noteId].map(
childNoteId => this.treeCache.getBranchIdByChildParent(childNoteId, this.noteId));
return await this.treeCache.getBranches(branchIds);
return this.treeCache.getBranches(branchIds);
}
/** @returns {string[]} */
getParentNoteIds() {
return this.treeCache.parents[this.noteId] || [];
return this.parents;
}
/** @returns {Promise&lt;NoteShort[]>} */
async getParentNotes() {
return await this.treeCache.getNotes(this.getParentNoteIds());
/** @returns {NoteShort[]} */
getParentNotes() {
return this.treeCache.getNotesFromCache(this.parents);
}
/** @returns {string[]} */
getChildNoteIds() {
return this.treeCache.children[this.noteId] || [];
return this.children;
}
/** @returns {Promise&lt;NoteShort[]>} */
async getChildNotes() {
return await this.treeCache.getNotes(this.getChildNoteIds());
return await this.treeCache.getNotes(this.children);
}
/**
* @param {string} [name] - attribute name to filter
* @returns {Promise&lt;Attribute[]>}
* @param {string} [type] - (optional) attribute type to filter
* @param {string} [name] - (optional) attribute name to filter
* @returns {Attribute[]} all note's attributes, including inherited ones
*/
async getAttributes(name) {
if (!this.attributeCache) {
this.attributeCache = await server.get('notes/' + this.noteId + '/attributes');
getOwnedAttributes(type, name) {
const attrs = this.attributes
.map(attributeId => this.treeCache.attributes[attributeId])
.filter(attr => !!attr);
return this.__filterAttrs(attrs, type, name)
}
/**
* @param {string} [type] - (optional) attribute type to filter
* @param {string} [name] - (optional) attribute name to filter
* @returns {Attribute[]} all note's attributes, including inherited ones
*/
getAttributes(type, name) {
const ownedAttributes = this.getOwnedAttributes();
const attrArrs = [
ownedAttributes
];
for (const templateAttr of ownedAttributes.filter(oa => oa.type === 'relation' &amp;&amp; oa.name === 'template')) {
const templateNote = this.treeCache.getNoteFromCache(templateAttr.value);
if (templateNote) {
attrArrs.push(templateNote.getAttributes());
}
}
if (name) {
return this.attributeCache.filter(attr => attr.name === name);
if (this.noteId !== 'root') {
for (const parentNote of this.getParentNotes()) {
// these virtual parent-child relationships are also loaded into frontend tree cache
if (parentNote.type !== 'search') {
attrArrs.push(parentNote.getInheritableAttributes());
}
}
}
else {
return this.attributeCache;
const attributes = attrArrs.flat();
return this.__filterAttrs(attributes, type, name);
}
__filterAttrs(attributes, type, name) {
if (type &amp;&amp; name) {
return attributes.filter(attr => attr.type === type &amp;&amp; attr.name === name);
} else if (type) {
return attributes.filter(attr => attr.type === type);
} else if (name) {
return attributes.filter(attr => attr.name === name);
} else {
return attributes;
}
}
getInheritableAttributes() {
const attrs = this.getAttributes();
return attrs.filter(attr => attr.isInheritable);
}
/**
* @param {string} [name] - label name to filter
* @returns {Promise&lt;Attribute[]>} all note's labels (attributes with type label), including inherited ones
* @returns {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);
getOwnedLabels(name) {
return this.getOwnedAttributes(LABEL, name);
}
/**
* @param {string} [name] - label name to filter
* @returns {Promise&lt;Attribute[]>} all note's label definitions, including inherited ones
* @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
*/
async getLabelDefinitions(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL_DEFINITION);
getLabels(name) {
return this.getAttributes(LABEL, name);
}
/**
* @param {string} [name] - label name to filter
* @returns {Attribute[]} all note's label definitions, including inherited ones
*/
getLabelDefinitions(name) {
return this.getAttributes(LABEL_DEFINITION, name);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), including inherited ones
* @returns {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);
getOwnedRelations(name) {
return this.getOwnedAttributes(RELATION, name);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;Attribute[]>} all note's relation definitions including inherited ones
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
*/
async getRelationDefinitions(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION_DEFINITION);
getRelations(name) {
return this.getAttributes(RELATION, name);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Attribute[]} all note's relation definitions including inherited ones
*/
getRelationDefinitions(name) {
return this.getAttributes(RELATION_DEFINITION, name);
}
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @returns {Promise&lt;boolean>} true if note has an attribute with given type and name (including inherited)
* @returns {boolean} true if note has an attribute with given type and name (including inherited)
*/
async hasAttribute(type, name) {
return !!await this.getAttribute(type, name);
hasAttribute(type, name) {
return !!this.getAttribute(type, name);
}
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @returns {Promise&lt;Attribute>} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
* @returns {boolean} true if note has an attribute with given type and name (including inherited)
*/
async getAttribute(type, name) {
const attributes = await this.getAttributes();
return attributes.find(attr => attr.type === type &amp;&amp; attr.name === name);
hasOwnedAttribute(type, name) {
return !!this.getOwnedAttribute(type, name);
}
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @returns {Promise&lt;string>} attribute value of given type and name or null if no such attribute exists.
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
*/
async getAttributeValue(type, name) {
const attr = await this.getAttribute(type, name);
getOwnedAttribute(type, name) {
const attributes = this.getOwnedAttributes(type, name);
return attributes.length > 0 ? attributes[0] : 0;
}
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
*/
getAttribute(type, name) {
const attributes = this.getAttributes(type, name);
return attributes.length > 0 ? attributes[0] : 0;
}
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @returns {string} attribute value of given type and name or null if no such attribute exists.
*/
getOwnedAttributeValue(type, name) {
const attr = this.getOwnedAttribute(type, name);
return attr ? attr.value : null;
}
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @returns {string} attribute value of given type and name or null if no such attribute exists.
*/
getAttributeValue(type, name) {
const attr = this.getAttribute(type, name);
return attr ? attr.value : null;
}
/**
* @param {string} name - label name
* @returns {Promise&lt;boolean>} true if label exists (including inherited)
* @returns {boolean} true if label exists (excluding inherited)
*/
async hasLabel(name) { return await this.hasAttribute(LABEL, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;boolean>} true if relation exists (including inherited)
*/
async hasRelation(name) { return await this.hasAttribute(RELATION, name); }
hasOwnedLabel(name) { return this.hasOwnedAttribute(LABEL, name); }
/**
* @param {string} name - label name
* @returns {Promise&lt;Attribute>} label if it exists, null otherwise
* @returns {boolean} true if label exists (including inherited)
*/
async getLabel(name) { return await this.getAttribute(LABEL, name); }
hasLabel(name) { return this.hasAttribute(LABEL, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;Attribute>} relation if it exists, null otherwise
* @returns {boolean} true if relation exists (excluding inherited)
*/
async getRelation(name) { return await this.getAttribute(RELATION, name); }
hasOwnedRelation(name) { return this.hasOwnedAttribute(RELATION, name); }
/**
* @param {string} name - relation name
* @returns {boolean} true if relation exists (including inherited)
*/
hasRelation(name) { return this.hasAttribute(RELATION, name); }
/**
* @param {string} name - label name
* @returns {Promise&lt;string>} label value if label exists, null otherwise
* @returns {Attribute} label if it exists, null otherwise
*/
async getLabelValue(name) { return await this.getAttributeValue(LABEL, name); }
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
/**
* @param {string} name - label name
* @returns {Attribute} label if it exists, null otherwise
*/
getLabel(name) { return this.getAttribute(LABEL, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;string>} relation value if relation exists, null otherwise
* @returns {Attribute} relation if it exists, null otherwise
*/
async getRelationValue(name) { return await this.getAttributeValue(RELATION, name); }
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
/**
* @param {string} name - relation name
* @returns {Attribute} relation if it exists, null otherwise
*/
getRelation(name) { return this.getAttribute(RELATION, name); }
/**
* @param {string} name - label name
* @returns {string} label value if label exists, null otherwise
*/
getOwnedLabelValue(name) { return this.getOwnedAttributeValue(LABEL, name); }
/**
* @param {string} name - label name
* @returns {string} label value if label exists, null otherwise
*/
getLabelValue(name) { return this.getAttributeValue(LABEL, name); }
/**
* @param {string} name - relation name
* @returns {string} relation value if relation exists, null otherwise
*/
getOwnedRelationValue(name) { return this.getOwnedAttributeValue(RELATION, name); }
/**
* @param {string} name - relation name
* @returns {string} relation value if relation exists, null otherwise
*/
getRelationValue(name) { return this.getAttributeValue(RELATION, name); }
/**
* @param {string} name
* @returns {Promise&lt;Note>|null} target note of the relation or null (if target is empty or note was not found)
* @returns {Promise&lt;NoteShort>|null} target note of the relation or null (if target is empty or note was not found)
*/
async getRelationTarget(name) {
const relation = await this.getRelation(name);
const targets = await this.getRelationTargets(name);
return relation ? await repository.getNote(relation.value) : null;
return targets.length > 0 ? targets[0] : null;
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;NoteShort[]>}
*/
async getRelationTargets(name) {
const relations = this.getRelations(name);
const targets = [];
for (const relation of relations) {
targets.push(await this.treeCache.getNote(relation.value));
}
return targets;
}
/**
@@ -237,7 +453,17 @@ class NoteShort {
* Cache is note instance scoped.
*/
invalidateAttributeCache() {
this.attributeCache = null;
this.__attributeCache = null;
}
/**
* Get relations which target this note
*
* @returns {Attribute[]}
*/
getTargetRelations() {
return this.targetRelations
.map(attributeId => this.treeCache.attributes[attributeId]);
}
get toString() {
@@ -247,11 +473,14 @@ class NoteShort {
get dto() {
const dto = Object.assign({}, this);
delete dto.treeCache;
delete dto.archived;
delete dto.attributeCache;
return dto;
}
getCssClass() {
const labels = this.getLabels('cssClass');
return labels.map(l => l.value).join(' ');
}
}
export default NoteShort;</code></pre>
@@ -264,13 +493,13 @@ export default NoteShort;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -95,6 +95,275 @@
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="decorateWidget"><span class="type-signature"></span>decorateWidget<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
for overriding
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line93">line 93</a>
</li></ul></dd>
</dl>
<h4 class="name" id="doRenderBody"><span class="type-signature">(async) </span>doRenderBody<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
for overriding
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line96">line 96</a>
</li></ul></dd>
</dl>
<h4 class="name" id="widgetCollapsedStateChangedEvent"><span class="type-signature"></span>widgetCollapsedStateChangedEvent<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
This event is used to synchronize collapsed state of all the tab-cached widgets since they are all rendered
separately but should behave uniformly for the user.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line86">line 86</a>
</li></ul></dd>
</dl>
@@ -204,7 +473,7 @@
<td class="description last">name of the JAM icon to be used (e.g. "clock" for "jam-clock" icon)</td>
<td class="description last">name of the boxicon to be used (e.g. "time" for "bx-time" icon)</td>
</tr>
@@ -303,7 +572,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#line56">line 56</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line76">line 76</a>
</li></ul></dd>
@@ -333,13 +602,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -50,13 +50,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -0,0 +1,280 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: exports</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: exports</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>exports<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">blaa vlaa</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="exports"><span class="type-signature"></span>new exports<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_keyboard_actions.js.html">services/keyboard_action.js</a>, <a href="services_keyboard_actions.js.html#line5">line 5</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="JUMP_TO"><span class="type-signature"></span>JUMP_TO<span class="type-signature"></span></h4>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_keyboard_actions.js.html">services/keyboard_action.js</a>, <a href="services_keyboard_actions.js.html#line7">line 7</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="module.exports.html">exports</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@@ -1,12 +1,12 @@
/*global document */
(function() {
var source = document.getElementsByClassName('prettyprint source linenums');
var i = 0;
var lineNumber = 0;
var lineId;
var lines;
var totalLines;
var anchorHash;
(() => {
const source = document.getElementsByClassName('prettyprint source linenums');
let i = 0;
let lineNumber = 0;
let lineId;
let lines;
let totalLines;
let anchorHash;
if (source && source[0]) {
anchorHash = document.location.hash.substring(1);
@@ -15,7 +15,7 @@
for (; i < totalLines; i++) {
lineNumber++;
lineId = 'line' + lineNumber;
lineId = `line${lineNumber}`;
lines[i].id = lineId;
if (lineId === anchorHash) {
lines[i].className += ' selected';

View File

@@ -29,14 +29,19 @@
<pre class="prettyprint source linenums"><code>import treeService from './tree.js';
import server from './server.js';
import utils from './utils.js';
import infoService from './info.js';
import toastService from './toast.js';
import linkService from './link.js';
import treeCache from './tree_cache.js';
import noteDetailService from './note_detail.js';
import noteTypeService from './note_type.js';
import noteTooltipService from './note_tooltip.js';
import protectedSessionService from'./protected_session.js';
import dateNotesService from'./date_notes.js';
import protectedSessionService from './protected_session.js';
import dateNotesService from './date_notes.js';
import CollapsibleWidget from '../widgets/collapsible_widget.js';
import ws from "./ws.js";
import hoistedNoteService from "./hoisted_note.js";
import appContext from "./app_context.js";
import TabAwareWidget from "../widgets/tab_aware_widget.js";
import TabCachingWidget from "../widgets/tab_caching_widget.js";
import BasicWidget from "../widgets/basic_widget.js";
/**
* This is the main frontend API interface for scripts. It's published in the local "api" object.
@@ -44,9 +49,12 @@ import dateNotesService from'./date_notes.js';
* @constructor
* @hideconstructor
*/
function FrontendScriptApi(startNote, currentNote, originEntity = null, tabContext = null) {
function FrontendScriptApi(startNote, currentNote, originEntity = null, $container = null) {
const $pluginButtons = $("#plugin-buttons");
/** @property {jQuery} container of all the rendered script content */
this.$container = $container;
/** @property {object} note where script started executing */
this.startNote = startNote;
/** @property {object} note where script is currently executing */
@@ -57,8 +65,17 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
// to keep consistency with backend API
this.dayjs = dayjs;
/** @property {TabContext|null} - experimental! */
this.tabContext = tabContext;
/** @property {CollapsibleWidget} */
this.CollapsibleWidget = CollapsibleWidget;
/** @property {TabAwareWidget} */
this.TabAwareWidget = TabAwareWidget;
/** @property {TabCachingWidget} */
this.TabCachingWidget = TabCachingWidget;
/** @property {BasicWidget} */
this.BasicWidget = BasicWidget;
/**
* Activates note in the tree and in the note detail.
@@ -67,24 +84,27 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
* @param {string} notePath (or noteId)
* @returns {Promise&lt;void>}
*/
this.activateNote = treeService.activateNote;
this.activateNote = async notePath => {
await appContext.tabManager.getActiveTabContext().setNote(notePath);
};
/**
* Activates newly created note. Compared to this.activateNote() also refreshes tree.
* Activates newly created note. Compared to this.activateNote() also makes sure that frontend has been fully synced.
*
* @param {string} notePath (or noteId)
* @return {Promise&lt;void>}
*/
this.activateNewNote = async notePath => {
await treeService.reload();
await ws.waitForMaxKnownSyncId();
await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle);
await appContext.tabManager.getActiveTabContext().setNote(notePath);
appContext.triggerEvent('focusAndSelectTitle');
};
/**
* @typedef {Object} ToolbarButtonOptions
* @property {string} title
* @property {string} [icon] - name of the JAM icon to be used (e.g. "clock" for "jam-clock" icon)
* @property {string} [icon] - name of the boxicon to be used (e.g. "time" for "bx-time" icon)
* @property {function} action - callback handling the click on the button
* @property {string} [shortcut] - keyboard shortcut for the button, e.g. "alt+t"
*/
@@ -99,10 +119,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
const button = $('&lt;button>')
.addClass("btn btn-sm")
.click(opts.action);
.on('click', opts.action);
if (opts.icon) {
button.append($("&lt;span>").addClass("jam jam-" + opts.icon))
button.append($("&lt;span>").addClass("bx bx-" + opts.icon))
.append("&amp;nbsp;");
}
@@ -115,7 +135,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
}
if (opts.shortcut) {
$(document).bind('keydown', opts.shortcut, opts.action);
utils.bindGlobalShortcut(opts.shortcut, opts.action);
button.attr("title", "Shortcut " + opts.shortcut);
}
@@ -137,14 +157,14 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
}
/**
* Executes given anonymous function on the server.
* Executes given anonymous function on the backend.
* Internally this serializes the anonymous function into string and sends it to backend via AJAX.
*
* @param {string} script - script to be executed on the backend
* @param {Array.&lt;?>} params - list of parameters to the anonymous function to be send to backend
* @return {Promise&lt;*>} return value of the executed function on the backend
*/
this.runOnServer = async (script, params = []) => {
this.runOnBackend = async (script, params = []) => {
if (typeof script === "function") {
script = script.toString();
}
@@ -156,9 +176,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
currentNoteId: currentNote.noteId,
originEntityName: "notes", // currently there's no other entity on frontend which can trigger event
originEntityId: originEntity ? originEntity.noteId : null
});
}, "script");
if (ret.success) {
// wait until all the changes done in the script has been synced to frontend before continuing
await ws.waitForSyncId(ret.maxSyncId);
return ret.executionResult;
}
else {
@@ -166,6 +189,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
}
};
/**
* @deprecated new name of this API call is runOnBackend so use that
* @method
*/
this.runOnServer = this.runOnBackend;
/**
* This is a powerful search method - you can search by attributes and their values, e.g.:
* "@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
@@ -219,16 +248,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
this.getNotes = async (noteIds, silentNotFoundError = false) => await treeCache.getNotes(noteIds, silentNotFoundError);
/**
* @param {string} noteId
* Update frontend tree (note) cache from the backend.
*
* @param {string[]} noteIds
* @method
*/
this.reloadChildren = async noteId => await treeCache.reloadChildren(noteId);
/**
* @param {string} noteId
* @method
*/
this.reloadParents = async noteId => await treeCache.reloadParents(noteId);
this.reloadNotes = async noteIds => await treeCache.reloadNotes(noteIds);
/**
* Instance name identifies particular Trilium instance. It can be useful for scripts
@@ -258,7 +283,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
* @method
* @param {string} message
*/
this.showMessage = infoService.showMessage;
this.showMessage = toastService.showMessage;
/**
* Show error message to the user.
@@ -266,15 +291,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
* @method
* @param {string} message
*/
this.showError = infoService.showError;
this.showError = toastService.showError;
/**
* Refresh tree
*
* @method
* @returns {Promise&lt;void>}
* @deprecated - this is now no-op since all the changes should be gracefully handled per widget
*/
this.refreshTree = treeService.reload;
this.refreshTree = () => {};
/**
* Create note link (jQuery object) for given note.
@@ -286,57 +309,32 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
this.createNoteLink = linkService.createNoteLink;
/**
* Adds given text to the editor cursor
*
* @param {string} text - this must be clear text, HTML is not supported.
* @method
* @returns {NoteFull} active note (loaded into right pane)
*/
this.getActiveNote = noteDetailService.getActiveNote;
this.addTextToActiveTabEditor = text => appContext.triggerCommand('addTextToActiveEditor', {text});
/**
* @method
* @returns {NoteShort} active note (loaded into right pane)
*/
this.getActiveTabNote = () => appContext.tabManager.getActiveTabNote();
/**
* See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html for a documentation on the returned instance.
*
* @method
* @param callback - method receiving "textEditor" instance
*/
this.getActiveTabTextEditor = callback => appContext.triggerCommand('executeInActiveEditor', {callback});
/**
* @method
* @returns {Promise&lt;string|null>} returns note path of active note or null if there isn't active note
*/
this.getActiveNotePath = () => {
const activeTabContext = noteDetailService.getActiveTabContext();
return activeTabContext ? activeTabContext.notePath : null;
};
/**
* This method checks whether user navigated away from the note from which the scripts has been started.
* This is necessary because script execution is async and by the time it is finished, the user might have
* already navigated away from this page - the end result would be that script might return data for the wrong
* note.
*
* @method
* @return {boolean} returns true if the original note is still loaded, false if user switched to another
*/
this.isNoteStillActive = () => {
return this.originEntity.noteId === noteDetailService.getActiveNoteId();
};
/**
* @method
* @param {function} func - callback called on note change as user is typing (not necessarily tied to save event)
*/
this.onNoteChange = noteDetailService.onNoteChange;
/**
* @method
* @returns {array} list of default code mime types
*/
this.getDefaultCodeMimeTypes = noteTypeService.getDefaultCodeMimeTypes;
/**
* @method
* @returns {array} list of currently used code mime types
*/
this.getCodeMimeTypes = noteTypeService.getCodeMimeTypes;
/**
* @method
* @param {array} types - list of mime types to be used
*/
this.setCodeMimeTypes = noteTypeService.setCodeMimeTypes;
this.getActiveTabNotePath = () => appContext.tabManager.getActiveTabNotePath();
/**
* @method
@@ -345,9 +343,32 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
this.setupElementTooltip = noteTooltipService.setupElementTooltip;
/**
* @deprecated use protectNote and protectSubtree instead
* @method
*/
this.protectActiveNote = protectedSessionService.protectNoteAndSendToServer;
this.protectActiveNote = async () => {
const activeNote = appContext.tabManager.getActiveTabNote();
await protectedSessionService.protectNote(activeNote.noteId, true, false);
};
/**
* @method
* @param {string} noteId
* @param {boolean} protect - true to protect note, false to unprotect
*/
this.protectNote = async (noteId, protect) => {
await protectedSessionService.protectNote(noteId, protect, false);
};
/**
* @method
* @param {string} noteId
* @param {boolean} protect - true to protect subtree, false to unprotect
*/
this.protectSubTree = async (noteId, protect) => {
await protectedSessionService.protectNote(noteId, protect, true);
};
/**
* Returns date-note for today. If it doesn't exist, it is automatically created.
@@ -383,6 +404,33 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
* @return {Promise&lt;NoteShort>}
*/
this.getYearNote = dateNotesService.getYearNote;
/**
* Hoist note. See https://github.com/zadam/trilium/wiki/Note-hoisting
*
* @method
* @param {string} noteId - set hoisted note. 'root' will effectively unhoist
* @return {Promise}
*/
this.setHoistedNoteId = hoistedNoteService.setHoistedNoteId;
/**
* @method
* @param {string} keyboardShortcut - e.g. "ctrl+shift+a"
* @param {function} handler
*/
this.bindGlobalShortcut = utils.bindGlobalShortcut;
/**
* Trilium runs in backend and frontend process, when something is changed on the backend from script,
* frontend will get asynchronously synchronized.
*
* This method returns a promise which resolves once all the backend -> frontend synchronization is finished.
* Typical use case is when new note has been created, we should wait until it is synced into frontend and only then activate it.
*
* @method
*/
this.waitUntilSynced = ws.waitForMaxKnownSyncId;
}
export default FrontendScriptApi;</code></pre>
@@ -395,13 +443,13 @@ export default FrontendScriptApi;</code></pre>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -0,0 +1,280 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: services/keyboard_action.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: services/keyboard_action.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* blaa vlaa
*/
class KeyboardAction {
constructor(params) {
this.optionName = params.optionName;
}
}
/**
* Open "Jump to note" dialog
* @static
*/
KeyboardAction.JumpToNote = new KeyboardAction({
optionName: "JumpToNote",
defaultShortcuts: "mod+j",
description: 'Open "Jump to note" dialog'
});
/** @static */
KeyboardAction.MarkdownToHTML = new KeyboardAction({
optionName: "MarkdownToHTML",
defaultShortcuts: "mod+return"
});
/** @static */
KeyboardAction.NewTab = new KeyboardAction({
optionName: "NewTab",
defaultShortcuts: "mod+t"
});
/** @static */
KeyboardAction.CloseTab = new KeyboardAction({
optionName: "CloseTab",
defaultShortcuts: "mod+w"
});
/** @static */
KeyboardAction.NextTab = new KeyboardAction({
optionName: "NextTab",
defaultShortcuts: "mod+tab"
});
/** @static */
KeyboardAction.PreviousTab = new KeyboardAction({
optionName: "PreviousTab",
defaultShortcuts: "mod+shift+tab"
});
/** @static */
KeyboardAction.CreateNoteAfter = new KeyboardAction({
optionName: "CreateNoteAfter",
defaultShortcuts: "mod+o"
});
/** @static */
KeyboardAction.CreateNoteInto = new KeyboardAction({
optionName: "CreateNoteInto",
defaultShortcuts: "mod+p"
});
/** @static */
KeyboardAction.ScrollToActiveNote = new KeyboardAction({
optionName: "ScrollToActiveNote",
defaultShortcuts: "mod+."
});
/** @static */
KeyboardAction.CollapseTree = new KeyboardAction({
optionName: "CollapseTree",
defaultShortcuts: "alt+c"
});
/** @static */
KeyboardAction.RunSQL = new KeyboardAction({
optionName: "RunSQL",
defaultShortcuts: "mod+return"
});
/** @static */
KeyboardAction.FocusNote = new KeyboardAction({
optionName: "FocusNote",
defaultShortcuts: "return"
});
/** @static */
KeyboardAction.RunCurrentNote = new KeyboardAction({
optionName: "RunCurrentNote",
defaultShortcuts: "mod+return"
});
/** @static */
KeyboardAction.ClipboardCopy = new KeyboardAction({
optionName: "ClipboardCopy",
defaultShortcuts: "mod+c"
});
/** @static */
KeyboardAction.ClipboardPaste = new KeyboardAction({
optionName: "ClipboardPaste",
defaultShortcuts: "mod+v"
});
/** @static */
KeyboardAction.ClipboardCut = new KeyboardAction({
optionName: "ClipboardCut",
defaultShortcuts: "mod+x"
});
/** @static */
KeyboardAction.SelectAllNotesInParent = new KeyboardAction({
optionName: "SelectAllNotesInParent",
defaultShortcuts: "mod+a"
});
/** @static */
KeyboardAction.Undo = new KeyboardAction({
optionName: "Undo",
defaultShortcuts: "mod+z"
});
/** @static */
KeyboardAction.Redo = new KeyboardAction({
optionName: "Redo",
defaultShortcuts: "mod+y"
});
/** @static */
KeyboardAction.AddLinkToText = new KeyboardAction({
optionName: "AddLinkToText",
defaultShortcuts: "mod+l"
});
/** @static */
KeyboardAction.CloneNotesTo = new KeyboardAction({
optionName: "CloneNotesTo",
defaultShortcuts: "mod+shift+c"
});
/** @static */
KeyboardAction.MoveNotesTo = new KeyboardAction({
optionName: "MoveNotesTo",
defaultShortcuts: "mod+shift+c"
});
/** @static */
KeyboardAction.SearchNotes = new KeyboardAction({
optionName: "SearchNotes",
defaultShortcuts: "mod+s"
});
/** @static */
KeyboardAction.ShowAttributes = new KeyboardAction({
optionName: "ShowAttributes",
defaultShortcuts: "alt+a"
});
/** @static */
KeyboardAction.ShowHelp = new KeyboardAction({
optionName: "ShowHelp",
defaultShortcuts: "f1"
});
/** @static */
KeyboardAction.OpenSQLConsole = new KeyboardAction({
optionName: "OpenSQLConsole",
defaultShortcuts: "alt+o"
});
/** @static */
KeyboardAction.BackInNoteHistory = new KeyboardAction({
optionName: "BackInNoteHistory",
defaultShortcuts: "alt+left"
});
/** @static */
KeyboardAction.ForwardInNoteHistory = new KeyboardAction({
optionName: "ForwardInNoteHistory",
defaultShortcuts: "alt+right"
});
/** @static */
KeyboardAction.ToggleZenMode = new KeyboardAction({
optionName: "ToggleZenMode",
defaultShortcuts: "alt+m"
});
/** @static */
KeyboardAction.InsertDateTime = new KeyboardAction({
optionName: "InsertDateTime",
defaultShortcuts: "alt+t"
});
/** @static */
KeyboardAction.ReloadApp = new KeyboardAction({
optionName: "ReloadApp",
defaultShortcuts: ["f5", "mod+r"]
});
/** @static */
KeyboardAction.OpenDevTools = new KeyboardAction({
optionName: "OpenDevTools",
defaultShortcuts: "mod+shift+i"
});
/** @static */
KeyboardAction.FindInText = new KeyboardAction({
optionName: "FindInText",
defaultShortcuts: "mod+f"
});
/** @static */
KeyboardAction.ToggleFullscreen = new KeyboardAction({
optionName: "ToggleFullscreen",
defaultShortcuts: "f11"
});
/** @static */
KeyboardAction.ZoomOut = new KeyboardAction({
optionName: "ZoomOut",
defaultShortcuts: "mod+-"
});
/** @static */
KeyboardAction.ZoomIn = new KeyboardAction({
optionName: "ZoomIn",
defaultShortcuts: "mod+="
});
export default KeyboardAction;</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="KeyboardAction.html">KeyboardAction</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: services/keyboard_action.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: services/keyboard_action.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* blaa vlaa
*/
class KeyboardActions {
constructor() {
/** @property {string} */
this.JUMP_TO = "";
}
}
export default KeyboardActions;</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="KeyboardActions.html">KeyboardActions</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More