Compare commits

..

62 Commits

Author SHA1 Message Date
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
azivner
185fb4b787 release 0.21.0 2018-09-03 20:18:28 +02:00
azivner
f2712e92bb minor demo db updates after change to paragraph layout 2018-09-03 20:14:45 +02:00
azivner
763f885cc7 commonjs modules should have "this" available 2018-09-03 17:31:52 +02:00
azivner
25f8df1e03 fix import for tars generated outside of trilium 2018-09-03 17:08:34 +02:00
azivner
c7a609e349 new frontend API - getCurrentNoteContent and onNoteChange 2018-09-03 16:05:28 +02:00
azivner
a3feaa13b3 single markdown file import, #166 2018-09-03 13:40:40 +02:00
azivner
4a58357a9a fixes & refactoring to markdown import 2018-09-03 13:17:29 +02:00
azivner
c41b809720 markdown import 2018-09-03 12:05:44 +02:00
azivner
9bdd4437f2 export single note as markdown, #166 2018-09-03 09:40:22 +02:00
azivner
467ad79129 implemented markdown export, #166 2018-09-02 23:39:10 +02:00
azivner
0daeb71869 removing paragraph margin & padding collapse, #51, no migration yet 2018-09-02 23:03:44 +02:00
azivner
708874a02c #166 inline markdown import 2018-09-02 23:02:01 +02:00
azivner
fa77132fe9 mention of markdown autoformat in README 2018-09-02 11:05:07 +02:00
azivner
d3300df3d7 typo, fixes #164 2018-09-02 08:01:16 +02:00
azivner
4984b06d9f night theme in README 2018-09-01 17:50:49 +02:00
azivner
66c908f2b2 relations should be also prefixed by at-sign in bottom attribute panel 2018-09-01 15:49:35 +02:00
azivner
7199208d9d putting reddit importer back 2018-09-01 15:23:51 +02:00
azivner
8adc111b0a removed scripts which are outdated, demo document should be sufficient for now 2018-09-01 14:10:36 +02:00
azivner
1079ba1707 release 0.20.2 2018-09-01 14:08:37 +02:00
azivner
10ff504528 demo document update 2018-09-01 13:57:03 +02:00
azivner
005b66f4f4 smaller initial height of 800 to fit into 1600*900 display 2018-09-01 13:41:01 +02:00
azivner
792039227f cssClass is correctly filled for new note 2018-09-01 13:18:55 +02:00
azivner
bc38172792 readme update 2018-09-01 11:04:31 +02:00
azivner
c55bc471db fix note move to different parent in note cache 2018-08-31 19:55:56 +02:00
azivner
fdc3a7a7f2 fix "search" button click 2018-08-31 19:23:56 +02:00
azivner
a98d80db31 renamed subtree operations in context menu from "branch" to "subtree" 2018-08-31 18:22:53 +02:00
azivner
65d99f3f06 fixed bug which caused incorrect ordering of lazy loaded branches 2018-08-31 17:29:54 +02:00
azivner
85215aa440 fix timing issue when saving changes to notes 2018-08-31 00:08:04 +02:00
azivner
cfa4cc4931 fix undefined Sync section in the config file 2018-08-30 23:28:38 +02:00
azivner
ce9805c5bc protection against deleting root note 2018-08-30 22:38:34 +02:00
azivner
0442a44aab font slightly larger in setup + tiny visual tweaks 2018-08-30 22:28:57 +02:00
azivner
be22d3cb4c new server package build without using pkg (fixes images stuff) 2018-08-30 21:57:14 +02:00
azivner
dcc770c443 readme update 2018-08-30 11:56:12 +02:00
azivner
a2d7be445f demo db update 2018-08-30 00:42:02 +02:00
106 changed files with 3337 additions and 4999 deletions

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,4 +1,4 @@
FROM node:8.11.2
FROM node:10.9.0
RUN apt-get update && apt-get install -y nasm

View File

@@ -5,44 +5,36 @@ Trilium Notes is a hierarchical note taking application. Picture tells a thousan
![](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
* 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)
* WYSIWYG (What You See Is What You Get) editing
* Rich WYSIWYG note editing including e.g. tables and images with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-editor#autoformat)
* Support for editing [notes with source code](https://raw.githubusercontent.com/wiki/zadam/trilium/images/code-note.png), including syntax highlighting
* Fast and easy [navigation between notes](https://github.com/zadam/trilium/wiki/Note-navigation)
* Seamless note versioning
* Note labels can be used to tag/label notes as an alternative note organization and querying
* Can be deployed as web application and / or desktop application with offline access (electron based)
* [Synchronization with](https://github.com/zadam/trilium/wiki/Synchronization) self-hosted sync server
* 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]]
* [Synchronization](https://github.com/zadam/trilium/wiki/Synchronization) with self-hosted sync server
* Strong [note encryption](https://github.com/zadam/trilium/wiki/Protected-notes)
* [Scripting](https://github.com/zadam/trilium/wiki/Scripts) - see [Advanced showcases](https://github.com/zadam/trilium/wiki/Advanced-showcases)
* Scales well in both usability and performance upwards of 100 000 notes
* [Night theme](https://github.com/zadam/trilium/wiki/Themes)
* [Markdown import & export](https://github.com/zadam/trilium/wiki/Markdown)
## Builds
* If you want to install Trilium on server, follow [this page](https://github.com/zadam/trilium/wiki/Installation-as-webapp)
* 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.
Trilium is provided as either desktop application ([Electron](https://electronjs.org)-based) or web application hosted on your server.
## Supported platforms
* If you want to use Trilium on the desktop, download binary release for your platform (currently Linux and Windows are supported) 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.
Desktop (electron-based) 64-bit builds are available for Linux and Windows.
## Status
Requirements for web based installation are [outlined here](https://github.com/zadam/trilium/wiki/Installation-as-webapp).
Currently only recent Chrome and Firefox are supported (tested) browsers. Other modern browsers (not IE) might work as well.
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
List of documentation pages:
* [Installation as webapp](https://github.com/zadam/trilium/wiki/Installation-as-webapp)
* [Note navigation](https://github.com/zadam/trilium/wiki/Note-navigation)
* [Tree manipulation](https://github.com/zadam/trilium/wiki/Tree-manipulation)
* [Labels](https://github.com/zadam/trilium/wiki/Labels)
* [Links](https://github.com/zadam/trilium/wiki/Links)
* [Cloning notes](https://github.com/zadam/trilium/wiki/Cloning-notes)
* [Protected notes](https://github.com/zadam/trilium/wiki/Protected-notes)
* [Synchronization](https://github.com/zadam/trilium/wiki/Synchronization)
* [Document](https://github.com/zadam/trilium/wiki/Document)
* [Theming](https://github.com/zadam/trilium/wiki/Theming)
* [Keyboard shortcuts](https://github.com/zadam/trilium/wiki/Keyboard-shortcuts)
* [Troubleshooting](https://github.com/zadam/trilium/wiki/Troubleshooting)
[See wiki for complete list of documentation pages.](https://github.com/zadam/trilium/wiki/)

View File

@@ -1,23 +0,0 @@
#!/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
mkdir $PKG_DIR
pkg . --targets node8-linux-x64 --output ${PKG_DIR}/trilium
chmod +x ${PKG_DIR}/trilium
cp node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node ${PKG_DIR}/
cp node_modules/scrypt/build/Release/scrypt.node ${PKG_DIR}/
cd dist
7z a trilium-linux-x64-server-${VERSION}.7z trilium-linux-x64-server

38
bin/build-server.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/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
rm -r $PKG_DIR
mkdir $PKG_DIR
cd $PKG_DIR
wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz
tar xvfJ node-v${NODE_VERSION}-linux-x64.tar.xz
rm node-v${NODE_VERSION}-linux-x64.tar.xz
mv node-v${NODE_VERSION}-linux-x64 node
cp -r ../../node_modules/ ./
cp -r ../../src/ ./
cp -r ../../db/ ./
cp -r ../../package.json ./
cp -r ../../package-lock.json ./
cp -r ../../README.md ./
cp -r ../../LICENSE ./
cp -r ../../config-sample.ini ./
rm -r ./node_modules/electron*
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

View File

@@ -1,5 +1,9 @@
#!/usr/bin/env bash
rm -r node_modules
npm install
echo "Deleting existing builds"
rm -r dist/*
@@ -11,7 +15,7 @@ echo "Rebuilding binaries for linux-ia32"
./node_modules/.bin/electron-packager . --out=dist --platform=win32 --arch=x64 --overwrite
# we build x64 as second so that we keep X64 binaries in node_modules for local development
# 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
@@ -25,7 +29,7 @@ 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/
cp bin/deps/scrypt.node $WIN_RES_DIR/node_modules/@mlink/scrypt/build/Release/
echo "Cleaning up unnecessary binaries from all builds"

Binary file not shown.

Binary file not shown.

View File

@@ -78,7 +78,7 @@ github-release upload \
echo "Packaging server version"
bin/build-pkg.sh $VERSION
bin/build-server.sh $VERSION
github-release upload \
--tag $TAG \

View File

@@ -24,7 +24,6 @@ INSERT INTO attributes VALUES('yVZf4BNnV0Ev','8APXN4n4Hnb8','label','person','',
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('Gfhzgi1fbbYY','s0Hhsl0nb1bg','relation','isPartnerOf','8APXN4n4Hnb8',2,'2018-08-28T20:50:22.474Z','2018-08-28T20:50:22.474Z',0,'4vBDYs4T8T',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);
@@ -94,12 +93,6 @@ INSERT INTO attributes VALUES('f0Ow5PJyhbYY','nUgD4SYx2gt7','label','taskTagRoot
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('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','{"labelType":"text","multiplicityType":"singlevalue","isPromoted":true}',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','{"labelType":"text","multiplicityType":"multivalue","isPromoted":true}',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','{"labelType":"date","multiplicityType":"singlevalue","isPromoted":true}',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','{"labelType":"date","multiplicityType":"singlevalue","isPromoted":true}',4,'2018-08-28T20:50:48.716Z','2018-08-28T20:50:48.717Z',0,'ibiT2W04+I',1);
INSERT INTO attributes VALUES('I98xKISNcMwY','HbtlYiMvmm4V','label','taskTemplate','',5,'2018-08-28T20:50:48.724Z','2018-08-28T20:50:48.724Z',0,'r2hEWMgitj',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);
@@ -107,9 +100,6 @@ INSERT INTO attributes VALUES('4m6dIcDjkC2q','8LOr7xUMuWD4','label','hideChildre
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('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('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);
@@ -159,7 +149,6 @@ INSERT INTO attributes VALUES('h0git26ZEGDy','rUsGgtpohm7T','relation','template
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('kNp0J9uXoC8U','tX80udgxnW5n','label','weight','75',2,'2018-08-29T17:31:58.692Z','2018-08-29T17:31:58.692Z',0,'Fi6QCUFo5i',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);
@@ -173,7 +162,6 @@ INSERT INTO attributes VALUES('LTGKKLNRYSM6','Z4CC9azzMNhg','label','taskLocatio
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('01UuzuSR78Kj','uP3V8BqwXC05','label','todoDate','2017-12-22',6,'2018-08-29T19:43:01.973Z','2018-08-29T19:43:01.974Z',0,'EutrqW3a5b',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);
@@ -184,8 +172,6 @@ INSERT INTO attributes VALUES('Li7MCkVJwtoe','Lom0LEnCes1l','label','taskTagNote
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('yc58HTwoM3b0','prjUbW6QtsL4','label','todoDate','2017-12-20',3,'2018-08-29T19:47:53.123Z','2018-08-29T19:47:53.123Z',0,'UnKvGyVk7X',0);
INSERT INTO attributes VALUES('JVlFEQPYUiCR','prjUbW6QtsL4','label','doneDate','2017-12-18',5,'2018-08-29T19:48:00.928Z','2018-08-29T19:48:00.928Z',0,'nSVv39kafi',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);
@@ -213,3 +199,18 @@ INSERT INTO attributes VALUES('YngESU7G6T62','TTl2nD4CqzC9','label','taskLocatio
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);
INSERT INTO attributes VALUES('rZBWHIojcLGl','7YEYLSrnFpIi','label','run','frontendStartup',0,'2018-09-10T22:00:30.600Z','2018-09-10T22:00:30.600Z',0,'Z+589x5RRa',0);

View File

@@ -1,23 +1,23 @@
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',2,NULL,0,0,'2017-12-23T01:20:04.181Z','','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,0,0,'2017-12-23T04:06:24.012Z','','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,0,0,'2017-12-23T01:23:47.756Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('xyAi7MmgvAgR','C44aq4mkaX67','ZC78NlmdXeC6',1,NULL,1,0,'2017-12-23T01:23:47.756Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('xQ3fjRp9yaPq','I6Cw88AirBBl','C44aq4mkaX67',0,NULL,0,0,'2017-12-23T01:24:04.681Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('2GOsNT5LsvTP','mcEwFMSjhlvL','C44aq4mkaX67',1,NULL,0,0,'2017-12-23T01:29:35.974Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('RxUiraiR655R','CF2lUIJAr6Ey','NncfGH8dyNjJ',2,NULL,0,0,'2017-12-23T01:34:37.658Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('mZuSrZ18Zmv0','xkXwueRoDNeN','MG0wntwILQW6',0,NULL,0,0,'2017-12-23T01:35:40.306Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('hbcWTnEnXPwF','eXHZAKsMYgur','1Heh2acXfPNt',5,NULL,0,0,'2017-12-23T03:32:42.868Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('hbcWTnEnXPwF','eXHZAKsMYgur','1Heh2acXfPNt',9,NULL,0,0,'2017-12-23T03:32:42.868Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('8a3aNxjG0nu7','2WU27ekfy07E','eXHZAKsMYgur',0,NULL,0,0,'2017-12-23T03:32:49.379Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('4Tu6vaPdCxCM','TjWEndYCCg7g','eXHZAKsMYgur',1,NULL,0,0,'2017-12-23T03:33:23.584Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('lBPOmhP12egP','8nRNDJGyGs2Z','TjWEndYCCg7g',0,NULL,0,0,'2017-12-23T03:33:37.327Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('4Tu6vaPdCxCM','TjWEndYCCg7g','eXHZAKsMYgur',1,NULL,1,0,'2017-12-23T03:33:23.584Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('lBPOmhP12egP','8nRNDJGyGs2Z','TjWEndYCCg7g',0,NULL,1,0,'2017-12-23T03:33:37.327Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('C5ipVqeDWySp','9zSwD89vgzNO','8nRNDJGyGs2Z',0,NULL,0,0,'2017-12-23T03:37:04.912Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('uSitzbGcSATJ','u5t1EvWa3CMO','TjWEndYCCg7g',1,NULL,0,0,'2017-12-23T03:39:21.918Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('GZ6aRI8rdSJt','8nRNDJGyGs2Z','MG0wntwILQW6',1,'',0,0,'2017-12-23T03:42:28.310Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('GZ6aRI8rdSJt','8nRNDJGyGs2Z','MG0wntwILQW6',1,'',1,0,'2017-12-23T03:42:28.310Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('uipfvAfwWRgx','6ZuXjCSWgjB4','HJusZTbBU494',0,NULL,0,0,'2017-12-23T03:44:54.096Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('nMRpPWWH8WRk','GpGnjmcAPeWG','6ZuXjCSWgjB4',1,NULL,0,0,'2017-12-23T03:44:57.036Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('c4wt27WNjepw','21K84UqGhqlt','GpGnjmcAPeWG',0,NULL,0,0,'2017-12-23T03:45:10.933Z','','1970-01-01T00:00:00.000Z');
@@ -37,8 +37,8 @@ INSERT INTO branches VALUES('t3vVElqMIQVa','h4OfLEAYspud','WdWZFuWNVDZk',2,NULL,
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',8,NULL,0,0,'2017-12-23T04:06:16.179Z','','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('GOxcrZrxalFN','yK4SBJfwD3tY','1Heh2acXfPNt',12,NULL,0,0,'2017-12-23T04:06:32.833Z','','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');
@@ -60,15 +60,13 @@ INSERT INTO branches VALUES('vWch9vHEIsKw','OZKicr536m7U','YULCKCrWJJZ6',8,NULL,
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',17,NULL,0,0,'2018-08-28T20:50:36.080Z','l6e868XpLw','2018-08-28T20:50:36.079Z');
INSERT INTO branches VALUES('iRvWmIBZPmBV','NGSqsVZkg0Fb','kV2NwNNvepGF',0,NULL,1,0,'2018-08-28T20:50:36.107Z','TnumCb1pF9','2018-08-28T20:50:36.107Z');
INSERT INTO branches VALUES('9zW6GNyUrSwj','HgaAwBX5zVcP','kV2NwNNvepGF',1,NULL,0,0,'2018-08-28T20:50:36.140Z','IsmvjdfKeM','2018-08-28T20:50:36.139Z');
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',19,NULL,0,0,'2018-08-28T20:50:48.458Z','KaPAe+LyvC','2018-08-28T20:50:48.458Z');
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,0,0,'2018-08-28T20:50:48.507Z','sxhKcIO0Fo','2018-08-28T20:50:48.507Z');
INSERT INTO branches VALUES('H4uX5U8UA3Fb','hL4rychNFWZs','IYKhW6LTUpwP',6,NULL,0,0,'2018-08-28T20:50:48.539Z','8/KA289XO5','2018-08-28T20:50:48.539Z');
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');
@@ -77,46 +75,43 @@ INSERT INTO branches VALUES('feP0uJpIPOz3','HbtlYiMvmm4V','hL4rychNFWZs',4,NULL,
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,0,0,'2018-08-29T16:03:23.987Z','7YCK6Cf3vr','2018-08-28T20:50:22.175Z');
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',18,NULL,0,0,'2018-08-29T16:03:27.894Z','+Jd+Zzgx2u','2018-08-28T20:50:21.931Z');
INSERT INTO branches VALUES('bryQseMhyzaI','IlULcDiOTI4K','1Heh2acXfPNt',1,NULL,0,0,'2018-08-29T17:10:47.987Z','wX6dY3pq/D','1970-01-01T00:00:00.000Z');
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,0,0,'2018-08-29T17:26:27.928Z','rw9k0n9SUb','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('uMt25KxpV45Y','tX80udgxnW5n','3oldoiMUPOlr',1,NULL,0,0,'2018-08-29T17:29:24.554Z','XlDqz7PX7X','2018-08-29T17:29:24.554Z');
INSERT INTO branches VALUES('NTlSXCbgt5Va','Lt8IUldw7d7H','3RkyK9LI18dO',2,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,0,0,'2018-08-29T17:29:43.138Z','mDyppB0lkz','2018-08-29T17:29:43.138Z');
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,0,0,'2018-08-29T19:42:47.857Z','GPgoswIB8x','2018-08-29T19:42:47.856Z');
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',0,NULL,0,0,'2018-08-29T19:42:51.139Z','V1TNeMyqD5','2018-08-29T19:42:51.139Z');
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('7XqFyRCCbbFR','Lom0LEnCes1l','nUgD4SYx2gt7',1,NULL,0,0,'2018-08-29T19:43:44.024Z','/4YLa/r5CT','2018-08-29T19:43:44.024Z');
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,0,0,'2018-08-29T19:48:05.277Z','FirAueCkjs','2018-08-28T20:50:48.529Z');
INSERT INTO branches VALUES('KgPU7QD19kBk','prjUbW6QtsL4','tX80udgxnW5n',0,'DONE',NULL,0,'2018-08-29T19:48:00.995Z','HPvrpaEQO7','2018-08-29T19:48:00.995Z');
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,0,0,'2018-08-29T19:55:04.661Z','ZMEYWKhIhB','2018-08-29T19:55:04.661Z');
INSERT INTO branches VALUES('uMnwVhwtdXZg','cUWgYJfpp8G8','3oldoiMUPOlr',24,NULL,1,0,'2018-08-29T19:55:04.661Z','ZMEYWKhIhB','2018-08-29T19:55:04.661Z');
INSERT INTO branches VALUES('kS7GsSvztE1J','EluAg7EiealE','cUWgYJfpp8G8',0,'TODO',NULL,0,'2018-08-29T19:55:04.691Z','72zbNyyFRw','2018-08-29T19:54:38.626Z');
INSERT INTO branches VALUES('EjQTcVVHFmmZ','MG0wntwILQW6','3oldoiMUPOlr',19,NULL,0,0,'2018-08-29T19:55:53.824Z','bx2z9074Vi','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('HsN4600rQoL9','Iha4YwchR413','3oldoiMUPOlr',17,NULL,0,0,'2018-08-29T17:26:52.528Z','GBlVZxHhto','1970-01-01T00:00:00.000Z');
INSERT INTO branches VALUES('fQ2BsgDWdqoE','1Fi3MpUkZkLk','3oldoiMUPOlr',16,NULL,0,0,'2018-08-29T19:56:00.793Z','tk6763xjRL','2018-08-29T17:29:02.035Z');
INSERT INTO branches VALUES('Sv77hHzVZvdw','cwPuYRAGKtUi','3oldoiMUPOlr',2,NULL,0,0,'2018-08-29T19:56:04.404Z','Uwn3W1Q8py','2018-08-29T17:29:16.635Z');
INSERT INTO branches VALUES('kPZLi2VKVjQ1','2V9Zg9CXdNvn','nUgD4SYx2gt7',2,NULL,0,0,'2018-08-29T19:57:02.270Z','v0dB+4MnXy','2018-08-29T19:57:02.270Z');
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('iTtVoNfVBdex','d04CnuZxPXj2','nUgD4SYx2gt7',3,NULL,1,0,'2018-08-29T19:58:59.136Z','AWKJ2Bzv6u','2018-08-29T19:58:59.136Z');
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');
@@ -124,4 +119,11 @@ INSERT INTO branches VALUES('No0w47P6V5NU','TTl2nD4CqzC9','Dyahpf7LroQY',3,NULL,
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('5OwmqXXREhwW','uP3V8BqwXC05','MG0wntwILQW6',2,'TODO',NULL,0,'2018-08-29T19:43:02.012Z','y+j8i/4GSy','2018-08-29T19:43:02.012Z');
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');
INSERT INTO branches VALUES('MKMv2KLxfXhp','7YEYLSrnFpIi','3RkyK9LI18dO',3,NULL,0,0,'2018-09-10T22:00:30.553Z','c8DQDwMIOI','2018-09-10T22:00:30.553Z');

File diff suppressed because one or more lines are too long

View File

@@ -1 +1,2 @@
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

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

@@ -25,8 +25,9 @@ function onClosed() {
async function createMainWindow() {
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: 900,
height: 800,
title: 'Trilium Notes',
icon: path.join(__dirname, 'src/public/images/app-icons/png/256x256.png')
});

5447
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "trilium",
"description": "Trilium Notes",
"version": "0.20.1",
"version": "0.22.1",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {
@@ -26,10 +26,12 @@
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs"
},
"dependencies": {
"@mlink/scrypt": "6.1.2",
"async-mutex": "0.1.3",
"axios": "0.18",
"body-parser": "1.18.3",
"cls-hooked": "4.2.2",
"commonmark": "0.28.1",
"cookie-parser": "1.4.3",
"debug": "3.1.0",
"devtron": "1.4.0",
@@ -49,7 +51,7 @@
"imagemin-mozjpeg": "7.0.0",
"imagemin-pngquant": "6.0.0",
"ini": "1.3.5",
"jimp": "0.3.9",
"jimp": "0.4.0",
"moment": "2.22.2",
"multer": "1.3.1",
"open": "0.0.5",
@@ -59,26 +61,24 @@
"request-promise": "4.2.2",
"rimraf": "2.6.2",
"sanitize-filename": "1.6.1",
"scrypt": "6.0.3",
"serve-favicon": "2.5.0",
"session-file-store": "1.2.0",
"simple-node-logger": "0.93.37",
"simple-node-logger": "0.93.40",
"sqlite": "3.0.0",
"tar-stream": "1.6.1",
"turndown": "5.0.1",
"unescape": "1.0.1",
"ws": "6.0.0",
"xml2js": "0.4.19"
},
"devDependencies": {
"electron": "2.0.7",
"electron": "2.0.9",
"electron-compile": "6.4.3",
"electron-packager": "12.1.1",
"electron-prebuilt-compile": "2.0.7",
"electron-rebuild": "1.8.2",
"lorem-ipsum": "1.0.5",
"lorem-ipsum": "1.0.6",
"tape": "4.9.1",
"xo": "0.22.0",
"pkg": "4.3.4"
"xo": "0.23.0"
},
"config": {
"forge": {
@@ -117,15 +117,5 @@
"node",
"browser"
]
},
"pkg": {
"assets": [
"./db/**/*",
"./src/public/**/*",
"./src/views/**/*",
"./node_modules/mozjpeg/vendor/*",
"./node_modules/pngquant-bin/vendor/*",
"./node_modules/giflossy/vendor/*"
]
}
}

View File

@@ -27,6 +27,14 @@ class Branch extends Entity {
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "prefix"]; }
constructor(row = {}) {
super(row);
// used to detect move in note tree
this.origParentNoteId = this.parentNoteId;
}
/** @returns {Note|null} */
async getNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
}

View File

@@ -99,23 +99,37 @@ class Note extends Entity {
return await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
}
/** @returns {Promise<Attribute[]>} all note's attributes, including inherited ones */
async getAttributes() {
/**
* @param {string} [name] - attribute name to filter
* @returns {Promise<Attribute[]>} all note's attributes, including inherited ones
*/
async getAttributes(name) {
if (!this.__attributeCache) {
await this.loadAttributesToCache();
}
return this.__attributeCache;
if (name) {
return this.__attributeCache.filter(attr => attr.name === name);
}
else {
return this.__attributeCache;
}
}
/** @returns {Promise<Attribute[]>} all note's labels (attributes with type label), including inherited ones */
async getLabels() {
return (await this.getAttributes()).filter(attr => attr.type === LABEL);
/**
* @param {string} [name] - label name to filter
* @returns {Promise<Attribute[]>} all note's labels (attributes with type label), including inherited ones
*/
async getLabels(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL);
}
/** @returns {Promise<Attribute[]>} all note's relations (attributes with type relation), including inherited ones */
async getRelations() {
return (await this.getAttributes()).filter(attr => attr.type === RELATION);
/**
* @param {string} [name] - relation name to filter
* @returns {Promise<Attribute[]>} all note's relations (attributes with type relation), including inherited ones
*/
async getRelations(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION);
}
/**
@@ -468,6 +482,13 @@ class Note extends Entity {
return await repository.getEntities("SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
}
/**
* @returns {boolean} - true if note has children
*/
async hasChildren() {
return (await this.getChildNotes()).length > 0;
}
/**
* @returns {Promise<Note[]>} child notes of this note
*/

View File

@@ -48,7 +48,10 @@ export default {
addTabHandler((function() {
const $themeSelect = $("#theme-select");
const $zoomFactorSelect = $("#zoom-factor-select");
const $leftPaneMinWidth = $("#left-pane-min-width");
const $leftPaneWidthPercent = $("#left-pane-width-percent");
const $html = $("html");
const $container = $("#container");
function optionsLoaded(options) {
$themeSelect.val(options.theme);
@@ -59,6 +62,9 @@ addTabHandler((function() {
else {
$zoomFactorSelect.prop('disabled', true);
}
$leftPaneMinWidth.val(options.leftPaneMinWidth);
$leftPaneWidthPercent.val(options.leftPaneWidthPercent);
}
$themeSelect.change(function() {
@@ -75,6 +81,30 @@ addTabHandler((function() {
zoomService.setZoomFactorAndSave(newZoomFactor);
});
function resizeLeftPanel() {
const leftPanePercent = parseInt($leftPaneWidthPercent.val());
const rightPanePercent = 100 - leftPanePercent;
const leftPaneMinWidth = $leftPaneMinWidth.val();
$container.css("grid-template-columns", `minmax(${leftPaneMinWidth}px, ${leftPanePercent}fr) ${rightPanePercent}fr`);
}
$leftPaneMinWidth.change(function() {
const newMinWidth = $(this).val();
resizeLeftPanel();
server.put('options/leftPaneMinWidth/' + newMinWidth);
});
$leftPaneWidthPercent.change(function() {
const newWidthPercent = $(this).val();
resizeLeftPanel();
server.put('options/leftPaneWidthPercent/' + newWidthPercent);
});
return {
optionsLoaded
};
@@ -193,7 +223,6 @@ addTabHandler((function() {
const $syncServerTimeout = $("#sync-server-timeout");
const $syncProxy = $("#sync-proxy");
const $testSyncButton = $("#test-sync-button");
const $syncToServerButton = $("#sync-to-server-button");
function optionsLoaded(options) {
$syncServerHost.val(options['syncServerHost']);
@@ -214,22 +243,11 @@ addTabHandler((function() {
$testSyncButton.click(async () => {
const result = await server.post('sync/test');
if (result.connection === "Success") {
infoService.showMessage("Sync server handshake has been successful");
if (result.success) {
infoService.showMessage(result.message);
}
else {
infoService.showError("Sync server handshake failed, error: " + result.error);
}
});
$syncToServerButton.click(async () => {
const resp = await server.post("setup/sync-to-server");
if (resp.success) {
infoService.showMessage("Sync has been established to the server instance. It will take some time to finish.");
}
else {
infoService.showError('Sync setup failed: ' + resp.error);
infoService.showError("Sync server handshake failed, error: " + result.message);
}
});

View File

@@ -8,7 +8,7 @@ import optionsDialog from '../dialogs/options.js';
import sqlConsoleDialog from '../dialogs/sql_console.js';
import cloning from './cloning.js';
import contextMenu from './context_menu.js';
import contextMenu from './tree_context_menu.js';
import dragAndDropSetup from './drag_and_drop.js';
import exportService from './export.js';
import link from './link.js';
@@ -98,6 +98,8 @@ if (utils.isElectron()) {
});
}
$("#export-note-to-markdown-button").click(() => exportService.exportSubtree(noteDetailService.getCurrentNoteId(), 'markdown-single'));
treeService.showTree();
entrypoints.registerEntrypoints();

View File

@@ -59,6 +59,8 @@ async function moveToNode(nodesToMove, toNode) {
}
async function deleteNodes(nodes) {
nodes = nodes.filter(node => node.data.noteId !== 'root');
if (nodes.length === 0 || !confirm('Are you sure you want to delete select note(s) and all the sub-notes?')) {
return;
}

View File

@@ -1,18 +1,21 @@
import treeService from './tree.js';
import infoService from './info.js';
import protectedSessionHolder from './protected_session_holder.js';
import utils from './utils.js';
import server from './server.js';
function exportSubTree(noteId, format) {
function exportSubtree(noteId, format) {
const url = utils.getHost() + "/api/notes/" + noteId + "/export/" + format +
"?protectedSessionId=" + encodeURIComponent(protectedSessionHolder.getProtectedSessionId());
utils.download(url);
infoService.showMessage("Export to file has been finished.");
}
let importNoteId;
function importBranch(noteId) {
function importIntoNote(noteId) {
importNoteId = noteId;
$("#import-upload").trigger('click');
@@ -26,15 +29,20 @@ $("#import-upload").change(async function() {
url: baseApiUrl + 'notes/' + importNoteId + '/import',
headers: server.getHeaders(),
data: formData,
dataType: 'json',
type: 'POST',
contentType: false, // NEEDED, DON'T OMIT THIS
processData: false, // NEEDED, DON'T OMIT THIS
}).fail((xhr, status, error) => alert('Import error: ' + xhr.responseText));
})
.fail((xhr, status, error) => alert('Import error: ' + xhr.responseText))
.done(async note => {
await treeService.reload();
await treeService.reload();
await treeService.activateNote(note.noteId);
});
});
export default {
exportSubTree,
importBranch
exportSubtree,
importIntoNote
};

View File

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

View File

@@ -20,6 +20,8 @@ const CODE_MIRROR = {
const ESLINT = {js: ["libraries/eslint.js"]};
const COMMONMARK = {js: ["libraries/commonmark.min.js"]};
async function requireLibrary(library) {
if (library.css) {
library.css.map(cssUrl => requireCss(cssUrl));
@@ -61,5 +63,6 @@ export default {
requireLibrary,
CKEDITOR,
CODE_MIRROR,
ESLINT
ESLINT,
COMMONMARK
}

View File

@@ -49,6 +49,10 @@ const components = {
};
function getComponent(type) {
if (!type) {
type = getCurrentNote().type;
}
if (components[type]) {
return components[type];
}
@@ -93,18 +97,28 @@ async function switchToNote(noteId) {
}
}
function getCurrentNoteContent() {
return getComponent().getContent();
}
function onNoteChange(func) {
return getComponent().onNoteChange(func);
}
async function saveNote() {
const note = getCurrentNote();
note.title = $noteTitle.val();
note.content = getComponent(note.type).getContent();
note.content = getCurrentNoteContent(note);
// it's important to set the flag back to false immediatelly after retrieving title and content
// otherwise we might overwrite another change (especially async code)
isNoteChanged = false;
treeService.setNoteTitle(note.noteId, note.title);
await server.put('notes/' + note.noteId, note.dto);
isNoteChanged = false;
if (note.isProtected) {
protectedSessionHolder.touchProtectedSession();
}
@@ -445,7 +459,7 @@ async function showAttributes() {
$attributeListInner.append(utils.formatLabel(attribute) + " ");
}
else if (attribute.type === 'relation') {
$attributeListInner.append(attribute.name + "=");
$attributeListInner.append('@' + attribute.name + "=");
$attributeListInner.append(await linkService.createNoteLink(attribute.value));
$attributeListInner.append(" ");
}
@@ -499,10 +513,8 @@ async function loadNote(noteId) {
return new NoteFull(treeCache, row);
}
function focus() {
const note = getCurrentNote();
getComponent(note.type).focus();
function focusOnTitle() {
$noteTitle.focus();
}
messagingService.subscribeToSyncMessages(syncData => {
@@ -540,11 +552,13 @@ export default {
getCurrentNoteType,
getCurrentNoteId,
newNoteCreated,
focus,
focusOnTitle,
getAttributes,
showAttributes,
refreshAttributes,
saveNote,
saveNoteIfChanged,
noteChanged
noteChanged,
getCurrentNoteContent,
onNoteChange
};

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,8 +1,14 @@
import libraryLoader from "./library_loader.js";
import noteDetailService from './note_detail.js';
import utils from "./utils.js";
import infoService from "./info.js";
const $noteDetailText = $('#note-detail-text');
const $markdownImportDialog = $('#markdown-import-dialog');
const $markdownImportTextarea = $('#markdown-import-textarea');
const $markdownImportButton = $('#markdown-import-button');
let textEditor = null;
async function show() {
@@ -12,9 +18,9 @@ async function show() {
// textEditor might have been initialized during previous await so checking again
// looks like double initialization can freeze CKEditor pretty badly
if (!textEditor) {
textEditor = await BalloonEditor.create($noteDetailText[0], {});
textEditor = await BalloonEditor.create($noteDetailText[0]);
textEditor.model.document.on('change:data', noteDetailService.noteChanged);
onNoteChange(noteDetailService.noteChanged);
}
}
@@ -43,9 +49,67 @@ function getEditor() {
return textEditor;
}
async function convertMarkdownToHtml(text) {
await libraryLoader.requireLibrary(libraryLoader.COMMONMARK);
const reader = new commonmark.Parser();
const writer = new commonmark.HtmlRenderer();
const parsed = reader.parse(text);
const result = writer.render(parsed);
const viewFragment = textEditor.data.processor.toView(result);
const modelFragment = textEditor.data.toModel(viewFragment);
textEditor.model.insertContent(modelFragment, textEditor.model.document.selection);
infoService.showMessage("Markdown content has been imported into the document.");
}
async function importMarkdownInline() {
if (utils.isElectron()) {
const {clipboard} = require('electron');
const text = clipboard.readText();
convertMarkdownToHtml(text);
}
else {
$("input[name='search-text']").focus();
glob.activeDialog = $markdownImportDialog;
$markdownImportDialog.dialog({
modal: true,
width: 700,
height: 500
});
}
}
async function sendMarkdownDialog() {
const text = $markdownImportTextarea.val();
$markdownImportDialog.dialog('close');
await convertMarkdownToHtml(text);
$markdownImportTextarea.val('');
}
function onNoteChange(func) {
textEditor.model.document.on('change:data', func);
}
$markdownImportButton.click(sendMarkdownDialog);
$markdownImportDialog.bind('keydown', 'ctrl+return', sendMarkdownDialog);
window.glob.importMarkdownInline = importMarkdownInline;
export default {
show,
getEditor,
getContent,
focus
focus,
onNoteChange
}

View File

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

View File

@@ -89,6 +89,8 @@ async function setupProtectedSession() {
$protectedSessionOnButton.addClass('active');
$protectedSessionOffButton.removeClass('active');
}
infoService.showMessage("Protected session has been started.");
}
function ensureDialogIsClosed() {
@@ -148,7 +150,7 @@ async function unprotectNoteAndSendToServer() {
noteDetailService.setNoteBackgroundIfProtected(note);
}
async function protectBranch(noteId, protect) {
async function protectSubtree(noteId, protect) {
await ensureProtectedSession(true, true);
await server.put('notes/' + noteId + "/protect/" + (protect ? 1 : 0));
@@ -172,7 +174,7 @@ export default {
ensureProtectedSession,
protectNoteAndSendToServer,
unprotectNoteAndSendToServer,
protectBranch,
protectSubtree,
ensureDialogIsClosed,
enterProtectedSession,
leaveProtectedSession

View File

@@ -89,7 +89,7 @@ $searchInput.keyup(e => {
}
}).focus();
$doSearchButton.click(doSearch);
$doSearchButton.click(() => doSearch()); // keep long form because of argument
$resetSearchButton.click(resetSearch);
$saveSearchButton.click(saveSearch);

View File

@@ -1,4 +1,4 @@
import contextMenuService from './context_menu.js';
import treeContextMenuService from './tree_context_menu.js';
import dragAndDropSetup from './drag_and_drop.js';
import linkService from './link.js';
import messagingService from './messaging.js';
@@ -369,7 +369,7 @@ function initFancyTree(tree) {
}
});
$tree.contextmenu(contextMenuService.contextMenuOptions);
$tree.contextmenu(treeContextMenuService.contextMenuOptions);
}
function getTree() {
@@ -443,10 +443,10 @@ async function setNoteTitle(noteId, title) {
async function createNewTopLevelNote() {
const rootNode = getNodesByNoteId('root')[0];
await createNote(rootNode, "root", "into");
await createNote(rootNode, "root", "into", false);
}
async function createNote(node, parentNoteId, target, isProtected) {
async function createNote(node, parentNoteId, target, isProtected, saveSelection = false) {
utils.assertArguments(node, parentNoteId, target);
// if isProtected isn't available (user didn't enter password yet), then note is created as unencrypted
@@ -455,15 +455,33 @@ async function createNote(node, parentNoteId, target, isProtected) {
isProtected = false;
}
const newNoteName = "new note";
if (noteDetailService.getCurrentNoteType() !== 'text') {
saveSelection = false;
}
let title, content;
if (saveSelection) {
[title, content] = parseSelectedHtml(window.cutToNote.getSelectedHtml());
}
const newNoteName = title || "new note";
const {note, branch} = await server.post('notes/' + parentNoteId + '/children', {
title: newNoteName,
content: content,
target: target,
target_branchId: node.data.branchId,
isProtected: isProtected
});
if (saveSelection) {
// we remove the selection only after it was saved to server to make sure we don't lose anything
window.cutToNote.removeSelection();
}
await noteDetailService.saveNoteIfChanged();
const noteEntity = new NoteShort(treeCache, note);
const branchEntity = new Branch(treeCache, branch);
@@ -506,6 +524,22 @@ async function createNote(node, parentNoteId, target, isProtected) {
infoService.showMessage("Created!");
}
/* If first element is heading, parse it out and use it as a new heading. */
function parseSelectedHtml(selectedHtml) {
const dom = $.parseHTML(selectedHtml);
if (dom.length > 0 && dom[0].tagName && dom[0].tagName.match(/h[1-6]/i)) {
const title = $(dom[0]).text();
// remove the title from content (only first occurence)
const content = selectedHtml.replace(dom[0].outerHTML, "");
return [title, content];
}
else {
return [null, selectedHtml];
}
}
async function sortAlphabetically(noteId) {
await server.put('notes/' + noteId + '/sort');
@@ -539,14 +573,18 @@ utils.bindShortcut('ctrl+o', () => {
const parentNoteId = node.data.parentNoteId;
const isProtected = treeUtils.getParentProtectedStatus(node);
createNote(node, parentNoteId, 'after', isProtected);
createNote(node, parentNoteId, 'after', isProtected, true);
});
utils.bindShortcut('ctrl+p', () => {
function createNoteInto() {
const node = getCurrentNode();
createNote(node, node.data.noteId, 'into', node.data.isProtected);
});
createNote(node, node.data.noteId, 'into', node.data.isProtected, true);
}
window.glob.createNoteInto = createNoteInto;
utils.bindShortcut('ctrl+p', createNoteInto);
utils.bindShortcut('ctrl+del', () => {
const node = getCurrentNode();

View File

@@ -86,21 +86,22 @@ const contextMenuOptions = {
{title: "----"},
{title: "Edit branch prefix <kbd>F2</kbd>", cmd: "editBranchPrefix", uiIcon: "ui-icon-pencil"},
{title: "----"},
{title: "Protect branch", cmd: "protectBranch", uiIcon: "ui-icon-locked"},
{title: "Unprotect branch", cmd: "unprotectBranch", uiIcon: "ui-icon-unlocked"},
{title: "Protect subtree", cmd: "protectSubtree", uiIcon: "ui-icon-locked"},
{title: "Unprotect subtree", cmd: "unprotectSubtree", uiIcon: "ui-icon-unlocked"},
{title: "----"},
{title: "Copy / clone <kbd>Ctrl+C</kbd>", cmd: "copy", uiIcon: "ui-icon-copy"},
{title: "Cut <kbd>Ctrl+X</kbd>", cmd: "cut", uiIcon: "ui-icon-scissors"},
{title: "Paste into <kbd>Ctrl+V</kbd>", cmd: "pasteInto", uiIcon: "ui-icon-clipboard"},
{title: "Paste after", cmd: "pasteAfter", uiIcon: "ui-icon-clipboard"},
{title: "----"},
{title: "Export subtree", cmd: "exportSubTree", uiIcon: " ui-icon-arrowthick-1-ne", children: [
{title: "Native&nbsp;Tar", cmd: "exportSubTreeToTar"},
{title: "OPML", cmd: "exportSubTreeToOpml"}
{title: "Export subtree", cmd: "exportSubtree", uiIcon: " ui-icon-arrowthick-1-ne", children: [
{title: "Native&nbsp;Tar", cmd: "exportSubtreeToTar"},
{title: "OPML", cmd: "exportSubtreeToOpml"},
{title: "Markdown", cmd: "exportSubtreeToMarkdown"}
]},
{title: "Import into branch (tar, opml)", cmd: "importBranch", uiIcon: "ui-icon-arrowthick-1-sw"},
{title: "Import into note (tar, opml, md)", cmd: "importIntoNote", uiIcon: "ui-icon-arrowthick-1-sw"},
{title: "----"},
{title: "Collapse branch <kbd>Alt+-</kbd>", cmd: "collapseBranch", uiIcon: "ui-icon-minus"},
{title: "Collapse subtree <kbd>Alt+-</kbd>", cmd: "collapseSubtree", uiIcon: "ui-icon-minus"},
{title: "Force note sync", cmd: "forceNoteSync", uiIcon: "ui-icon-refresh"},
{title: "Sort alphabetically <kbd>Alt+S</kbd>", cmd: "sortAlphabetically", uiIcon: " ui-icon-arrowthick-2-n-s"}
],
@@ -119,8 +120,8 @@ const contextMenuOptions = {
$tree.contextmenu("enableEntry", "cut", isNotRoot);
$tree.contextmenu("enableEntry", "pasteAfter", clipboardIds.length > 0 && isNotRoot && parentNote.type !== 'search');
$tree.contextmenu("enableEntry", "pasteInto", clipboardIds.length > 0 && note.type !== 'search');
$tree.contextmenu("enableEntry", "importBranch", note.type !== 'search');
$tree.contextmenu("enableEntry", "exportSubTree", note.type !== 'search');
$tree.contextmenu("enableEntry", "importIntoNote", note.type !== 'search');
$tree.contextmenu("enableEntry", "exportSubtree", note.type !== 'search');
$tree.contextmenu("enableEntry", "editBranchPrefix", isNotRoot && parentNote.type !== 'search');
// Activate node on right-click
@@ -145,11 +146,11 @@ const contextMenuOptions = {
else if (ui.cmd === "editBranchPrefix") {
branchPrefixDialog.showDialog(node);
}
else if (ui.cmd === "protectBranch") {
protectedSessionService.protectBranch(node.data.noteId, true);
else if (ui.cmd === "protectSubtree") {
protectedSessionService.protectSubtree(node.data.noteId, true);
}
else if (ui.cmd === "unprotectBranch") {
protectedSessionService.protectBranch(node.data.noteId, false);
else if (ui.cmd === "unprotectSubtree") {
protectedSessionService.protectSubtree(node.data.noteId, false);
}
else if (ui.cmd === "copy") {
copy(treeService.getSelectedNodes());
@@ -166,16 +167,19 @@ const contextMenuOptions = {
else if (ui.cmd === "delete") {
treeChangesService.deleteNodes(treeService.getSelectedNodes(true));
}
else if (ui.cmd === "exportSubTreeToTar") {
exportService.exportSubTree(node.data.noteId, 'tar');
else if (ui.cmd === "exportSubtreeToTar") {
exportService.exportSubtree(node.data.branchId, 'tar');
}
else if (ui.cmd === "exportSubTreeToOpml") {
exportService.exportSubTree(node.data.noteId, 'opml');
else if (ui.cmd === "exportSubtreeToOpml") {
exportService.exportSubtree(node.data.branchId, 'opml');
}
else if (ui.cmd === "importBranch") {
exportService.importBranch(node.data.noteId);
else if (ui.cmd === "exportSubtreeToMarkdown") {
exportService.exportSubtree(node.data.branchId, 'markdown');
}
else if (ui.cmd === "collapseBranch") {
else if (ui.cmd === "importIntoNote") {
exportService.importIntoNote(node.data.noteId);
}
else if (ui.cmd === "collapseSubtree") {
treeService.collapseTree(node);
}
else if (ui.cmd === "forceNoteSync") {

View File

@@ -1,7 +1,7 @@
import noteDetailService from "./note_detail.js";
import utils from "./utils.js";
import treeChangesService from "./branches.js";
import contextMenuService from "./context_menu.js";
import contextMenuService from "./tree_context_menu.js";
import treeService from "./tree.js";
import editBranchPrefixDialog from "../dialogs/branch_prefix.js";
@@ -100,7 +100,7 @@ const keyBindings = {
return false;
},
"return": node => {
noteDetailService.focus();
noteDetailService.focusOnTitle();
return false;
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,14 @@
/* We change h5 and h6 because by default (bootstrap) they are smaller than normal text */
h5 {
font-size: 16px;
font-weight: 500;
}
h6 {
font-size: 14px;
font-weight: 600;
}
#container {
margin: 0 auto; /* center */
height: 100vh;
@@ -6,7 +17,6 @@
grid-template-areas: "header header"
"left-pane title"
"left-pane note-detail";
grid-template-columns: 29% 69.5%;
grid-template-rows: auto
auto
1fr;
@@ -23,6 +33,34 @@
padding: 4px;
}
#left-pane {
grid-area: left-pane;
display: flex;
flex-direction: column;
}
#global-buttons {
display: flex;
justify-content: space-around;
padding: 10px 0 10px 0;
margin: 0 10px 0 16px;
border: 1px solid #ccc;
}
#search-box {
display: none;
padding: 10px;
margin-top: 10px;
}
#title-container {
grid-area: title;
}
.tdialog {
display: none; /* hidden by default */
}
#note-detail-wrapper {
position: relative;
overflow: hidden;
@@ -58,11 +96,6 @@
background-position: center;
}
#note-detail-text p {
padding: 0;
margin: 0;
}
ul.fancytree-container {
outline: none !important;
}

View File

@@ -1,23 +1,29 @@
"use strict";
const sql = require('../../services/sql');
const html = require('html');
const tar = require('tar-stream');
const sanitize = require("sanitize-filename");
const repository = require("../../services/repository");
const utils = require('../../services/utils');
const TurndownService = require('turndown');
async function exportNote(req, res) {
const noteId = req.params.noteId;
// entityId maybe either noteId or branchId depending on format
const entityId = req.params.entityId;
const format = req.params.format;
const branchId = await sql.getValue('SELECT branchId FROM branches WHERE noteId = ?', [noteId]);
if (format === 'tar') {
await exportToTar(branchId, res);
await exportToTar(await repository.getBranch(entityId), res);
}
else if (format === 'opml') {
await exportToOpml(branchId, res);
await exportToOpml(await repository.getBranch(entityId), res);
}
else if (format === 'markdown') {
await exportToMarkdown(await repository.getBranch(entityId), res);
}
// export single note without subtree
else if (format === 'markdown-single') {
await exportSingleMarkdown(await repository.getNote(entityId), res);
}
else {
return [404, "Unrecognized export format " + format];
@@ -43,8 +49,7 @@ function prepareText(text) {
return escaped.replace(/\n/g, '&#10;');
}
async function exportToOpml(branchId, res) {
const branch = await repository.getBranch(branchId);
async function exportToOpml(branch, res) {
const note = await branch.getNote();
const title = (branch.prefix ? (branch.prefix + ' - ') : '') + note.title;
const sanitizedTitle = sanitize(title);
@@ -76,21 +81,20 @@ async function exportToOpml(branchId, res) {
</head>
<body>`);
await exportNoteInner(branchId);
await exportNoteInner(branch.branchId);
res.write(`</body>
</opml>`);
res.end();
}
async function exportToTar(branchId, res) {
async function exportToTar(branch, res) {
const pack = tar.pack();
const exportedNoteIds = [];
const name = await exportNoteInner(branchId, '');
const name = await exportNoteInner(branch, '');
async function exportNoteInner(branchId, directory) {
const branch = await repository.getBranch(branchId);
async function exportNoteInner(branch, directory) {
const note = await branch.getNote();
const childFileName = directory + sanitize(note.title);
@@ -124,7 +128,7 @@ async function exportToTar(branchId, res) {
})
};
if (metadata.attributes.find(attributes => attributes.type === 'label' && attributes.name === 'excludeFromExport')) {
if (await note.hasLabel('excludeFromExport')) {
return;
}
@@ -133,8 +137,14 @@ async function exportToTar(branchId, res) {
exportedNoteIds.push(note.noteId);
for (const child of await note.getChildBranches()) {
await exportNoteInner(child.branchId, childFileName + "/");
const childBranches = await note.getChildBranches();
if (childBranches.length > 0) {
saveDirectory(childFileName);
}
for (const childBranch of childBranches) {
await exportNoteInner(childBranch, childFileName + "/");
}
return childFileName;
@@ -152,6 +162,10 @@ async function exportToTar(branchId, res) {
pack.entry({name: childFileName + ".meta", size: metadataJson.length}, metadataJson);
}
function saveDirectory(childFileName) {
pack.entry({name: childFileName, type: 'directory'});
}
pack.finalize();
res.setHeader('Content-Disposition', 'file; filename="' + name + '.tar"');
@@ -160,6 +174,89 @@ async function exportToTar(branchId, res) {
pack.pipe(res);
}
async function exportToMarkdown(branch, res) {
const note = await branch.getNote();
if (!await note.hasChildren()) {
await exportSingleMarkdown(note, res);
return;
}
const turndownService = new TurndownService();
const pack = tar.pack();
const name = await exportNoteInner(note, '');
async function exportNoteInner(note, directory) {
const childFileName = directory + sanitize(note.title);
if (await note.hasLabel('excludeFromExport')) {
return;
}
saveDataFile(childFileName, note);
const childNotes = await note.getChildNotes();
if (childNotes.length > 0) {
saveDirectory(childFileName);
}
for (const childNote of childNotes) {
await exportNoteInner(childNote, childFileName + "/");
}
return childFileName;
}
function saveDataFile(childFileName, note) {
if (note.type !== 'text' && note.type !== 'code') {
return;
}
if (note.content.trim().length === 0) {
return;
}
let markdown;
if (note.type === 'code') {
markdown = '```\n' + note.content + "\n```";
}
else if (note.type === 'text') {
markdown = turndownService.turndown(note.content);
}
else {
// other note types are not supported
return;
}
pack.entry({name: childFileName + ".md", size: markdown.length}, markdown);
}
function saveDirectory(childFileName) {
pack.entry({name: childFileName, type: 'directory'});
}
pack.finalize();
res.setHeader('Content-Disposition', 'file; filename="' + name + '.tar"');
res.setHeader('Content-Type', 'application/tar');
pack.pipe(res);
}
async function exportSingleMarkdown(note, res) {
const turndownService = new TurndownService();
const markdown = turndownService.turndown(note.content);
const name = sanitize(note.title);
res.setHeader('Content-Disposition', 'file; filename="' + name + '.md"');
res.setHeader('Content-Type', 'text/markdown; charset=UTF-8');
res.send(markdown);
}
module.exports = {
exportNote
};

View File

@@ -1,6 +1,7 @@
"use strict";
const repository = require('../../services/repository');
const log = require('../../services/log');
const attributeService = require('../../services/attributes');
const noteService = require('../../services/notes');
const Branch = require('../../entities/branch');
@@ -8,11 +9,16 @@ const tar = require('tar-stream');
const stream = require('stream');
const path = require('path');
const parseString = require('xml2js').parseString;
const commonmark = require('commonmark');
async function importToBranch(req) {
const parentNoteId = req.params.parentNoteId;
const file = req.file;
if (!file) {
return [400, "No file has been uploaded"];
}
const parentNote = await repository.getNote(parentNoteId);
if (!parentNote) {
@@ -22,11 +28,14 @@ async function importToBranch(req) {
const extension = path.extname(file.originalname).toLowerCase();
if (extension === '.tar') {
await importTar(file, parentNoteId);
return await importTar(file, parentNoteId);
}
else if (extension === '.opml') {
return await importOpml(file, parentNoteId);
}
else if (extension === '.md') {
return await importMarkdown(file, parentNoteId);
}
else {
return [400, `Unrecognized extension ${extension}, must be .tar or .opml`];
}
@@ -46,6 +55,8 @@ async function importOutline(outline, parentNoteId) {
for (const childOutline of (outline.outline || [])) {
await importOutline(childOutline, note.noteId);
}
return note;
}
async function importOpml(file, parentNoteId) {
@@ -66,27 +77,37 @@ async function importOpml(file, parentNoteId) {
}
const outlines = xml.opml.body[0].outline || [];
let returnNote = null;
for (const outline of outlines) {
await importOutline(outline, parentNoteId);
const note = await importOutline(outline, parentNoteId);
// first created note will be activated after import
returnNote = returnNote || note;
}
return returnNote;
}
async function importTar(file, parentNoteId) {
const files = await parseImportFile(file);
// maps from original noteId (in tar file) to newly generated noteId
const noteIdMap = {};
const attributes = [];
const ctx = {
// maps from original noteId (in tar file) to newly generated noteId
noteIdMap: {},
attributes: [],
reader: new commonmark.Parser(),
writer: new commonmark.HtmlRenderer()
};
await importNotes(files, parentNoteId, noteIdMap, attributes);
const note = await importNotes(ctx, files, parentNoteId);
// we save attributes after importing notes because we need to have all the relation
// targets already existing
for (const attr of attributes) {
for (const attr of ctx.attributes) {
if (attr.type === 'relation') {
// map to local noteId
attr.value = noteIdMap[attr.value];
attr.value = ctx.noteIdMap[attr.value];
if (!attr.value) {
// relation is targeting note not present in the import
@@ -96,6 +117,8 @@ async function importTar(file, parentNoteId) {
await attributeService.createAttribute(attr);
}
return note;
}
function getFileName(name) {
@@ -105,13 +128,18 @@ function getFileName(name) {
key = "data";
name = name.substr(0, name.length - 4);
}
else if (name.endsWith(".md")) {
key = "markdown";
name = name.substr(0, name.length - 3);
}
else if (name.endsWith((".meta"))) {
key = "meta";
name = name.substr(0, name.length - 5);
}
else {
throw new Error("Unknown file type in import archive: " + name);
log.error("Unknown file type in import: " + name);
}
return {name, key};
}
@@ -122,12 +150,26 @@ async function parseImportFile(file) {
const extract = tar.extract();
extract.on('entry', function(header, stream, next) {
const {name, key} = getFileName(header.name);
let name, key;
if (header.type === 'file') {
({name, key} = getFileName(header.name));
}
else if (header.type === 'directory') {
// directory entries in tar often end with directory separator
name = (header.name.endsWith("/") || header.name.endsWith("\\")) ? header.name.substr(0, header.name.length - 1) : header.name;
key = 'directory';
}
else {
log.error("Unrecognized tar entry: " + JSON.stringify(header));
return;
}
let file = fileMap[name];
if (!file) {
file = fileMap[name] = {
name: path.basename(name),
children: []
};
@@ -176,49 +218,95 @@ async function parseImportFile(file) {
});
}
async function importNotes(files, parentNoteId, noteIdMap, attributes) {
async function importNotes(ctx, files, parentNoteId) {
let returnNote = null;
for (const file of files) {
if (file.meta.version !== 1) {
throw new Error("Can't read meta data version " + file.meta.version);
}
let note;
if (file.meta.clone) {
await new Branch({
parentNoteId: parentNoteId,
noteId: noteIdMap[file.meta.noteId],
if (!file.meta) {
let content = '';
if (file.data) {
content = file.data.toString("UTF-8");
}
else if (file.markdown) {
const parsed = ctx.reader.parse(file.markdown.toString("UTF-8"));
content = ctx.writer.render(parsed);
}
note = (await noteService.createNote(parentNoteId, file.name, content, {
type: 'text',
mime: 'text/html'
})).note;
}
else {
if (file.meta.version !== 1) {
throw new Error("Can't read meta data version " + file.meta.version);
}
if (file.meta.clone) {
await new Branch({
parentNoteId: parentNoteId,
noteId: ctx.noteIdMap[file.meta.noteId],
prefix: file.meta.prefix
}).save();
return;
}
if (file.meta.type !== 'file') {
file.data = file.data.toString("UTF-8");
}
note = (await noteService.createNote(parentNoteId, file.meta.title, file.data, {
type: file.meta.type,
mime: file.meta.mime,
prefix: file.meta.prefix
}).save();
})).note;
return;
ctx.noteIdMap[file.meta.noteId] = note.noteId;
for (const attribute of file.meta.attributes) {
ctx.attributes.push({
noteId: note.noteId,
type: attribute.type,
name: attribute.name,
value: attribute.value,
isInheritable: attribute.isInheritable,
position: attribute.position
});
}
}
if (file.meta.type !== 'file') {
file.data = file.data.toString("UTF-8");
}
const {note} = await noteService.createNote(parentNoteId, file.meta.title, file.data, {
type: file.meta.type,
mime: file.meta.mime,
prefix: file.meta.prefix
});
noteIdMap[file.meta.noteId] = note.noteId;
for (const attribute of file.meta.attributes) {
attributes.push({
noteId: note.noteId,
type: attribute.type,
name: attribute.name,
value: attribute.value,
isInheritable: attribute.isInheritable,
position: attribute.position
});
}
// first created note will be activated after import
returnNote = returnNote || note;
if (file.children.length > 0) {
await importNotes(file.children, note.noteId, noteIdMap, attributes);
await importNotes(ctx, file.children, note.noteId);
}
}
return returnNote;
}
async function importMarkdown(file, parentNoteId) {
const markdownContent = file.buffer.toString("UTF-8");
const reader = new commonmark.Parser();
const writer = new commonmark.HtmlRenderer();
const parsed = reader.parse(markdownContent);
const htmlContent = writer.render(parsed);
const title = file.originalname.substr(0, file.originalname.length - 3); // strip .md extension
const {note} = await noteService.createNote(parentNoteId, title, htmlContent, {
type: 'text',
mime: 'text/html'
});
return note;
}
module.exports = {

View File

@@ -38,7 +38,7 @@ async function loginSync(req) {
const givenHash = req.body.hash;
if (expectedHash !== givenHash) {
return [400, { message: "Sync login hash doesn't match" }];
return [400, { message: "Sync login credentials are incorrect." }];
}
req.session.loggedIn = true;

View File

@@ -26,6 +26,8 @@ async function createNote(req) {
const { note, branch } = await noteService.createNewNote(parentNoteId, newNote, req);
note.cssClass = (await note.getLabels("cssClass")).map(label => label.value).join(" ");
return {
note,
branch
@@ -45,7 +47,7 @@ async function sortNotes(req) {
await treeService.sortNotesAlphabetically(noteId);
}
async function protectBranch(req) {
async function protectSubtree(req) {
const noteId = req.params.noteId;
const note = await repository.getNote(noteId);
const protect = !!parseInt(req.params.isProtected);
@@ -70,6 +72,6 @@ module.exports = {
updateNote,
createNote,
sortNotes,
protectBranch,
protectSubtree,
setNoteTypeMime
};

View File

@@ -6,13 +6,10 @@ const log = require('../../services/log');
// options allowed to be updated directly in options dialog
const ALLOWED_OPTIONS = ['protectedSessionTimeout', 'noteRevisionSnapshotTimeInterval',
'zoomFactor', 'theme', 'syncServerHost', 'syncServerTimeout', 'syncProxy'];
'zoomFactor', 'theme', 'syncServerHost', 'syncServerTimeout', 'syncProxy', 'leftPaneMinWidth', 'leftPaneWidthPercent'];
async function getOptions() {
const options = await sql.getMap("SELECT name, value FROM options WHERE name IN ("
+ ALLOWED_OPTIONS.map(x => '?').join(",") + ")", ALLOWED_OPTIONS);
return options;
return await optionService.getOptionsMap(ALLOWED_OPTIONS);
}
async function updateOption(req) {

View File

@@ -2,10 +2,14 @@
const sqlInit = require('../../services/sql_init');
const setupService = require('../../services/setup');
const optionService = require('../../services/options');
const syncService = require('../../services/sync');
const log = require('../../services/log');
const rp = require('request-promise');
async function getStatus() {
return {
isInitialized: await sqlInit.isDbInitialized(),
schemaExists: await sqlInit.schemaExists()
};
}
async function setupNewDocument(req) {
const { username, password } = req.body;
@@ -19,42 +23,6 @@ async function setupSyncFromServer(req) {
return await setupService.setupSyncFromSyncServer(syncServerHost, syncProxy, username, password);
}
async function setupSyncToSyncServer() {
log.info("Initiating sync to server");
const syncServerHost = await optionService.getOption('syncServerHost');
const syncProxy = await optionService.getOption('syncProxy');
const rpOpts = {
uri: syncServerHost + '/api/setup/sync-seed',
method: 'POST',
json: true,
body: {
options: await setupService.getSyncSeedOptions()
}
};
if (syncProxy) {
rpOpts.proxy = syncProxy;
}
try {
await rp(rpOpts);
}
catch (e) {
return { success: false, error: e.message };
}
// this is completely new sync, need to reset counters. If this would not be new sync,
// the previous request would have failed.
await optionService.setOption('lastSyncedPush', 0);
await optionService.setOption('lastSyncedPull', 0);
syncService.sync();
return { success: true };
}
async function saveSyncSeed(req) {
const options = req.body.options;
@@ -68,9 +36,9 @@ async function getSyncSeed() {
}
module.exports = {
getStatus,
setupNewDocument,
setupSyncFromServer,
setupSyncToSyncServer,
getSyncSeed,
saveSyncSeed
};

View File

@@ -8,17 +8,26 @@ const sqlInit = require('../../services/sql_init');
const optionService = require('../../services/options');
const contentHashService = require('../../services/content_hash');
const log = require('../../services/log');
const syncOptions = require('../../services/sync_options');
async function testSync() {
try {
if (!await syncOptions.isSyncSetup()) {
return { success: false, message: "Sync server host is not configured. Please configure sync first." };
}
await syncService.login();
return { connection: "Success" };
// login was successful so we'll kick off sync now
// this is important in case when sync server has been just initialized
syncService.sync();
return { success: true, message: "Sync server handshake has been successful, sync has been started." };
}
catch (e) {
return {
connection: "Failure",
error: e.message
success: false,
message: e.message
};
}
}

View File

@@ -39,8 +39,14 @@ async function getRelations(noteIds) {
// we need to fetch both parentNoteId and noteId matches because we can have loaded child
// of which only some of the parents has been loaded.
return await sql.getManyRows(`SELECT branchId, noteId AS 'childNoteId', parentNoteId FROM branches WHERE isDeleted = 0
const relations = await sql.getManyRows(`SELECT branchId, noteId AS 'childNoteId', parentNoteId, notePosition FROM branches WHERE isDeleted = 0
AND (parentNoteId IN (???) OR noteId IN (???))`, noteIds);
// although we're fetching relations for multiple notes, ordering will stay correct for single note as well - relations are being added into tree cache in the order they were returned
// cannot use ORDER BY because of usage of getManyRows which is not a single SQL query
relations.sort((a, b) => a.notePosition > b.notePosition ? 1 : -1);
return relations;
}
async function getTree() {

View File

@@ -7,8 +7,13 @@ const config = require('../services/config');
const optionService = require('../services/options');
async function index(req, res) {
const options = await optionService.getOptionsMap();
res.render('index', {
theme: await optionService.getOption('theme'),
theme: options.theme,
leftPaneMinWidth: parseInt(options.leftPaneMinWidth),
leftPaneWidthPercent: parseInt(options.leftPaneWidthPercent),
rightPaneWidthPercent: 100 - parseInt(options.leftPaneWidthPercent),
sourceId: await sourceIdService.generateSourceId(),
maxSyncIdAtLoad: await sql.getValue("SELECT MAX(id) FROM sync"),
instanceName: config.General ? config.General.instanceName : null,

View File

@@ -117,14 +117,14 @@ function register(app) {
apiRoute(PUT, '/api/notes/:noteId', notesApiRoute.updateNote);
apiRoute(POST, '/api/notes/:parentNoteId/children', notesApiRoute.createNote);
apiRoute(PUT, '/api/notes/:noteId/sort', notesApiRoute.sortNotes);
apiRoute(PUT, '/api/notes/:noteId/protect/:isProtected', notesApiRoute.protectBranch);
apiRoute(PUT, '/api/notes/:noteId/protect/:isProtected', notesApiRoute.protectSubtree);
apiRoute(PUT, /\/api\/notes\/(.*)\/type\/(.*)\/mime\/(.*)/, notesApiRoute.setNoteTypeMime);
apiRoute(GET, '/api/notes/:noteId/revisions', noteRevisionsApiRoute.getNoteRevisions);
apiRoute(PUT, '/api/notes/:noteId/clone-to/:parentNoteId', cloningApiRoute.cloneNoteToParent);
apiRoute(PUT, '/api/notes/:noteId/clone-after/:afterBranchId', cloningApiRoute.cloneNoteAfter);
route(GET, '/api/notes/:noteId/export/:format', [auth.checkApiAuthOrElectron], exportRoute.exportNote);
route(GET, '/api/notes/:entityId/export/:format', [auth.checkApiAuthOrElectron], exportRoute.exportNote);
route(POST, '/api/notes/:parentNoteId/import', [auth.checkApiAuthOrElectron, uploadMiddleware], importRoute.importToBranch, apiResultHandler);
route(POST, '/api/notes/:parentNoteId/upload', [auth.checkApiAuthOrElectron, uploadMiddleware],
@@ -166,9 +166,9 @@ function register(app) {
apiRoute(PUT, '/api/recent-notes/:branchId/:notePath', recentNotesRoute.addRecentNote);
apiRoute(GET, '/api/app-info', appInfoRoute.getAppInfo);
route(GET, '/api/setup/status', [], setupApiRoute.getStatus, apiResultHandler);
route(POST, '/api/setup/new-document', [auth.checkAppNotInitialized], setupApiRoute.setupNewDocument, apiResultHandler);
route(POST, '/api/setup/sync-from-server', [auth.checkAppNotInitialized], setupApiRoute.setupSyncFromServer, apiResultHandler, false);
apiRoute(POST, '/api/setup/sync-to-server', setupApiRoute.setupSyncToSyncServer);
route(GET, '/api/setup/sync-seed', [auth.checkBasicAuth], setupApiRoute.getSyncSeed, apiResultHandler);
route(POST, '/api/setup/sync-seed', [auth.checkAppNotInitialized], setupApiRoute.saveSyncSeed, apiResultHandler, false);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,7 +3,7 @@
const build = require('./build');
const packageJson = require('../../package');
const APP_DB_VERSION = 112;
const APP_DB_VERSION = 113;
const SYNC_VERSION = 1;
module.exports = {

View File

@@ -1 +1 @@
module.exports = { buildDate:"2018-08-29T22:29:36+02:00", buildRevision: "561b514b8494de93787e875f42ba7765a65bb63f" };
module.exports = { buildDate:"2018-09-11T10:15:15+02:00", buildRevision: "3af27845b5aeecd8311d4529c0b46252f5e3077c" };

View File

@@ -1,7 +1,7 @@
"use strict";
const optionService = require('./options');
const scrypt = require('scrypt');
const scrypt = require('@mlink/scrypt');
async function getVerificationHash(password) {
const salt = await optionService.getOption('passwordVerificationSalt');
@@ -17,7 +17,7 @@ async function getPasswordDerivedKey(password) {
async function getScryptHash(password, salt) {
const hashed = scrypt.hashSync(password,
{N: 16384, r:8, p:1},
{N: 14, r:8, p:1},
32,
salt);

View File

@@ -260,20 +260,19 @@ eventService.subscribe(eventService.ENTITY_CHANGED, async ({entityName, entity})
else if (entityName === 'branches') {
const branch = entity;
if (childToParent[branch.noteId]) {
childToParent[branch.noteId] = childToParent[branch.noteId].filter(noteId => noteId !== branch.parentNoteId)
}
// first we remove records for original placement (if they exist)
childToParent[branch.noteId] = childToParent[branch.noteId] || [];
childToParent[branch.noteId] = childToParent[branch.noteId].filter(noteId => noteId !== branch.origParentNoteId);
if (branch.isDeleted) {
delete prefixes[branch.noteId + '-' + branch.parentNoteId];
delete childParentToBranchId[branch.noteId + '-' + branch.parentNoteId];
}
else {
delete prefixes[branch.noteId + '-' + branch.origParentNoteId];
delete childParentToBranchId[branch.noteId + '-' + branch.origParentNoteId];
if (!branch.isDeleted) {
// ... and then we create new records
if (branch.prefix) {
prefixes[branch.noteId + '-' + branch.parentNoteId] = branch.prefix;
}
childToParent[branch.noteId] = childToParent[branch.noteId] || [];
childToParent[branch.noteId].push(branch.parentNoteId);
childParentToBranchId[branch.noteId + '-' + branch.parentNoteId] = branch.branchId;
}

View File

@@ -81,6 +81,8 @@ async function createNewNote(parentNoteId, noteData) {
position: attr.position,
isInheritable: attr.isInheritable
}).save();
note.invalidateAttributeCache();
}
}
@@ -193,14 +195,14 @@ async function saveNoteRevision(note) {
const revisionCutoff = dateUtils.dateStr(new Date(now.getTime() - noteRevisionSnapshotTimeInterval * 1000));
const existingnoteRevisionId = await sql.getValue(
const existingNoteRevisionId = await sql.getValue(
"SELECT noteRevisionId FROM note_revisions WHERE noteId = ? AND dateModifiedTo >= ?", [note.noteId, revisionCutoff]);
const msSinceDateCreated = now.getTime() - dateUtils.parseDateTime(note.dateCreated).getTime();
if (note.type !== 'file'
&& !await note.hasLabel('disableVersioning')
&& !existingnoteRevisionId
&& !existingNoteRevisionId
&& msSinceDateCreated >= noteRevisionSnapshotTimeInterval * 1000) {
await new NoteRevision({
@@ -248,6 +250,10 @@ async function deleteNote(branch) {
return;
}
if (branch.branchId === 'root' || branch.noteId === 'root') {
throw new Error("Can't delete root branch/note");
}
branch.isDeleted = true;
await branch.save();

View File

@@ -1,3 +1,5 @@
const utils = require('./utils');
async function getOption(name) {
const option = await require('./repository').getOption(name);
@@ -31,8 +33,26 @@ async function createOption(name, value, isSynced) {
}).save();
}
async function getOptions(allowedOptions) {
let options = await require('./repository').getEntities("SELECT * FROM options ORDER BY name");
if (allowedOptions) {
options = options.filter(opt => allowedOptions.includes(opt.name));
}
return options;
}
async function getOptionsMap(allowedOptions) {
const options = await getOptions(allowedOptions);
return utils.toObject(options, opt => [opt.name, opt.value]);
}
module.exports = {
getOption,
setOption,
createOption
createOption,
getOptions,
getOptionsMap
};

View File

@@ -42,6 +42,9 @@ async function initNotSyncedOptions(initialized, startNotePath = 'root', syncSer
await optionService.createOption('zoomFactor', 1.0, false);
await optionService.createOption('theme', 'white', false);
await optionService.createOption('leftPaneMinWidth', '350', false);
await optionService.createOption('leftPaneWidthPercent', '20', false);
await optionService.createOption('syncServerHost', syncServerHost, false);
await optionService.createOption('syncServerTimeout', 5000, false);
await optionService.createOption('syncProxy', syncProxy, false);

View File

@@ -36,22 +36,27 @@ async function getEntity(query, params = []) {
return entityConstructor.createEntityFromRow(row);
}
/** @returns {Note|null} */
async function getNote(noteId) {
return await getEntity("SELECT * FROM notes WHERE noteId = ?", [noteId]);
}
/** @returns {Branch|null} */
async function getBranch(branchId) {
return await getEntity("SELECT * FROM branches WHERE branchId = ?", [branchId]);
}
/** @returns {Image|null} */
async function getImage(imageId) {
return await getEntity("SELECT * FROM images WHERE imageId = ?", [imageId]);
}
/** @returns {Attribute|null} */
async function getAttribute(attributeId) {
return await getEntity("SELECT * FROM attributes WHERE attributeId = ?", [attributeId]);
}
/** @returns {Option|null} */
async function getOption(name) {
return await getEntity("SELECT * FROM options WHERE name = ?", [name]);
}
@@ -68,9 +73,11 @@ async function updateEntity(entity) {
const clone = Object.assign({}, entity);
// transient properties not supposed to be persisted
delete clone.jsonContent;
delete clone.isOwned;
delete clone.isChanged;
delete clone.origParentNoteId;
delete clone.__attributeCache;
for (const key in clone) {

View File

@@ -127,15 +127,15 @@ async function getScriptBundle(note, root = true, scriptEnv = null, includedNote
if (note.isJavaScript()) {
bundle.script += `
apiContext.modules['${note.noteId}'] = {};
${root ? 'return ' : ''}await (async function(exports, module, require, api` + (modules.length > 0 ? ', ' : '') +
${root ? 'return ' : ''}await ((async function(exports, module, require, api` + (modules.length > 0 ? ', ' : '') +
modules.map(child => sanitizeVariableName(child.title)).join(', ') + `) {
try {
${note.content};
} catch (e) { throw new Error("Load of script note \\"${note.title}\\" (${note.noteId}) failed with: " + e.message); }
if (!module.exports) module.exports = {};
for (const exportKey in exports) module.exports[exportKey] = exports[exportKey];
})({}, apiContext.modules['${note.noteId}'], apiContext.require(${JSON.stringify(moduleNoteIds)}), apiContext.apis['${note.noteId}']` + (modules.length > 0 ? ', ' : '') +
modules.map(mod => `apiContext.modules['${mod.noteId}'].exports`).join(', ') + `);
}).call({}, {}, apiContext.modules['${note.noteId}'], apiContext.require(${JSON.stringify(moduleNoteIds)}), apiContext.apis['${note.noteId}']` + (modules.length > 0 ? ', ' : '') +
modules.map(mod => `apiContext.modules['${mod.noteId}'].exports`).join(', ') + `));
`;
}
else if (note.isHtml()) {

View File

@@ -3,6 +3,14 @@ const syncService = require('./sync');
const log = require('./log');
const sqlInit = require('./sql_init');
const repository = require('./repository');
const optionService = require('./options');
const syncOptions = require('./sync_options');
async function hasSyncServerSchemaAndSeed() {
const response = await requestToSyncServer('GET', '/api/setup/status');
return response.schemaExists;
}
function triggerSync() {
log.info("Triggering sync.");
@@ -15,6 +23,39 @@ function triggerSync() {
});
}
async function sendSeedToSyncServer() {
log.info("Initiating sync to server");
await requestToSyncServer('POST', '/api/setup/sync-seed', {
options: await getSyncSeedOptions()
});
// this is completely new sync, need to reset counters. If this would not be new sync,
// the previous request would have failed.
await optionService.setOption('lastSyncedPush', 0);
await optionService.setOption('lastSyncedPull', 0);
}
async function requestToSyncServer(method, path, body = null) {
const rpOpts = {
uri: await syncOptions.getSyncServerHost() + path,
method: method,
json: true
};
if (body) {
rpOpts.body = body;
}
const syncProxy = await syncOptions.getSyncProxy();
if (syncProxy) {
rpOpts.proxy = syncProxy;
}
return await rp(rpOpts);
}
async function setupSyncFromSyncServer(syncServerHost, syncProxy, username, password) {
if (await sqlInit.isDbInitialized()) {
return {
@@ -64,7 +105,9 @@ async function getSyncSeedOptions() {
}
module.exports = {
hasSyncServerSchemaAndSeed,
triggerSync,
sendSeedToSyncServer,
setupSyncFromSyncServer,
getSyncSeedOptions,
triggerSync
getSyncSeedOptions
};

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