Compare commits

...

578 Commits

Author SHA1 Message Date
zadam
b48474998b release 0.30.3-beta 2019-03-03 20:47:50 +01:00
zadam
95d8f07458 debugging info for image shrinking 2019-03-03 20:41:03 +01:00
zadam
e628c30c89 fix OPML export to include correct OPML version 2019-03-03 19:43:30 +01:00
zadam
52a8aae74f moved test enex files to separate repo 2019-03-03 19:40:47 +01:00
zadam
54b5898582 detect mime types from the filename instead of relying on upload mime type 2019-03-03 00:25:31 +01:00
zadam
64974d75d5 added sync fill for note_contents 2019-03-02 19:59:32 +01:00
zadam
bd118027fb note content is also part of hash check 2019-03-02 12:40:46 +01:00
zadam
36de217835 release 0.30.2-beta 2019-02-28 22:33:33 +01:00
zadam
b5283d58bb nicer underlining under tooltip items 2019-02-28 22:32:54 +01:00
zadam
8414d97ffa improve logging a little bit 2019-02-27 22:15:52 +01:00
zadam
9f30d4e673 fix image caption editing (#422) 2019-02-26 22:59:38 +01:00
zadam
8e0d1fa0df better contrast of links on the dark theme 2019-02-26 22:51:33 +01:00
zadam
5b251b9977 added drag & drop files on note detail 2019-02-26 21:37:15 +01:00
zadam
8b3e721028 added "explodeArchives" option to the import dialog 2019-02-25 22:38:48 +01:00
zadam
7e2a2baa5d drag & drop now uses import code 2019-02-25 22:28:15 +01:00
zadam
003eed368b unify markdown mime to text/x-markdown 2019-02-25 21:57:11 +01:00
zadam
4b1cf05c0e import images 2019-02-25 21:22:57 +01:00
zadam
d9429c4f4b import plain text file as text/html 2019-02-24 13:10:47 +01:00
zadam
b7bd94b6b0 switchable image shrinking 2019-02-24 12:25:34 +01:00
zadam
51bbc10744 switchable image shrinking 2019-02-24 12:24:28 +01:00
zadam
fb5df33ee7 new import options in the dialog, tooltips 2019-02-24 11:36:01 +01:00
zadam
d8ba0ccd7d use formdata to pass text arguments during import instead of request path 2019-02-24 09:56:00 +01:00
zadam
886ea6c68c allow import of multiple files at the same time 2019-02-24 09:34:50 +01:00
zadam
936f85c09e drag & drop multi file upload to note tree 2019-02-23 20:33:27 +01:00
zadam
b25deea21d fixes for relative paths 2019-02-22 23:03:20 +01:00
zadam
cf5ec44303 another fix for debian package upload 2019-02-20 23:22:04 +01:00
zadam
6f956c2415 release 0.30.1-beta 2019-02-20 23:08:36 +01:00
zadam
3533160bef fix initial document setup 2019-02-20 23:07:57 +01:00
zadam
60cbfdcabd update API docs 2019-02-20 22:24:51 +01:00
zadam
604f036a54 fix debian package upload 2019-02-20 22:10:19 +01:00
zadam
dd4f3ec264 release 0.30.0-beta 2019-02-20 21:58:31 +01:00
zadam
ff67b8a0ba initial debian package support 2019-02-20 21:58:23 +01:00
zadam
1d5fb0b646 add possibility to create week note, closes #416 2019-02-19 22:49:57 +01:00
zadam
80931a318f exposing APIs to get month and year note, #416 2019-02-19 21:29:41 +01:00
zadam
16f16cb36a fixed API for Trilium Sender, closes #415 2019-02-19 21:24:35 +01:00
zadam
899f24cde5 minor node upgrades 2019-02-17 22:56:33 +01:00
zadam
9f29521ab8 disable caching of note autocomplete for more accurate results 2019-02-17 20:59:52 +01:00
zadam
c1ce0c6b22 avoid various HTTP server issues with slashes by putting notePath into the body with POST 2019-02-17 20:49:51 +01:00
zadam
a7fce33750 OPML v2 export 2019-02-16 23:58:42 +01:00
zadam
6fd8e73150 UI for export of OPML v2, WIP 2019-02-16 23:33:40 +01:00
zadam
1359dd86c2 OPML 2 import, closes #298, #286 2019-02-16 22:13:29 +01:00
zadam
a1b610fc50 full screen help dialog 2019-02-16 19:42:58 +01:00
zadam
c849d719e9 styling for external links 2019-02-16 18:49:57 +01:00
zadam
96de2e7008 fixed saved search 2019-02-15 21:21:26 +01:00
zadam
f140b77e7c fix migration script 2019-02-15 21:10:00 +01:00
zadam
22228de63b sync changes for note content 2019-02-15 00:15:09 +01:00
zadam
b0596c9eb2 removed noteId display in the note detail, #408 2019-02-14 20:57:56 +01:00
zadam
2a2319d434 created note info dialog, closes #408 2019-02-14 20:56:33 +01:00
zadam
dad47d115f fixes for SQL console schema view 2019-02-13 23:27:00 +01:00
zadam
502026359c help page, closes #273 2019-02-13 23:06:11 +01:00
zadam
47b0e4e4d3 Save electron window size and position, closes #186 2019-02-12 22:42:40 +01:00
zadam
6c927d9159 Merge remote-tracking branch 'origin/note-content' 2019-02-12 21:14:42 +01:00
zadam
ddc79b2517 release 0.29.1 2019-02-12 20:30:07 +01:00
zadam
4c2e12d2cb upgrade to bootstrap 4.3.0 2019-02-12 20:26:28 +01:00
zadam
14f7a8b7b9 safe import implementation 2019-02-11 23:45:58 +01:00
zadam
caa7dd9619 prettier progress count 2019-02-10 22:56:14 +01:00
zadam
8aa7e2d0a0 fixes in opml export and note content loading 2019-02-10 22:45:44 +01:00
zadam
6be8a3f343 added progress also to export 2019-02-10 22:30:55 +01:00
zadam
a097cefba7 import error handling 2019-02-10 19:53:57 +01:00
zadam
e4c78f3887 added ImportContext 2019-02-10 19:36:03 +01:00
zadam
5baa251944 more changes to import reporting through WS 2019-02-10 16:59:50 +01:00
zadam
cde68abec9 progress of tar import through WS 2019-02-10 16:36:25 +01:00
zadam
51175e3676 import/export refactorign 2019-02-10 15:33:56 +01:00
zadam
45ddfef30a new import dialog 2019-02-10 14:33:13 +01:00
zadam
1e1d78999e some help dialog content 2019-02-10 12:19:48 +01:00
zadam
92fcd7b345 sql console added to global menu and now has schema info 2019-02-10 10:38:18 +01:00
zadam
e04f1cd574 help button with no help dialog yet 2019-02-09 19:48:19 +01:00
zadam
176c3a5d51 added dev tools to global menu 2019-02-09 19:25:55 +01:00
zadam
c09570cf39 global menu 2019-02-09 19:17:16 +01:00
zadam
4a093000be note content refactoring, WIP 2019-02-08 21:01:26 +01:00
zadam
6952b643ae note content refactoring, WIP 2019-02-07 22:16:40 +01:00
zadam
c487a95bc7 note content refactoring, WIP 2019-02-06 21:29:23 +01:00
zadam
8884177d9f split out note's content into separate entity, WIP 2019-02-06 20:19:25 +01:00
zadam
8b250ed523 fix upload of the same file in succession, #388 2019-02-03 17:44:06 +01:00
zadam
d8b78d8025 check reference issues only for non deleted entities 2019-02-03 16:27:26 +01:00
zadam
42112b8053 fix consistency check 2019-02-03 16:22:45 +01:00
zadam
6cc0dd5a80 release 0.29.0-beta 2019-02-03 15:44:19 +01:00
zadam
afd5f4823f added Steel Blue theme to demo document 2019-02-03 15:39:27 +01:00
zadam
b0cf82c91b fix 2019-02-03 15:37:01 +01:00
zadam
6a67cdd5af appThemeClass is redundant 2019-02-03 15:35:37 +01:00
zadam
bad7b84993 error handling in custom request handler 2019-02-03 11:15:32 +01:00
zadam
d3ca6b5ae6 styling for scrollbar which looks ugly otherwise in dark themes 2019-02-03 10:21:28 +01:00
zadam
da5009f089 main border color CSS variable 2019-02-03 10:09:59 +01:00
zadam
c08524c977 fix CSS class of user theme 2019-02-03 00:12:57 +01:00
zadam
f89537037e small styling fixes 2019-02-02 23:51:00 +01:00
zadam
c153793766 added CSS variable for disabled button background 2019-02-02 23:26:39 +01:00
zadam
0aec5927d5 added missing labels customRequestHandler, customResourceProvider to autocomplete 2019-02-02 22:33:02 +01:00
zadam
8aea9a1801 added font family CSS variables to theming API 2019-02-02 20:45:38 +01:00
zadam
73247e3220 minor library updates 2019-02-02 19:21:30 +01:00
zadam
89344a6eda final fixes and refactorings for consistency checks 2019-02-02 12:41:20 +01:00
zadam
40d2e6ea83 refactoring consistency checks WIP 2019-02-02 11:26:27 +01:00
zadam
910cfe9a17 refactoring consistency checks WIP 2019-02-02 10:38:33 +01:00
zadam
e58a80fc00 consistency checks WIP 2019-02-02 09:26:57 +01:00
zadam
4a2319cb33 refactoring of consistency checks plus some autofixers 2019-02-01 22:48:51 +01:00
zadam
5619088c41 raise payload size limit to 500 MB #395 2019-01-29 21:19:08 +01:00
zadam
60271993eb Merge pull request #392 from jkurei/ios_favicon
Better icon for iOS' homescreen
2019-01-28 23:01:12 +01:00
jkurei
6695e8b011 Better icon for iOS' homescreen 2019-01-28 22:48:01 +01:00
zadam
707df18b93 added type and mime classes on body as well #383 2019-01-28 21:42:37 +01:00
zadam
90895f1288 added noteId to file view 2019-01-27 23:10:37 +01:00
zadam
ba1ca506af change in referencing CSS resources to allow easier relative linking 2019-01-27 22:34:41 +01:00
zadam
f90ed99a40 fix leaf node having angle bracket in dark & black themes, closes #387 2019-01-27 21:54:24 +01:00
zadam
67630b1a22 options now allow selecting user theme 2019-01-27 21:18:11 +01:00
zadam
2c1580ea65 appCss/appTheme are now loaded as external CSS files instead of inline styles 2019-01-27 17:01:37 +01:00
zadam
840a0b5f64 custom handler refactoring 2019-01-27 16:37:18 +01:00
zadam
b39f6ef7ad bug fixes for custom handlers 2019-01-27 15:47:40 +01:00
zadam
fb27088fcd smaller children overview font 2019-01-27 14:26:39 +01:00
azivner
76fbff68ba added readOnly attribute which puts text editor into readonly mode #371 2019-01-27 13:10:03 +01:00
azivner
54de4d236d custom HTTP handler which triggers associated script notes WIP, #356 2019-01-27 12:28:20 +01:00
azivner
e211dd65ad exit on detection of not supported node version, #324 2019-01-26 19:59:51 +01:00
azivner
a87f4d8653 search can be triggered from URL, closes #385 2019-01-25 22:18:34 +01:00
azivner
b59c175c2e add HTML header with UTF-8 meta encoding declaration to exported HTML files, fixes #384 2019-01-25 21:34:14 +01:00
azivner
580104c4c5 using trilium's confirm dialog, small refactoring 2019-01-24 22:18:31 +01:00
zadam
0fc3053b0a Merge pull request #377 from flurmbo/master
add confirm type change dialog when note not empty
2019-01-24 22:12:09 +01:00
Phil Marshall
929e0f69c2 add confirm type change dialog when note not empty 2019-01-23 15:15:24 -06:00
azivner
e70af1300a drag and drop moves multiple items only if CTRL is pressed, active note has now bold text for more differentiation from selected note 2019-01-23 21:13:04 +01:00
azivner
4d0e46021b Mac uses CMD+Left, CMD+Right for history navigation, closes #376 2019-01-23 20:15:33 +01:00
azivner
1a9a49b739 release 0.28.3 2019-01-22 23:01:32 +01:00
azivner
2ac560c56e text note should change its icon after having new note inserted into, fixes #361 2019-01-22 21:21:44 +01:00
azivner
c23387c0fb make search dialog more responsive in narrow sidebar, fixes #367 2019-01-22 20:54:00 +01:00
azivner
0ff250fe15 font sizes were not created for new documents - fix plus migration for existing ones 2019-01-22 20:34:45 +01:00
azivner
52b1e58b26 make tree selection more visually consistent 2019-01-22 20:23:54 +01:00
azivner
484715e440 fix icon in desktop linux build, fixes #372 2019-01-22 19:49:33 +01:00
azivner
9d42c3d802 release 0.28.2 2019-01-21 22:55:12 +01:00
azivner
c654172d33 auto fixer for "undeleted branch of deleted note" consistency check 2019-01-21 22:51:49 +01:00
azivner
e17b26c883 revert consistency checks refactoring for now 2019-01-21 22:46:27 +01:00
azivner
24d02d9cf5 fix in task manager script to not error out so much on deletion 2019-01-21 22:05:37 +01:00
azivner
7208a311ac check that note is not deleted before creating a branch 2019-01-21 21:55:40 +01:00
azivner
ad7355372b issue template 2019-01-21 19:55:07 +01:00
azivner
f18b5babad uncommented issue template 2019-01-20 16:47:49 +01:00
azivner
9831ec0ca9 added issue template 2019-01-20 16:46:56 +01:00
azivner
596544eca3 fix setNoteToParent API method, closes #360 2019-01-20 16:33:09 +01:00
azivner
1f853024ee more autofixers WIP 2019-01-19 09:57:51 +01:00
azivner
0308b13460 expose app info on the backend script api #345 2019-01-18 23:57:08 +01:00
azivner
06b8a82f70 refactoring of consistency checks + some auto fixers 2019-01-18 19:32:59 +01:00
azivner
91ca07929d before we clone the note we must make sure it's not deleted 2019-01-17 23:24:59 +01:00
azivner
afabaa5fdb workaround for hidden last line on mobile 2019-01-17 21:13:53 +01:00
azivner
a6fd3fa77c release 0.28.1-beta 2019-01-17 00:03:17 +01:00
azivner
58a2c08dcd release 0.28.1-beta 2019-01-16 23:58:10 +01:00
azivner
299bbff2f4 fix too large font on mobile 2019-01-16 23:57:09 +01:00
azivner
19d8947123 runOnNoteChange fires also on the frontend, closes #340 2019-01-16 22:52:32 +01:00
azivner
35edce7523 fix crazy clipboard operation on mac setup, closes #348 2019-01-16 22:03:30 +01:00
azivner
bc4cec69a5 use local dates to create day notes, closes #337 2019-01-15 23:46:01 +01:00
azivner
cce8c1b674 create top level note and collapse tree now work relative to hoisted note, closes #343 2019-01-15 20:30:54 +01:00
azivner
aa58788769 added basic DB size diagnostic log 2019-01-15 20:00:24 +01:00
azivner
6c62ab7a52 removing logging params for slow queries 2019-01-15 19:36:04 +01:00
azivner
d6ab638b30 fix file names in github release script 2019-01-15 00:10:47 +01:00
azivner
bd4db406de release 0.28.0-beta 2019-01-14 23:51:55 +01:00
azivner
e50f9cd0a3 fix device detection in setup 2019-01-14 23:50:45 +01:00
azivner
2b64cbce2c added dark theme (to have same set of themes as before) 2019-01-13 23:25:30 +01:00
azivner
2797c942ab changes to options dialog to allow configuring font size, closes #326 2019-01-13 22:03:06 +01:00
azivner
f1c3278874 store font size in options #326 2019-01-13 21:27:32 +01:00
azivner
424c22dcde split UI to 3 different font sizes #326 2019-01-13 21:16:51 +01:00
azivner
5c223dfd12 all fonts are relative so it's easier to scale them properly 2019-01-13 21:04:08 +01:00
azivner
6a3e7a5a8e generate css classes for each mime type, #328 2019-01-13 20:14:33 +01:00
azivner
f88cdac000 fixes for black theme for relation map and code notes 2019-01-13 20:03:28 +01:00
azivner
eeead90f32 improved theme support using CSS variables, #328 2019-01-13 18:57:46 +01:00
azivner
b607857409 fix weight tracker demo to use relations instead of hardcoded noteId, fixes #329 2019-01-13 12:21:17 +01:00
azivner
9268f88bc3 frontend scripts now have startNote, currentNote and targetNote as NoteShort entities which e.g. provides easy access to relations/labels 2019-01-13 12:16:05 +01:00
azivner
f7f0560a9f simplification of script bundles on backend 2019-01-13 11:56:50 +01:00
azivner
3d8905207e fixed export with non-ASCII characters in note title, fixes #285, #331 2019-01-13 10:22:17 +01:00
azivner
dbc312010b update fancytree to 2.30.2 2019-01-13 09:24:00 +01:00
azivner
b115a7cf19 delete note through its entity instead of manually with SQL, closes #303 2019-01-13 00:24:51 +01:00
azivner
348562352c fixes in ASAR build and zipping 2019-01-12 19:48:45 +01:00
azivner
70fd917e7c build desktop versions into ASAR, closes #271 2019-01-12 00:05:13 +01:00
zadam
d2b60764cd Merge pull request #289 from perissology/electron-builder
use electron-builder for dev install
2019-01-11 23:54:11 +01:00
azivner
581b1fdaa5 trigger runOnAttributeChange, runOnNoteChange on entity deletions as well 2019-01-11 23:43:22 +01:00
azivner
3c19a712c0 active protected state button has darker background and is disabled 2019-01-11 23:29:56 +01:00
azivner
cc27f16088 store iv directly in the respective columns 2019-01-11 23:04:51 +01:00
azivner
dffdb82288 after creating new note, it is focused and now also selected so renaming is super easy, #318 2019-01-10 22:46:08 +01:00
azivner
2b32addade release 0.27.4 2019-01-10 21:31:30 +01:00
azivner
0b251530fa open recent notes autocomplete by focus so it is then closed with blur, fixes #272 2019-01-10 21:04:06 +01:00
azivner
f5b933149a Merge remote-tracking branch 'origin/master' 2019-01-10 19:53:47 +01:00
azivner
48bbfb8bdb fix activating note by noteId when hoisting, fixes #320 2019-01-10 19:53:42 +01:00
zadam
889971c4d6 Merge pull request #312 from perissology/evernote-import
Fixes evernote import errors
2019-01-09 23:41:17 +01:00
azivner
0722494d41 fix saving JSON note with invalid JSON (previously in such a case content was not updated), fixes #307 2019-01-09 23:36:17 +01:00
azivner
4b977a3306 setup keyboard shortcuts on the setup page as well, closes #267 2019-01-09 22:08:24 +01:00
azivner
3ff3021acd shortcuts for mac should use cmd instead of ctrl, closes #290 2019-01-09 21:42:16 +01:00
azivner
99e56a9c42 make sure to save the search note before refreshing the tree 2019-01-09 19:54:32 +01:00
azivner
77279dfe16 fix anonymization 2019-01-09 19:49:02 +01:00
perissology
93f8050454 use resizedImage if image optimization fails 2019-01-09 06:29:49 -08:00
perissology
31cfede7a7 enex import: attempt to get correct mime from Buffer 2019-01-09 06:29:13 -08:00
azivner
c8ec86e537 allow refreshing saved note, closes #304 2019-01-08 23:32:03 +01:00
azivner
05aee884b6 fix saving search note content #304 2019-01-08 22:48:53 +01:00
azivner
012ba9e060 don't attempt to run protected notes outside of protected session, fixes #279 2019-01-08 21:21:49 +01:00
azivner
8e8fd88857 process only whitelisted mime types as an image, fixes #288 2019-01-08 20:45:34 +01:00
azivner
523ccdad6b reload note cache after import, closes #293 2019-01-08 20:19:41 +01:00
azivner
ded3f605be fix almost invisible buttons on options page, closes #297 2019-01-08 19:47:35 +01:00
perissology
62b44e3549 use electron-builder for npm install
This will build deps as required for electron as well as the os.

This fixes the missing binding error for sqlite3 when trying to run the
electron app after a fresh npm i
2019-01-08 06:50:48 -08:00
azivner
030d12a465 stretch sync login token validity to 5 minutes #277 2019-01-07 23:29:56 +01:00
azivner
4d15628840 Merge remote-tracking branch 'origin/master' 2019-01-07 23:17:45 +01:00
azivner
81b849898c stretch body to full window width, fixes #276 2019-01-07 23:17:12 +01:00
zadam
3824486b85 Merge pull request #275 from Lee303/Dockerfile-dependency-fix
Update Dockerfile
2019-01-07 22:49:27 +01:00
Lee Spottiswood
081ab00a0a Update Dockerfile 2019-01-07 21:21:23 +00:00
zadam
04f6af5c9a Merge pull request #270 from svenefftinge/master
Make contributions easier
2019-01-07 21:46:02 +01:00
Sven Efftinge
4dc1f1f6eb Added contribute section and gitpod config 2019-01-07 12:52:02 +00:00
azivner
3930a02123 tree now uses standard font size which effectively makes it a bit larger 2019-01-06 20:59:19 +01:00
azivner
3112de105e fancytree selection/hover colors are shades of gray, border is rounded 2019-01-06 18:58:12 +01:00
azivner
3b8d7b8fba release 0.27.3 2019-01-05 22:48:11 +01:00
azivner
9fca7f09a5 link to mobile frontend 2019-01-05 22:45:18 +01:00
azivner
fd39d6b3a9 using btn-secondary instead of btn-default since that doesn't exist in BS4 2019-01-05 21:51:27 +01:00
azivner
a103886ea5 responsive setup page 2019-01-05 21:49:40 +01:00
azivner
373408e401 fix Branch reference to parent note id after parent change 2019-01-05 19:25:22 +01:00
azivner
db44c1d8e6 border color tweaks 2019-01-05 11:49:17 +01:00
azivner
95a34c9e2d small tweaks of icon alignment 2019-01-05 11:41:09 +01:00
azivner
6ce401f260 release 0.27.2-beta 2019-01-04 23:33:32 +01:00
azivner
5d74dcd256 package-lock 2019-01-04 23:33:30 +01:00
azivner
5a9fc1697b electron 4.0.1 2019-01-04 23:32:14 +01:00
azivner
927415838c using enhanceTitle event instead of renderNode per https://github.com/mar10/fancytree/issues/927 2019-01-04 20:18:07 +01:00
azivner
d72fcefdc7 fix sync of deleted notes 2019-01-04 20:10:16 +01:00
azivner
0be173a8f7 lower lastSyncedPull if server max sync ID is lower 2019-01-04 18:58:46 +01:00
azivner
c3913a8735 updating the note cache after sync 2019-01-03 23:27:10 +01:00
azivner
e2dfe1b6de fixed setup page issues which caused wrong choice to be used in the wizard 2019-01-03 22:32:36 +01:00
azivner
fec3e47eb8 serialize binary note content into base64, incremented sync version 2019-01-03 22:13:58 +01:00
azivner
d72efd2450 removed unnecessary logging of data dir which is now logged as part of app info 2019-01-03 21:46:32 +01:00
azivner
ef1c840aa7 tiny fixes 2019-01-02 22:36:06 +01:00
azivner
1581464d8c fix layout - promoted attributes should never grow beyond its content 2019-01-02 20:21:34 +01:00
azivner
9de29584a4 added data directory to options -> about 2019-01-02 20:08:41 +01:00
azivner
9e2e6fb50c fixed glitch where "unhoist" button disappears after renaming the hoisted note 2019-01-02 19:26:01 +01:00
azivner
c85979b66b it should not be possible to add note after hoisted note 2019-01-02 18:59:08 +01:00
azivner
ecdc5865a6 release 0.27.1-beta 2019-01-01 20:54:23 +01:00
azivner
1771ddb787 responsive promoted attributes view and attribute overview to make sure note content is always visible. Fixes #262 2019-01-01 20:53:18 +01:00
azivner
3ab657fe46 created concept of "detail loaded listeners" which allow scripts to execute some action after the note detail has been loaded 2019-01-01 19:32:34 +01:00
azivner
8785dae753 force reload fancytree node when child is not found 2019-01-01 18:27:36 +01:00
azivner
2f1c5b29d4 update eslint 2019-01-01 18:06:52 +01:00
azivner
7135349a10 allow deleting protected notes outside of protected session 2019-01-01 17:04:21 +01:00
azivner
66c639d5e3 frontend API addition to protect current note 2019-01-01 15:39:13 +01:00
azivner
6704b755d8 attribute overview shows only owned attributes 2019-01-01 15:29:58 +01:00
azivner
cf96baad48 release 0.27.0-beta 2018-12-30 22:38:11 +01:00
azivner
32220476aa better behavior on default loading detail / switching between tree and detail 2018-12-30 22:36:39 +01:00
azivner
86bc84a2ad better detection of float parameter in label filters, fixes #265 2018-12-30 22:09:14 +01:00
azivner
de9e0c7929 lazy loading icon for both mobile and desktop 2018-12-30 21:13:35 +01:00
azivner
6963e662ef fix layout on chrome 2018-12-30 19:15:44 +01:00
azivner
7127822e8f placeholder for empty note content 2018-12-30 19:02:42 +01:00
azivner
0a35abf68f refresh note detail view after attribute save (from full dialog, not promoted notes), closes #261 2018-12-30 15:21:53 +01:00
azivner
3f8e8f8561 fix saving branch prefix, fixes #260 2018-12-29 10:35:44 +01:00
azivner
e02eca87b0 dont toggle panes note on the first load 2018-12-29 10:19:28 +01:00
azivner
2f680c4326 tweaks, fixes, refactorings, creating new note from detail, not tree 2018-12-29 10:04:59 +01:00
azivner
0b4a44a403 layout tweaks etc. 2018-12-29 09:13:52 +01:00
azivner
89299f865c api method to detect navigation away from current page 2018-12-29 08:40:35 +01:00
azivner
f6db9a50ab "switch to desktop version" button 2018-12-29 00:09:16 +01:00
azivner
78d9fac1e6 global actions context menu, logout 2018-12-28 23:57:11 +01:00
azivner
458ed1faff mobile detection 2018-12-28 23:47:06 +01:00
azivner
0657815de5 Merge branch 'master' into mobile 2018-12-28 22:31:51 +01:00
azivner
a608832681 change to relation map note type doesn't trigger content change, related issue #258 2018-12-28 22:31:06 +01:00
azivner
d2f72529b3 context menu with delete 2018-12-28 22:05:04 +01:00
azivner
28185af158 fix layout/scrolling issues in the tree 2018-12-28 20:36:18 +01:00
azivner
7aacd01ad7 separate css layout file for mobile and desktop 2018-12-28 19:47:02 +01:00
azivner
74cc34696e unifying expander icons in both desktop and mobile 2018-12-27 22:38:19 +01:00
azivner
d4baac0bb5 mobile fixes 2018-12-27 22:36:11 +01:00
azivner
35bc1421f1 cannot edit note title when not in protected session 2018-12-27 20:22:33 +01:00
azivner
d4db265fd9 non-modal protected session password form is now done separately as a kind of detail component. Also reworked branch prefix dialog input 2018-12-27 20:04:59 +01:00
azivner
1dad919de9 working protected session in mobile 2018-12-25 10:58:40 +01:00
azivner
246dfbdcb4 fix attribute loading for mobile 2018-12-24 23:08:43 +01:00
azivner
f8d32d64f5 content scrolling 2018-12-24 22:39:17 +01:00
azivner
5dea271d6f basic responsive layout 2018-12-24 20:38:38 +01:00
azivner
eeb62a6cf2 fix keyboard shortcut setup on mobile 2018-12-24 18:39:31 +01:00
azivner
35cf8026b0 activating note opens dialog with its detail 2018-12-24 12:49:27 +01:00
azivner
e0028ab6f1 mobile frontend WIP, removing extra dependencies 2018-12-24 10:10:36 +01:00
azivner
a32645cdeb fix scrolling to the top of detail after switching note 2018-12-24 09:47:00 +01:00
azivner
812f9f6fca initial work on mobile frontend 2018-12-23 22:28:57 +01:00
azivner
f7a670ec24 responsive login page 2018-12-23 11:06:11 +01:00
azivner
d0d24f0f4a unify ejs indentation to 4 spaces 2018-12-23 10:57:40 +01:00
azivner
042f9b7f2d fix positioning of protected session password dialog 2018-12-22 23:54:06 +01:00
azivner
2d260cdbed explicit node-abi required for 4.0.0 electron build 2018-12-22 23:10:03 +01:00
azivner
6a786cad83 updated API docs 2018-12-22 22:28:49 +01:00
azivner
67019b3d6c added attributes to frontend entity model 2018-12-22 22:16:32 +01:00
azivner
1db6e59077 tooltip related changes for scripting support 2018-12-22 20:57:09 +01:00
azivner
5e4770875e upgrade to bootstrap 4.2.1 2018-12-22 10:33:50 +01:00
azivner
e9a77f3f16 image sync fixes and 4.0.0 electron 2018-12-22 09:54:09 +01:00
azivner
cbec85f295 release 0.26.1 2018-12-20 19:54:09 +01:00
azivner
14bd5d301d fix broken image sync 2018-12-20 19:51:03 +01:00
azivner
321d0e8d64 explicit error handler for connection errors 2018-12-19 21:29:35 +01:00
azivner
84e1512031 added robots.txt to public root 2018-12-19 20:56:10 +01:00
azivner
b036852b2d release 0.26.0-beta 2018-12-18 22:49:48 +01:00
azivner
f693dc31e8 mention note hoisting in the readme 2018-12-18 20:50:03 +01:00
azivner
af8f5b11b8 better error handling in request 2018-12-18 20:39:56 +01:00
azivner
8ca943f87b fix hoistedNoteId option init 2018-12-18 20:34:24 +01:00
azivner
35cc9da626 note about system proxy in the settings 2018-12-17 22:58:53 +01:00
azivner
44cc86a1a5 added support for explicit proxy 2018-12-17 22:54:54 +01:00
azivner
7c3bbfd45e using http service for sync setup as well, removed request(-promise) dependency 2018-12-17 22:12:26 +01:00
azivner
a1f939e3a0 refactoring of network code into separate service 2018-12-17 21:34:02 +01:00
azivner
4ca7886090 uniform requests through electron's net and node http/https to support different proxy setups 2018-12-16 23:30:53 +01:00
azivner
b942163748 sync with electron net API (for system proxy support) - working, but WIP 2018-12-16 21:19:12 +01:00
azivner
5b6d15acb3 note path might not always include root explicitly 2018-12-16 10:41:47 +01:00
azivner
841420360e quick unhoist link/button 2018-12-15 20:29:08 +01:00
azivner
a680bb4612 unhoist note when activating note outside of the hoisted note subtree 2018-12-13 23:28:48 +01:00
azivner
f763e13996 fix searching without hoisting 2018-12-13 21:43:13 +01:00
azivner
e73e1262ae Merge branch 'stable' into hoist 2018-12-13 21:18:44 +01:00
azivner
b774d56cf7 note titles in jump to note start from hoisted note instead of root 2018-12-13 21:18:35 +01:00
azivner
bae55f2e8b release 0.25.2 2018-12-12 21:30:06 +01:00
azivner
6c16cdb011 recent notes and jump to note are filtered by hoisted note 2018-12-12 21:28:38 +01:00
azivner
86fcbb0354 keyboard shortcut for hoisting, hoisted note is always expanded and has arrow icon 2018-12-12 20:54:58 +01:00
azivner
17d030e800 continuing work on hoisting notes 2018-12-12 20:39:56 +01:00
azivner
6fbf28b30d hoisting notes WIP 2018-12-11 21:53:56 +01:00
azivner
8171b68b18 electron 4.0 beta 9, context menu padding 2018-12-11 19:50:31 +01:00
azivner
d30e3a4052 bind standard shortcuts on both command and ctrl modifiers, #254 2018-12-10 20:44:50 +01:00
azivner
87aab7ac5b fix attributes leaking into imported notes, #241 2018-12-10 20:29:49 +01:00
azivner
c46f5805b1 removed the note from readme about missing mac build 2018-12-09 21:50:29 +01:00
azivner
dd6a29dfc0 no ia32 release upload 2018-12-09 21:34:08 +01:00
azivner
a0933c7f10 release 0.25.1-beta 2018-12-09 21:22:33 +01:00
azivner
492adc2909 fix broken drag & drop, closes 252 2018-12-09 21:18:53 +01:00
azivner
90a52f57b5 recent notes route accepts slash in the param (problem with nginx etc.) 2018-12-09 14:30:19 +01:00
azivner
a1469854e8 Allow Trilium to work from non-root document paths, closes #253 2018-12-09 13:37:28 +01:00
azivner
e2c2993255 changes in build - linux-x64 also uses prebuilt binaries compatible with glibc 2.27 so e.g. ubuntu 18.04 works again. Also dropped build for linux-ia32 2018-12-09 11:41:32 +01:00
azivner
270d63b265 deactivated cut to note functionality in ckeditor build 2018-12-08 10:54:10 +01:00
azivner
1d004be91d ckeditor upgrade to 11.2.0 2018-12-08 09:48:36 +01:00
azivner
b8a74c727e copy paste, undo, redo, select all shortcuts supported on mac build 2018-12-02 14:04:53 +01:00
azivner
c87b592277 fix in the release script 2018-12-02 08:42:11 +01:00
azivner
cfa926602a release 0.25.0-beta 2018-12-02 00:30:07 +01:00
zadam
350cb52c07 Merge pull request #249 from nicoulaj/master
fix #248: crossorigin attribute is needed when including with type="module"
2018-12-02 00:27:59 +01:00
azivner
af195beb7e initial mac support + some other build changes 2018-12-02 00:26:45 +01:00
Julien Nicoulaud
cb00d42546 fix #248: crossorigin attribute is needed when including with type="module"
For more info, see:
 * https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes
 * https://jakearchibald.com/2017/es-modules-in-browsers
2018-12-01 23:33:23 +01:00
azivner
ee0b0c3dfe minor export fixes 2018-11-30 22:43:03 +01:00
azivner
ddcb4a0e10 added another mime type for JS 2018-11-30 22:28:30 +01:00
azivner
8cbb29ee25 default location for data dir is now .local for linux and Roaming for windows 2018-11-30 19:56:20 +01:00
azivner
9da11ac144 electron 4 beta 8 2018-11-30 17:50:38 +01:00
azivner
ba7c8e77e5 add support for number precision in promoted attributes, closes #245 2018-11-30 17:36:41 +01:00
azivner
4577b03fc9 promoted attributes now use saved indicator (little check) instead of notification 2018-11-30 17:18:19 +01:00
azivner
72d83aa85e fix note cache - note entity after initialization doesn't contain ciphertext so decryption is not necessary 2018-11-30 15:51:55 +01:00
azivner
8ee80cb5f1 using dashes instead of underscores in header names to avoid the fact that nginx by default drops all headers with underscore in the header name 2018-11-30 15:49:35 +01:00
azivner
4cc08bff8b minor node updates in docker and server package 2018-11-30 13:56:36 +01:00
zadam
295cfb2d75 Merge pull request #247 from gabe565/master
Smaller Docker image
2018-11-30 13:38:47 +01:00
azivner
7775376b33 disable "cut to note" feature because of issues with CKEditor 2018-11-30 11:37:33 +01:00
azivner
9f64e994dc fix minor UI issue causing children overview not being decrypted right after entering protected session 2018-11-30 10:33:40 +01:00
azivner
ee1e4fc710 added "update pojo" stage in entity saving to avoid encrypting data on protected note directly on the entity 2018-11-30 10:20:03 +01:00
Gabe Cook
5ea62c710d Move devtron to devDependencies and update package-lock.json 2018-11-30 05:46:55 +00:00
Gabe Cook
aeca31d06a Add .git, bin, and docs to the .dockerignore 2018-11-30 05:46:49 +00:00
Gabe Cook
9cb9ea6ab5 Smaller Docker image by switching the base image to node:10.13.0-alpine and consolidating scripts 2018-11-30 05:41:53 +00:00
azivner
e37dd69827 link to Patterns of personal knowledge base 2018-11-28 22:05:23 +01:00
azivner
6c51696d1a also don't show "No results" for attr autocomplete 2018-11-27 19:43:34 +01:00
azivner
27787c8f37 attribute name and value autocompletes should not have autoselect since it's OK to enter value not in the autocomplete 2018-11-27 19:40:19 +01:00
azivner
e910595545 updated readme 2018-11-27 19:18:24 +01:00
azivner
a616739805 release 0.24.5 2018-11-27 15:34:15 +01:00
azivner
bea28de6a0 tab on autocomplete doesn't select first item, closes #243 2018-11-27 13:13:06 +01:00
azivner
4e198ca2f0 storing trilium version into export metadata 2018-11-27 10:31:55 +01:00
azivner
2fbd16a0e3 updated demo export according to latest format changes 2018-11-26 23:50:43 +01:00
azivner
76fc49f037 allow import of single HTML file too 2018-11-26 23:47:02 +01:00
azivner
139c99440f export stores note position and some other fixes 2018-11-26 23:39:43 +01:00
azivner
137b9dfa0b fix storing attributes and relinking noteIds 2018-11-26 23:19:19 +01:00
azivner
5f0fdd15eb fix adding sync entities during import 2018-11-26 22:37:59 +01:00
azivner
61e1427b83 fix matching of "b" in the note autcomplete highlighter 2018-11-26 22:35:19 +01:00
azivner
b3aa0ba47c entity events are not triggered on imported entities 2018-11-26 22:27:57 +01:00
azivner
56e2b44c25 fix import 2018-11-26 22:22:16 +01:00
azivner
4d5a17583f happy path tar import now works 2018-11-26 20:30:43 +01:00
azivner
71eda5aa3d import tar archive WIP 2018-11-26 14:47:46 +01:00
azivner
0711ea8dc8 filter out links and relations which are outside of the export 2018-11-25 22:38:09 +01:00
azivner
be206872d1 changed export model to single metadata file per exported .tar 2018-11-25 22:09:52 +01:00
azivner
fcf3fe8dcd tar export can now solve naming conflict 2018-11-25 15:17:28 +01:00
azivner
62dbd4062a on/off button for entering/leaving protected session has been changed to literal buttons 2018-11-25 14:12:33 +01:00
azivner
196e8b4380 extra icons 2018-11-25 14:05:54 +01:00
azivner
551e1255ff export WIP + some unrelated changes 2018-11-25 10:26:45 +01:00
azivner
e09b61d1ac single file export working, tar WIP 2018-11-24 20:58:38 +01:00
azivner
ee23bcc783 unified export dialog, WIP 2018-11-24 14:44:56 +01:00
azivner
3e351bd8d3 better positioning of nonmodal protected session dialog 2018-11-22 21:24:47 +01:00
azivner
0d3bc22d73 fix z-index of notification 2018-11-22 21:19:12 +01:00
azivner
d82898421e less obtrusive saved indicator, fixes #122 2018-11-22 20:25:49 +01:00
azivner
1db2f0c2c5 improved notifications, now with animations, in center and show up properly in the dialogs 2018-11-22 16:08:02 +01:00
azivner
6cd8a2203e create app icon only for electron build 2018-11-22 00:24:33 +01:00
azivner
08e062ab34 release 0.24.4-beta 2018-11-21 23:47:09 +01:00
azivner
3a06493459 partial workaround for the broken in page search (next & previous don't work, but at least highlighting works) 2018-11-21 23:39:19 +01:00
azivner
8159564885 fix .desktop + allow to turn this feature off 2018-11-21 11:19:33 +01:00
azivner
8ce3c1a480 generate local .desktop file so it shows among apps in linux desktop environments 2018-11-21 11:01:03 +01:00
azivner
dbc93f4a79 mitigations for tooltip flickering 2018-11-20 23:50:19 +01:00
azivner
92ffe321aa smaller context menu 2018-11-20 22:55:07 +01:00
azivner
6cb7d0098e changed layout a little bit to fix broken children overview in the electron/chrome 2018-11-20 22:49:10 +01:00
azivner
bdcb4361b2 simplification of note autocomplete result ordering by depth #240 2018-11-20 22:22:26 +01:00
azivner
15366d37d7 ordering results in autocomplete based on depth, closes #240 2018-11-20 21:22:20 +01:00
azivner
acd001501b release 0.24.3-beta 2018-11-20 13:01:41 +01:00
azivner
0019865807 disabling broken in page search 2018-11-20 12:54:03 +01:00
azivner
137ffcc4e3 enable line wrap for code editor 2018-11-20 10:49:03 +01:00
azivner
585398ad5c fix bug when saving non-text notes 2018-11-19 23:11:36 +01:00
azivner
50401954d1 disable cache for attribute name autocomplete 2018-11-19 22:17:08 +01:00
azivner
32a9df8489 fixes (and refactoring) for "empty attribute name" check 2018-11-19 22:06:51 +01:00
azivner
5bf5d1cac4 attribute dialog doesn't allow to (attempt to) save relation without target note 2018-11-19 21:58:52 +01:00
azivner
3608857f25 small fix to demo export 2018-11-19 21:09:59 +01:00
azivner
16a1dc12df jsdoc now doesn't include date into files to avoid unnecessary noise 2018-11-19 21:03:43 +01:00
azivner
9c834229b9 release 0.24.2-beta 2018-11-19 17:17:08 +01:00
azivner
3fd45b15e7 set icon and app name, closes #201 2018-11-19 17:16:22 +01:00
azivner
f20ab45576 fix absolute image paths to relative paths as part of parsing links 2018-11-19 15:00:49 +01:00
azivner
77a89d85c8 fix "copy image to clipboard" button 2018-11-19 12:12:58 +01:00
azivner
30249a353e renamed "mirror" relation to "inverse" relation 2018-11-19 12:07:33 +01:00
azivner
eb9bae9010 updated relation map in demo document 2018-11-19 11:47:40 +01:00
azivner
0c7ae527c5 allow dragging only one note at a time 2018-11-19 11:19:56 +01:00
azivner
fef4705e2f center button changed to "reset pan & zoom" 2018-11-19 11:14:55 +01:00
azivner
568c2c997f possibility to export single code note as markdown. UI fix of disabled buttons 2018-11-19 09:54:33 +01:00
azivner
d6b5cd6ead support saving files and images in markdown tar export 2018-11-19 09:46:24 +01:00
azivner
00ce379962 excludeFromExport support also in OPML 2018-11-19 09:34:05 +01:00
azivner
b1ed022771 release 0.24.1-beta 2018-11-19 00:06:44 +01:00
azivner
ad6cb6ba34 mirror relation has to target source note 2018-11-19 00:06:04 +01:00
azivner
2e76de5f34 minor relation map fixes 2018-11-18 23:57:39 +01:00
azivner
4f23f2515a fix relation saving 2018-11-18 23:36:21 +01:00
azivner
8e16cc2326 fix prompt mutability (autocomplete on answer input field) 2018-11-18 23:31:31 +01:00
azivner
49bca04ebb fix doubling of notes after some actions 2018-11-18 23:01:48 +01:00
azivner
05e9669eaf fixed relation map sizing issue 2018-11-18 22:49:53 +01:00
azivner
62a250a7fc fixes for tooltip handling 2018-11-18 20:57:52 +01:00
azivner
8299524682 fixed cleanup of deleted notes for protected notes 2018-11-18 11:34:40 +01:00
azivner
7691a59977 imported notes can reference root 2018-11-18 11:19:50 +01:00
azivner
3db2f6784d fix DB migration and consistency issues 2018-11-18 10:20:06 +01:00
azivner
48684d0509 fixed app termination after unsuccessful migration for electron 2018-11-18 09:05:50 +01:00
azivner
1ee8d9fd93 sql console executes selected text if there's a selection instead of the whole content 2018-11-18 08:29:56 +01:00
azivner
228a77cb89 release 0.24.0-beta 2018-11-16 23:30:52 +01:00
azivner
90eb1b53fb update of demo document, using relation map for "family tree" demo 2018-11-16 23:29:38 +01:00
azivner
6a36e1ca86 we're now saving links also for notes included in relation maps which helps with translation of noteIds during import from native tar 2018-11-16 23:27:57 +01:00
azivner
3fee263355 fixed "paths" styling for BS4 and fix for special case of root note 2018-11-16 22:04:51 +01:00
azivner
d19fa89f69 fixed sqlite3 windows binary 2018-11-16 21:44:50 +01:00
azivner
6b65592d7a attachment preview, closes #210 2018-11-16 18:40:58 +01:00
azivner
94565e3ec0 now using .tar export to initialize DB instead of direct DB dumps 2018-11-16 14:36:50 +01:00
azivner
5b9a1ef0e9 import/export logic refactored into separate files per format, closes #237 2018-11-16 12:12:04 +01:00
azivner
e0f9a7fc6a added links to the import/export + fixing internal links inside note content 2018-11-16 11:42:06 +01:00
azivner
46c7901e1f fix migration script 2018-11-15 22:24:30 +01:00
azivner
efc5cf4091 Doubleclick on the image will take you to that image note, closes #236 2018-11-15 14:51:09 +01:00
azivner
39b3c91abf image notes can't be updated + minor visual tweaks 2018-11-15 14:33:02 +01:00
azivner
6749cbed1b added some consistency checks for links and attributes 2018-11-15 13:58:14 +01:00
azivner
346b8c21dd uploaded attachments with image mime are saved as image notes, closes #211 2018-11-15 12:13:32 +01:00
azivner
8ee8639faa allow also deleting note when removing note from note relation 2018-11-14 23:30:28 +01:00
azivner
fa264d1cbe fix CSS filter issue in firefox, closes #233 2018-11-14 20:58:19 +01:00
azivner
8a3f508825 "go to selected note" button now has also note tooltip 2018-11-14 19:33:48 +01:00
azivner
19a07c699c added BS dialog for confirm 2018-11-14 19:03:55 +01:00
azivner
b8feb4cce3 fix attribute sorting, closes #225 2018-11-14 17:54:28 +01:00
azivner
cfce744338 method name refactoring 2018-11-14 17:26:07 +01:00
azivner
211001fb2f #232 implement recenter even though it probably doesn't work totally correctly 2018-11-14 15:11:39 +01:00
azivner
a334f08782 refactorings in relation map related to noteId handling and storage 2018-11-14 14:52:05 +01:00
azivner
040bb13800 disable shield background in distraction free mode, fixes #226 2018-11-14 13:42:50 +01:00
azivner
6652ddc20a fix relation map display in distraction free mode 2018-11-14 13:37:45 +01:00
azivner
e44c7c9947 hide "go to selected note" button in jump because it doesn't make sense there 2018-11-14 11:28:52 +01:00
azivner
24a0856d22 open external link button moved inside input 2018-11-14 11:24:40 +01:00
azivner
74acb08f7b "open" note put into note autocomplete input, also fixes #222 2018-11-14 11:17:20 +01:00
azivner
7be85acf11 mitigation of tooltip flicker by making tooltip smaller 2018-11-14 10:36:14 +01:00
azivner
fc9495bcdf links are now shown in the relation map as well 2018-11-14 10:11:15 +01:00
azivner
247275d391 fix icon of newly created note 2018-11-14 08:42:00 +01:00
azivner
427234293e tooltip for image note 2018-11-14 08:36:19 +01:00
azivner
9568fde027 tooltip color tweak 2018-11-14 08:28:38 +01:00
azivner
9cf08bf926 fix shadow of protected note's icon in the tree 2018-11-14 08:23:34 +01:00
azivner
295800881b fix #223 plus some refactorings 2018-11-14 00:05:09 +01:00
azivner
25e68762fe note autocompletes now have clear text button 2018-11-13 23:16:26 +01:00
azivner
ea0a5bc1c9 added code basic style do ckeditor, fixes #220 2018-11-13 22:22:01 +01:00
azivner
abbade96af added hidePromotedAttributes label, fixes #221 2018-11-13 22:14:41 +01:00
azivner
83c6f86d26 re-center button, WIP 2018-11-13 22:05:32 +01:00
azivner
db17b05db1 hide attribute "status bar" for relation map to maximize screen space, some refactoring 2018-11-13 19:25:59 +01:00
azivner
1ce26ed704 fix dirtying transform saved status by properly cloning transform object 2018-11-13 19:16:21 +01:00
azivner
a065a610c1 absolute positioning of relation map buttons to maximize screen estate 2018-11-13 19:00:01 +01:00
azivner
0b85f87cb2 display mirror relations correctly on relation map 2018-11-13 12:50:08 +01:00
azivner
144e814b02 added relation name autocomplete to relation map connection creation 2018-11-13 10:42:55 +01:00
azivner
8dc32e581e refactored attribute autocompletes into separate service 2018-11-13 10:25:59 +01:00
azivner
21d3b0c9d8 implemented mirror relations 2018-11-12 23:34:22 +01:00
azivner
e7cea59ba7 fixes for relation map rendering 2018-11-12 21:18:22 +01:00
azivner
2523f81f3b bootstrap backed replacements for JS prompt and alert 2018-11-12 20:17:48 +01:00
azivner
c6e1ad5f15 drag all selected notes instead of just one 2018-11-12 15:10:49 +01:00
azivner
340916d5da drag & drop notes from the tree into relation map 2018-11-12 13:05:09 +01:00
azivner
bbe36fc7fb some refactorings on relation map 2018-11-12 09:57:48 +01:00
azivner
02fd8f8133 working (but messy) pan & zoom without scrollbar and new note on click 2018-11-11 23:21:43 +01:00
azivner
525f167127 Merge branch 'stable' 2018-11-11 19:26:40 +01:00
azivner
3750919169 fixed context menus in relation map 2018-11-09 22:18:51 +01:00
azivner
4f34fb802b minor icon changes 2018-11-09 20:45:28 +01:00
azivner
d978c64e1a refactoring of tree context menu into reusable component 2018-11-09 17:11:45 +01:00
azivner
bc2e230425 fix frontend API to work with JAM icons 2018-11-09 14:49:08 +01:00
azivner
71f333154d unprotecting note after protecting it sometimes didn't work
fix protected note background
2018-11-09 14:36:27 +01:00
azivner
c5113eb292 fix options dialog which used jquery tabs 2018-11-09 12:13:51 +01:00
azivner
232f135843 using jam font icon pack instead of feather, fixes #204 2018-11-09 11:57:52 +01:00
azivner
8be328cb3b now that content is nullable, cleanup sets it to null instead of empty string 2018-11-09 09:04:55 +01:00
azivner
bfc09187e3 disabled note-level actions based on note type, fixes #218 2018-11-08 23:59:25 +01:00
azivner
3a4691b46d updated API docs to reflect changes in link/image handling 2018-11-08 23:49:44 +01:00
azivner
7b3c0243f3 enter protected password is not modal now, closes #217 2018-11-08 23:48:49 +01:00
azivner
8d7a2546e1 help buttons on the dialog titlebar wherever possible, closes #205 2018-11-08 21:36:35 +01:00
azivner
991d5d3be3 save and remove both hyper and image links 2018-11-08 20:17:56 +01:00
azivner
6416e3e9fb refactored attributes out of note detail, fixes #213 2018-11-08 20:01:25 +01:00
azivner
3ba761fe28 refactored import markdown dialog into separate file, fixes #206 2018-11-08 19:42:57 +01:00
azivner
273a9b14d9 added copy image to the image detail 2018-11-08 18:35:23 +01:00
azivner
afcbfcfa03 cleanup obsolete image code 2018-11-08 11:14:13 +01:00
azivner
d7afbe4059 saving image 2018-11-08 11:08:16 +01:00
azivner
21e952a7f0 note image detail 2018-11-08 10:30:35 +01:00
azivner
d0d2a7fe47 store images in notes, basic structure 2018-11-08 10:11:00 +01:00
azivner
5f427e37fe export dialog to choose export format, closes #207 2018-11-07 22:58:33 +01:00
azivner
13f9007bd6 attributes dialog converted to algolia autocomplete, closes #203 2018-11-07 20:32:11 +01:00
azivner
90dbe637ed autocomplete for add link dialog, #203 2018-11-07 17:16:33 +01:00
azivner
a0f362457e refactoring of autocomplete handling, #203 2018-11-07 09:51:14 +01:00
azivner
1febf5136c finished jump to autocomplete, now with token highlighting, #203 2018-11-07 09:35:29 +01:00
azivner
3c23d7085e porting autocomplete to algolia, WIP, #203 2018-11-07 00:23:50 +01:00
azivner
57e9850ca6 migrated tooltips to bootstrap, #203 2018-11-06 19:35:42 +01:00
azivner
2f4ef0a4a2 migrated all remaining dialogs to bootstrap modals, #203 2018-11-06 17:47:40 +01:00
azivner
6fb99ae89e changed ejs indentation to 2 spaces instead of 4 (or mix) 2018-11-06 15:53:23 +01:00
azivner
69d2bd8b58 replacement of jquery ui dialog for bootstrap modal for jump to note dialog, #203 2018-11-06 15:25:07 +01:00
azivner
e62cca886c fix login & setup page 2018-11-06 14:54:22 +01:00
azivner
a8e13eac3a fix postponed deletion job - need to have cls 2018-11-06 14:23:49 +01:00
azivner
2f887f1ea7 split dialog templates into separate files 2018-11-06 14:16:38 +01:00
azivner
3856de4483 positioning of context menu when click on elements down on the page 2018-11-06 13:45:58 +01:00
azivner
0348bbe4f1 context menu cleanup 2018-11-06 12:50:48 +01:00
azivner
24dfe0fa98 replace note tree context menu with bootstrap dropdown, #203 2018-11-06 12:46:29 +01:00
azivner
20baa47d26 use HTML5 for Drag & Drop instead of jquery UI draggable for fancytree, #203 2018-11-05 21:42:29 +01:00
azivner
19cb29cdca use native date picker instead of jquery UI, #203 2018-11-05 21:20:05 +01:00
azivner
24a1838b13 bootstrap 4 upgrade 2018-11-05 21:12:03 +01:00
azivner
7bdbea81f1 enex import recognizes images, media references are converted to links 2018-11-05 12:52:50 +01:00
azivner
b8eaff055a create notebook's "root note" for ENEX import 2018-11-05 09:23:04 +01:00
azivner
5e318c6242 basic enex import, closes #194 2018-11-05 00:06:17 +01:00
azivner
607c821cac logging slow autocomplete times 2018-11-04 22:10:52 +01:00
azivner
26b9302267 run unused image cleanup periodically (once every 4 hours) 2018-11-01 16:40:25 +01:00
azivner
de14e808c7 logging of slow queries (currently >= 200ms) 2018-11-01 11:18:54 +01:00
azivner
80178b52c0 cleanup of note (& revisions) content is now postponed and done 48 hours after deleting it. This makes it possible to correct user mistake without having to use a real backup 2018-11-01 10:23:21 +01:00
azivner
370efdc034 place note on canvas by click, WIP 2018-11-01 09:41:03 +01:00
azivner
f06d8c7c54 multiselection with keyboard doesn't trigger activation which helps with performance 2018-10-31 23:55:14 +01:00
azivner
63edde8a73 improve performance when quickly switching notes (by e.g. holding down arrow in the tree) 2018-10-31 19:08:31 +01:00
azivner
5872146172 better detection of empty tooltip 2018-10-31 18:31:18 +01:00
azivner
ab26216cbe fixes for "add child note" button 2018-10-31 18:21:58 +01:00
azivner
5cc91c64a3 fix right click delete (or other action) when other node is activated 2018-10-31 18:13:08 +01:00
azivner
4858f0bec6 button for creating subnote in relation map and other unrelated changed, WIP 2018-10-31 12:29:01 +01:00
azivner
639284fd85 changing title directly from relation map 2018-10-30 22:18:20 +01:00
azivner
f33f99134b zoom fix 2018-10-30 21:28:41 +01:00
azivner
a2434f200e icon for relation map 2018-10-30 20:26:31 +01:00
azivner
31abec5d1c zoom icons 2018-10-30 20:22:05 +01:00
azivner
93d152eae5 using whole note box to drag the box instead of special handle 2018-10-30 11:28:48 +01:00
azivner
2a14ea8d0c fixes for relation handling + visual design restyled into gray colors 2018-10-30 10:36:19 +01:00
azivner
a19af8a61d fixes and tweaks for relation map 2018-10-30 08:53:30 +01:00
azivner
2a129809b3 support for adding new relations from relation map with drag & drop 2018-10-29 22:38:51 +01:00
azivner
07cbc385e5 basic refactoring of relation map code 2018-10-29 19:25:45 +01:00
azivner
67d47c389a Merge remote-tracking branch 'origin/master' into canvas 2018-10-29 19:10:28 +01:00
azivner
e61f17809a set icon reference to electron packager 2018-10-29 19:08:23 +01:00
azivner
23de04daaa removed forge related config which isn't used 2018-10-29 18:39:09 +01:00
azivner
a8774353fd release 0.23.1 2018-10-25 18:13:37 +02:00
azivner
18f2419bd6 allow creating anonymized database from command line as well, fixes #200 2018-10-25 18:03:28 +02:00
azivner
332a65a9cc disable smooth scroll 2018-10-25 17:11:50 +02:00
azivner
1d51f58447 remember pan and zoom 2018-10-25 15:45:14 +02:00
azivner
41fca4c4f3 fixes, getting rid of resizing for now 2018-10-25 14:01:03 +02:00
azivner
4a5a63d7b4 relation map WIP 2018-10-25 12:06:36 +02:00
azivner
b17f442d1f Merge branch 'master' into canvas 2018-10-23 18:11:29 +02:00
azivner
9f0860edab Merge branch 'stable' 2018-10-21 22:48:58 +02:00
azivner
0c007566ad fixes for invalid operations on root note 2018-10-21 22:42:20 +02:00
azivner
bfa2b5fa62 add a check for root parent 2018-10-21 21:37:34 +02:00
azivner
6559e6c25b add children to relation map 2018-10-21 10:26:14 +02:00
azivner
627e5e0edb imported poc code 2018-10-18 11:53:01 +02:00
azivner
2a8de2653e added libraries for relation map 2018-10-18 11:46:07 +02:00
azivner
e487dc1df7 basic infrastructure for "relation map" note type 2018-10-18 11:25:33 +02:00
azivner
04af8a3a96 fixed CTRL-ALT-P shortcut 2018-10-15 23:45:37 +02:00
azivner
209551a205 using new scrypt api from node 10 as a replacement of third party library 2018-10-14 11:48:29 +02:00
azivner
c6bfd3909f sqlite3 binary for electron 4 2018-10-14 11:37:29 +02:00
azivner
8b7694d0ec use node 10 also for server edition 2018-10-14 11:35:31 +02:00
azivner
76c980b51f electron 4.0.0-beta.3 2018-10-14 11:31:23 +02:00
azivner
1de06b4fc9 fix links in README 2018-10-12 18:38:57 +02:00
azivner
949456212a fix for ckeditor stretching body 2018-10-12 13:40:06 +02:00
azivner
06a867773e minor library updates 2018-10-12 12:37:03 +02:00
azivner
269f56bdca release 0.23.0 2018-10-09 21:08:11 +02:00
azivner
5352f388a7 ckeditor updated to 11.1.0 2018-10-09 12:39:36 +02:00
azivner
be94766f76 trigger events after note attributes are created 2018-10-08 11:09:45 +02:00
azivner
24673168bb api docs update 2018-10-07 16:27:12 +02:00
azivner
b5bb653889 fancytree updated to 2.30.0 2018-10-07 14:34:05 +02:00
azivner
b09071eb9b publish API to allow manipulating list of allowed mime types for #192 2018-10-07 14:25:17 +02:00
azivner
5f95ab95c9 code mirror update to 5.40.2 2018-10-07 12:02:07 +02:00
azivner
0ce8d1e7e8 ctrl+del already has a standard behavior so removing it as a shortcut to delete note 2018-10-06 23:16:43 +02:00
azivner
b2776954a1 fix opening internal link from ckeditor link editing, fixes #191 2018-10-06 23:11:42 +02:00
azivner
d65610429c don't show tooltip over ckeditor link editing dialog 2018-10-06 22:00:43 +02:00
azivner
62de7f28eb consistently use root/ prefix for note paths 2018-10-06 21:32:07 +02:00
azivner
257cced182 release 0.22.1 2018-09-11 10:15:15 +02:00
azivner
3af27845b5 report missing sync configuration when clicking on Test sync 2018-09-11 10:09:55 +02:00
azivner
9b425025c9 fix sync double initialization issue 2018-09-11 10:01:40 +02:00
azivner
e8797a137f fix getting sync setup 2018-09-11 09:35:29 +02:00
azivner
947e875b6c added today script into demo document 2018-09-11 00:02:25 +02:00
azivner
15610626f1 fix for import issue 2018-09-10 23:41:11 +02:00
azivner
eb84cfbef2 sync login now includes check for sync server initialization and initializes it if necessary
Test sync button strictly not necessary
2018-09-10 20:22:26 +02:00
azivner
e4381d10e8 merged "Sync local document" into "Test sync" 2018-09-10 20:05:10 +02:00
azivner
b4a566df9e electron 2.0.9 and other small library updates 2018-09-10 19:09:05 +02:00
azivner
b20ff78653 revert server package to node 8 2018-09-09 17:53:55 +02:00
azivner
15888a5f8f sqlite binary for node 10 2018-09-09 12:57:11 +02:00
azivner
a90c164bbe fix server build 2018-09-09 12:08:56 +02:00
azivner
4f3aa9cd79 release 0.22.0 2018-09-09 10:08:45 +02:00
azivner
d248994143 updated windows scrypt binary 2018-09-09 09:46:15 +02:00
azivner
78518fbc60 note about platform support in README 2018-09-07 13:55:13 +02:00
azivner
50cd0c792c provide H4-H6, fixes #177 2018-09-07 13:47:26 +02:00
azivner
22e905aa99 enter on note in note tree leads to note title instead of content (second enter then goes to content) 2018-09-07 10:50:05 +02:00
azivner
8b41c1ef31 fix pasting HTML content into subnotes 2018-09-07 10:26:23 +02:00
azivner
492fde6f46 fix copy scrypt binary to correct directory 2018-09-06 23:23:19 +02:00
azivner
892a254e5a put missing options also to sqlInit 2018-09-06 23:21:14 +02:00
zadam
1ef3188213 cut selection and put it into subnote, fixes #171 2018-09-06 22:58:46 +02:00
azivner
c76329e671 increased default min pane width to 350px 2018-09-06 12:02:42 +02:00
azivner
c95e409b5e left pane sizing taking effect 2018-09-06 11:54:04 +02:00
azivner
ff086569f2 saving options for left pane sizing 2018-09-06 11:17:30 +02:00
azivner
bdc2fa1019 small refactoring of template and CSS 2018-09-06 09:33:38 +02:00
azivner
6668b55d6e use node 10 for docker and server package 2018-09-05 20:35:33 +02:00
azivner
46f37f7426 using @mlink/scrypt for node 10 compatibility 2018-09-05 15:14:20 +02:00
azivner
bc669c7b81 markdown wiki reference on README 2018-09-03 21:06:24 +02:00
662 changed files with 82261 additions and 60794 deletions

View File

@@ -1,4 +1,7 @@
.git
.idea
/bin
/dist
/docs
/npm-debug.log
node_modules
npm-debug.log
dist
.idea

7
.gitpod.yml Normal file
View File

@@ -0,0 +1,7 @@
tasks:
- before: nvm install 10 && nvm use 10
init: npm install
command: npm run start
ports:
- port: 8080
onOpen: open-preview

10
.idea/codeStyles/Project.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</value>
</option>
</code_scheme>
</component>

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View File

@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

2
.idea/dataSources.xml generated
View File

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

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<dataSource name="document.db">
<database-model serializer="dbm" rdbms="SQLITE" format-version="4.11">
<database-model serializer="dbm" dbms="SQLITE" family-id="SQLITE" format-version="4.14">
<root id="1">
<ServerVersion>3.16.1</ServerVersion>
</root>
@@ -15,8 +15,8 @@
<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="images"/>
<table id="11" parent="2" name="note_images"/>
<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"/>
@@ -59,6 +59,7 @@
<index id="25" 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">
@@ -127,523 +128,550 @@
<index id="38" parent="7" name="sqlite_autoindex_attributes_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>attributeId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="39" parent="7">
<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>
<ColumnCollations></ColumnCollations>
</index>
<index id="42" parent="7" name="IDX_attributes_value_index">
<ColNames>value</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="43" parent="7">
<ColNames>attributeId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_attributes_1</UnderlyingIndexName>
</key>
<column id="40" parent="8" name="branchId">
<column id="44" parent="8" name="branchId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="41" parent="8" name="noteId">
<column id="45" parent="8" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="42" parent="8" name="parentNoteId">
<column id="46" parent="8" name="parentNoteId">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="43" parent="8" name="notePosition">
<column id="47" parent="8" name="notePosition">
<Position>4</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="44" parent="8" name="prefix">
<column id="48" parent="8" name="prefix">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="45" parent="8" name="isExpanded">
<column id="49" parent="8" name="isExpanded">
<Position>6</Position>
<DataType>BOOLEAN|0s</DataType>
</column>
<column id="46" parent="8" name="isDeleted">
<column id="50" parent="8" name="isDeleted">
<Position>7</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="47" parent="8" name="dateModified">
<column id="51" parent="8" name="dateModified">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="48" parent="8" name="hash">
<column id="52" parent="8" name="hash">
<Position>9</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="49" parent="8" name="dateCreated">
<column id="53" parent="8" name="dateCreated">
<Position>10</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;1970-01-01T00:00:00.000Z&apos;</DefaultExpression>
</column>
<index id="50" parent="8" name="sqlite_autoindex_branches_1">
<index id="54" parent="8" name="sqlite_autoindex_branches_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>branchId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="51" parent="8" name="IDX_branches_noteId_parentNoteId">
<index id="55" parent="8" name="IDX_branches_noteId_parentNoteId">
<ColNames>noteId
parentNoteId</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="52" parent="8" name="IDX_branches_noteId">
<index id="56" parent="8" name="IDX_branches_noteId">
<ColNames>noteId</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="53" parent="8" name="IDX_branches_parentNoteId">
<index id="57" parent="8" name="IDX_branches_parentNoteId">
<ColNames>parentNoteId</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="54" parent="8">
<key id="58" parent="8">
<ColNames>branchId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_branches_1</UnderlyingIndexName>
</key>
<column id="55" parent="9" name="eventId">
<column id="59" parent="9" name="eventId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="56" parent="9" name="noteId">
<column id="60" parent="9" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="57" parent="9" name="comment">
<column id="61" parent="9" name="comment">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="58" parent="9" name="dateCreated">
<column id="62" parent="9" name="dateCreated">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="59" parent="9" name="sqlite_autoindex_event_log_1">
<index id="63" parent="9" name="sqlite_autoindex_event_log_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>eventId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="60" parent="9">
<key id="64" parent="9">
<ColNames>eventId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_event_log_1</UnderlyingIndexName>
</key>
<column id="61" parent="10" name="imageId">
<column id="65" parent="10" name="linkId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="62" parent="10" name="format">
<column id="66" parent="10" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="63" parent="10" name="checksum">
<column id="67" parent="10" name="targetNoteId">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="64" parent="10" name="name">
<column id="68" parent="10" name="type">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="65" parent="10" name="data">
<Position>5</Position>
<DataType>BLOB|0s</DataType>
</column>
<column id="66" parent="10" name="isDeleted">
<Position>6</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="67" parent="10" name="dateModified">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="68" parent="10" name="dateCreated">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="69" parent="10" name="hash">
<Position>9</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<index id="70" parent="10" name="sqlite_autoindex_images_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>imageId</ColNames>
<Unique>1</Unique>
</index>
<key id="71" parent="10">
<ColNames>imageId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_images_1</UnderlyingIndexName>
</key>
<column id="72" parent="11" name="noteImageId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="73" parent="11" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="74" parent="11" name="imageId">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="75" parent="11" name="isDeleted">
<Position>4</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="76" parent="11" name="dateModified">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="77" parent="11" name="dateCreated">
<column id="70" parent="10" name="isDeleted">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="78" parent="11" name="hash">
<column id="71" parent="10" name="dateCreated">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<index id="79" parent="11" name="sqlite_autoindex_note_images_1">
<column id="72" parent="10" name="dateModified">
<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>noteImageId</ColNames>
<ColNames>linkId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="80" parent="11" name="IDX_note_images_noteId_imageId">
<ColNames>noteId
imageId</ColNames>
</index>
<index id="81" parent="11" name="IDX_note_images_noteId">
<index id="74" parent="10" name="IDX_links_noteId_index">
<ColNames>noteId</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="82" parent="11" name="IDX_note_images_imageId">
<ColNames>imageId</ColNames>
<index id="75" parent="10" name="IDX_links_targetNoteId_index">
<ColNames>targetNoteId</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="83" parent="11">
<ColNames>noteImageId</ColNames>
<key id="76" parent="10">
<ColNames>linkId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_note_images_1</UnderlyingIndexName>
<UnderlyingIndexName>sqlite_autoindex_links_1</UnderlyingIndexName>
</key>
<column id="84" parent="12" name="noteRevisionId">
<column id="77" parent="11" name="noteContentId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="85" parent="12" name="noteId">
<column id="78" parent="11" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="86" parent="12" name="title">
<column id="79" parent="11" name="isProtected">
<Position>3</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="80" parent="11" name="content">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<DefaultExpression>NULL</DefaultExpression>
</column>
<column id="81" parent="11" name="hash">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="82" parent="11" name="dateCreated">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;2018-05-08T23:41:15.225Z&apos;</DefaultExpression>
</column>
<column id="83" parent="11" name="dateModified">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;2018-05-08T23:41:15.225Z&apos;</DefaultExpression>
</column>
<index id="84" parent="11" name="sqlite_autoindex_note_contents_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteContentId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="85" parent="11" name="IDX_note_contents_noteId">
<ColNames>noteId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="86" parent="11">
<ColNames>noteContentId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_note_contents_1</UnderlyingIndexName>
</key>
<column id="87" parent="12" name="noteRevisionId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="88" parent="12" name="noteId">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="89" parent="12" name="title">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="87" parent="12" name="content">
<column id="90" parent="12" name="content">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="88" parent="12" name="isProtected">
<column id="91" parent="12" name="isProtected">
<Position>5</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="89" parent="12" name="dateModifiedFrom">
<column id="92" parent="12" name="dateModifiedFrom">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="90" parent="12" name="dateModifiedTo">
<column id="93" parent="12" name="dateModifiedTo">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="91" parent="12" name="type">
<column id="94" parent="12" name="type">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="92" parent="12" name="mime">
<column id="95" parent="12" name="mime">
<Position>9</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;&apos;</DefaultExpression>
</column>
<column id="93" parent="12" name="hash">
<column id="96" parent="12" name="hash">
<Position>10</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<index id="94" parent="12" name="sqlite_autoindex_note_revisions_1">
<index id="97" parent="12" name="sqlite_autoindex_note_revisions_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteRevisionId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="95" parent="12" name="IDX_note_revisions_noteId">
<index id="98" parent="12" name="IDX_note_revisions_noteId">
<ColNames>noteId</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="96" parent="12" name="IDX_note_revisions_dateModifiedFrom">
<index id="99" parent="12" name="IDX_note_revisions_dateModifiedFrom">
<ColNames>dateModifiedFrom</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="97" parent="12" name="IDX_note_revisions_dateModifiedTo">
<index id="100" parent="12" name="IDX_note_revisions_dateModifiedTo">
<ColNames>dateModifiedTo</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="98" parent="12">
<key id="101" parent="12">
<ColNames>noteRevisionId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_note_revisions_1</UnderlyingIndexName>
</key>
<column id="99" parent="13" name="noteId">
<column id="102" parent="13" name="noteId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="100" parent="13" name="title">
<column id="103" parent="13" name="title">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;unnamed&quot;</DefaultExpression>
<DefaultExpression>&quot;note&quot;</DefaultExpression>
</column>
<column id="101" parent="13" name="content">
<column id="104" parent="13" name="isProtected">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="102" parent="13" name="isProtected">
<column id="105" parent="13" name="type">
<Position>4</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="103" parent="13" name="isDeleted">
<Position>5</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="104" parent="13" name="dateCreated">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="105" parent="13" name="dateModified">
<Position>7</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="106" parent="13" name="type">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;text&apos;</DefaultExpression>
</column>
<column id="107" parent="13" name="mime">
<Position>9</Position>
<column id="106" parent="13" name="mime">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;text/html&apos;</DefaultExpression>
</column>
<column id="108" parent="13" name="hash">
<Position>10</Position>
<column id="107" parent="13" name="hash">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<index id="109" parent="13" name="sqlite_autoindex_notes_1">
<column id="108" parent="13" name="isDeleted">
<Position>7</Position>
<DataType>INT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="109" parent="13" name="dateCreated">
<Position>8</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="110" parent="13" name="dateModified">
<Position>9</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="111" parent="13" name="sqlite_autoindex_notes_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>noteId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="110" parent="13" name="IDX_notes_type">
<ColNames>type</ColNames>
</index>
<key id="111" parent="13">
<key id="112" parent="13">
<ColNames>noteId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_notes_1</UnderlyingIndexName>
</key>
<column id="112" parent="14" name="name">
<column id="113" parent="14" name="name">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="113" parent="14" name="value">
<column id="114" parent="14" name="value">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
</column>
<column id="114" parent="14" name="dateModified">
<column id="115" parent="14" name="dateModified">
<Position>3</Position>
<DataType>INT|0s</DataType>
</column>
<column id="115" parent="14" name="isSynced">
<column id="116" parent="14" name="isSynced">
<Position>4</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>0</DefaultExpression>
</column>
<column id="116" parent="14" name="hash">
<column id="117" parent="14" name="hash">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="117" parent="14" name="dateCreated">
<column id="118" parent="14" name="dateCreated">
<Position>6</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&apos;1970-01-01T00:00:00.000Z&apos;</DefaultExpression>
</column>
<index id="118" parent="14" name="sqlite_autoindex_options_1">
<index id="119" parent="14" name="sqlite_autoindex_options_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>name</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="119" parent="14">
<key id="120" parent="14">
<ColNames>name</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_options_1</UnderlyingIndexName>
</key>
<column id="120" parent="15" name="branchId">
<column id="121" parent="15" name="branchId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="121" parent="15" name="notePath">
<column id="122" parent="15" name="notePath">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="122" parent="15" name="hash">
<column id="123" parent="15" name="hash">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
<DefaultExpression>&quot;&quot;</DefaultExpression>
</column>
<column id="123" parent="15" name="dateCreated">
<column id="124" parent="15" name="dateCreated">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="124" parent="15" name="isDeleted">
<column id="125" parent="15" name="isDeleted">
<Position>5</Position>
<DataType>INT|0s</DataType>
</column>
<index id="125" parent="15" name="sqlite_autoindex_recent_notes_1">
<index id="126" parent="15" name="sqlite_autoindex_recent_notes_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>branchId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="126" parent="15">
<key id="127" parent="15">
<ColNames>branchId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_recent_notes_1</UnderlyingIndexName>
</key>
<column id="127" parent="16" name="sourceId">
<column id="128" parent="16" name="sourceId">
<Position>1</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="128" parent="16" name="dateCreated">
<column id="129" parent="16" name="dateCreated">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="129" parent="16" name="sqlite_autoindex_source_ids_1">
<index id="130" parent="16" name="sqlite_autoindex_source_ids_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>sourceId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="130" parent="16">
<key id="131" parent="16">
<ColNames>sourceId</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_source_ids_1</UnderlyingIndexName>
</key>
<column id="131" parent="17" name="type">
<column id="132" parent="17" name="type">
<Position>1</Position>
<DataType>text|0s</DataType>
</column>
<column id="132" parent="17" name="name">
<column id="133" parent="17" name="name">
<Position>2</Position>
<DataType>text|0s</DataType>
</column>
<column id="133" parent="17" name="tbl_name">
<column id="134" parent="17" name="tbl_name">
<Position>3</Position>
<DataType>text|0s</DataType>
</column>
<column id="134" parent="17" name="rootpage">
<column id="135" parent="17" name="rootpage">
<Position>4</Position>
<DataType>integer|0s</DataType>
</column>
<column id="135" parent="17" name="sql">
<column id="136" parent="17" name="sql">
<Position>5</Position>
<DataType>text|0s</DataType>
</column>
<column id="136" parent="18" name="name">
<column id="137" parent="18" name="name">
<Position>1</Position>
</column>
<column id="137" parent="18" name="seq">
<column id="138" parent="18" name="seq">
<Position>2</Position>
</column>
<column id="138" parent="19" name="id">
<column id="139" parent="19" name="id">
<Position>1</Position>
<DataType>INTEGER|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="139" parent="19" name="entityName">
<column id="140" parent="19" name="entityName">
<Position>2</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="140" parent="19" name="entityId">
<column id="141" parent="19" name="entityId">
<Position>3</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="141" parent="19" name="sourceId">
<column id="142" parent="19" name="sourceId">
<Position>4</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="142" parent="19" name="syncDate">
<column id="143" parent="19" name="syncDate">
<Position>5</Position>
<DataType>TEXT|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="143" parent="19" name="IDX_sync_entityName_entityId">
<index id="144" parent="19" name="IDX_sync_entityName_entityId">
<ColNames>entityName
entityId</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="144" parent="19" name="IDX_sync_syncDate">
<index id="145" parent="19" name="IDX_sync_syncDate">
<ColNames>syncDate</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="145" parent="19">
<key id="146" parent="19">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>

4
.idea/encodings.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

View File

@@ -1,21 +1,28 @@
FROM node:8.11.2
RUN apt-get update && apt-get install -y nasm
FROM node:10.15.0-alpine
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# Copy both package.json and package-lock.json
# where available (npm@5+)
COPY package*.json ./
COPY package.json package-lock.json ./
RUN npm install --production
# If you are building your code for production
# RUN npm install --only=production
# Install app dependencies
RUN set -x \
&& apk add --no-cache --virtual .build-dependencies \
autoconf \
automake \
g++ \
gcc \
libtool \
make \
nasm \
libpng-dev \
&& npm install --production \
&& apk del .build-dependencies
# Bundle app source
COPY . .
EXPOSE 8080
CMD [ "node", "src/www" ]
CMD [ "node", "./src/www" ]

View File

@@ -1,39 +1,49 @@
# Trilium Notes
[![Join the chat at https://gitter.im/trilium-notes/Lobby](https://badges.gitter.im/trilium-notes/Lobby.svg)](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Trilium Notes is a hierarchical note taking application. Picture tells a thousand words:
Trilium Notes is a hierarchical note taking application with focus on building large personal knowledge bases. See [screenshots](https://github.com/zadam/trilium/wiki/Screenshot-tour) for quick overview:
![](https://raw.githubusercontent.com/wiki/zadam/trilium/images/screenshot.png)
See other pictures in [screenshot tour](https://github.com/zadam/trilium/wiki/Screenshot-tour).
## Features
* Notes can be arranged into arbitrarily deep hierarchy (tree)
* Notes can have more than 1 parents - see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes)
* 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)
* Support for editing [notes with source code](https://raw.githubusercontent.com/wiki/zadam/trilium/images/code-note.png), including syntax highlighting
* Fast and easy [navigation between notes](https://github.com/zadam/trilium/wiki/Note-navigation)
* 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|scripts]]
* 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)
* 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
* [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)
## Builds
Trilium is provided as either desktop application ([Electron](https://electronjs.org)-based) or web application hosted on your server.
Trilium is provided as either desktop application (Linux, Windows, Mac) or web application hosted on your server (Linux).
* 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).
* Currently only recent Chrome and Firefox are supported (tested) browsers.
## Status
Trilium is beta quality software. While it is reasonably feature complete and is tested by its author, it lacks proper testing by more users. It's not yet recommended for daily use, but testing and experimentation is encouraged.
## Documentation
[See wiki for complete list of documentation pages.](https://github.com/zadam/trilium/wiki/)
[See wiki for complete list of documentation pages.](https://github.com/zadam/trilium/wiki/)
You can also read [Patterns of personal knowledge base](https://github.com/zadam/trilium/wiki/Patterns-of-personal-knowledge-base) to get some inspiration on how you might use Trilium.
## Contribute
Use a browser based dev environment
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/zadam/trilium)
Or clone locally and run
```
npm install
npm run start
```

7
bin/build-debian.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
echo "Packaging debian x64 distribution..."
VERSION=`jq -r ".version" package.json`
./node_modules/.bin/electron-installer-debian --config bin/deb-options.json --options.version=${VERSION} --arch amd64

View File

@@ -1,8 +1,5 @@
#!/usr/bin/env bash
if [[ $# -eq 0 ]] ; then
echo "Missing argument of new version"
exit 1
fi
VERSION=`jq -r ".version" package.json`
sudo docker build -t zadam/trilium:latest -t zadam/trilium:$1 .
sudo docker build -t zadam/trilium:latest -t zadam/trilium:$VERSION .

24
bin/build-linux-x64.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
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 src/public/images/app-icons/png/128x128.png $BUILD_DIR/icon.png
# removing software WebGL binaries because they are pretty huge and not necessary
rm -r $BUILD_DIR/swiftshader
echo "Packaging linux x64 electron distribution..."
VERSION=`jq -r ".version" package.json`
cd dist
tar cJf trilium-linux-x64-${VERSION}.tar.xz trilium-linux-x64

32
bin/build-mac-x64.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
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=src/public/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`
cd dist
rm trilium-mac-x64-${VERSION}.zip
zip -r9 --symlinks trilium-mac-x64-${VERSION}.zip trilium-mac-x64

View File

@@ -1,19 +1,13 @@
#!/usr/bin/env bash
if [[ $# -eq 0 ]] ; then
echo "Missing argument of new version"
exit 1
fi
VERSION=$1
PKG_DIR=dist/trilium-linux-x64-server
NODE_VERSION=8.11.4
NODE_VERSION=10.15.0
rm -r $PKG_DIR
mkdir $PKG_DIR
cd $PKG_DIR
wget https://nodejs.org/dist/latest-v8.x/node-v${NODE_VERSION}-linux-x64.tar.xz
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
@@ -30,9 +24,15 @@ 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 ..
7z a trilium-linux-x64-server-${VERSION}.7z trilium-linux-x64-server
VERSION=`jq -r ".version" ../package.json`
tar cJf trilium-linux-x64-server-${VERSION}.tar.xz trilium-linux-x64-server

32
bin/build-win-x64.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
BUILD_DIR=./dist/trilium-windows-x64
rm -rf $BUILD_DIR
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/*
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/
./node_modules/.bin/electron-packager . --asar --out=dist --executable-name=trilium --platform=win32 --arch=x64 --overwrite --icon=src/public/images/app-icons/win/icon.ico
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`
cd dist
zip -r9 trilium-windows-x64-${VERSION}.zip trilium-windows-x64

View File

@@ -8,31 +8,14 @@ echo "Deleting existing builds"
rm -r dist/*
echo "Rebuilding binaries for linux-ia32"
./node_modules/.bin/electron-rebuild --arch=ia32
bin/build-win-x64.sh
./node_modules/.bin/electron-packager . --out=dist --platform=linux --arch=ia32 --overwrite
bin/build-mac-x64.sh
./node_modules/.bin/electron-packager . --out=dist --platform=win32 --arch=x64 --overwrite
# building X64 linux as the last so electron-rebuild will prepare X64 binaries for local development
bin/build-linux-x64.sh
# we build x64 as second so that we keep X64 binaries in node_modules for local development and server build
echo "Rebuilding binaries for linux-x64"
./node_modules/.bin/electron-rebuild --arch=x64
# this needs to be run after linux build
bin/build-debian.sh
./node_modules/.bin/electron-packager . --out=dist --platform=linux --arch=x64 --overwrite
echo "Copying required windows binaries"
WIN_RES_DIR=./dist/trilium-win32-x64/resources/app
cp -r bin/deps/sqlite/* $WIN_RES_DIR/node_modules/sqlite3/lib/binding/
cp bin/deps/image/cjpeg.exe $WIN_RES_DIR/node_modules/mozjpeg/vendor/
cp bin/deps/image/pngquant.exe $WIN_RES_DIR/node_modules/imagemin-pngquant/node_modules/pngquant-bin/vendor/
cp bin/deps/image/gifsicle.exe $WIN_RES_DIR/node_modules/giflossy/vendor/
cp bin/deps/scrypt.node $WIN_RES_DIR/node_modules/scrypt/build/Release/
echo "Cleaning up unnecessary binaries from all builds"
rm -r ./dist/trilium-linux-ia32/resources/app/bin/deps
rm -r ./dist/trilium-linux-x64/resources/app/bin/deps
rm -r ./dist/trilium-win32-x64/resources/app/bin/deps
bin/build-server.sh

14
bin/deb-options.json Normal file
View File

@@ -0,0 +1,14 @@
{
"src": "dist/trilium-linux-x64",
"dest": "dist/",
"name": "trilium",
"productName": "Trilium Notes",
"genericName": "Note taker",
"description": "Trilium Notes is a hierarchical note taking application with focus on building large personal knowledge bases.",
"sections": "misc",
"maintainer": "zadam.apps@gmail.com",
"homepage": "https://github.com/zadam/trilium",
"bin": "trilium",
"icon": "dist/trilium-linux-x64/icon.png",
"categories": [ "Office" ]
}

BIN
bin/deps/mac-x64/image/cjpeg Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
sqlite3 ~/trilium-data/document.db < bin/dump.sql

View File

@@ -1,19 +0,0 @@
.mode insert branches
.out db/main_branches.sql
select * from branches where isDeleted = 0;
.mode insert notes
.out db/main_notes.sql
select * from notes where isDeleted = 0;
.mode insert images
.out db/main_images.sql
select * from images where isDeleted = 0;
.mode insert note_images
.out db/main_note_images.sql
select * from note_images where isDeleted = 0;
.mode insert attributes
.out db/main_attributes.sql
select * from attributes where isDeleted = 0;

View File

@@ -2,6 +2,6 @@
SCHEMA_FILE_PATH=db/schema.sql
sqlite3 ~/trilium-data/document.db .schema > "$SCHEMA_FILE_PATH"
sqlite3 ~/trilium-data/document.db .schema | grep -v "sqlite_sequence" > "$SCHEMA_FILE_PATH"
echo "DB schema exported to $SCHEMA_FILE_PATH"

0
bin/generate-cert.sh Normal file → Executable file
View File

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env bash
VERSION=`jq -r ".version" package.json`
cd dist
echo "Packaging linux x64 electron distribution..."
7z a trilium-linux-x64-${VERSION}.7z trilium-linux-x64
echo "Packaging linux ia32 electron distribution..."
7z a trilium-linux-ia32-${VERSION}.7z trilium-linux-ia32
echo "Packaging windows x64 electron distribution..."
7z a trilium-windows-x64-${VERSION}.7z trilium-win32-x64

View File

@@ -42,18 +42,30 @@ git push origin $TAG
bin/build.sh
bin/package.sh
LINUX_X64_BUILD=trilium-linux-x64-$VERSION.7z
LINUX_IA32_BUILD=trilium-linux-ia32-$VERSION.7z
WINDOWS_X64_BUILD=trilium-windows-x64-$VERSION.7z
SERVER_BUILD=trilium-linux-x64-server-$VERSION.7z
LINUX_X64_BUILD=trilium-linux-x64-$VERSION.tar.xz
DEBIAN_X64_BUILD=trilium_${VERSION}_amd64.deb
WINDOWS_X64_BUILD=trilium-windows-x64-$VERSION.zip
MAC_X64_BUILD=trilium-mac-x64-$VERSION.zip
SERVER_BUILD=trilium-linux-x64-server-$VERSION.tar.xz
echo "Creating release in GitHub"
EXTRA=
if [[ $TAG == *"beta"* ]]; then
EXTRA=--pre-release
fi
github-release release \
--tag $TAG \
--name "$TAG release"
--name "$TAG release" $EXTRA
echo "Uploading debian x64 package"
github-release upload \
--tag $TAG \
--name "$DEBIAN_X64_BUILD" \
--file "dist/$DEBIAN_X64_BUILD"
echo "Uploading linux x64 build"
@@ -62,13 +74,6 @@ github-release upload \
--name "$LINUX_X64_BUILD" \
--file "dist/$LINUX_X64_BUILD"
echo "Uploading linux ia32 build"
github-release upload \
--tag $TAG \
--name "$LINUX_IA32_BUILD" \
--file "dist/$LINUX_IA32_BUILD"
echo "Uploading windows x64 build"
github-release upload \
@@ -76,9 +81,14 @@ github-release upload \
--name "$WINDOWS_X64_BUILD" \
--file "dist/$WINDOWS_X64_BUILD"
echo "Packaging server version"
echo "Uploading mac x64 build"
bin/build-server.sh $VERSION
github-release upload \
--tag $TAG \
--name "$MAC_X64_BUILD" \
--file "dist/$MAC_X64_BUILD"
echo "Uploading linux x64 server build"
github-release upload \
--tag $TAG \

3
bin/reset-local.sh Executable file
View File

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

BIN
db/demo.tar Normal file

Binary file not shown.

View File

@@ -1,215 +0,0 @@
INSERT INTO attributes VALUES('YGaLsZ2s2WFr','N029F9ANGn8b','label','originalFileName','d3.js',1,'2018-08-28T20:50:22.260Z','2018-08-28T20:50:22.260Z',0,'71K4ZEuZMn',0);
INSERT INTO attributes VALUES('MU459UPoTpIl','N029F9ANGn8b','label','fileSize','495159',2,'2018-08-28T20:50:22.268Z','2018-08-28T20:50:22.269Z',0,'Uw4q81aSPb',0);
INSERT INTO attributes VALUES('K7NPLAdJC75T','bFTtwsnNgw9T','label','originalFileName','dagre-d3.js',1,'2018-08-28T20:50:22.278Z','2018-08-28T20:50:22.278Z',0,'B+5IYDa0kV',0);
INSERT INTO attributes VALUES('fxcbzV7SajDg','bFTtwsnNgw9T','label','fileSize','1412934',2,'2018-08-28T20:50:22.338Z','2018-08-28T20:50:22.338Z',0,'fKMcMhthAe',0);
INSERT INTO attributes VALUES('H1Y47EfTlkcx','ucC6Zabv3Uml','label','appCss','',0,'2018-08-28T20:50:22.404Z','2018-08-28T20:50:22.404Z',0,'gy/N05x553',0);
INSERT INTO attributes VALUES('dClxXNDtkPhG','YULCKCrWJJZ6','relation','child:template','WkdQrYTnsgxP',0,'2018-08-28T20:50:22.407Z','2018-08-28T20:50:22.407Z',0,'KCB4vrX2+Q',0);
INSERT INTO attributes VALUES('ascoxgnizejs','YULCKCrWJJZ6','label','child:person','',1,'2018-08-28T20:50:22.410Z','2018-08-28T20:50:22.410Z',0,'cWQ4h0JzfC',0);
INSERT INTO attributes VALUES('nDrmznDDBYA9','wHb2YBwhjxiD','label','dateOfBirth','1895-12-14',0,'2018-08-28T20:50:22.413Z','2018-08-28T20:50:22.413Z',0,'erlRsUQzW5',0);
INSERT INTO attributes VALUES('xQ6wvIQaVIZ1','wHb2YBwhjxiD','label','dateOfDeath','1952-02-06',1,'2018-08-28T20:50:22.416Z','2018-08-28T20:50:22.416Z',0,'2uh0vKvpVU',0);
INSERT INTO attributes VALUES('oyIs9VmMgsvI','wHb2YBwhjxiD','relation','isPartnerOf','cUYFEvsdY6N6',2,'2018-08-28T20:50:22.419Z','2018-08-28T20:50:22.419Z',0,'OM3NVpPaUq',0);
INSERT INTO attributes VALUES('O54Zoiiq2Fcu','wHb2YBwhjxiD','label','person','',3,'2018-08-28T20:50:22.423Z','2018-08-28T20:50:22.423Z',0,'FHNEKhY7+c',0);
INSERT INTO attributes VALUES('hq6g3wa2T2Iw','wHb2YBwhjxiD','relation','template','WkdQrYTnsgxP',4,'2018-08-28T20:50:22.426Z','2018-08-28T20:50:22.426Z',0,'+K8jpY+5S/',0);
INSERT INTO attributes VALUES('8zizvAfpH5Jl','wHb2YBwhjxiD','relation','hasChild','s0Hhsl0nb1bg',5,'2018-08-28T20:50:22.428Z','2018-08-28T20:50:22.428Z',0,'NRrR0GBy88',0);
INSERT INTO attributes VALUES('WPqEnSKOFM8N','cUYFEvsdY6N6','label','dateOfBirth','1900-08-04',0,'2018-08-28T20:50:22.431Z','2018-08-28T20:50:22.432Z',0,'3HOaOLE+oy',0);
INSERT INTO attributes VALUES('BY6Kj6aAFu0e','cUYFEvsdY6N6','label','dateOfDeath','2002-03-30',1,'2018-08-28T20:50:22.436Z','2018-08-28T20:50:22.436Z',0,'rZrLFiOvj8',0);
INSERT INTO attributes VALUES('0555anatAyWg','cUYFEvsdY6N6','relation','isPartnerOf','wHb2YBwhjxiD',2,'2018-08-28T20:50:22.439Z','2018-08-28T20:50:22.439Z',0,'yWMcMCRxnH',0);
INSERT INTO attributes VALUES('oXibmgJQOzGB','cUYFEvsdY6N6','label','person','',3,'2018-08-28T20:50:22.441Z','2018-08-28T20:50:22.441Z',0,'RetqdPzOby',0);
INSERT INTO attributes VALUES('A0E0SgIGNYBR','cUYFEvsdY6N6','relation','template','WkdQrYTnsgxP',4,'2018-08-28T20:50:22.444Z','2018-08-28T20:50:22.444Z',0,'UGs+JIASFB',0);
INSERT INTO attributes VALUES('DlXDyWCKW7ST','cUYFEvsdY6N6','relation','hasChild','s0Hhsl0nb1bg',5,'2018-08-28T20:50:22.448Z','2018-08-28T20:50:22.448Z',0,'wPF8Epw2f2',0);
INSERT INTO attributes VALUES('5Dxq7ZOSyOwZ','8APXN4n4Hnb8','label','dateOfBirth','1921-06-10',0,'2018-08-28T20:50:22.451Z','2018-08-28T20:50:22.451Z',0,'kM9tlQ1n7a',0);
INSERT INTO attributes VALUES('pRMQNiknkpSr','8APXN4n4Hnb8','relation','isPartnerOf','s0Hhsl0nb1bg',1,'2018-08-28T20:50:22.457Z','2018-08-28T20:50:22.457Z',0,'TzsOqFQYjk',0);
INSERT INTO attributes VALUES('OKlFBgqr61Uy','8APXN4n4Hnb8','relation','hasChild','baafKkgNGYLm',2,'2018-08-28T20:50:22.460Z','2018-08-28T20:50:22.460Z',0,'t4hEDC534r',0);
INSERT INTO attributes VALUES('yVZf4BNnV0Ev','8APXN4n4Hnb8','label','person','',3,'2018-08-28T20:50:22.462Z','2018-08-28T20:50:22.462Z',0,'L+xujQPpBw',0);
INSERT INTO attributes VALUES('8oAIhmdTUvEg','8APXN4n4Hnb8','relation','template','WkdQrYTnsgxP',4,'2018-08-28T20:50:22.465Z','2018-08-28T20:50:22.465Z',0,'GbRQJL+GEp',0);
INSERT INTO attributes VALUES('cneD8mgzvai7','s0Hhsl0nb1bg','label','dateOfBirth','1926-04-21',0,'2018-08-28T20:50:22.468Z','2018-08-28T20:50:22.468Z',0,'cXdtlXqXEB',0);
INSERT INTO attributes VALUES('8z9zChaZOTDH','s0Hhsl0nb1bg','relation','isPartnerOf','8APXN4n4Hnb8',1,'2018-08-28T20:50:22.471Z','2018-08-28T20:50:22.471Z',0,'33J9ZyF2ho',0);
INSERT INTO attributes VALUES('gdJaomu0xBOu','s0Hhsl0nb1bg','relation','isChildOf','cUYFEvsdY6N6',3,'2018-08-28T20:50:22.477Z','2018-08-28T20:50:22.477Z',0,'BIFGASgBgq',0);
INSERT INTO attributes VALUES('9Jwa8a993yen','s0Hhsl0nb1bg','relation','isChildOf','wHb2YBwhjxiD',4,'2018-08-28T20:50:22.479Z','2018-08-28T20:50:22.480Z',0,'TG9GD3do5B',0);
INSERT INTO attributes VALUES('Xe1QAkKsWWpF','s0Hhsl0nb1bg','relation','hasChild','baafKkgNGYLm',5,'2018-08-28T20:50:22.482Z','2018-08-28T20:50:22.482Z',0,'dqIMe2e19M',0);
INSERT INTO attributes VALUES('kEg8zFFq248G','s0Hhsl0nb1bg','label','person','',6,'2018-08-28T20:50:22.485Z','2018-08-28T20:50:22.485Z',0,'MMnLxCR8F3',0);
INSERT INTO attributes VALUES('tRZ6MSnKSTqR','s0Hhsl0nb1bg','relation','template','WkdQrYTnsgxP',7,'2018-08-28T20:50:22.509Z','2018-08-28T20:50:22.509Z',0,'rosgXW/nGc',0);
INSERT INTO attributes VALUES('JBKulahGmJbS','baafKkgNGYLm','label','dateOfBirth','1948-11-14',0,'2018-08-28T20:50:22.513Z','2018-08-28T20:50:22.513Z',0,'rrxcH0EJyd',0);
INSERT INTO attributes VALUES('iQrlMg7Hw4TV','baafKkgNGYLm','relation','isPartnerOf','Ab7WuV47mQOf',1,'2018-08-28T20:50:22.517Z','2018-08-28T20:50:22.517Z',0,'ZC8g7df+GX',0);
INSERT INTO attributes VALUES('lR5KNuf8nZPv','baafKkgNGYLm','relation','isChildOf','s0Hhsl0nb1bg',3,'2018-08-28T20:50:22.520Z','2018-08-28T20:50:22.520Z',0,'3+cBucfifY',0);
INSERT INTO attributes VALUES('Zy86gvVrUdL9','baafKkgNGYLm','relation','isChildOf','8APXN4n4Hnb8',4,'2018-08-28T20:50:22.527Z','2018-08-28T20:50:22.527Z',0,'S8oRMD6Zl2',0);
INSERT INTO attributes VALUES('4A0fdX1Nw6HW','baafKkgNGYLm','relation','hasChild','w7t110kWsK8e',5,'2018-08-28T20:50:22.529Z','2018-08-28T20:50:22.529Z',0,'1xwLwGQ8Nq',0);
INSERT INTO attributes VALUES('KJp2whVwU9t8','baafKkgNGYLm','relation','hasChild','at7bZyjJfIrM',6,'2018-08-28T20:50:22.533Z','2018-08-28T20:50:22.533Z',0,'GCW74wkayV',0);
INSERT INTO attributes VALUES('Z9XptIzsoACA','baafKkgNGYLm','label','person','',7,'2018-08-28T20:50:22.536Z','2018-08-28T20:50:22.536Z',0,'JjkYlF07eh',0);
INSERT INTO attributes VALUES('ZW3lFQx4x5b2','baafKkgNGYLm','relation','template','WkdQrYTnsgxP',8,'2018-08-28T20:50:22.540Z','2018-08-28T20:50:22.540Z',0,'UpMRWuOZb/',0);
INSERT INTO attributes VALUES('Ey8y4cy3DcCi','Ab7WuV47mQOf','label','dateOfBirth','1961-07-01',0,'2018-08-28T20:50:22.543Z','2018-08-28T20:50:22.543Z',0,'64htbnhge6',0);
INSERT INTO attributes VALUES('AiAfIBWpOz5x','Ab7WuV47mQOf','label','dateOfDeath','1997-08-31',1,'2018-08-28T20:50:22.545Z','2018-08-28T20:50:22.546Z',0,'mFxHu1vXL5',0);
INSERT INTO attributes VALUES('MZYw8enjG9NE','Ab7WuV47mQOf','relation','isPartnerOf','baafKkgNGYLm',2,'2018-08-28T20:50:22.549Z','2018-08-28T20:50:22.549Z',0,'jvWO1/tx45',0);
INSERT INTO attributes VALUES('ScLhggJccqQa','Ab7WuV47mQOf','relation','hasChild','at7bZyjJfIrM',3,'2018-08-28T20:50:22.551Z','2018-08-28T20:50:22.552Z',0,'bvNZplJq2L',0);
INSERT INTO attributes VALUES('ZsXr2c8BygWE','Ab7WuV47mQOf','relation','hasChild','w7t110kWsK8e',4,'2018-08-28T20:50:22.555Z','2018-08-28T20:50:22.555Z',0,'FN00a6ym1T',0);
INSERT INTO attributes VALUES('YdQLLaYVuziQ','Ab7WuV47mQOf','label','person','',5,'2018-08-28T20:50:22.558Z','2018-08-28T20:50:22.558Z',0,'j3DcoUoRob',0);
INSERT INTO attributes VALUES('wCFa6BcfMeYs','Ab7WuV47mQOf','relation','template','WkdQrYTnsgxP',6,'2018-08-28T20:50:22.561Z','2018-08-28T20:50:22.561Z',0,'pWMc9bIpYU',0);
INSERT INTO attributes VALUES('UjQK6CfeN1FQ','w7t110kWsK8e','label','dateOfBirth','1982-06-21',0,'2018-08-28T20:50:22.564Z','2018-08-28T20:50:22.564Z',0,'KmPfpQC3YZ',0);
INSERT INTO attributes VALUES('BgEgHc6nbK9N','w7t110kWsK8e','relation','isPartnerOf','OZKicr536m7U',1,'2018-08-28T20:50:22.567Z','2018-08-28T20:50:22.567Z',0,'/x6KvO+8a3',0);
INSERT INTO attributes VALUES('KqV4d4pJYS2E','w7t110kWsK8e','relation','isChildOf','Ab7WuV47mQOf',2,'2018-08-28T20:50:22.570Z','2018-08-28T20:50:22.570Z',0,'KyraxcQqDz',0);
INSERT INTO attributes VALUES('wlb9vaZSYcq5','w7t110kWsK8e','relation','isChildOf','baafKkgNGYLm',3,'2018-08-28T20:50:22.575Z','2018-08-28T20:50:22.575Z',0,'UU8YR4ybWt',0);
INSERT INTO attributes VALUES('z5LqaK45g4hR','w7t110kWsK8e','relation','hasChild','oato1D7kuNU2',4,'2018-08-28T20:50:22.577Z','2018-08-28T20:50:22.577Z',0,'e/UPI6kcvv',0);
INSERT INTO attributes VALUES('fCD45rh2vdkT','w7t110kWsK8e','relation','hasChild','C1I7GPA8ORO4',5,'2018-08-28T20:50:22.580Z','2018-08-28T20:50:22.581Z',0,'oT4QlgrVte',0);
INSERT INTO attributes VALUES('C2Vigv6G5FS1','w7t110kWsK8e','relation','hasChild','gQNQaMBzRYdb',6,'2018-08-28T20:50:22.584Z','2018-08-28T20:50:22.584Z',0,'wUKaPiuJQk',0);
INSERT INTO attributes VALUES('E9rVr79Kz9V6','w7t110kWsK8e','label','person','',7,'2018-08-28T20:50:22.587Z','2018-08-28T20:50:22.587Z',0,'K/hdjV+tSK',0);
INSERT INTO attributes VALUES('8XRlAf6WV3qg','w7t110kWsK8e','relation','template','WkdQrYTnsgxP',8,'2018-08-28T20:50:22.590Z','2018-08-28T20:50:22.590Z',0,'FSl46d9i1L',0);
INSERT INTO attributes VALUES('zH72GS2ubC6n','at7bZyjJfIrM','label','dateOfBirth','1984-09-15',0,'2018-08-28T20:50:22.593Z','2018-08-28T20:50:22.593Z',0,'gRa24FkJ54',0);
INSERT INTO attributes VALUES('RUlGHoZKKwI1','at7bZyjJfIrM','relation','isChildOf','Ab7WuV47mQOf',2,'2018-08-28T20:50:22.595Z','2018-08-28T20:50:22.595Z',0,'UqtXMxkS8I',0);
INSERT INTO attributes VALUES('s6fz9RfUkN16','at7bZyjJfIrM','relation','isChildOf','baafKkgNGYLm',3,'2018-08-28T20:50:22.598Z','2018-08-28T20:50:22.598Z',0,'sflViPP/Jy',0);
INSERT INTO attributes VALUES('ewBwlqrIQ4gT','at7bZyjJfIrM','label','person','',4,'2018-08-28T20:50:22.600Z','2018-08-28T20:50:22.600Z',0,'qV4yjjVjU8',0);
INSERT INTO attributes VALUES('R2LUPwcGsuNw','at7bZyjJfIrM','relation','template','WkdQrYTnsgxP',5,'2018-08-28T20:50:22.603Z','2018-08-28T20:50:22.603Z',0,'NRS6Dn58NQ',0);
INSERT INTO attributes VALUES('NmqnFfEvfSPm','OZKicr536m7U','label','dateOfBirth','1982-01-09',0,'2018-08-28T20:50:22.606Z','2018-08-28T20:50:22.607Z',0,'d3wENODQzf',0);
INSERT INTO attributes VALUES('TFzxV7PECiaL','OZKicr536m7U','relation','isPartnerOf','w7t110kWsK8e',1,'2018-08-28T20:50:22.611Z','2018-08-28T20:50:22.611Z',0,'Om8CZOKQ3n',0);
INSERT INTO attributes VALUES('KZkuMnxLcwXv','OZKicr536m7U','label','person','',2,'2018-08-28T20:50:22.615Z','2018-08-28T20:50:22.615Z',0,'ant2+CLJEK',0);
INSERT INTO attributes VALUES('mpaiLAxFYEaV','OZKicr536m7U','relation','template','WkdQrYTnsgxP',3,'2018-08-28T20:50:22.618Z','2018-08-28T20:50:22.619Z',0,'sny+Ar6U5l',0);
INSERT INTO attributes VALUES('DMrFjWJ1gEGV','OZKicr536m7U','relation','hasChild','oato1D7kuNU2',4,'2018-08-28T20:50:22.624Z','2018-08-28T20:50:22.624Z',0,'JDx8fEDsrJ',0);
INSERT INTO attributes VALUES('We1iR49umgtV','OZKicr536m7U','relation','hasChild','C1I7GPA8ORO4',5,'2018-08-28T20:50:22.626Z','2018-08-28T20:50:22.626Z',0,'ZZPFqVVGHL',0);
INSERT INTO attributes VALUES('AYJHtO581jiN','OZKicr536m7U','relation','hasChild','gQNQaMBzRYdb',6,'2018-08-28T20:50:22.628Z','2018-08-28T20:50:22.629Z',0,'tbtnoMJJZn',0);
INSERT INTO attributes VALUES('iuCrdcbtL4qC','oato1D7kuNU2','label','dateOfBirth','2013-07-22',0,'2018-08-28T20:50:22.632Z','2018-08-28T20:50:22.632Z',0,'IcMT391SzX',0);
INSERT INTO attributes VALUES('Q8Vo1KIxkJmj','oato1D7kuNU2','relation','isChildOf','w7t110kWsK8e',1,'2018-08-28T20:50:22.635Z','2018-08-28T20:50:22.635Z',0,'zoA+rRFKM+',0);
INSERT INTO attributes VALUES('5mrM42brxDuz','oato1D7kuNU2','relation','isChildOf','OZKicr536m7U',2,'2018-08-28T20:50:22.638Z','2018-08-28T20:50:22.639Z',0,'P6P4YU7BTd',0);
INSERT INTO attributes VALUES('buvl0DlrHfPa','oato1D7kuNU2','label','person','',3,'2018-08-28T20:50:22.642Z','2018-08-28T20:50:22.642Z',0,'AumhH4Hib8',0);
INSERT INTO attributes VALUES('fmy9BlOToZyF','oato1D7kuNU2','relation','template','WkdQrYTnsgxP',4,'2018-08-28T20:50:22.645Z','2018-08-28T20:50:22.645Z',0,'E1I7jbmUVs',0);
INSERT INTO attributes VALUES('dO2wroKfcuE0','C1I7GPA8ORO4','label','dateOfBirth','2015-05-02',0,'2018-08-28T20:50:22.647Z','2018-08-28T20:50:22.648Z',0,'Y7bf4ZWZCE',0);
INSERT INTO attributes VALUES('Z5gVHx3DbIch','C1I7GPA8ORO4','relation','isChildOf','w7t110kWsK8e',1,'2018-08-28T20:50:22.650Z','2018-08-28T20:50:22.650Z',0,'LSINZZQzBt',0);
INSERT INTO attributes VALUES('1kNzvErwUjrs','C1I7GPA8ORO4','relation','isChildOf','OZKicr536m7U',2,'2018-08-28T20:50:22.653Z','2018-08-28T20:50:22.653Z',0,'ePUs5vanHB',0);
INSERT INTO attributes VALUES('W6glbhKhyWPT','C1I7GPA8ORO4','label','person','',3,'2018-08-28T20:50:22.658Z','2018-08-28T20:50:22.658Z',0,'zRvRYSbqZi',0);
INSERT INTO attributes VALUES('0GJ2aHqAuodC','C1I7GPA8ORO4','relation','template','WkdQrYTnsgxP',4,'2018-08-28T20:50:22.661Z','2018-08-28T20:50:22.661Z',0,'m88hxWjzQ0',0);
INSERT INTO attributes VALUES('ITjvtJPre6AT','gQNQaMBzRYdb','label','dateOfBirth','2018-04-23',0,'2018-08-28T20:50:22.664Z','2018-08-28T20:50:22.664Z',0,'ceKKy9B5o1',0);
INSERT INTO attributes VALUES('CObXkmUCKNvA','gQNQaMBzRYdb','relation','isChildOf','w7t110kWsK8e',1,'2018-08-28T20:50:22.667Z','2018-08-28T20:50:22.668Z',0,'D/R7JZPq5g',0);
INSERT INTO attributes VALUES('zFLwAPnbTSXJ','gQNQaMBzRYdb','relation','isChildOf','OZKicr536m7U',2,'2018-08-28T20:50:22.674Z','2018-08-28T20:50:22.674Z',0,'Hi1uUloX9W',0);
INSERT INTO attributes VALUES('76tF3kkXj0DU','gQNQaMBzRYdb','label','person','',3,'2018-08-28T20:50:22.676Z','2018-08-28T20:50:22.676Z',0,'MDjdPy4afu',0);
INSERT INTO attributes VALUES('t1iefYiRAtYo','gQNQaMBzRYdb','relation','template','WkdQrYTnsgxP',4,'2018-08-28T20:50:22.679Z','2018-08-28T20:50:22.679Z',0,'5GgcLGKhaR',0);
INSERT INTO attributes VALUES('Bpe9iT3XyyOY','WkdQrYTnsgxP','label-definition','dateOfBirth','{"labelType":"date","multiplicityType":"singlevalue","isPromoted":true}',0,'2018-08-28T20:50:22.682Z','2018-08-28T20:50:22.682Z',0,'NYj5Rr17+t',1);
INSERT INTO attributes VALUES('GxEesX6Ps1qg','WkdQrYTnsgxP','label-definition','dateOfDeath','{"labelType":"date","multiplicityType":"singlevalue","isPromoted":true}',1,'2018-08-28T20:50:22.684Z','2018-08-28T20:50:22.685Z',0,'ayZ1VP6NAU',1);
INSERT INTO attributes VALUES('8lmgLJkU0fts','WkdQrYTnsgxP','relation-definition','isPartnerOf','{"multiplicityType":"multivalue","isPromoted":true}',2,'2018-08-28T20:50:22.687Z','2018-08-28T20:50:22.687Z',0,'efMdysR9Pd',1);
INSERT INTO attributes VALUES('jKbUzkPDskWK','WkdQrYTnsgxP','relation-definition','isChildOf','{"multiplicityType":"multivalue","isPromoted":true}',3,'2018-08-28T20:50:22.690Z','2018-08-28T20:50:22.690Z',0,'ZUJB7r3rT4',1);
INSERT INTO attributes VALUES('WUn7ZivbtEEL','WkdQrYTnsgxP','relation-definition','hasChild','{"multiplicityType":"multivalue","isPromoted":true}',4,'2018-08-28T20:50:22.693Z','2018-08-28T20:50:22.694Z',0,'l55U94jslK',1);
INSERT INTO attributes VALUES('9bwMbu66bibw','WkdQrYTnsgxP','label','person','',5,'2018-08-28T20:50:22.696Z','2018-08-28T20:50:22.696Z',0,'4PC6o0t3Pr',0);
INSERT INTO attributes VALUES('6oj5nftjfbBC','HgaAwBX5zVcP','label','originalFileName','chart.js',1,'2018-08-28T20:50:36.164Z','2018-08-28T20:50:36.164Z',0,'6nDd6oTR6B',0);
INSERT INTO attributes VALUES('gZgmYZ9C4foc','HgaAwBX5zVcP','label','fileSize','211133',2,'2018-08-28T20:50:36.171Z','2018-08-28T20:50:36.171Z',0,'hHlFlDfuQP',0);
INSERT INTO attributes VALUES('Fb8UazsIiOk5','Dyahpf7LroQY','label','taskLocationRoot','',0,'2018-08-28T20:50:48.604Z','2018-08-28T20:50:48.604Z',0,'DM2/m1t5TR',0);
INSERT INTO attributes VALUES('f0Ow5PJyhbYY','nUgD4SYx2gt7','label','taskTagRoot','',0,'2018-08-28T20:50:48.618Z','2018-08-28T20:50:48.618Z',0,'5MQeVb7i0Z',0);
INSERT INTO attributes VALUES('6or0Gr0hFW2t','9HHqPxJkLAkl','label','taskDoneRoot','',0,'2018-08-28T20:50:48.626Z','2018-08-28T20:50:48.626Z',0,'e8MjtXx+UD',0);
INSERT INTO attributes VALUES('pSVR4p5EM3i1','XVlWndK4Oh6A','label','run','frontendStartup',0,'2018-08-28T20:50:48.630Z','2018-08-28T20:50:48.630Z',0,'/Og2vneotj',0);
INSERT INTO attributes VALUES('uSj6vDAaM3Z8','gYNJtGEPGW95','label','appCss','',0,'2018-08-28T20:50:48.636Z','2018-08-28T20:50:48.636Z',0,'TssM5mauP3',0);
INSERT INTO attributes VALUES('lKaZjiGo2X1T','gDrEI7LFWqrP','label','hideChildrenOverview','',0,'2018-08-28T20:50:22.253Z','2018-08-28T20:50:22.253Z',0,'qGo6F87JjB',0);
INSERT INTO attributes VALUES('wycKIOGBLBr2','gDrEI7LFWqrP','relation','familyContainer','YULCKCrWJJZ6',1,'2018-08-28T20:50:22.257Z','2018-08-28T20:50:22.257Z',0,'wRgPdq8myG',0);
INSERT INTO attributes VALUES('45sz6us7COFA','gDrEI7LFWqrP','relation','renderNote','Z5yhGE5g0UB5',2,'2018-08-28T20:52:45.872Z','2018-08-28T20:52:45.872Z',0,'Rf2zkiB3bY',0);
INSERT INTO attributes VALUES('4m6dIcDjkC2q','8LOr7xUMuWD4','label','hideChildrenOverview','',0,'2018-08-28T20:50:36.159Z','2018-08-28T20:50:36.159Z',0,'3emtcLLcp7',0);
INSERT INTO attributes VALUES('UbMObRd5U1p3','8LOr7xUMuWD4','relation','renderNote','YBAcWV8TjYEp',1,'2018-08-28T20:54:40.517Z','2018-08-28T20:56:27.135Z',0,'iqKSOL+B1L',0);
INSERT INTO attributes VALUES('2YBCX6bTRrde','qEi5St9PBPCP','label','run','frontendStartup',0,'2018-08-28T20:50:36.178Z','2018-08-28T20:50:36.179Z',0,'hDcu/CoV8A',0);
INSERT INTO attributes VALUES('IhuXzxRoCdJj','qEi5St9PBPCP','relation','targetNote','8LOr7xUMuWD4',1,'2018-08-28T20:58:15.164Z','2018-08-28T20:58:15.164Z',0,'un6P3bD9wb',0);
INSERT INTO attributes VALUES('wfv43UPhvRDB','1s6SGhByxkoU','label','cssClass','todo',3,'2018-08-28T21:11:48.954Z','2018-08-28T21:11:48.955Z',0,'CFjJZ/EjzN',0);
INSERT INTO attributes VALUES('vnDnf7erhpHf','eXHZAKsMYgur','relation','child:template','TlGCAdcfxkOT',0,'2018-08-29T17:13:34.317Z','2018-08-29T17:13:34.317Z',0,'8W6ql67C0G',0);
INSERT INTO attributes VALUES('Vwo09bhVsDFP','TjWEndYCCg7g','relation','child:template','TlGCAdcfxkOT',0,'2018-08-29T17:15:28.700Z','2018-08-29T17:15:28.700Z',0,'Dowmf6VzWU',0);
INSERT INTO attributes VALUES('zguuNS6ERdQL','8nRNDJGyGs2Z','relation','template','TlGCAdcfxkOT',0,'2018-08-29T17:16:14.938Z','2018-08-29T17:16:14.940Z',0,'bQanDjKWpy',0);
INSERT INTO attributes VALUES('Ar39t8omV0MM','8nRNDJGyGs2Z','label','link','https://www.amazon.com/Mechanical-Alchemy-Wars-Ian-Tregillis/dp/0316248002',1,'2018-08-29T17:16:26.915Z','2018-08-29T17:16:26.916Z',0,'SQyuo81DHH',0);
INSERT INTO attributes VALUES('E2ol5oG7vwq8','TlGCAdcfxkOT','label-definition','link','{"isPromoted":true,"labelType":"url","multiplicityType":"singlevalue"}',1,'2018-08-29T17:12:47.600Z','2018-08-29T17:12:47.600Z',0,'ZMGjd3nm/p',1);
INSERT INTO attributes VALUES('awToFhC7v0UV','TlGCAdcfxkOT','label-definition','readingStart','{"isPromoted":true,"labelType":"date","multiplicityType":"singlevalue"}',2,'2018-08-29T17:12:47.610Z','2018-08-29T17:12:47.610Z',0,'VabLEj737Q',1);
INSERT INTO attributes VALUES('pLJ9r6lnPOYs','TlGCAdcfxkOT','label-definition','readingEnd','{"isPromoted":true,"labelType":"date","multiplicityType":"singlevalue"}',3,'2018-08-29T17:12:47.618Z','2018-08-29T17:12:47.618Z',0,'UHB3bE1/yM',1);
INSERT INTO attributes VALUES('rmg7IQRkazsZ','TlGCAdcfxkOT','label-definition','author','{"isPromoted":true,"labelType":"text","multiplicityType":"singlevalue"}',0,'2018-08-29T17:13:11.393Z','2018-08-29T17:13:11.393Z',0,'AriDq8D/S+',1);
INSERT INTO attributes VALUES('FaiTpHt7VXzC','8nRNDJGyGs2Z','label','author','Ian Tregillis',2,'2018-08-29T17:17:00.159Z','2018-08-29T17:17:00.160Z',0,'GjzmTQcGwE',0);
INSERT INTO attributes VALUES('oINm9qaejyqS','8nRNDJGyGs2Z','label','readingStart','2018-05-05',3,'2018-08-29T17:17:11.560Z','2018-08-29T17:17:11.561Z',0,'LG7/XyjXMx',0);
INSERT INTO attributes VALUES('ss4NVSjoxcv4','8nRNDJGyGs2Z','label','readingEnd','2018-05-23',4,'2018-08-29T17:17:18.653Z','2018-08-29T17:17:18.653Z',0,'UuAazixGy6',0);
INSERT INTO attributes VALUES('yw88iR3gN1NW','u5t1EvWa3CMO','relation','template','TlGCAdcfxkOT',0,'2018-08-29T17:17:49.060Z','2018-08-29T17:17:49.061Z',0,'ejixmQdU6q',0);
INSERT INTO attributes VALUES('eTIoe4Ab7ocY','u5t1EvWa3CMO','label','author','Viktor Frankl',1,'2018-08-29T17:18:59.006Z','2018-08-29T17:18:59.006Z',0,'OZhmBfoQOo',0);
INSERT INTO attributes VALUES('VBiqEJ6mnFgT','u5t1EvWa3CMO','label','link','https://en.wikipedia.org/wiki/Man%27s_Search_for_Meaning',2,'2018-08-29T17:19:10.420Z','2018-08-29T17:19:10.421Z',0,'esBqX0UAL1',0);
INSERT INTO attributes VALUES('hAKixYWrKL4f','u5t1EvWa3CMO','label','readingStart','2018-08-01',3,'2018-08-29T17:19:14.550Z','2018-08-29T17:19:14.550Z',0,'HoGROsXwVQ',0);
INSERT INTO attributes VALUES('n3OTUTkuWRYM','u5t1EvWa3CMO','label','readingEnd','2018-08-10',4,'2018-08-29T17:19:17.741Z','2018-08-29T17:19:17.742Z',0,'65QfoguWMa',0);
INSERT INTO attributes VALUES('82OrS7QREaBM','3RkyK9LI18dO','label','calendarRoot','',0,'2018-08-28T21:18:18.512Z','2018-08-28T21:18:18.512Z',0,'1Mw7vhXyk1',0);
INSERT INTO attributes VALUES('eZeOn45UgWa6','3RkyK9LI18dO','label','sorted','',1,'2018-08-29T10:51:55.212Z','2018-08-29T10:51:55.212Z',0,'GeXw6I7toO',0);
INSERT INTO attributes VALUES('J4vAdbL9o5M2','3RkyK9LI18dO','label','child:sorted','',2,'2018-08-29T10:51:55.205Z','2018-08-29T10:51:55.205Z',0,'6iLHLIFy96',0);
INSERT INTO attributes VALUES('GTGfj3qmMoSC','3RkyK9LI18dO','label','child:sorted:sorted','',3,'2018-08-29T10:51:55.220Z','2018-08-29T10:51:55.220Z',0,'8gxZmnY60b',0);
INSERT INTO attributes VALUES('L6vT9du3WHzI','3RkyK9LI18dO','relation','child:child:child:template','Lt8IUldw7d7H',4,'2018-08-29T17:24:45.182Z','2018-08-29T17:24:45.182Z',0,'+PS2Pj1tU+',0);
INSERT INTO attributes VALUES('kPk6wY2as8Il','HJusZTbBU494','label','sorted','',0,'2018-08-29T10:52:08.238Z','2018-08-29T10:52:08.238Z',0,'m+y/Oxpq6f',0);
INSERT INTO attributes VALUES('ysCNVMnBf3s1','HJusZTbBU494','label','child:sorted','',1,'2018-08-29T10:52:08.249Z','2018-08-29T10:52:08.250Z',0,'ItprIuiTlZ',0);
INSERT INTO attributes VALUES('oTeqKnzwZURH','HJusZTbBU494','label','yearNote','2017',2,'2018-08-29T10:53:09.515Z','2018-08-29T10:53:16.513Z',0,'YrrW7ywzCK',0);
INSERT INTO attributes VALUES('8oreGYcHHVTA','HJusZTbBU494','relation','child:child:template','Lt8IUldw7d7H',3,'2018-08-29T17:25:04.693Z','2018-08-29T17:25:04.694Z',0,'ABVdTeSYoK',0);
INSERT INTO attributes VALUES('KOTvzLMSuse5','6ZuXjCSWgjB4','label','sorted','',0,'2018-08-29T10:52:15.655Z','2018-08-29T10:52:15.658Z',0,'veo8Kp5mE0',0);
INSERT INTO attributes VALUES('aCBsrwvzvqjE','6ZuXjCSWgjB4','label','monthNote','2017-11',1,'2018-08-29T10:53:37.887Z','2018-08-29T10:53:37.887Z',0,'tF8CYyko+S',0);
INSERT INTO attributes VALUES('Q9q3JLWvglVK','6ZuXjCSWgjB4','relation','child:template','Lt8IUldw7d7H',2,'2018-08-29T17:25:31.601Z','2018-08-29T17:25:31.601Z',0,'14xS6esi1y',0);
INSERT INTO attributes VALUES('dGdwWsGNqPOD','GpGnjmcAPeWG','label','dateNote','2017-11-28',0,'2018-08-29T10:55:14.883Z','2018-08-29T10:55:14.884Z',0,'dBEaBZnqWC',0);
INSERT INTO attributes VALUES('6VedgpljPNFf','GpGnjmcAPeWG','relation','template','Lt8IUldw7d7H',1,'2018-08-29T17:25:57.641Z','2018-08-29T17:25:57.641Z',0,'IzqZVWA336',0);
INSERT INTO attributes VALUES('CJJjUCdpdD3K','Lt8IUldw7d7H','label-definition','weight','{"isPromoted":true,"labelType":"number","multiplicityType":"singlevalue"}',0,'2018-08-29T17:24:15.719Z','2018-08-29T17:26:16.917Z',0,'iedV7CtrF8',1);
INSERT INTO attributes VALUES('7twUQrUK7XcT','3oldoiMUPOlr','label','sorted','',0,'2018-08-29T10:52:19.809Z','2018-08-29T10:52:19.809Z',0,'sm1omFTQsu',0);
INSERT INTO attributes VALUES('OJYkhC8lC8ZC','3oldoiMUPOlr','label','monthNote','2017-12',1,'2018-08-29T10:53:53.206Z','2018-08-29T10:53:55.686Z',0,'dec3sb4XOC',0);
INSERT INTO attributes VALUES('0xu9SmGcAeFA','3oldoiMUPOlr','relation','child:template','Lt8IUldw7d7H',2,'2018-08-29T17:26:48.714Z','2018-08-29T17:26:48.714Z',0,'x7h9ty9Ba2',0);
INSERT INTO attributes VALUES('fpbatIuJE1a5','Iha4YwchR413','label','dateNote','2017-12-21',0,'2018-08-29T10:54:11.560Z','2018-08-29T10:55:02.740Z',0,'+XTEkYlpvF',0);
INSERT INTO attributes VALUES('ZgqCVhuTO3C6','Iha4YwchR413','relation','template','Lt8IUldw7d7H',1,'2018-08-29T17:27:04.139Z','2018-08-29T17:27:04.139Z',0,'2BaPFmr3ug',0);
INSERT INTO attributes VALUES('tWMT7ukJwwQy','MG0wntwILQW6','label','dateNote','2017-12-22',0,'2018-08-29T10:54:54.959Z','2018-08-29T10:54:54.959Z',0,'ApbCv7exkj',0);
INSERT INTO attributes VALUES('XHzaztChYyx4','MG0wntwILQW6','relation','template','Lt8IUldw7d7H',1,'2018-08-29T17:27:21.763Z','2018-08-29T17:27:21.763Z',0,'v0KSL22+Eo',0);
INSERT INTO attributes VALUES('5cvnf0PsN3id','tX80udgxnW5n','relation','template','Lt8IUldw7d7H',0,'2018-08-29T17:29:24.575Z','2018-08-29T17:29:24.575Z',0,'6L62Rt1ejL',0);
INSERT INTO attributes VALUES('7UPbae4hkikm','tX80udgxnW5n','label','dateNote','2017-12-18',1,'2018-08-29T17:30:19.926Z','2018-08-29T17:30:19.926Z',0,'KtRpvYjniC',0);
INSERT INTO attributes VALUES('epyMNWR2avA9','cwPuYRAGKtUi','relation','template','Lt8IUldw7d7H',0,'2018-08-29T17:29:16.650Z','2018-08-29T17:29:16.650Z',0,'NLYu4DPer2',0);
INSERT INTO attributes VALUES('93zAKNkRBxjN','cwPuYRAGKtUi','label','dateNote','2017-12-19',1,'2018-08-29T17:30:28.732Z','2018-08-29T17:30:28.732Z',0,'7wIkRCgM05',0);
INSERT INTO attributes VALUES('L2F19EaI9bOZ','1Fi3MpUkZkLk','relation','template','Lt8IUldw7d7H',0,'2018-08-29T17:29:02.051Z','2018-08-29T17:29:02.051Z',0,'Nu8wfSkKSt',0);
INSERT INTO attributes VALUES('id69I9N34M1O','1Fi3MpUkZkLk','label','dateNote','2017-12-20',1,'2018-08-29T17:30:54.265Z','2018-08-29T17:30:54.265Z',0,'hQ9mpr1Rd5',0);
INSERT INTO attributes VALUES('h0git26ZEGDy','rUsGgtpohm7T','relation','template','Lt8IUldw7d7H',0,'2018-08-29T17:29:32.966Z','2018-08-29T17:29:32.966Z',0,'CNQTOtg9ZJ',0);
INSERT INTO attributes VALUES('mcqG8yBYNxTo','rUsGgtpohm7T','label','dateNote','2017-12-23',1,'2018-08-29T17:31:06.444Z','2018-08-29T17:31:06.444Z',0,'BdarwYoBuQ',0);
INSERT INTO attributes VALUES('KtkikXf0X9nc','sXti7HgialF2','relation','template','Lt8IUldw7d7H',0,'2018-08-29T17:29:43.173Z','2018-08-29T17:29:43.173Z',0,'iFuRC25cyS',0);
INSERT INTO attributes VALUES('3LO087cn7L37','sXti7HgialF2','label','dateNote','2017-12-24',1,'2018-08-29T17:31:14.645Z','2018-08-29T17:31:14.645Z',0,'U2d5WjCqq4',0);
INSERT INTO attributes VALUES('tgeFjZXxRCVr','cwPuYRAGKtUi','label','weight','75.4',2,'2018-08-29T17:32:04.330Z','2018-08-29T17:32:04.330Z',0,'1qYNDu4uln',0);
INSERT INTO attributes VALUES('QkQATsOfaiZ2','1Fi3MpUkZkLk','label','weight','75.2',2,'2018-08-29T17:32:08.910Z','2018-08-29T17:32:08.910Z',0,'ildTmrBJED',0);
INSERT INTO attributes VALUES('cjrMaMByU8d7','Iha4YwchR413','label','weight','76',2,'2018-08-29T17:32:13.915Z','2018-08-29T17:32:13.915Z',0,'PSxYyr9giQ',0);
INSERT INTO attributes VALUES('06pEZahjSI3k','sXti7HgialF2','label','weight','76.1',2,'2018-08-29T17:32:36.358Z','2018-08-29T17:32:36.358Z',0,'d2oQY/Lj1b',0);
INSERT INTO attributes VALUES('VdwPmuaTpT0T','MG0wntwILQW6','label','weight','75.9',2,'2018-08-29T17:32:18.592Z','2018-08-29T17:42:14.520Z',0,'tjceaSy8hu',0);
INSERT INTO attributes VALUES('bPDbyj7wXvma','rUsGgtpohm7T','label','weight','75.6',2,'2018-08-29T17:32:24.677Z','2018-08-29T17:46:17.548Z',0,'uicNUs05DG',0);
INSERT INTO attributes VALUES('T9S7wfp2FvFV','uP3V8BqwXC05','label','task','',1,'2018-08-29T19:42:32.724Z','2018-08-29T19:42:32.724Z',0,'1I/LdG1tOp',0);
INSERT INTO attributes VALUES('Rlvwcmprsvq5','uP3V8BqwXC05','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:42:32.731Z','2018-08-29T19:42:32.731Z',0,'OzTsnqPj78',0);
INSERT INTO attributes VALUES('K6edZDy1VBTi','uP3V8BqwXC05','label','location','tesco',3,'2018-08-29T19:42:47.815Z','2018-08-29T19:42:47.815Z',0,'kevp3B5qMM',0);
INSERT INTO attributes VALUES('LTGKKLNRYSM6','Z4CC9azzMNhg','label','taskLocationNote','tesco',1,'2018-08-29T19:42:47.863Z','2018-08-29T19:42:47.863Z',0,'VXA4YOEPpK',0);
INSERT INTO attributes VALUES('J0g9ODCjbAOD','uP3V8BqwXC05','label','cssClass','todo',4,'2018-08-29T19:42:47.875Z','2018-08-29T19:42:47.875Z',0,'0mfYyV3m0Y',0);
INSERT INTO attributes VALUES('OmZAhWAt2bIe','uP3V8BqwXC05','label','tag','groceries',5,'2018-08-29T19:42:51.115Z','2018-08-29T19:42:51.115Z',0,'9CP3TeprnT',0);
INSERT INTO attributes VALUES('n2RHZ8Sl0lQF','q6A62bZE2R1r','label','taskTagNote','groceries',1,'2018-08-29T19:42:51.152Z','2018-08-29T19:42:51.152Z',0,'ke/5NXvA5v',0);
INSERT INTO attributes VALUES('ch6YD8XTrUr5','XoLNnnlwdjBi','label','task','',1,'2018-08-29T19:43:06.412Z','2018-08-29T19:43:06.412Z',0,'jQHXfhklXB',0);
INSERT INTO attributes VALUES('TZkneA5u23Kw','XoLNnnlwdjBi','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:43:06.432Z','2018-08-29T19:43:06.432Z',0,'0ePfOmtYfE',0);
INSERT INTO attributes VALUES('4TPlivzsoHPv','XoLNnnlwdjBi','label','location','mall',3,'2018-08-29T19:43:40.276Z','2018-08-29T19:43:40.276Z',0,'vh+2pYyK3U',0);
INSERT INTO attributes VALUES('FMUuvj9EqQaH','tQmqkQOMHgQJ','label','taskLocationNote','mall',1,'2018-08-29T19:43:40.327Z','2018-08-29T19:43:40.327Z',0,'BN9MF6o9qm',0);
INSERT INTO attributes VALUES('axCS9DyjSRmo','XoLNnnlwdjBi','label','cssClass','todo',4,'2018-08-29T19:43:40.339Z','2018-08-29T19:43:40.339Z',0,'HLfCqLKAbE',0);
INSERT INTO attributes VALUES('FPm7iK5b179Z','XoLNnnlwdjBi','label','tag','christmas',5,'2018-08-29T19:43:43.973Z','2018-08-29T19:43:43.973Z',0,'LSaUBtMo8z',0);
INSERT INTO attributes VALUES('Li7MCkVJwtoe','Lom0LEnCes1l','label','taskTagNote','christmas',1,'2018-08-29T19:43:44.030Z','2018-08-29T19:43:44.030Z',0,'3yDGaK13Ey',0);
INSERT INTO attributes VALUES('7hNexvifrZ9F','XoLNnnlwdjBi','label','todoDate','2017-12-20',6,'2018-08-29T19:43:50.837Z','2018-08-29T19:43:50.837Z',0,'+nJtkDbMMG',0);
INSERT INTO attributes VALUES('OllsfdAN2wCw','prjUbW6QtsL4','label','task','',1,'2018-08-29T19:46:42.152Z','2018-08-29T19:46:42.152Z',0,'TCfgA6DVBv',0);
INSERT INTO attributes VALUES('VjUlZR2yv2Vs','prjUbW6QtsL4','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:46:42.158Z','2018-08-29T19:46:42.158Z',0,'eFW+ARGCQN',0);
INSERT INTO attributes VALUES('PwkDmazJTPAM','prjUbW6QtsL4','label','cssClass','done',6,'2018-08-29T19:48:00.986Z','2018-08-29T19:48:00.986Z',0,'JQ5wGmAqdM',0);
INSERT INTO attributes VALUES('Q3u9O4u2utP3','prjUbW6QtsL4','label','location','mall',7,'2018-08-29T19:49:13.815Z','2018-08-29T19:49:13.816Z',0,'JkBPyNcdpA',0);
INSERT INTO attributes VALUES('SMyP8V9L8vBj','prjUbW6QtsL4','label','tag','christmas',8,'2018-08-29T19:49:35.716Z','2018-08-29T19:49:35.717Z',0,'polIDXvbFh',0);
INSERT INTO attributes VALUES('T2HBEaDedUkK','EluAg7EiealE','label','task','',1,'2018-08-29T19:53:44.535Z','2018-08-29T19:53:44.535Z',0,'qLcD7/Sxu/',0);
INSERT INTO attributes VALUES('uXxiBvaawSxB','EluAg7EiealE','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:53:44.545Z','2018-08-29T19:53:44.546Z',0,'LYDxqtQ0oj',0);
INSERT INTO attributes VALUES('rPKq1auqgjne','EluAg7EiealE','label','location','gym',3,'2018-08-29T19:54:19.526Z','2018-08-29T19:54:19.527Z',0,'3D6MY7txSx',0);
INSERT INTO attributes VALUES('OlQapDHmPsvE','vkoNZlNO5TO4','label','taskLocationNote','gym',1,'2018-08-29T19:54:19.623Z','2018-08-29T19:54:19.624Z',0,'JjIloRX8Lj',0);
INSERT INTO attributes VALUES('isgI18Da7raL','EluAg7EiealE','label','cssClass','todo',4,'2018-08-29T19:54:19.645Z','2018-08-29T19:54:19.645Z',0,'oSAy7WDTd/',0);
INSERT INTO attributes VALUES('bueAaBOZaPR1','EluAg7EiealE','label','todoDate','2017-12-28',5,'2018-08-29T19:54:38.485Z','2018-08-29T19:55:04.592Z',0,'h8K/66xrrB',0);
INSERT INTO attributes VALUES('o9VzDlKJm2Wv','cUWgYJfpp8G8','relation','template','Lt8IUldw7d7H',2,'2018-08-29T19:55:04.668Z','2018-08-29T19:55:04.668Z',0,'mU4NSX5SfY',0);
INSERT INTO attributes VALUES('aAAKUP8Xzk84','cUWgYJfpp8G8','label','dateNote','2017-12-28',3,'2018-08-29T19:55:04.681Z','2018-08-29T19:55:04.681Z',0,'KkDCxAsM5x',0);
INSERT INTO attributes VALUES('Ts6QDZqcbOWK','cmYy3Z22F4MY','label','task','',1,'2018-08-29T19:56:35.634Z','2018-08-29T19:56:35.634Z',0,'9XyxVqr+mR',0);
INSERT INTO attributes VALUES('mi8JlZzzDMvf','cmYy3Z22F4MY','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:56:35.640Z','2018-08-29T19:56:35.640Z',0,'l8tpnd26SZ',0);
INSERT INTO attributes VALUES('xCrm8cWEAERo','cmYy3Z22F4MY','label','tag','health',3,'2018-08-29T19:57:02.217Z','2018-08-29T19:57:02.218Z',0,'gkz91AYO7M',0);
INSERT INTO attributes VALUES('EQgv8jgBGDeO','2V9Zg9CXdNvn','label','taskTagNote','health',1,'2018-08-29T19:57:02.276Z','2018-08-29T19:57:02.276Z',0,'T1LboUFYwM',0);
INSERT INTO attributes VALUES('2CLl7F07nrUX','cmYy3Z22F4MY','label','cssClass','done',7,'2018-08-29T19:57:11.866Z','2018-08-29T19:57:11.866Z',0,'U+xrckPbD4',0);
INSERT INTO attributes VALUES('L8QbHBtuWocN','cmYy3Z22F4MY','label','todoDate','2017-12-19',5,'2018-08-29T19:57:09.347Z','2018-08-29T19:57:33.998Z',0,'P+niQLnqtT',0);
INSERT INTO attributes VALUES('HWw4Q01cb9Re','cmYy3Z22F4MY','label','doneDate','2017-12-19',6,'2018-08-29T19:57:11.798Z','2018-08-29T19:57:39.255Z',0,'jGSCX/QklX',0);
INSERT INTO attributes VALUES('qwtBFzh0wmpe','XoLNnnlwdjBi','label','tag','shopping',7,'2018-08-29T19:58:59.083Z','2018-08-29T19:58:59.084Z',0,'Hw2zrl2NtD',0);
INSERT INTO attributes VALUES('AX3w15mAFRoB','d04CnuZxPXj2','label','taskTagNote','shopping',1,'2018-08-29T19:58:59.142Z','2018-08-29T19:58:59.142Z',0,'e0BBJ30IQ1',0);
INSERT INTO attributes VALUES('1cermfHB24bp','ve3Ib30x9nGf','label','task','',1,'2018-08-29T19:59:04.352Z','2018-08-29T19:59:04.352Z',0,'vFv8J/h5qJ',0);
INSERT INTO attributes VALUES('QlSQJcHlt3ZQ','ve3Ib30x9nGf','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:59:04.359Z','2018-08-29T19:59:04.360Z',0,'263XZD0Xpd',0);
INSERT INTO attributes VALUES('UPvlXSBXxRJv','ve3Ib30x9nGf','label','location','work',3,'2018-08-29T19:59:38.832Z','2018-08-29T19:59:38.832Z',0,'GufZy7QNVn',0);
INSERT INTO attributes VALUES('YngESU7G6T62','TTl2nD4CqzC9','label','taskLocationNote','work',1,'2018-08-29T19:59:38.890Z','2018-08-29T19:59:38.890Z',0,'FTH7CxVaB1',0);
INSERT INTO attributes VALUES('PEbrAcRaFOXE','ve3Ib30x9nGf','label','cssClass','todo',4,'2018-08-29T19:59:38.915Z','2018-08-29T19:59:38.915Z',0,'Xepyx9jFGP',0);
INSERT INTO attributes VALUES('cdSIp3FJ50vX','ve3Ib30x9nGf','label','todoDate','2017-12-18',5,'2018-08-29T19:59:46.829Z','2018-08-29T20:00:18.351Z',0,'TWZfKhjpe3',0);
INSERT INTO attributes VALUES('TZa1McDCnNHj','uP3V8BqwXC05','label','tag','shopping',7,'2018-08-29T20:01:47.691Z','2018-08-29T20:01:47.691Z',0,'kH6CGtIT/r',0);
INSERT INTO attributes VALUES('kNp0J9uXoC8U','tX80udgxnW5n','label','weight','74.9',2,'2018-08-29T17:31:58.692Z','2018-08-29T21:30:23.669Z',0,'xagvtLz48G',0);
INSERT INTO attributes VALUES('0F9G0OQujXVO','prjUbW6QtsL4','label','tag','shopping',9,'2018-08-30T07:54:40.727Z','2018-08-30T07:54:40.728Z',0,'XyCvk4htB5',0);
INSERT INTO attributes VALUES('yc58HTwoM3b0','prjUbW6QtsL4','label','todoDate','2017-12-20',3,'2018-08-29T19:47:53.123Z','2018-08-30T07:56:53.874Z',0,'UnKvGyVk7X',0);
INSERT INTO attributes VALUES('JVlFEQPYUiCR','prjUbW6QtsL4','label','doneDate','2017-12-24',5,'2018-08-29T19:48:00.928Z','2018-08-30T07:57:00.569Z',0,'nbXCZOrqq6',0);
INSERT INTO attributes VALUES('01UuzuSR78Kj','uP3V8BqwXC05','label','todoDate','2017-12-24',6,'2018-08-29T19:43:01.973Z','2018-08-30T08:04:55.301Z',0,'tDEAzDOKYn',0);
INSERT INTO attributes VALUES('cyujybJzh4It','HbtlYiMvmm4V','relation','runOnAttributeChange','gYVdjKAJeImD',0,'2018-08-28T20:50:48.640Z','2018-08-28T20:50:48.640Z',0,'6ziRrHJAhQ',1);
INSERT INTO attributes VALUES('MEr8Y48B5fuA','HbtlYiMvmm4V','label-definition','location','{"isPromoted":true,"labelType":"text","multiplicityType":"singlevalue"}',1,'2018-08-28T20:50:48.652Z','2018-08-28T20:50:48.652Z',0,'SHKsaKOZDy',1);
INSERT INTO attributes VALUES('0zEib333MHaK','HbtlYiMvmm4V','label-definition','tag','{"isPromoted":true,"labelType":"text","multiplicityType":"multivalue"}',2,'2018-08-28T20:50:48.661Z','2018-08-28T20:50:48.661Z',0,'qGaGNt4Il4',1);
INSERT INTO attributes VALUES('XsQlrpkI26vx','HbtlYiMvmm4V','label-definition','todoDate','{"isPromoted":true,"labelType":"date","multiplicityType":"singlevalue"}',3,'2018-08-28T20:50:48.707Z','2018-08-28T20:50:48.708Z',0,'K1zIHbXWjg',1);
INSERT INTO attributes VALUES('jbVAxy9rOvw7','HbtlYiMvmm4V','label-definition','doneDate','{"isPromoted":true,"labelType":"date","multiplicityType":"singlevalue"}',4,'2018-08-28T20:50:48.716Z','2018-08-28T20:50:48.717Z',0,'ibiT2W04+I',1);
INSERT INTO attributes VALUES('0p8vtV5LoH0e','L9qettZi0csz','label','taskTodoRoot','',0,'2018-08-28T20:50:48.596Z','2018-08-28T20:50:48.596Z',0,'mKdjsJRSwv',0);
INSERT INTO attributes VALUES('lCyxJnXmNy5x','L9qettZi0csz','label','child:task','',1,'2018-08-28T21:11:09.138Z','2018-08-28T21:11:09.138Z',0,'EarSd1tApi',0);
INSERT INTO attributes VALUES('ifqAReEYdFh6','L9qettZi0csz','relation','child:template','HbtlYiMvmm4V',2,'2018-08-28T21:11:09.143Z','2018-08-28T21:11:09.143Z',0,'JXcAyc3in4',0);
INSERT INTO attributes VALUES('1hmYf4fJQmBk','L9qettZi0csz','label','child:cssClass','todo',3,'2018-09-01T11:20:29.168Z','2018-09-01T11:20:29.168Z',0,'toS3GWHG/9',0);

View File

@@ -1,128 +0,0 @@
INSERT INTO branches VALUES('root','root','none',0,NULL,1,0,'2018-01-01T00:00:00.000Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('dLgtLUFn3GoN','1Heh2acXfPNt','root',21,NULL,1,0,'2017-12-23T00:46:39.304Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('QLfS835GSfIh','3RkyK9LI18dO','1Heh2acXfPNt',5,NULL,1,0,'2017-12-23T01:20:04.181Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('wLTa2l3lYi83','HJusZTbBU494','3RkyK9LI18dO',1,NULL,1,0,'2017-12-23T01:20:50.709Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('jvhKcwz4pYTr','ZC78NlmdXeC6','WdWZFuWNVDZk',0,NULL,1,0,'2017-12-23T04:06:21.579Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('CarTrwkGVcPz','NncfGH8dyNjJ','WdWZFuWNVDZk',1,NULL,1,0,'2017-12-23T04:06:24.012Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('6M7qPlr7at6N','eouCLkjbruai','NncfGH8dyNjJ',0,NULL,0,0,'2017-12-23T01:23:28.291Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('tQgognnAH9WI','C44aq4mkaX67','NncfGH8dyNjJ',1,NULL,0,0,'2017-12-23T01:23:31.879Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('xyAi7MmgvAgR','C44aq4mkaX67','ZC78NlmdXeC6',1,NULL,1,0,'2017-12-23T01:23:47.756Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('xQ3fjRp9yaPq','I6Cw88AirBBl','C44aq4mkaX67',0,NULL,0,0,'2017-12-23T01:24:04.681Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('2GOsNT5LsvTP','mcEwFMSjhlvL','C44aq4mkaX67',1,NULL,0,0,'2017-12-23T01:29:35.974Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('RxUiraiR655R','CF2lUIJAr6Ey','NncfGH8dyNjJ',2,NULL,0,0,'2017-12-23T01:34:37.658Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('mZuSrZ18Zmv0','xkXwueRoDNeN','MG0wntwILQW6',0,NULL,0,0,'2017-12-23T01:35:40.306Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('hbcWTnEnXPwF','eXHZAKsMYgur','1Heh2acXfPNt',9,NULL,0,0,'2017-12-23T03:32:42.868Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('8a3aNxjG0nu7','2WU27ekfy07E','eXHZAKsMYgur',0,NULL,0,0,'2017-12-23T03:32:49.379Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('4Tu6vaPdCxCM','TjWEndYCCg7g','eXHZAKsMYgur',1,NULL,1,0,'2017-12-23T03:33:23.584Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('lBPOmhP12egP','8nRNDJGyGs2Z','TjWEndYCCg7g',0,NULL,1,0,'2017-12-23T03:33:37.327Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('C5ipVqeDWySp','9zSwD89vgzNO','8nRNDJGyGs2Z',0,NULL,0,0,'2017-12-23T03:37:04.912Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('uSitzbGcSATJ','u5t1EvWa3CMO','TjWEndYCCg7g',1,NULL,0,0,'2017-12-23T03:39:21.918Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('GZ6aRI8rdSJt','8nRNDJGyGs2Z','MG0wntwILQW6',1,'',1,0,'2017-12-23T03:42:28.310Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('uipfvAfwWRgx','6ZuXjCSWgjB4','HJusZTbBU494',0,NULL,0,0,'2017-12-23T03:44:54.096Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('nMRpPWWH8WRk','GpGnjmcAPeWG','6ZuXjCSWgjB4',1,NULL,0,0,'2017-12-23T03:44:57.036Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('c4wt27WNjepw','21K84UqGhqlt','GpGnjmcAPeWG',0,NULL,0,0,'2017-12-23T03:45:10.933Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('d8L8zYlLTbym','R6pheWjdwmNU','rz5t0r9Qr2WC',0,NULL,0,0,'2017-12-23T03:45:28.002Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('T4USGzfllu5t','5v5Dx6LMHXIO','Iha4YwchR413',0,NULL,0,0,'2017-12-23T03:45:44.184Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('c4JgFNIobvQW','MLQjmREtcnJ3','R6pheWjdwmNU',0,NULL,0,0,'2017-12-23T03:47:48.208Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('nfWjptAU2ZDg','pTTjrxgnvURB','R6pheWjdwmNU',1,NULL,0,0,'2017-12-23T03:47:55.932Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('T2ToYBfyPy0g','cFK9sGYZaMWs','rz5t0r9Qr2WC',1,NULL,0,0,'2017-12-23T03:49:32.210Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('NG4gbKOnsM3v','21K84UqGhqlt','MLQjmREtcnJ3',0,'28. 11. 2017',0,0,'2017-12-23T03:53:38.110Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('Fstg4tkccO4N','5v5Dx6LMHXIO','MLQjmREtcnJ3',1,'21. 12. 2017',0,0,'2017-12-23T03:53:49.737Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('MN8B7qXDUViO','xkXwueRoDNeN','MLQjmREtcnJ3',2,'22. 12. 2017',0,0,'2017-12-23T03:53:57.486Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('gSRkHpB7Bu3D','pOFVzbXLmzhX','R6pheWjdwmNU',2,NULL,0,0,'2017-12-23T03:54:46.138Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('6brdjeWDOB6w','0xtvjqrcGiRB','ZC78NlmdXeC6',0,NULL,0,0,'2017-12-23T04:02:06.650Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('AqKUM2zUVFUF','Zl69uXBSen0w','ZC78NlmdXeC6',2,NULL,1,0,'2017-12-23T04:02:16.685Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('Ez7NN2WVzRc4','62BKAQMVP2KW','Zl69uXBSen0w',1,NULL,0,0,'2017-12-23T04:02:39.164Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('t3vVElqMIQVa','h4OfLEAYspud','WdWZFuWNVDZk',2,NULL,1,0,'2017-12-23T04:06:25.769Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('O983DHtLpgmr','1hASbLRDL7oo','h4OfLEAYspud',0,NULL,0,0,'2017-12-23T16:42:26.347Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('RsvL795Mk1bp','1hASbLRDL7oo','GpGnjmcAPeWG',1,'',0,0,'2017-12-23T04:04:56.830Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('79e4hrHLFmx6','jyqG9GucsMdn','Iha4YwchR413',1,NULL,0,0,'2017-12-23T04:05:16.439Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('oWO8rctUjf7d','WdWZFuWNVDZk','1Heh2acXfPNt',13,NULL,0,0,'2017-12-23T04:06:16.179Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('GOxcrZrxalFN','yK4SBJfwD3tY','1Heh2acXfPNt',18,NULL,0,0,'2017-12-23T04:06:32.833Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('bSPmEvjLzQKU','r4BnsmSQeVr1','yK4SBJfwD3tY',0,NULL,0,0,'2017-12-23T04:06:37.427Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('bMtxCD6cwNR9','QbL3pTvhgzM8','yK4SBJfwD3tY',2,NULL,0,0,'2017-12-23T04:06:43.841Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('o4ycR7xIi4oI','moMbTKwN15Ps','yK4SBJfwD3tY',3,NULL,1,0,'2017-12-23T04:06:49.331Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('abTEhnOsAsSg','PEGQGg0In3Ar','GpGnjmcAPeWG',2,NULL,0,0,'2017-12-23T16:44:35.900Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('ccslPJf3wQV3','vBv6ovBupfTj','IlULcDiOTI4K',0,NULL,0,0,'2017-12-23T18:04:50.904Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('5Dt9YCMn59sY','mw4f2xB4J5fV','IlULcDiOTI4K',1,NULL,0,0,'2017-12-23T18:05:24.868Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('Qwj5gpLainnP','N029F9ANGn8b','Dk5RGYzufXg3',0,NULL,0,0,'2018-08-28T20:50:22.011Z','gziRGab1sT','2018-08-28T20:50:22.011Z');
INSERT INTO branches VALUES('gslGsoDESZjG','bFTtwsnNgw9T','Dk5RGYzufXg3',1,NULL,0,0,'2018-08-28T20:50:22.110Z','ZcNPsaKsw8','2018-08-28T20:50:22.110Z');
INSERT INTO branches VALUES('aP3f70xCJWGs','N029F9ANGn8b','bFTtwsnNgw9T',0,NULL,NULL,0,'2018-08-28T20:50:22.117Z','ZvcZgDrutn','2018-08-28T20:50:22.117Z');
INSERT INTO branches VALUES('WlpZMMsXlQJw','wHb2YBwhjxiD','YULCKCrWJJZ6',0,NULL,0,0,'2018-08-28T20:50:22.181Z','cBicKleFbl','2018-08-28T20:50:22.181Z');
INSERT INTO branches VALUES('jyFk0k855gf1','cUYFEvsdY6N6','YULCKCrWJJZ6',1,NULL,0,0,'2018-08-28T20:50:22.187Z','BC+PIh5h25','2018-08-28T20:50:22.186Z');
INSERT INTO branches VALUES('O7hcbDc4taan','8APXN4n4Hnb8','YULCKCrWJJZ6',2,NULL,0,0,'2018-08-28T20:50:22.192Z','ubas1i1Xzz','2018-08-28T20:50:22.192Z');
INSERT INTO branches VALUES('hmtcxz6dMz9S','s0Hhsl0nb1bg','YULCKCrWJJZ6',3,NULL,0,0,'2018-08-28T20:50:22.197Z','sRmlG1Gqe3','2018-08-28T20:50:22.197Z');
INSERT INTO branches VALUES('W0tZAcTC0dGY','baafKkgNGYLm','YULCKCrWJJZ6',4,NULL,0,0,'2018-08-28T20:50:22.204Z','/Y9ycmu78F','2018-08-28T20:50:22.204Z');
INSERT INTO branches VALUES('t0PqYe7oEZQg','Ab7WuV47mQOf','YULCKCrWJJZ6',5,NULL,0,0,'2018-08-28T20:50:22.210Z','NznnppTEIe','2018-08-28T20:50:22.210Z');
INSERT INTO branches VALUES('7cOKBWmaN1kw','w7t110kWsK8e','YULCKCrWJJZ6',6,NULL,0,0,'2018-08-28T20:50:22.215Z','VxtbCyFURt','2018-08-28T20:50:22.215Z');
INSERT INTO branches VALUES('3bIvCk23JeXJ','at7bZyjJfIrM','YULCKCrWJJZ6',7,NULL,0,0,'2018-08-28T20:50:22.220Z','lH/8HHwLB1','2018-08-28T20:50:22.220Z');
INSERT INTO branches VALUES('vWch9vHEIsKw','OZKicr536m7U','YULCKCrWJJZ6',8,NULL,0,0,'2018-08-28T20:50:22.225Z','FldZuyxiDN','2018-08-28T20:50:22.225Z');
INSERT INTO branches VALUES('p07f522OT9FP','oato1D7kuNU2','YULCKCrWJJZ6',9,NULL,0,0,'2018-08-28T20:50:22.231Z','LQlWJmL3RR','2018-08-28T20:50:22.231Z');
INSERT INTO branches VALUES('03YszmiIfe8B','C1I7GPA8ORO4','YULCKCrWJJZ6',10,NULL,0,0,'2018-08-28T20:50:22.236Z','uNgEmMMv59','2018-08-28T20:50:22.236Z');
INSERT INTO branches VALUES('iZJMJE9v4caq','gQNQaMBzRYdb','YULCKCrWJJZ6',11,NULL,0,0,'2018-08-28T20:50:22.242Z','OIMswfv8u0','2018-08-28T20:50:22.242Z');
INSERT INTO branches VALUES('BgakZWX2NSoa','8LOr7xUMuWD4','1Heh2acXfPNt',24,NULL,0,0,'2018-08-28T20:50:36.080Z','l6e868XpLw','2018-08-28T20:50:36.079Z');
INSERT INTO branches VALUES('6yEXb5xSww7E','qEi5St9PBPCP','8LOr7xUMuWD4',3,NULL,0,0,'2018-08-28T20:50:36.154Z','wiqkXVJhDQ','2018-08-28T20:50:36.154Z');
INSERT INTO branches VALUES('WFBrWWGubT8N','IYKhW6LTUpwP','1Heh2acXfPNt',28,NULL,0,0,'2018-08-28T20:50:48.458Z','KaPAe+LyvC','2018-08-28T20:50:48.458Z');
INSERT INTO branches VALUES('VEq36SudFqDe','L9qettZi0csz','IYKhW6LTUpwP',0,NULL,1,0,'2018-08-28T20:50:48.471Z','74RNaEVH/C','2018-08-28T20:50:48.470Z');
INSERT INTO branches VALUES('cnL65jQZPFng','Dyahpf7LroQY','IYKhW6LTUpwP',2,NULL,1,0,'2018-08-28T20:50:48.481Z','uY3Jzm+34n','2018-08-28T20:50:48.480Z');
INSERT INTO branches VALUES('jj5QAGAl31lB','nUgD4SYx2gt7','IYKhW6LTUpwP',4,NULL,1,0,'2018-08-28T20:50:48.507Z','sxhKcIO0Fo','2018-08-28T20:50:48.507Z');
INSERT INTO branches VALUES('H4uX5U8UA3Fb','hL4rychNFWZs','IYKhW6LTUpwP',6,NULL,1,0,'2018-08-28T20:50:48.539Z','8/KA289XO5','2018-08-28T20:50:48.539Z');
INSERT INTO branches VALUES('r6XUe41mCgPY','gYVdjKAJeImD','hL4rychNFWZs',0,NULL,0,0,'2018-08-28T20:50:48.546Z','B8Zx5cyTRW','2018-08-28T20:50:48.546Z');
INSERT INTO branches VALUES('UPdB517CCSC6','vVhlPtM5YgWe','gYVdjKAJeImD',0,NULL,0,0,'2018-08-28T20:50:48.556Z','Ydd3hXIn5h','2018-08-28T20:50:48.556Z');
INSERT INTO branches VALUES('2lLNmlPp32DT','XVlWndK4Oh6A','hL4rychNFWZs',2,NULL,0,0,'2018-08-28T20:50:48.575Z','7KpHQIqICP','2018-08-28T20:50:48.575Z');
INSERT INTO branches VALUES('8A8Hj2KELLZe','gYNJtGEPGW95','hL4rychNFWZs',3,NULL,0,0,'2018-08-28T20:50:48.583Z','akAZK6+pYC','2018-08-28T20:50:48.583Z');
INSERT INTO branches VALUES('feP0uJpIPOz3','HbtlYiMvmm4V','hL4rychNFWZs',4,NULL,0,0,'2018-08-28T20:50:48.592Z','2hPRviPOvY','2018-08-28T20:50:48.592Z');
INSERT INTO branches VALUES('VgaH4I1fLW0p','Dk5RGYzufXg3','Z5yhGE5g0UB5',0,NULL,1,0,'2018-08-28T20:51:30.388Z','A5p7MjKIdD','2018-08-28T20:50:21.941Z');
INSERT INTO branches VALUES('sOGDHPGhnMoM','YBAcWV8TjYEp','8LOr7xUMuWD4',0,NULL,1,0,'2018-08-28T20:56:04.336Z','e84wqxU8y+','2018-08-28T20:55:00.064Z');
INSERT INTO branches VALUES('Hoq9xTZg8sCK','kV2NwNNvepGF','YBAcWV8TjYEp',0,NULL,1,0,'2018-08-28T20:56:05.910Z','0rORbULibz','2018-08-28T20:50:36.095Z');
INSERT INTO branches VALUES('A56xlTT6rczp','YULCKCrWJJZ6','gDrEI7LFWqrP',0,NULL,1,0,'2018-08-29T16:03:23.987Z','7YCK6Cf3vr','2018-08-28T20:50:22.175Z');
INSERT INTO branches VALUES('5cJwU0VlCJA7','WkdQrYTnsgxP','gDrEI7LFWqrP',1,NULL,0,0,'2018-08-29T16:03:24.889Z','RaGS8TUyuV','2018-08-28T20:50:22.250Z');
INSERT INTO branches VALUES('U4XC6g7oB4ME','Z5yhGE5g0UB5','gDrEI7LFWqrP',2,NULL,1,0,'2018-08-29T16:03:25.779Z','fAkVtlU455','2018-08-28T20:51:10.194Z');
INSERT INTO branches VALUES('bFGrKoCcHTD0','ucC6Zabv3Uml','gDrEI7LFWqrP',3,NULL,0,0,'2018-08-29T16:03:30.624Z','KWGpDGiWrq','2018-08-28T20:50:22.122Z');
INSERT INTO branches VALUES('FIurtaYkU3mn','gDrEI7LFWqrP','1Heh2acXfPNt',26,NULL,0,0,'2018-08-29T16:03:27.894Z','+Jd+Zzgx2u','2018-08-28T20:50:21.931Z');
INSERT INTO branches VALUES('bryQseMhyzaI','IlULcDiOTI4K','1Heh2acXfPNt',2,NULL,0,0,'2018-08-29T17:10:47.987Z','wX6dY3pq/D','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('u84s3tBBB92g','TlGCAdcfxkOT','eXHZAKsMYgur',2,NULL,0,0,'2018-08-29T17:11:16.550Z','Ei4ozqDMWi','2018-08-29T17:11:16.550Z');
INSERT INTO branches VALUES('yMhwsE7uvEij','3oldoiMUPOlr','HJusZTbBU494',1,NULL,1,0,'2018-08-29T17:20:59.012Z','7U4pIRsbwO','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('NTlSXCbgt5Va','Lt8IUldw7d7H','3RkyK9LI18dO',3,NULL,0,0,'2018-08-29T17:23:45.198Z','QjebjIeHUj','2018-08-29T17:23:45.198Z');
INSERT INTO branches VALUES('0fpnraUGs9Kl','rz5t0r9Qr2WC','HJusZTbBU494',2,NULL,1,0,'2018-08-29T17:26:27.928Z','rw9k0n9SUb','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('uMt25KxpV45Y','tX80udgxnW5n','3oldoiMUPOlr',1,NULL,1,0,'2018-08-29T17:29:24.554Z','XlDqz7PX7X','2018-08-29T17:29:24.554Z');
INSERT INTO branches VALUES('IsCUFfM1QzHl','rUsGgtpohm7T','3oldoiMUPOlr',21,NULL,0,0,'2018-08-29T17:29:32.942Z','o8ZNDOfGSB','2018-08-29T17:29:32.942Z');
INSERT INTO branches VALUES('UozNcoXYDovC','sXti7HgialF2','3oldoiMUPOlr',23,NULL,1,0,'2018-08-29T17:29:43.138Z','mDyppB0lkz','2018-08-29T17:29:43.138Z');
INSERT INTO branches VALUES('3B2q1J0jymcC','uP3V8BqwXC05','L9qettZi0csz',0,NULL,0,0,'2018-08-29T19:42:32.718Z','fgHfgNl00Y','2018-08-29T19:42:32.718Z');
INSERT INTO branches VALUES('tznJp79kaw59','Z4CC9azzMNhg','Dyahpf7LroQY',0,NULL,1,0,'2018-08-29T19:42:47.857Z','GPgoswIB8x','2018-08-29T19:42:47.856Z');
INSERT INTO branches VALUES('akqrs7gHmh5t','uP3V8BqwXC05','Z4CC9azzMNhg',0,NULL,0,0,'2018-08-29T19:42:47.872Z','aoLg0gFrd/','2018-08-29T19:42:47.872Z');
INSERT INTO branches VALUES('acVSG5Mau4XN','q6A62bZE2R1r','nUgD4SYx2gt7',2,NULL,0,0,'2018-08-29T19:42:51.139Z','V1TNeMyqD5','2018-08-29T19:42:51.139Z');
INSERT INTO branches VALUES('Gd1QxgTLiOQx','uP3V8BqwXC05','q6A62bZE2R1r',0,NULL,0,0,'2018-08-29T19:42:51.161Z','FC79qQkyC3','2018-08-29T19:42:51.161Z');
INSERT INTO branches VALUES('aCAgcqpOKx7z','XoLNnnlwdjBi','L9qettZi0csz',1,NULL,0,0,'2018-08-29T19:43:06.394Z','5tETh0Khcc','2018-08-29T19:43:06.394Z');
INSERT INTO branches VALUES('ofME2yjEstZT','tQmqkQOMHgQJ','Dyahpf7LroQY',1,NULL,0,0,'2018-08-29T19:43:40.323Z','bRdu27+7TZ','2018-08-29T19:43:40.323Z');
INSERT INTO branches VALUES('LfV9Vuv2KOYi','XoLNnnlwdjBi','tQmqkQOMHgQJ',0,NULL,0,0,'2018-08-29T19:43:40.335Z','blImjibA2C','2018-08-29T19:43:40.334Z');
INSERT INTO branches VALUES('mSyNlVSA6WRX','XoLNnnlwdjBi','Lom0LEnCes1l',0,NULL,0,0,'2018-08-29T19:43:44.040Z','kQy9lC8qmF','2018-08-29T19:43:44.039Z');
INSERT INTO branches VALUES('q735AeBxPj1T','ydix6JqjXiUm','XoLNnnlwdjBi',0,NULL,0,0,'2018-08-29T19:46:03.357Z','5eoW9KyskY','2018-08-29T19:46:03.356Z');
INSERT INTO branches VALUES('fmm6YcEBxv8T','prjUbW6QtsL4','9HHqPxJkLAkl',0,NULL,0,0,'2018-08-29T19:48:00.972Z','JMdLMCDy2J','2018-08-29T19:48:00.972Z');
INSERT INTO branches VALUES('NnybbW5xPPHO','9HHqPxJkLAkl','IYKhW6LTUpwP',1,NULL,1,0,'2018-08-29T19:48:05.277Z','FirAueCkjs','2018-08-28T20:50:48.529Z');
INSERT INTO branches VALUES('Fq4TqKTo93aK','EluAg7EiealE','L9qettZi0csz',2,NULL,0,0,'2018-08-29T19:53:44.530Z','mJCxaZ1mlW','2018-08-29T19:53:44.530Z');
INSERT INTO branches VALUES('2dac99oNkdH3','vkoNZlNO5TO4','Dyahpf7LroQY',2,NULL,0,0,'2018-08-29T19:54:19.618Z','fN3DqnjcUb','2018-08-29T19:54:19.618Z');
INSERT INTO branches VALUES('8aSc0sibmCZm','EluAg7EiealE','vkoNZlNO5TO4',0,NULL,0,0,'2018-08-29T19:54:19.637Z','RpUFzJs2RD','2018-08-29T19:54:19.637Z');
INSERT INTO branches VALUES('uMnwVhwtdXZg','cUWgYJfpp8G8','3oldoiMUPOlr',24,NULL,1,0,'2018-08-29T19:55:04.661Z','ZMEYWKhIhB','2018-08-29T19:55:04.661Z');
INSERT INTO branches VALUES('kS7GsSvztE1J','EluAg7EiealE','cUWgYJfpp8G8',0,'TODO',NULL,0,'2018-08-29T19:55:04.691Z','72zbNyyFRw','2018-08-29T19:54:38.626Z');
INSERT INTO branches VALUES('EjQTcVVHFmmZ','MG0wntwILQW6','3oldoiMUPOlr',19,NULL,0,0,'2018-08-29T19:55:53.824Z','bx2z9074Vi','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('HsN4600rQoL9','Iha4YwchR413','3oldoiMUPOlr',17,NULL,1,0,'2018-08-29T17:26:52.528Z','GBlVZxHhto','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('fQ2BsgDWdqoE','1Fi3MpUkZkLk','3oldoiMUPOlr',16,NULL,1,0,'2018-08-29T19:56:00.793Z','tk6763xjRL','2018-08-29T17:29:02.035Z');
INSERT INTO branches VALUES('Sv77hHzVZvdw','cwPuYRAGKtUi','3oldoiMUPOlr',2,NULL,1,0,'2018-08-29T19:56:04.404Z','Uwn3W1Q8py','2018-08-29T17:29:16.635Z');
INSERT INTO branches VALUES('kPZLi2VKVjQ1','2V9Zg9CXdNvn','nUgD4SYx2gt7',6,NULL,0,0,'2018-08-29T19:57:02.270Z','v0dB+4MnXy','2018-08-29T19:57:02.270Z');
INSERT INTO branches VALUES('9nEK1jBKqdL7','cmYy3Z22F4MY','9HHqPxJkLAkl',1,NULL,0,0,'2018-08-29T19:57:11.828Z','P7AvZh6VlN','2018-08-29T19:57:11.828Z');
INSERT INTO branches VALUES('HVvl5lR3Db7p','cmYy3Z22F4MY','cwPuYRAGKtUi',1,'DONE',NULL,0,'2018-08-29T19:57:39.314Z','dZK0rWy9IN','2018-08-29T19:57:11.876Z');
INSERT INTO branches VALUES('bPQksNkJmvLR','XoLNnnlwdjBi','d04CnuZxPXj2',0,NULL,0,0,'2018-08-29T19:58:59.150Z','bMHPa6tOOV','2018-08-29T19:58:59.150Z');
INSERT INTO branches VALUES('eoWt4fWm0sW3','XoLNnnlwdjBi','1Fi3MpUkZkLk',0,'TODO',NULL,0,'2018-08-29T19:43:50.887Z','Dq9p08n0+S','2018-08-29T19:43:50.887Z');
INSERT INTO branches VALUES('lMn7U8E3HcM8','ve3Ib30x9nGf','L9qettZi0csz',3,NULL,0,0,'2018-08-29T19:59:04.336Z','9uxcfSBqQm','2018-08-29T19:59:04.336Z');
INSERT INTO branches VALUES('No0w47P6V5NU','TTl2nD4CqzC9','Dyahpf7LroQY',3,NULL,0,0,'2018-08-29T19:59:38.884Z','Po5wJqpzvR','2018-08-29T19:59:38.884Z');
INSERT INTO branches VALUES('0TOuqT1KIYRZ','ve3Ib30x9nGf','TTl2nD4CqzC9',0,NULL,0,0,'2018-08-29T19:59:38.901Z','jjfsd5sCg4','2018-08-29T19:59:38.901Z');
INSERT INTO branches VALUES('5dNoZxDbyGLR','ve3Ib30x9nGf','tX80udgxnW5n',0,'TODO',NULL,0,'2018-08-29T20:00:18.428Z','YrUH6cdlZO','2018-08-29T19:59:47.032Z');
INSERT INTO branches VALUES('mTe83gvO9fsQ','uP3V8BqwXC05','d04CnuZxPXj2',1,NULL,0,0,'2018-08-29T20:01:47.773Z','2uPfZok3xo','2018-08-29T20:01:47.772Z');
INSERT INTO branches VALUES('DzI3pH06LRAK','7H3OrcgB8Io6','tX80udgxnW5n',1,NULL,0,0,'2018-08-29T21:26:55.817Z','TQATDSthxP','2018-08-29T21:26:55.817Z');
INSERT INTO branches VALUES('9zW6GNyUrSwj','HgaAwBX5zVcP','kV2NwNNvepGF',0,NULL,0,0,'2018-08-29T22:13:25.436Z','n7SHMc8Do/','2018-08-28T20:50:36.139Z');
INSERT INTO branches VALUES('KgPU7QD19kBk','prjUbW6QtsL4','sXti7HgialF2',0,'DONE',NULL,0,'2018-08-30T07:57:00.605Z','55wpz4Yj6h','2018-08-29T19:48:00.995Z');
INSERT INTO branches VALUES('iTtVoNfVBdex','d04CnuZxPXj2','nUgD4SYx2gt7',0,NULL,1,0,'2018-08-30T07:57:39.090Z','YuZ73fj3vz','2018-08-29T19:58:59.136Z');
INSERT INTO branches VALUES('7XqFyRCCbbFR','Lom0LEnCes1l','nUgD4SYx2gt7',1,NULL,0,0,'2018-08-30T08:04:45.853Z','xPKVn25yMG','2018-08-29T19:43:44.024Z');
INSERT INTO branches VALUES('5OwmqXXREhwW','uP3V8BqwXC05','sXti7HgialF2',2,'TODO',NULL,0,'2018-08-30T08:04:55.389Z','SBwS31n2Cp','2018-08-29T19:43:02.012Z');
INSERT INTO branches VALUES('Bu2TmxdlNlTi','i3cLVxiO6GlW','1Heh2acXfPNt',3,NULL,0,0,'2018-09-01T11:47:59.762Z','imw6rHOkkw','2018-09-01T11:47:52.505Z');

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +0,0 @@
INSERT INTO note_images VALUES('2EtgRRPfk4Fi','1Heh2acXfPNt','ed64aET6i379',0,'2018-01-08T04:41:30.663Z','2018-01-08T04:41:30.663Z','');
INSERT INTO note_images VALUES('T7qQAw9BVi0E','prjUbW6QtsL4','0mLHhGv61RDM',0,'2018-08-30T07:53:53.165Z','2018-08-30T07:53:53.164Z','lSz2qni/Rx');

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
VALUES ('leftPaneMinWidth', '350', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
VALUES ('leftPaneWidthPercent', '20', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);

View File

@@ -0,0 +1 @@
update branches set parentNoteId = 'none' where branchId = 'root'

View File

@@ -0,0 +1,75 @@
-- first fix deleted status of existing images
UPDATE note_images SET isDeleted = 1 WHERE noteId IN (SELECT noteId FROM notes WHERE isDeleted = 1);
-- we don't need set data to null because table is going to be dropped anyway and we want image size into attribute
UPDATE images SET isDeleted = 1 WHERE imageId NOT IN (SELECT imageId FROM note_images WHERE isDeleted = 0);
-- allow null for note content (for deleted notes)
CREATE TABLE IF NOT EXISTS "notes_mig" (
`noteId` TEXT NOT NULL,
`title` TEXT NOT NULL DEFAULT "note",
`content` TEXT NULL DEFAULT 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,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
PRIMARY KEY(`noteId`)
);
INSERT INTO notes_mig (noteId, title, content, isProtected, isDeleted, dateCreated, dateModified, type, mime, hash)
SELECT noteId, title, content, isProtected, isDeleted, dateCreated, dateModified, type, mime, hash FROM notes;
DROP TABLE notes;
ALTER TABLE notes_mig RENAME TO notes;
CREATE TABLE "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,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
PRIMARY KEY(`linkId`)
);
INSERT INTO links (linkId, noteId, targetNoteId, type, isDeleted, dateCreated, dateModified)
SELECT 'L' || SUBSTR(noteImageId, 2), noteId, imageId, 'image', isDeleted, dateCreated, dateModified FROM note_images;
INSERT INTO branches (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, dateModified, hash, dateCreated)
SELECT 'B' || SUBSTR(noteImageId, 2), imageId, noteId, 100, '', 0, isDeleted, dateModified, hash, dateCreated FROM note_images;
DROP TABLE note_images;
INSERT INTO notes (noteId, title, content, isProtected, isDeleted, dateCreated, dateModified, type, mime, hash)
SELECT imageId, name, data, 0, isDeleted, dateCreated, dateModified, 'image', 'image/' || format, hash FROM images;
INSERT INTO attributes (attributeId, noteId, type, name, value, position, dateCreated, dateModified, isDeleted, hash, isInheritable)
SELECT 'O' || SUBSTR(imageId, 2), imageId, 'label', 'originalFileName', name, 0, dateCreated, dateModified, isDeleted, '', 0 FROM images;
INSERT INTO attributes (attributeId, noteId, type, name, value, position, dateCreated, dateModified, isDeleted, hash, isInheritable)
SELECT 'F' || SUBSTR(imageId, 2), imageId, 'label', 'fileSize', LENGTH(data), 0, dateCreated, dateModified, isDeleted, '', 0 FROM images;
DROP TABLE images;
INSERT INTO sync (entityName, entityId, sourceId, syncDate)
SELECT 'attributes', 'O' || SUBSTR(entityId, 2), sourceId, syncDate FROM sync WHERE entityName = 'images';
INSERT INTO sync (entityName, entityId, sourceId, syncDate)
SELECT 'attributes', 'F' || SUBSTR(entityId, 2), sourceId, syncDate FROM sync WHERE entityName = 'images';
UPDATE sync SET entityName = 'notes' WHERE entityName = 'images';
INSERT INTO sync (entityName, entityId, sourceId, syncDate)
SELECT 'links', 'L' || SUBSTR(entityId, 2), sourceId, syncDate FROM sync WHERE entityName = 'note_images';
INSERT INTO sync (entityName, entityId, sourceId, syncDate)
SELECT 'branches', 'B' || SUBSTR(entityId, 2), sourceId, syncDate FROM sync WHERE entityName = 'note_images';
DELETE FROM sync WHERE entityName = 'note_images';
DELETE FROM sync WHERE entityName = 'images';

View File

@@ -0,0 +1,14 @@
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);

View File

@@ -0,0 +1 @@
UPDATE attributes SET isDeleted = 1 WHERE noteId IN (SELECT noteId FROM notes WHERE isDeleted = 1);

View File

@@ -0,0 +1 @@
UPDATE attributes SET isDeleted = 1 WHERE type = 'relation' AND value NOT IN (SELECT noteId FROM notes WHERE notes.isDeleted = 0);

View File

@@ -0,0 +1 @@
UPDATE attributes SET value = replace(value, 'mirrorRelation', 'inverseRelation') WHERE type = 'relation-definition';

View File

@@ -0,0 +1 @@
UPDATE attributes SET name = 'archived' where name = 'hideInAutocomplete';

View File

@@ -0,0 +1,2 @@
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
VALUES ('hoistedNoteId', 'root', '2018-12-11T18:31:00.874Z', '2018-12-11T18:31:00.874Z', 0);

View File

@@ -0,0 +1,62 @@
const sql = require('../../src/services/sql');
function prependIv(cipherText, ivText) {
const arr = ivText.split("").map(c => parseInt(c) || 0);
const iv = Buffer.from(arr);
const payload = Buffer.from(cipherText, 'base64');
const complete = Buffer.concat([iv, payload]);
return complete.toString('base64');
}
async function updateEncryptedDataKey() {
const encryptedDataKey = await sql.getValue("SELECT value FROM options WHERE name = 'encryptedDataKey'");
const encryptedDataKeyIv = await sql.getValue("SELECT value FROM options WHERE name = 'encryptedDataKeyIv'");
const newEncryptedDataKey = prependIv(encryptedDataKey, encryptedDataKeyIv);
await sql.execute("UPDATE options SET value = ? WHERE name = 'encryptedDataKey'", [newEncryptedDataKey]);
await sql.execute("DELETE FROM options WHERE name = 'encryptedDataKeyIv'");
await sql.execute("DELETE FROM sync WHERE entityName = 'options' AND entityId = 'encryptedDataKeyIv'");
}
async function updateNotes() {
const protectedNotes = await sql.getRows("SELECT noteId, title, content FROM notes WHERE isProtected = 1");
for (const note of protectedNotes) {
if (note.title !== null) {
note.title = prependIv(note.title, "0" + note.noteId);
}
if (note.content !== null) {
note.content = prependIv(note.content, "1" + note.noteId);
}
await sql.execute("UPDATE notes SET title = ?, content = ? WHERE noteId = ?", [note.title, note.content, note.noteId]);
}
}
async function updateNoteRevisions() {
const protectedNoteRevisions = await sql.getRows("SELECT noteRevisionId, title, content FROM note_revisions WHERE isProtected = 1");
for (const noteRevision of protectedNoteRevisions) {
if (noteRevision.title !== null) {
noteRevision.title = prependIv(noteRevision.title, "0" + noteRevision.noteRevisionId);
}
if (noteRevision.content !== null) {
noteRevision.content = prependIv(noteRevision.content, "1" + noteRevision.noteRevisionId);
}
await sql.execute("UPDATE note_revisions SET title = ?, content = ? WHERE noteRevisionId = ?", [noteRevision.title, noteRevision.content, noteRevision.noteRevisionId]);
}
}
module.exports = async () => {
await updateEncryptedDataKey();
await updateNotes();
await updateNoteRevisions();
};

View File

@@ -0,0 +1,8 @@
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
VALUES ('mainFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0);
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
VALUES ('treeFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0);
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
VALUES ('detailFontSize', '110', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0);

View File

@@ -0,0 +1,11 @@
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
SELECT 'mainFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0
WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'mainFontSize');
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
SELECT 'treeFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0
WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'treeFontSize');
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
SELECT 'detailFontSize', '110', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0
WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'detailFontSize');

View File

@@ -0,0 +1,35 @@
CREATE TABLE IF NOT EXISTS "note_contents" (
`noteContentId` TEXT NOT NULL,
`noteId` TEXT NOT NULL,
`isProtected` INT NOT NULL DEFAULT 0,
`content` TEXT NULL DEFAULT NULL,
`hash` TEXT DEFAULT "" NOT NULL,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
PRIMARY KEY(`noteContentId`)
);
CREATE UNIQUE INDEX `IDX_note_contents_noteId` ON `note_contents` (`noteId`);
INSERT INTO note_contents (noteContentId, noteId, isProtected, content, dateCreated, dateModified)
SELECT 'C' || SUBSTR(noteId, 2), noteId, isProtected, content, dateCreated, dateModified FROM notes;
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,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
PRIMARY KEY(`noteId`)
);
INSERT INTO notes_mig (noteId, title, isProtected, isDeleted, dateCreated, dateModified, type, mime, hash)
SELECT noteId, title, isProtected, isDeleted, dateCreated, dateModified, type, mime, hash FROM notes;
DROP TABLE notes;
ALTER TABLE notes_mig RENAME TO notes;

View File

@@ -0,0 +1,2 @@
INSERT OR REPLACE INTO sync (entityName, entityId, sourceId, syncDate)
SELECT 'note_contents', noteContentId, '', '2019-03-02T18:07:29.182Z' FROM note_contents;

View File

@@ -34,29 +34,6 @@ CREATE INDEX `IDX_note_revisions_dateModifiedFrom` ON `note_revisions` (
CREATE INDEX `IDX_note_revisions_dateModifiedTo` ON `note_revisions` (
`dateModifiedTo`
);
CREATE TABLE IF NOT EXISTS "images"
(
imageId TEXT PRIMARY KEY NOT NULL,
format TEXT NOT NULL,
checksum TEXT NOT NULL,
name TEXT NOT NULL,
data BLOB,
isDeleted INT NOT NULL DEFAULT 0,
dateModified TEXT NOT NULL,
dateCreated TEXT NOT NULL
, hash TEXT DEFAULT "" NOT NULL);
CREATE TABLE note_images
(
noteImageId TEXT PRIMARY KEY NOT NULL,
noteId TEXT NOT NULL,
imageId TEXT NOT NULL,
isDeleted INT NOT NULL DEFAULT 0,
dateModified TEXT NOT NULL,
dateCreated TEXT NOT NULL
, hash TEXT DEFAULT "" NOT NULL);
CREATE INDEX IDX_note_images_noteId ON note_images (noteId);
CREATE INDEX IDX_note_images_imageId ON note_images (imageId);
CREATE INDEX IDX_note_images_noteId_imageId ON note_images (noteId, imageId);
CREATE TABLE IF NOT EXISTS "api_tokens"
(
apiTokenId TEXT PRIMARY KEY NOT NULL,
@@ -82,21 +59,7 @@ CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (
`noteId`,
`parentNoteId`
);
CREATE TABLE IF NOT EXISTS "notes" (
`noteId` TEXT NOT NULL,
`title` TEXT NOT NULL DEFAULT "unnamed",
`content` TEXT NOT NULL DEFAULT "",
`isProtected` INT NOT NULL DEFAULT 0,
`isDeleted` INT NOT NULL DEFAULT 0,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
type TEXT NOT NULL DEFAULT 'text',
mime TEXT NOT NULL DEFAULT 'text/html', hash TEXT DEFAULT "" NOT NULL,
PRIMARY KEY(`noteId`)
);
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
CREATE INDEX IDX_notes_type
on notes (type);
CREATE TABLE IF NOT EXISTS "recent_notes" (
`branchId` TEXT NOT NULL PRIMARY KEY,
`notePath` TEXT NOT NULL,
@@ -131,3 +94,49 @@ CREATE TABLE attributes
dateModified TEXT not null,
isDeleted INT not null,
hash TEXT default "" not null, isInheritable int DEFAULT 0 NULL);
CREATE INDEX IDX_attributes_name_value
on attributes (name, value);
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,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
PRIMARY KEY(`linkId`)
);
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" (
`noteContentId` TEXT NOT NULL,
`noteId` TEXT NOT NULL,
`isProtected` INT NOT NULL DEFAULT 0,
`content` TEXT NULL DEFAULT NULL,
`hash` TEXT DEFAULT "" NOT NULL,
`dateCreated` TEXT NOT NULL,
`dateModified` TEXT NOT NULL,
PRIMARY KEY(`noteContentId`)
);
CREATE UNIQUE INDEX `IDX_note_contents_noteId` ON `note_contents` (`noteId`);
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,
PRIMARY KEY(`noteId`)
);

View File

@@ -282,13 +282,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -406,6 +406,310 @@
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> &rarr; {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_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line46">line 46</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>
</dl>
<h4 class="name" id="getTargetNote"><span class="type-signature">(async) </span>getTargetNote<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_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line57">line 57</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>
</dl>
<h4 class="name" id="isDefinition"><span class="type-signature"></span>isDefinition<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_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line76">line 76</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
@@ -420,13 +724,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

File diff suppressed because it is too large Load Diff

View File

@@ -505,13 +505,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -210,13 +210,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

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

367
docs/backend_api/Link.html Normal file
View File

@@ -0,0 +1,367 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Link</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: Link</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>Link<span class="signature">(linkId, noteId, targetNoteId, type, isDeleted, dateModified, dateCreated)</span><span class="type-signature"></span></h2>
<div class="class-description">This class represents link from one note to another in the form of hyperlink or image reference. Note that
this is different concept than attribute/relation.</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="Link"><span class="type-signature"></span>new Link<span class="signature">(linkId, noteId, targetNoteId, type, isDeleted, dateModified, dateCreated)</span><span class="type-signature"></span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>linkId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>noteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>targetNoteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>isDeleted</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>dateModified</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>dateCreated</code></td>
<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="entities_link.js.html">entities/link.js</a>, <a href="entities_link.js.html#line21">line 21</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li><a href="Entity.html">Entity</a></li>
</ul>
</article>
</section>
</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="NoteContent.html">NoteContent</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>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,494 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: NoteContent</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: NoteContent</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>NoteContent<span class="signature">(row)</span><span class="type-signature"></span></h2>
<div class="class-description">This represents a Note which is a central object in the Trilium Notes project.</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="NoteContent"><span class="type-signature"></span>new NoteContent<span class="signature">(row)</span><span class="type-signature"></span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>row</code></td>
<td class="type">
</td>
<td class="description last">object containing database row from "note_contents" table</td>
</tr>
</tbody>
</table>
<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>noteContentId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">primary key</td>
</tr>
<tr>
<td class="name"><code>noteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">reference to owning note</td>
</tr>
<tr>
<td class="name"><code>isProtected</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">true if note content is protected</td>
</tr>
<tr>
<td class="name"><code>content</code></td>
<td class="type">
<span class="param-type">blob</span>
</td>
<td class="description last">note content - e.g. HTML text for text notes, file payload for files</td>
</tr>
<tr>
<td class="name"><code>dateCreated</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>dateModified</code></td>
<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="entities_note_content.js.html">entities/note_content.js</a>, <a href="entities_note_content.js.html#line20">line 20</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li><a href="Entity.html">Entity</a></li>
</ul>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Note.html">Note</a>>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note_content.js.html">entities/note_content.js</a>, <a href="entities_note_content.js.html#line63">line 63</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>></span>
</dd>
</dl>
</article>
</section>
</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="NoteContent.html">NoteContent</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>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

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

View File

@@ -397,13 +397,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -305,13 +305,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -282,13 +282,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -68,10 +68,20 @@ class Attribute extends Entity {
}
}
/**
* @returns {Promise&lt;Note|null>}
*/
async getNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
if (!this.__note) {
this.__note = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
}
return this.__note;
}
/**
* @returns {Promise&lt;Note|null>}
*/
async getTargetNote() {
if (this.type !== 'relation') {
throw new Error(`Attribute ${this.attributeId} is not relation`);
@@ -81,9 +91,16 @@ class Attribute extends Entity {
return null;
}
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.value]);
if (!this.__targetNote) {
this.__targetNote = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.value]);
}
return this.__targetNote;
}
/**
* @return {boolean}
*/
isDefinition() {
return this.type === 'label-definition' || this.type === 'relation-definition';
}
@@ -116,6 +133,11 @@ class Attribute extends Entity {
this.dateModified = dateUtils.nowDate();
}
}
// cannot be static!
updatePojo(pojo) {
delete pojo.isOwned;
}
}
module.exports = Attribute;</code></pre>
@@ -128,13 +150,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -87,6 +87,11 @@ class Branch extends Entity {
this.dateModified = dateUtils.nowDate();
}
}
// cannot be static!
updatePojo(pojo) {
delete pojo.origParentNoteId;
}
}
module.exports = Branch;</code></pre>
@@ -99,13 +104,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -36,7 +36,10 @@ class Entity {
*/
constructor(row = {}) {
for (const key in row) {
this[key] = row[key];
// ! is used when joint-fetching notes and note_contents objects for performance
if (!key.startsWith('!')) {
this[key] = row[key];
}
}
if ('isDeleted' in this) {
@@ -87,13 +90,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

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

View File

@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: entities/link.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/link.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>"use strict";
const Entity = require('./entity');
const repository = require('../services/repository');
const dateUtils = require('../services/date_utils');
/**
* This class represents link from one note to another in the form of hyperlink or image reference. Note that
* this is different concept than attribute/relation.
*
* @param {string} linkId
* @param {string} noteId
* @param {string} targetNoteId
* @param {string} type
* @param {boolean} isDeleted
* @param {string} dateModified
* @param {string} dateCreated
*
* @extends Entity
*/
class Link extends Entity {
static get entityName() { return "links"; }
static get primaryKeyName() { return "linkId"; }
static get hashedProperties() { return ["linkId", "noteId", "targetNoteId", "type", "isDeleted", "dateCreated", "dateModified"]; }
async getNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
}
async getTargetNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.targetNoteId]);
}
beforeSaving() {
if (!this.isDeleted) {
this.isDeleted = false;
}
if (!this.dateCreated) {
this.dateCreated = dateUtils.nowDate();
}
super.beforeSaving();
if (this.isChanged) {
this.dateModified = dateUtils.nowDate();
}
}
}
module.exports = Link;</code></pre>
</article>
</section>
</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="NoteContent.html">NoteContent</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>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@@ -30,12 +30,16 @@
const Entity = require('./entity');
const Attribute = require('./attribute');
const NoteContent = require('./note_content');
const protectedSessionService = require('../services/protected_session');
const repository = require('../services/repository');
const sql = require('../services/sql');
const dateUtils = require('../services/date_utils');
const LABEL = 'label';
const LABEL_DEFINITION = 'label-definition';
const RELATION = 'relation';
const RELATION_DEFINITION = 'relation-definition';
/**
* This represents a Note which is a central object in the Trilium Notes project.
@@ -44,7 +48,6 @@ const RELATION = 'relation';
* @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 {string} content - note content - e.g. HTML text for text notes, file payload for files
* @property {boolean} isProtected - true if note is protected
* @property {boolean} isDeleted - true if note is deleted
* @property {string} dateCreated
@@ -55,7 +58,7 @@ const RELATION = 'relation';
class Note extends Entity {
static get entityName() { return "notes"; }
static get primaryKeyName() { return "noteId"; }
static get hashedProperties() { return ["noteId", "title", "content", "type", "isProtected", "isDeleted"]; }
static get hashedProperties() { return ["noteId", "title", "type", "isProtected", "isDeleted"]; }
/**
* @param row - object containing database row from "notes" table
@@ -64,22 +67,72 @@ class Note extends Entity {
super(row);
this.isProtected = !!this.isProtected;
/* true if content (meaning any kind of potentially encrypted content) is either not encrypted
* or encrypted, but with available protected session (so effectively decrypted) */
this.isContentAvailable = true;
// check if there's noteId, otherwise this is a new entity which wasn't encrypted yet
if (this.isProtected &amp;&amp; this.noteId) {
protectedSessionService.decryptNote(this);
}
this.isContentAvailable = protectedSessionService.isProtectedSessionAvailable();
this.setContent(this.content);
if (this.isContentAvailable) {
protectedSessionService.decryptNote(this);
}
else {
// saving ciphertexts in case we do want to update protected note outside of protected session
// (which is allowed)
this.titleCipherText = this.title;
this.title = "[protected]";
}
}
}
setContent(content) {
this.content = content;
/** @returns {Promise&lt;NoteContent>} */
async getNoteContent() {
if (!this.noteContent) {
this.noteContent = await repository.getEntity(`SELECT * FROM note_contents WHERE noteId = ?`, [this.noteId]);
try {
this.jsonContent = JSON.parse(this.content);
if (!this.noteContent) {
throw new Error("Note content not found for noteId=" + this.noteId);
}
if (this.isStringNote()) {
this.noteContent.content = this.noteContent.content.toString("UTF-8");
}
}
catch(e) {}
return this.noteContent;
}
/** @returns {Promise&lt;*>} */
async getContent() {
const noteContent = await this.getNoteContent();
return noteContent.content;
}
/** @returns {Promise&lt;*>} */
async getJsonContent() {
const content = await this.getContent();
return JSON.parse(content);
}
/** @returns {Promise} */
async setContent(content) {
if (!this.noteContent) {
// make sure it is loaded
await this.getNoteContent();
}
this.noteContent.content = content;
await this.noteContent.save();
}
/** @returns {Promise} */
async setJsonContent(content) {
await this.setContent(JSON.stringify(content));
}
/** @returns {boolean} true if this note is the root of the note tree. Root note has "root" noteId */
@@ -95,7 +148,9 @@ class Note extends Entity {
/** @returns {boolean} true if this note is JavaScript (code or attachment) */
isJavaScript() {
return (this.type === "code" || this.type === "file")
&amp;&amp; (this.mime.startsWith("application/javascript") || this.mime === "application/x-javascript");
&amp;&amp; (this.mime.startsWith("application/javascript")
|| this.mime === "application/x-javascript"
|| this.mime === "text/javascript");
}
/** @returns {boolean} true if this note is HTML */
@@ -103,6 +158,11 @@ class Note extends Entity {
return (this.type === "code" || this.type === "file" || this.type === "render") &amp;&amp; this.mime === "text/html";
}
/** @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/');
}
/** @returns {string} JS script environment - either "frontend" or "backend" */
getScriptEnv() {
if (this.isHtml() || (this.isJavaScript() &amp;&amp; this.mime.endsWith('env=frontend'))) {
@@ -127,6 +187,13 @@ class Note extends Entity {
return await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
}
/**
* @returns {Promise&lt;Attribute[]>} relations targetting this specific note
*/
async getTargetRelations() {
return await repository.getEntities("SELECT * FROM attributes WHERE type = 'relation' AND isDeleted = 0 AND value = ?", [this.noteId]);
}
/**
* @param {string} [name] - attribute name to filter
* @returns {Promise&lt;Attribute[]>} all note's attributes, including inherited ones
@@ -152,6 +219,14 @@ class Note extends Entity {
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL);
}
/**
* @param {string} [name] - label name to filter
* @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);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), including inherited ones
@@ -160,6 +235,14 @@ class Note extends Entity {
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION);
}
/**
* @param {string} [name] - relation name to filter
* @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);
}
/**
* Clear note's attributes cache to force fresh reload for next attribute request.
* Cache is note instance scoped.
@@ -364,6 +447,16 @@ class Note extends Entity {
*/
async getRelationValue(name) { return await 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)
*/
async getRelationTarget(name) {
const relation = await this.getRelation(name);
return relation ? await repository.getNote(relation.value) : null;
}
/**
* Based on enabled, label is either set or removed.
*
@@ -421,24 +514,32 @@ class Note extends Entity {
async removeRelation(name, value) { return await this.removeAttribute(RELATION, name, value); }
/**
* @param {string} name
* @returns {Promise&lt;Note>|null} target note of the relation or null (if target is empty or note was not found)
* @return {Promise&lt;string[]>} return list of all descendant noteIds of this note. Returning just noteIds because number of notes can be huge. Includes also this note's noteId
*/
async getRelationTarget(name) {
const relation = await this.getRelation(name);
return relation ? await repository.getNote(relation.value) : null;
async getDescendantNoteIds() {
return await sql.getColumn(`
WITH RECURSIVE
tree(noteId) AS (
SELECT ?
UNION
SELECT branches.noteId FROM branches
JOIN tree ON branches.parentNoteId = tree.noteId
JOIN notes ON notes.noteId = branches.noteId
WHERE notes.isDeleted = 0
AND branches.isDeleted = 0
)
SELECT noteId FROM tree`, [this.noteId]);
}
/**
* Finds notes with given attribute name and value. Only own attributes are considered, not inherited ones
* Finds descendant notes with given attribute name and value. Only own attributes are considered, not inherited ones
*
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @param {string} [value] - attribute value
* @returns {Promise&lt;Note[]>}
*/
async findNotesWithAttribute(type, name, value) {
async getDescendantNotesWithAttribute(type, name, value) {
const params = [this.noteId, name];
let valueCondition = "";
@@ -470,22 +571,22 @@ class Note extends Entity {
}
/**
* Finds notes with given label name and value. Only own labels are considered, not inherited ones
* Finds descendant notes with given label name and value. Only own labels are considered, not inherited ones
*
* @param {string} name - label name
* @param {string} [value] - label value
* @returns {Promise&lt;Note[]>}
*/
async findNotesWithLabel(name, value) { return await this.findNotesWithAttribute(LABEL, name, value); }
async getDescendantNotesWithLabel(name, value) { return await this.getDescendantNotesWithAttribute(LABEL, name, value); }
/**
* Finds notes with given relation name and value. Only own relations are considered, not inherited ones
* Finds descendant notes with given relation name and value. Only own relations are considered, not inherited ones
*
* @param {string} name - relation name
* @param {string} [value] - relation value
* @returns {Promise&lt;Note[]>}
*/
async findNotesWithRelation(name, value) { return await this.findNotesWithAttribute(RELATION, name, value); }
async getDescendantNotesWithRelation(name, value) { return await this.getDescendantNotesWithAttribute(RELATION, name, value); }
/**
* Returns note revisions of this note.
@@ -497,10 +598,30 @@ class Note extends Entity {
}
/**
* @returns {Promise&lt;NoteImage[]>}
* Get list of links coming out of this note.
*
* @returns {Promise&lt;Link[]>}
*/
async getNoteImages() {
return await repository.getEntities("SELECT * FROM note_images WHERE noteId = ? AND isDeleted = 0", [this.noteId]);
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]);
}
/**
@@ -558,17 +679,6 @@ class Note extends Entity {
}
beforeSaving() {
if (this.isJson() &amp;&amp; this.jsonContent) {
this.content = JSON.stringify(this.jsonContent, null, '\t');
}
// we do this here because encryption needs the note ID for the IV
this.generateIdIfNecessary();
if (this.isProtected) {
protectedSessionService.encryptNote(this);
}
if (!this.isDeleted) {
this.isDeleted = false;
}
@@ -583,6 +693,23 @@ class Note extends Entity {
this.dateModified = dateUtils.nowDate();
}
}
// cannot be static!
updatePojo(pojo) {
if (pojo.isProtected) {
if (this.isContentAvailable) {
protectedSessionService.encryptNote(pojo);
}
else {
// updating protected note outside of protected session means we will keep original ciphertexts
pojo.title = pojo.titleCipherText;
}
}
delete pojo.isContentAvailable;
delete pojo.__attributeCache;
delete pojo.titleCipherText;
}
}
module.exports = Note;</code></pre>
@@ -595,13 +722,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -0,0 +1,146 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: entities/note_content.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_content.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>"use strict";
const Entity = require('./entity');
const protectedSessionService = require('../services/protected_session');
const repository = require('../services/repository');
const dateUtils = require('../services/date_utils');
/**
* This represents a Note which is a central object in the Trilium Notes project.
*
* @property {string} noteContentId - primary key
* @property {string} noteId - reference to owning note
* @property {boolean} isProtected - true if note content is protected
* @property {blob} content - note content - e.g. HTML text for text notes, file payload for files
* @property {string} dateCreated
* @property {string} dateModified
*
* @extends Entity
*/
class NoteContent extends Entity {
static get entityName() {
return "note_contents";
}
static get primaryKeyName() {
return "noteContentId";
}
static get hashedProperties() {
return ["noteContentId", "noteId", "isProtected", "content"];
}
/**
* @param row - object containing database row from "note_contents" table
*/
constructor(row) {
super(row);
this.isProtected = !!this.isProtected;
/* true if content (meaning any kind of potentially encrypted content) is either not encrypted
* or encrypted, but with available protected session (so effectively decrypted) */
this.isContentAvailable = true;
// check if there's noteContentId, otherwise this is a new entity which wasn't encrypted yet
if (this.isProtected &amp;&amp; this.noteContentId) {
this.isContentAvailable = protectedSessionService.isProtectedSessionAvailable();
if (this.isContentAvailable) {
protectedSessionService.decryptNoteContent(this);
}
else {
// saving ciphertexts in case we do want to update protected note outside of protected session
// (which is allowed)
this.contentCipherText = this.content;
this.content = "";
}
}
}
/**
* @returns {Promise&lt;Note>}
*/
async getNote() {
return await repository.getNote(this.noteId);
}
beforeSaving() {
if (!this.dateCreated) {
this.dateCreated = dateUtils.nowDate();
}
super.beforeSaving();
if (this.isChanged) {
this.dateModified = dateUtils.nowDate();
}
}
// cannot be static!
updatePojo(pojo) {
if (pojo.isProtected) {
if (this.isContentAvailable) {
protectedSessionService.encryptNoteContent(pojo);
}
else {
// updating protected note outside of protected session means we will keep original ciphertext
pojo.content = pojo.contentCipherText;
}
}
delete pojo.isContentAvailable;
delete pojo.contentCipherText;
}
}
module.exports = NoteContent;</code></pre>
</article>
</section>
</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="NoteContent.html">NoteContent</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>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

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

View File

@@ -85,13 +85,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -72,13 +72,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -272,7 +272,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#line144">line 144</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line149">line 149</a>
</li></ul></dd>
@@ -558,7 +558,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#line151">line 151</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line156">line 156</a>
</li></ul></dd>
@@ -588,13 +588,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -39,6 +39,7 @@ const repository = require('./repository');
const axios = require('axios');
const cloningService = require('./cloning');
const messagingService = require('./messaging');
const appInfo = require('./app_info');
/**
* This is the main backend API interface for scripts. It's published in the local "api" object.
@@ -46,13 +47,17 @@ const messagingService = require('./messaging');
* @constructor
* @hideconstructor
*/
function BackendScriptApi(startNote, currentNote, originEntity) {
function BackendScriptApi(currentNote, apiParams) {
/** @property {Note} note where script started executing */
this.startNote = startNote;
this.startNote = apiParams.startNote;
/** @property {Note} note where script is currently executing */
this.currentNote = currentNote;
/** @property {Entity} entity whose event triggered this executions */
this.originEntity = originEntity;
this.originEntity = apiParams.originEntity;
for (const key in apiParams) {
this[key] = apiParams[key];
}
this.axios = axios;
@@ -196,6 +201,23 @@ function BackendScriptApi(startNote, currentNote, originEntity) {
*/
this.createNote = noteService.createNote;
/**
* 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);
messagingService.refreshTree();
};
/**
* Log given message to trilium logs.
*
@@ -212,14 +234,42 @@ function BackendScriptApi(startNote, currentNote, originEntity) {
this.getRootCalendarNote = dateNoteService.getRootCalendarNote;
/**
* Returns day note for given date (YYYY-MM-DD format). If such note doesn't exist, it is created.
* Returns day note for given date. If such note doesn't exist, it is created.
*
* @method
* @param {string} date
* @param {string} date in YYYY-MM-DD format
* @returns {Promise&lt;Note|null>}
*/
this.getDateNote = dateNoteService.getDateNote;
/**
* Returns note for the first date of the week of the given date.
*
* @method
* @param {string} date in YYYY-MM-DD format
* @param {object} options - "startOfTheWeek" - either "monday" (default) or "sunday"
* @returns {Promise&lt;Note|null>}
*/
this.getWeekNote = dateNoteService.getWeekNote;
/**
* Returns month note for given date. If such note doesn't exist, it is created.
*
* @method
* @param {string} date in YYYY-MM format
* @returns {Promise&lt;Note|null>}
*/
this.getMonthNote = dateNoteService.getMonthNote;
/**
* Returns year note for given year. If such note doesn't exist, it is created.
*
* @method
* @param {string} year in YYYY format
* @returns {Promise&lt;Note|null>}
*/
this.getYearNote = dateNoteService.getYearNote;
/**
* @method
* @param {string} parentNoteId - this note's child notes will be sorted
@@ -253,13 +303,20 @@ function BackendScriptApi(startNote, currentNote, originEntity) {
*/
this.transactional = sql.transactional;
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>}
*/
this.refreshTree = () => messagingService.sendMessageToAllClients({ type: 'refresh-tree' });
this.refreshTree = messagingService.refreshTree;
/**
* @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
*/
this.getAppInfo = () => appInfo
}
module.exports = BackendScriptApi;</code></pre>
@@ -272,13 +329,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="Image.html">Image</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteImage.html">NoteImage</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="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</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> on Mon Sep 03 2018 16:04:45 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

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

View File

@@ -81,7 +81,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line15">line 15</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line18">line 18</a>
</li></ul></dd>
@@ -221,7 +221,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line21">line 21</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line24">line 24</a>
</li></ul></dd>
@@ -334,7 +334,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line23">line 23</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line26">line 26</a>
</li></ul></dd>
@@ -444,7 +444,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line19">line 19</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line22">line 22</a>
</li></ul></dd>
@@ -573,7 +573,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line40">line 40</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line43">line 43</a>
</li></ul></dd>
@@ -726,7 +726,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line32">line 32</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line35">line 35</a>
</li></ul></dd>
@@ -879,7 +879,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line59">line 59</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line62">line 62</a>
</li></ul></dd>
@@ -1057,7 +1057,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line194">line 194</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line199">line 199</a>
</li></ul></dd>
@@ -1188,7 +1188,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line154">line 154</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line159">line 159</a>
</li></ul></dd>
@@ -1244,6 +1244,110 @@
<h4 class="name" id="getCodeMimeTypes"><span class="type-signature"></span>getCodeMimeTypes<span class="signature">()</span><span class="type-signature"> &rarr; {array}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line236">line 236</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
list of currently used code mime types
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">array</span>
</dd>
</dl>
<h4 class="name" id="getCurrentNoteContent"><span class="type-signature"></span>getCurrentNoteContent<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
@@ -1292,7 +1396,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#line200">line 200</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line205">line 205</a>
</li></ul></dd>
@@ -1348,6 +1452,110 @@
<h4 class="name" id="getDefaultCodeMimeTypes"><span class="type-signature"></span>getDefaultCodeMimeTypes<span class="signature">()</span><span class="type-signature"> &rarr; {array}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line230">line 230</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
list of default code mime types
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">array</span>
</dd>
</dl>
<h4 class="name" id="getInstanceName"><span class="type-signature"></span>getInstanceName<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
@@ -1401,7 +1609,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line147">line 147</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line152">line 152</a>
</li></ul></dd>
@@ -1600,7 +1808,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line139">line 139</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line144">line 144</a>
</li></ul></dd>
@@ -1652,6 +1860,117 @@ otherwise (by e.g. createNoteLink())
<h4 class="name" id="isNoteStillLoaded"><span class="type-signature"></span>isNoteStillLoaded<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
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.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line216">line 216</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
returns true if the original note is still loaded, false if user switched to another
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="onNoteChange"><span class="type-signature"></span>onNoteChange<span class="signature">(func)</span><span class="type-signature"></span></h4>
@@ -1708,7 +2027,7 @@ otherwise (by e.g. createNoteLink())
<td class="description last">callback called on note change</td>
<td class="description last">callback called on note change as user is typing (not necessarily tied to save event)</td>
</tr>
@@ -1749,7 +2068,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line206">line 206</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line224">line 224</a>
</li></ul></dd>
@@ -1880,7 +2199,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line161">line 161</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line166">line 166</a>
</li></ul></dd>
@@ -1932,6 +2251,88 @@ otherwise (by e.g. createNoteLink())
<h4 class="name" id="protectCurrentNote"><span class="type-signature"></span>protectCurrentNote<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_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line253">line 253</a>
</li></ul></dd>
</dl>
@@ -1988,7 +2389,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line185">line 185</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line190">line 190</a>
</li></ul></dd>
@@ -2165,7 +2566,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line107">line 107</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line112">line 112</a>
</li></ul></dd>
@@ -2217,6 +2618,268 @@ Internally this serializes the anonymous function into string and sends it to ba
<h4 class="name" id="setCodeMimeTypes"><span class="type-signature"></span>setCodeMimeTypes<span class="signature">(types)</span><span class="type-signature"></span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>types</code></td>
<td class="type">
<span class="param-type">array</span>
</td>
<td class="description last">list of mime types to be used</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line242">line 242</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setupElementTooltip"><span class="type-signature"></span>setupElementTooltip<span class="signature">($el)</span><span class="type-signature"></span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>$el</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">jquery object on which to setup the tooltip</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line248">line 248</a>
</li></ul></dd>
</dl>
@@ -2322,7 +2985,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line177">line 177</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line182">line 182</a>
</li></ul></dd>
@@ -2457,7 +3120,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line169">line 169</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line174">line 174</a>
</li></ul></dd>
@@ -2507,7 +3170,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -141,7 +141,123 @@
<h4 class="name" id="content"><span class="type-signature"></span>content<span class="type-signature"></span></h4>
<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_full.js.html">entities/note_full.js</a>, <a href="entities_note_full.js.html#line14">line 14</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_full.js.html">entities/note_full.js</a>, <a href="entities_note_full.js.html#line17">line 17</a>
</li></ul></dd>
</dl>
<h4 class="name" id="noteContent"><span class="type-signature"></span>noteContent<span class="type-signature"></span></h4>
@@ -198,64 +314,6 @@
<h4 class="name" id="jsonContent"><span class="type-signature"></span>jsonContent<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_full.js.html">entities/note_full.js</a>, <a href="entities_note_full.js.html#line16">line 16</a>
</li></ul></dd>
</dl>
@@ -279,7 +337,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: entities/attribute.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/attribute.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>class Attribute {
constructor(treeCache, row) {
this.treeCache = treeCache;
/** @param {string} attributeId */
this.attributeId = row.attributeId;
/** @param {string} noteId */
this.noteId = row.noteId;
/** @param {string} type */
this.type = row.type;
/** @param {string} name */
this.name = row.name;
/** @param {string} value */
this.value = row.value;
/** @param {int} position */
this.position = row.position;
/** @param {boolean} isInheritable */
this.isInheritable = row.isInheritable;
/** @param {boolean} isDeleted */
this.isDeleted = row.isDeleted;
/** @param {string} dateCreated */
this.dateCreated = row.dateCreated;
/** @param {string} dateModified */
this.dateModified = row.dateModified;
}
/** @returns {NoteShort} */
async getNote() {
return await this.treeCache.getNote(this.noteId);
}
get toString() {
return `Attribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name})`;
}
}
export default Attribute;</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="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/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@@ -42,7 +42,7 @@ class Branch {
/** @param {string} */
this.prefix = row.prefix;
/** @param {boolean} */
this.isExpanded = row.isExpanded;
this.isExpanded = !!row.isExpanded;
}
/** @returns {NoteShort} */
@@ -76,7 +76,7 @@ export default Branch;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -36,15 +36,13 @@ class NoteFull extends NoteShort {
super(treeCache, row);
/** @param {string} */
this.content = row.content;
this.noteContent = row.noteContent;
if (this.content !== "" &amp;&amp; this.isJson()) {
try {
/** @param {object} */
this.jsonContent = JSON.parse(this.content);
}
catch(e) {}
}
/** @param {string} */
this.dateCreated = row.dateCreated;
/** @param {string} */
this.dateModified = row.dateModified;
}
}
@@ -64,7 +62,7 @@ export default NoteFull;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -26,7 +26,14 @@
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
<pre class="prettyprint source linenums"><code>import server from '../services/server.js';
const LABEL = 'label';
const LABEL_DEFINITION = 'label-definition';
const RELATION = 'relation';
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.
*/
@@ -99,6 +106,140 @@ class NoteShort {
return await this.treeCache.getNotes(this.getChildNoteIds());
}
/**
* @param {string} [name] - attribute name to filter
* @returns {Promise&lt;Attribute[]>}
*/
async getAttributes(name) {
if (!this.attributeCache) {
this.attributeCache = await server.get('notes/' + this.noteId + '/attributes');
}
if (name) {
return this.attributeCache.filter(attr => attr.name === name);
}
else {
return this.attributeCache;
}
}
/**
* @param {string} [name] - label name to filter
* @returns {Promise&lt;Attribute[]>} all note's labels (attributes with type label), including inherited ones
*/
async getLabels(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL);
}
/**
* @param {string} [name] - label name to filter
* @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);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), including inherited ones
*/
async getRelations(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION);
}
/**
* @param {string} [name] - relation name to filter
* @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);
}
/**
* @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)
*/
async hasAttribute(type, name) {
return !!await 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.
*/
async getAttribute(type, name) {
const attributes = await this.getAttributes();
return attributes.find(attr => attr.type === type &amp;&amp; attr.name === 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.
*/
async getAttributeValue(type, name) {
const attr = await this.getAttribute(type, name);
return attr ? attr.value : null;
}
/**
* @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 - relation name
* @returns {Promise&lt;boolean>} true if relation exists (including inherited)
*/
async hasRelation(name) { return await this.hasAttribute(RELATION, name); }
/**
* @param {string} name - label name
* @returns {Promise&lt;Attribute>} label if it exists, null otherwise
*/
async getLabel(name) { return await this.getAttribute(LABEL, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;Attribute>} relation if it exists, null otherwise
*/
async getRelation(name) { return await this.getAttribute(RELATION, name); }
/**
* @param {string} name - label name
* @returns {Promise&lt;string>} label value if label exists, null otherwise
*/
async getLabelValue(name) { return await this.getAttributeValue(LABEL, name); }
/**
* @param {string} name - relation name
* @returns {Promise&lt;string>} relation value if relation exists, null otherwise
*/
async getRelationValue(name) { return await 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)
*/
async getRelationTarget(name) {
const relation = await this.getRelation(name);
return relation ? await repository.getNote(relation.value) : null;
}
/**
* Clear note's attributes cache to force fresh reload for next attribute request.
* Cache is note instance scoped.
*/
invalidateAttributeCache() {
this.attributeCache = null;
}
get toString() {
return `Note(noteId=${this.noteId}, title=${this.title})`;
}
@@ -107,6 +248,7 @@ class NoteShort {
const dto = Object.assign({}, this);
delete dto.treeCache;
delete dto.archived;
delete dto.attributeCache;
return dto;
}
@@ -128,7 +270,7 @@ export default NoteShort;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -204,7 +204,7 @@
<td class="description last">name of the jQuery UI icon to be used (e.g. "clock" for "ui-icon-clock" icon)</td>
<td class="description last">name of the JAM icon to be used (e.g. "clock" for "jam-clock" icon)</td>
</tr>
@@ -303,7 +303,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line46">line 46</a>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line49">line 49</a>
</li></ul></dd>
@@ -339,7 +339,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

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

View File

@@ -33,6 +33,9 @@ import infoService from './info.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';
/**
* This is the main frontend API interface for scripts. It's published in the local "api" object.
@@ -68,13 +71,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
this.activateNewNote = async notePath => {
await treeService.reload();
await treeService.activateNote(notePath, true);
await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle);
};
/**
* @typedef {Object} ToolbarButtonOptions
* @property {string} title
* @property {string} [icon] - name of the jQuery UI icon to be used (e.g. "clock" for "ui-icon-clock" icon)
* @property {string} [icon] - name of the JAM icon to be used (e.g. "clock" for "jam-clock" icon)
* @property {function} action - callback handling the click on the button
* @property {string} [shortcut] - keyboard shortcut for the button, e.g. "alt+t"
*/
@@ -87,14 +90,16 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
this.addButtonToToolbar = opts => {
const buttonId = "toolbar-button-" + opts.title.replace(/[^a-zA-Z0-9]/g, "-");
const icon = $("&lt;span>")
.addClass("ui-icon ui-icon-" + opts.icon);
const button = $('&lt;button>')
.addClass("btn btn-xs")
.click(opts.action)
.append(icon)
.append($("&lt;span>").text(opts.title));
.addClass("btn btn-sm")
.click(opts.action);
if (opts.icon) {
button.append($("&lt;span>").addClass("jam jam-" + opts.icon))
.append("&amp;nbsp;");
}
button.append($("&lt;span>").text(opts.title));
button.attr('id', buttonId);
@@ -228,10 +233,52 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
this.getCurrentNoteContent = noteDetailService.getCurrentNoteContent;
/**
* 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
* @param {function} func - callback called on note change
* @return {boolean} returns true if the original note is still loaded, false if user switched to another
*/
this.isNoteStillLoaded = () => {
return this.originEntity.noteId === noteDetailService.getCurrentNoteId();
};
/**
* @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;
/**
* @method
* @param {object} $el - jquery object on which to setup the tooltip
*/
this.setupElementTooltip = noteTooltipService.setupElementTooltip;
/**
* @method
*/
this.protectCurrentNote = protectedSessionService.protectNoteAndSendToServer;
}
export default FrontendScriptApi;</code></pre>
@@ -250,7 +297,7 @@ export default FrontendScriptApi;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>
<script> prettyPrint(); </script>

View File

@@ -3,8 +3,11 @@
const electron = require('electron');
const path = require('path');
const log = require('./src/services/log');
const cls = require('./src/services/cls');
const url = require("url");
const port = require('./src/services/port');
const appIconService = require('./src/services/app_icon');
const windowStateKeeper = require('electron-window-state');
const app = electron.app;
const globalShortcut = electron.globalShortcut;
@@ -12,6 +15,8 @@ const globalShortcut = electron.globalShortcut;
// Adds debug features like hotkeys for triggering dev tools and reload
require('electron-debug')();
appIconService.installLocalAppIcon();
// Prevent window being garbage collected
let mainWindow;
@@ -24,14 +29,23 @@ function onClosed() {
}
async function createMainWindow() {
let mainWindowState = windowStateKeeper({
// default window width & height so it's usable on 1600 * 900 display (including some extra panels etc.)
defaultWidth: 1200,
defaultHeight: 800
});
const win = new electron.BrowserWindow({
// initial window width & height so it's usable on 1600 * 900 display (including some extra panels etc.)
width: 1200,
height: 800,
x: mainWindowState.x,
y: mainWindowState.y,
width: mainWindowState.width,
height: mainWindowState.height,
title: 'Trilium Notes',
icon: path.join(__dirname, 'src/public/images/app-icons/png/256x256.png')
});
mainWindowState.manage(win);
win.setMenu(null);
win.loadURL('http://localhost:' + await port);
win.on('closed', onClosed);
@@ -68,20 +82,22 @@ app.on('activate', () => {
}
});
app.on('ready', () => {
mainWindow = createMainWindow();
app.on('ready', async () => {
app.setAppUserModelId('com.github.zadam.trilium');
const result = globalShortcut.register('CommandOrControl+Alt+P', async () => {
mainWindow = await createMainWindow();
const result = globalShortcut.register('CommandOrControl+Alt+P', cls.wrap(async () => {
const dateNoteService = require('./src/services/date_notes');
const dateUtils = require('./src/services/date_utils');
const parentNote = await dateNoteService.getDateNote(dateUtils.nowDate());
const parentNote = await dateNoteService.getDateNote(dateUtils.nowLocalDate());
// window may be hidden / not in focus
mainWindow.focus();
mainWindow.webContents.send('create-day-sub-note', parentNote.noteId);
});
}));
if (!result) {
log.error("Could not register global shortcut CTRL+ALT+P");

5
issue_template.md Normal file
View File

@@ -0,0 +1,5 @@
For bug reports, please mention **version of the application** and include **log files** from following location:
* `/home/[user]/.local/share/trilium-data/log` for Linux
* `C:\Users\[user]\AppData\Roaming\trilium-data\log` for Windows Vista and up
* `/Users/[user]/Library/Application Support/trilium-data/log` for Mac OS

7
jsdoc-conf.json Normal file
View File

@@ -0,0 +1,7 @@
{
"templates": {
"default": {
"includeDate": false
}
}
}

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