mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 08:16:40 +01:00
Compare commits
217 Commits
v0.58.1-be
...
v0.59.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f541bf186c | ||
|
|
9eb3075f65 | ||
|
|
e2b8dfe96a | ||
|
|
f883fde74a | ||
|
|
ae6f2624a0 | ||
|
|
ee2953a5e1 | ||
|
|
ec8ed65feb | ||
|
|
b70699ce1c | ||
|
|
44c0ecdbfa | ||
|
|
7be9db8b84 | ||
|
|
69d7684b0d | ||
|
|
a88582c610 | ||
|
|
3fd0c01c05 | ||
|
|
c16537aecf | ||
|
|
79f1eb6e5e | ||
|
|
fc67dd4d0a | ||
|
|
232dad66d1 | ||
|
|
ed30ec27e7 | ||
|
|
eaab82551f | ||
|
|
d343ff0d23 | ||
|
|
400b14e021 | ||
|
|
760c7b73ad | ||
|
|
97cadc3acf | ||
|
|
7d0117bd28 | ||
|
|
956682f2c7 | ||
|
|
4558e349b5 | ||
|
|
6f7b554cdc | ||
|
|
42e08284b0 | ||
|
|
127486fdf5 | ||
|
|
4ffe36e4d0 | ||
|
|
85403321cf | ||
|
|
22cea63863 | ||
|
|
c95c5bb471 | ||
|
|
cbabaa6b0c | ||
|
|
520ffecd36 | ||
|
|
b1e2b5ba8e | ||
|
|
896a4fe981 | ||
|
|
e9a2cacb5b | ||
|
|
c190296bf9 | ||
|
|
e411ad0eb1 | ||
|
|
17085e5578 | ||
|
|
33d6bb69c0 | ||
|
|
44629e6a0a | ||
|
|
78d61f157e | ||
|
|
3c0ba09a62 | ||
|
|
e57d325bd6 | ||
|
|
260bc93a66 | ||
|
|
a9296e2a39 | ||
|
|
8371703090 | ||
|
|
fc7da015fe | ||
|
|
adf222b5e8 | ||
|
|
ade22ea825 | ||
|
|
2c8fb90ecb | ||
|
|
c67644a2e3 | ||
|
|
346f6edd7e | ||
|
|
92f586486f | ||
|
|
15607becc6 | ||
|
|
e7c6d912a4 | ||
|
|
290f7e2101 | ||
|
|
460b5fb3a4 | ||
|
|
88e09eb279 | ||
|
|
5e0fbea3b3 | ||
|
|
7b2c3afe4c | ||
|
|
2e181d0fb1 | ||
|
|
68a03211ce | ||
|
|
37ba76fdd8 | ||
|
|
78954268ab | ||
|
|
b0528b62d8 | ||
|
|
2b4dfaef7f | ||
|
|
ad887c4b12 | ||
|
|
63c62df787 | ||
|
|
c68a67d148 | ||
|
|
bd8568809f | ||
|
|
0bfb2631df | ||
|
|
3c57f08ef7 | ||
|
|
a7b103e07a | ||
|
|
64e7150765 | ||
|
|
a888f9aa04 | ||
|
|
2e9dbda077 | ||
|
|
c474e65cae | ||
|
|
f59e19d93b | ||
|
|
8a33645360 | ||
|
|
339d8a7378 | ||
|
|
f2a19c56b1 | ||
|
|
a98fd509c6 | ||
|
|
a3149aecf4 | ||
|
|
6a6ae359b6 | ||
|
|
2fa1d812f6 | ||
|
|
ef825371cf | ||
|
|
b567775129 | ||
|
|
58d71bf8e3 | ||
|
|
9fd0b85ff2 | ||
|
|
a5e21ea5f3 | ||
|
|
98620887d4 | ||
|
|
9eff08144c | ||
|
|
4ba72bc8d3 | ||
|
|
f50a9c250a | ||
|
|
743979266a | ||
|
|
4f98c960ec | ||
|
|
424b624ea9 | ||
|
|
a004a8b092 | ||
|
|
df0f52aff9 | ||
|
|
f7bd72ba2f | ||
|
|
038c0e78a6 | ||
|
|
2a2cbcd68b | ||
|
|
be654e7a31 | ||
|
|
32bd74fe27 | ||
|
|
14da697a4e | ||
|
|
2525857c20 | ||
|
|
c97ada3434 | ||
|
|
c924790f3e | ||
|
|
a110f24b05 | ||
|
|
8eaef3e1d8 | ||
|
|
082caf98e8 | ||
|
|
60602a2264 | ||
|
|
9479f1c1a1 | ||
|
|
88bc7402a2 | ||
|
|
e7b3c3239b | ||
|
|
4f4c3ef3f3 | ||
|
|
d7b0719788 | ||
|
|
7a457e4509 | ||
|
|
decfeb366c | ||
|
|
420175f5ef | ||
|
|
bdfdc0402d | ||
|
|
bb8496cb3f | ||
|
|
4bdb94fbaa | ||
|
|
05c04a35a7 | ||
|
|
4385a02f6b | ||
|
|
397dd68666 | ||
|
|
edbb60f2b5 | ||
|
|
5bf9c253f2 | ||
|
|
b0cc177d84 | ||
|
|
c60f25fb7c | ||
|
|
4ab90b694f | ||
|
|
87636f27ba | ||
|
|
571cb6d0eb | ||
|
|
f738787202 | ||
|
|
4ae1b6e07b | ||
|
|
41b8f6882c | ||
|
|
43c5163f66 | ||
|
|
8a2a9b2ea6 | ||
|
|
c70272e756 | ||
|
|
843f5d0da1 | ||
|
|
2242397280 | ||
|
|
8a641e1b4f | ||
|
|
f86fb0d0a2 | ||
|
|
a863da1dce | ||
|
|
d7cae7d5bb | ||
|
|
19f4870280 | ||
|
|
ac51d0d569 | ||
|
|
218f526a92 | ||
|
|
161b45aa12 | ||
|
|
397629587c | ||
|
|
034098fd06 | ||
|
|
e03cc01e15 | ||
|
|
0995c56506 | ||
|
|
3a5fa2954d | ||
|
|
398480415e | ||
|
|
81013ed21a | ||
|
|
53360c147a | ||
|
|
9e47da3f03 | ||
|
|
faefe10c15 | ||
|
|
a4d3150a24 | ||
|
|
e1f0676891 | ||
|
|
792ac9b77d | ||
|
|
bbbd2f7e82 | ||
|
|
d910191e83 | ||
|
|
e8a9389e6d | ||
|
|
6dce13bc34 | ||
|
|
71cdea3902 | ||
|
|
85a6e8b47e | ||
|
|
f02ad63e97 | ||
|
|
977399a73e | ||
|
|
5d4a2f2064 | ||
|
|
c5ab6fa2fa | ||
|
|
b80bf0ffb6 | ||
|
|
bff7434921 | ||
|
|
da161c7ce0 | ||
|
|
977a47bc27 | ||
|
|
957640f163 | ||
|
|
291ef87c9b | ||
|
|
115bf0af4d | ||
|
|
e40f1fd11a | ||
|
|
797ddf6205 | ||
|
|
ca4e1c19a7 | ||
|
|
d2b906bc1b | ||
|
|
94dcaae12d | ||
|
|
df47679c7f | ||
|
|
d6f3b79f20 | ||
|
|
c7556d9163 | ||
|
|
16c3833a36 | ||
|
|
007e45ad8c | ||
|
|
b9b8b35342 | ||
|
|
dd82b0f958 | ||
|
|
f150c223bc | ||
|
|
e76290e598 | ||
|
|
4f771cfa7a | ||
|
|
aa3b26c965 | ||
|
|
f4cf04232f | ||
|
|
d36cf47974 | ||
|
|
f809da58ec | ||
|
|
ff1f01be8c | ||
|
|
0ddaa8f5c2 | ||
|
|
620bed73bb | ||
|
|
c177d2b97b | ||
|
|
0758c82983 | ||
|
|
ecc2ed7d73 | ||
|
|
4b779d7512 | ||
|
|
5fea90491c | ||
|
|
d665b7e584 | ||
|
|
45b94ecaeb | ||
|
|
acda37e334 | ||
|
|
c409d7ff2a | ||
|
|
f8dd175837 | ||
|
|
df3212c304 | ||
|
|
6ec734df13 | ||
|
|
102bfcebd0 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,3 +11,4 @@ cert.crt
|
|||||||
server-package.json
|
server-package.json
|
||||||
.idea/httpRequests/
|
.idea/httpRequests/
|
||||||
data/
|
data/
|
||||||
|
tmp/
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ image:
|
|||||||
file: .gitpod.dockerfile
|
file: .gitpod.dockerfile
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- before: nvm install 16.19.0 && nvm use 16.19.0
|
- before: nvm install 16.19.1 && nvm use 16.19.1
|
||||||
init: npm install
|
init: npm install
|
||||||
command: npm run start-server
|
command: npm run start-server
|
||||||
|
|
||||||
|
|||||||
15
.idea/git_toolbox_prj.xml
generated
Normal file
15
.idea/git_toolbox_prj.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GitToolBoxProjectSettings">
|
||||||
|
<option name="commitMessageIssueKeyValidationOverride">
|
||||||
|
<BoolValueOverride>
|
||||||
|
<option name="enabled" value="true" />
|
||||||
|
</BoolValueOverride>
|
||||||
|
</option>
|
||||||
|
<option name="commitMessageValidationEnabledOverride">
|
||||||
|
<BoolValueOverride>
|
||||||
|
<option name="enabled" value="true" />
|
||||||
|
</BoolValueOverride>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
3
.vscode/launch.json
vendored
3
.vscode/launch.json
vendored
@@ -9,7 +9,8 @@
|
|||||||
"<node_internals>/**"
|
"<node_internals>/**"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"TRILIUM_ENV": "dev"
|
"TRILIUM_ENV": "dev",
|
||||||
|
"TRILIUM_DATA_DIR": "./data"
|
||||||
},
|
},
|
||||||
"outputCapture": "std",
|
"outputCapture": "std",
|
||||||
"program": "${workspaceFolder}/src/www"
|
"program": "${workspaceFolder}/src/www"
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Try connecting to /api/health-check using both http and https.
|
|
||||||
# TODO: we should only be connecting with the actual protocol that is enabled
|
|
||||||
# TODO: this assumes we use the default port 8080
|
|
||||||
|
|
||||||
for proto in http https; do
|
|
||||||
if wget --spider -S "$proto://127.0.0.1:8080/api/health-check" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
exit 1
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# !!! Don't try to build this Dockerfile directly, run it through bin/build-docker.sh script !!!
|
# !!! Don't try to build this Dockerfile directly, run it through bin/build-docker.sh script !!!
|
||||||
FROM node:16.19.0-alpine
|
FROM node:16.19.1-alpine
|
||||||
|
|
||||||
# Create app directory
|
# Create app directory
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
@@ -39,4 +39,4 @@ RUN adduser -s /bin/false node; exit 0
|
|||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
CMD [ "./start-docker.sh" ]
|
CMD [ "./start-docker.sh" ]
|
||||||
|
|
||||||
HEALTHCHECK CMD sh DockerHealthcheck.sh
|
HEALTHCHECK --start-period=10s CMD node docker_healthcheck.js
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Trilium Notes 是一个层次化的笔记应用程序,专注于建立大型个
|
|||||||
Ukraine is currently suffering from Russian aggression, please consider donating to [one of these charities](https://old.reddit.com/r/ukraine/comments/s6g5un/want_to_support_ukraine_heres_a_list_of_charities/).
|
Ukraine is currently suffering from Russian aggression, please consider donating to [one of these charities](https://old.reddit.com/r/ukraine/comments/s6g5un/want_to_support_ukraine_heres_a_list_of_charities/).
|
||||||
|
|
||||||
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
|
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
|
||||||
|
<img src="https://signmyrocket.com//uploads/2b2a523cd0c0e76cdbba95a89a9636b2_1676971281.jpg" alt="Trilium Notes supports Ukraine!" width="600"/>
|
||||||
|
|
||||||
## 特性
|
## 特性
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ Ukraine is currently defending itself from Russian aggression, please consider [
|
|||||||
|
|
||||||
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
|
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
|
||||||
|
|
||||||
|
<img src="https://signmyrocket.com//uploads/2b2a523cd0c0e76cdbba95a89a9636b2_1676971281.jpg" alt="Trilium Notes supports Ukraine!" width="600"/>
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
* Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
* Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Trilium Notes – это приложение для заметок с иера
|
|||||||
Ukraine is currently suffering from Russian aggression, please consider donating to [one of these charities](https://old.reddit.com/r/ukraine/comments/s6g5un/want_to_support_ukraine_heres_a_list_of_charities/).
|
Ukraine is currently suffering from Russian aggression, please consider donating to [one of these charities](https://old.reddit.com/r/ukraine/comments/s6g5un/want_to_support_ukraine_heres_a_list_of_charities/).
|
||||||
|
|
||||||
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
|
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
|
||||||
|
<img src="https://signmyrocket.com//uploads/2b2a523cd0c0e76cdbba95a89a9636b2_1676971281.jpg" alt="Trilium Notes supports Ukraine!" width="600"/>
|
||||||
|
|
||||||
## Возможности
|
## Возможности
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PKG_DIR=dist/trilium-linux-x64-server
|
PKG_DIR=dist/trilium-linux-x64-server
|
||||||
NODE_VERSION=16.19.0
|
NODE_VERSION=16.19.1
|
||||||
|
|
||||||
if [ "$1" != "DONTCOPY" ]
|
if [ "$1" != "DONTCOPY" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ if [[ $# -eq 0 ]] ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
n exec 16.19.0 npm run webpack
|
n exec 16.19.1 npm run webpack
|
||||||
|
|
||||||
DIR=$1
|
DIR=$1
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ cp -r electron.js $DIR/
|
|||||||
cp webpack-* $DIR/
|
cp webpack-* $DIR/
|
||||||
|
|
||||||
# run in subshell (so we return to original dir)
|
# run in subshell (so we return to original dir)
|
||||||
(cd $DIR && n exec 16.19.0 npm install --only=prod)
|
(cd $DIR && n exec 16.19.1 npm install --only=prod)
|
||||||
|
|
||||||
# cleanup of useless files in dependencies
|
# cleanup of useless files in dependencies
|
||||||
rm -r $DIR/node_modules/image-q/demo
|
rm -r $DIR/node_modules/image-q/demo
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
SCHEMA_FILE_PATH=db/schema.sql
|
SCHEMA_FILE_PATH=db/schema.sql
|
||||||
|
|
||||||
sqlite3 ~/trilium-data/document.db .schema | grep -v "sqlite_sequence" > "$SCHEMA_FILE_PATH"
|
sqlite3 ./data/document.db .schema | grep -v "sqlite_sequence" > "$SCHEMA_FILE_PATH"
|
||||||
|
|
||||||
echo "DB schema exported to $SCHEMA_FILE_PATH"
|
echo "DB schema exported to $SCHEMA_FILE_PATH"
|
||||||
@@ -1,12 +1,161 @@
|
|||||||
|
|
||||||
UPDATE etapi_tokens SET tokenHash = 'API token hash value';
|
UPDATE etapi_tokens SET tokenHash = 'API token hash value';
|
||||||
UPDATE notes SET title = 'title' WHERE title NOT IN ('root', '_hidden', '_share');
|
UPDATE notes SET title = 'title' WHERE noteId != 'root' AND noteId NOT LIKE '\_%' ESCAPE '\';
|
||||||
UPDATE note_contents SET content = 'text' WHERE content IS NOT NULL;
|
UPDATE note_contents SET content = 'text' WHERE content IS NOT NULL;
|
||||||
UPDATE note_revisions SET title = 'title';
|
UPDATE note_revisions SET title = 'title';
|
||||||
UPDATE note_revision_contents SET content = 'text' WHERE content IS NOT NULL;
|
UPDATE note_revision_contents SET content = 'text' WHERE content IS NOT NULL;
|
||||||
|
|
||||||
UPDATE attributes SET name = 'name', value = 'value' WHERE type = 'label' AND name NOT IN('inbox', 'disableVersioning', 'calendarRoot', 'archived', 'excludeFromExport', 'disableInclusion', 'appCss', 'appTheme', 'hidePromotedAttributes', 'readOnly', 'autoReadOnlyDisabled', 'cssClass', 'iconClass', 'keyboardShortcut', 'run', 'runOnInstance', 'runAtHour', 'customRequestHandler', 'customResourceProvider', 'widget', 'noteInfoWidgetDisabled', 'linkMapWidgetDisabled', 'noteRevisionsWidgetDisabled', 'whatLinksHereWidgetDisabled', 'similarNotesWidgetDisabled', 'workspace', 'workspaceIconClass', 'workspaceTabBackgroundColor', 'searchHome', 'workspaceInbox', 'workspaceSearchHome', 'sqlConsoleHome', 'datePattern', 'pageSize', 'viewType', 'mapRootNoteId', 'bookmarkFolder', 'sorted', 'top', 'fullContentWidth', 'shareHiddenFromTree', 'shareAlias', 'shareOmitDefaultCss', 'shareRoot', 'shareDescription', 'internalLink', 'imageLink', 'relationMapLink', 'includeMapLink', 'runOnNoteCreation', 'runOnNoteTitleChange', 'runOnNoteContentChange', 'runOnNoteChange', 'runOnChildNoteCreation', 'runOnAttributeCreation', 'runOnAttributeChange', 'template', 'widget', 'renderNote', 'shareCss', 'shareJs', 'shareFavicon');
|
UPDATE attributes SET name = 'name', value = 'value'
|
||||||
UPDATE attributes SET name = 'name' WHERE type = 'relation' AND name NOT IN ('inbox', 'disableVersioning', 'calendarRoot', 'archived', 'excludeFromExport', 'disableInclusion', 'appCss', 'appTheme', 'hidePromotedAttributes', 'readOnly', 'autoReadOnlyDisabled', 'cssClass', 'iconClass', 'keyboardShortcut', 'run', 'runOnInstance', 'runAtHour', 'customRequestHandler', 'customResourceProvider', 'widget', 'noteInfoWidgetDisabled', 'linkMapWidgetDisabled', 'noteRevisionsWidgetDisabled', 'whatLinksHereWidgetDisabled', 'similarNotesWidgetDisabled', 'workspace', 'workspaceIconClass', 'workspaceTabBackgroundColor', 'searchHome', 'workspaceInbox', 'workspaceSearchHome', 'sqlConsoleHome', 'datePattern', 'pageSize', 'viewType', 'mapRootNoteId', 'bookmarkFolder', 'sorted', 'top', 'fullContentWidth', 'shareHiddenFromTree', 'shareAlias', 'shareOmitDefaultCss', 'shareRoot', 'shareDescription', 'internalLink', 'imageLink', 'relationMapLink', 'includeMapLink', 'runOnNoteCreation', 'runOnNoteTitleChange', 'runOnNoteContentChange', 'runOnNoteChange', 'runOnChildNoteCreation', 'runOnAttributeCreation', 'runOnAttributeChange', 'template', 'widget', 'renderNote', 'shareCss', 'shareJs', 'shareFavicon');
|
WHERE type = 'label'
|
||||||
|
AND name NOT IN ('inbox',
|
||||||
|
'disableVersioning',
|
||||||
|
'calendarRoot',
|
||||||
|
'archived',
|
||||||
|
'excludeFromExport',
|
||||||
|
'disableInclusion',
|
||||||
|
'appCss',
|
||||||
|
'appTheme',
|
||||||
|
'hidePromotedAttributes',
|
||||||
|
'readOnly',
|
||||||
|
'autoReadOnlyDisabled',
|
||||||
|
'cssClass',
|
||||||
|
'iconClass',
|
||||||
|
'keyboardShortcut',
|
||||||
|
'run',
|
||||||
|
'runOnInstance',
|
||||||
|
'runAtHour',
|
||||||
|
'customRequestHandler',
|
||||||
|
'customResourceProvider',
|
||||||
|
'widget',
|
||||||
|
'noteInfoWidgetDisabled',
|
||||||
|
'linkMapWidgetDisabled',
|
||||||
|
'noteRevisionsWidgetDisabled',
|
||||||
|
'whatLinksHereWidgetDisabled',
|
||||||
|
'similarNotesWidgetDisabled',
|
||||||
|
'workspace',
|
||||||
|
'workspaceIconClass',
|
||||||
|
'workspaceTabBackgroundColor',
|
||||||
|
'searchHome',
|
||||||
|
'workspaceInbox',
|
||||||
|
'workspaceSearchHome',
|
||||||
|
'sqlConsoleHome',
|
||||||
|
'datePattern',
|
||||||
|
'pageSize',
|
||||||
|
'viewType',
|
||||||
|
'mapRootNoteId',
|
||||||
|
'bookmarkFolder',
|
||||||
|
'sorted',
|
||||||
|
'top',
|
||||||
|
'fullContentWidth',
|
||||||
|
'shareHiddenFromTree',
|
||||||
|
'shareAlias',
|
||||||
|
'shareOmitDefaultCss',
|
||||||
|
'shareRoot',
|
||||||
|
'internalLink',
|
||||||
|
'imageLink',
|
||||||
|
'relationMapLink',
|
||||||
|
'includeMapLink',
|
||||||
|
'runOnNoteCreation',
|
||||||
|
'runOnNoteTitleChange',
|
||||||
|
'runOnNoteContentChange',
|
||||||
|
'runOnNoteChange',
|
||||||
|
'runOnChildNoteCreation',
|
||||||
|
'runOnAttributeCreation',
|
||||||
|
'runOnAttributeChange',
|
||||||
|
'template',
|
||||||
|
'inherit',
|
||||||
|
'widget',
|
||||||
|
'renderNote',
|
||||||
|
'shareCss',
|
||||||
|
'shareJs',
|
||||||
|
'shareFavicon',
|
||||||
|
'executeButton',
|
||||||
|
'keepCurrentHoisting',
|
||||||
|
'color',
|
||||||
|
'toc',
|
||||||
|
'excludeFromNoteMap',
|
||||||
|
'docName',
|
||||||
|
'launcherType',
|
||||||
|
'builtinWidget',
|
||||||
|
'baseSize',
|
||||||
|
'growthFactor'
|
||||||
|
);
|
||||||
|
|
||||||
|
UPDATE attributes SET name = 'name'
|
||||||
|
AND name NOT IN ('inbox',
|
||||||
|
'disableVersioning',
|
||||||
|
'calendarRoot',
|
||||||
|
'archived',
|
||||||
|
'excludeFromExport',
|
||||||
|
'disableInclusion',
|
||||||
|
'appCss',
|
||||||
|
'appTheme',
|
||||||
|
'hidePromotedAttributes',
|
||||||
|
'readOnly',
|
||||||
|
'autoReadOnlyDisabled',
|
||||||
|
'cssClass',
|
||||||
|
'iconClass',
|
||||||
|
'keyboardShortcut',
|
||||||
|
'run',
|
||||||
|
'runOnInstance',
|
||||||
|
'runAtHour',
|
||||||
|
'customRequestHandler',
|
||||||
|
'customResourceProvider',
|
||||||
|
'widget',
|
||||||
|
'noteInfoWidgetDisabled',
|
||||||
|
'linkMapWidgetDisabled',
|
||||||
|
'noteRevisionsWidgetDisabled',
|
||||||
|
'whatLinksHereWidgetDisabled',
|
||||||
|
'similarNotesWidgetDisabled',
|
||||||
|
'workspace',
|
||||||
|
'workspaceIconClass',
|
||||||
|
'workspaceTabBackgroundColor',
|
||||||
|
'searchHome',
|
||||||
|
'workspaceInbox',
|
||||||
|
'workspaceSearchHome',
|
||||||
|
'sqlConsoleHome',
|
||||||
|
'datePattern',
|
||||||
|
'pageSize',
|
||||||
|
'viewType',
|
||||||
|
'mapRootNoteId',
|
||||||
|
'bookmarkFolder',
|
||||||
|
'sorted',
|
||||||
|
'top',
|
||||||
|
'fullContentWidth',
|
||||||
|
'shareHiddenFromTree',
|
||||||
|
'shareAlias',
|
||||||
|
'shareOmitDefaultCss',
|
||||||
|
'shareRoot',
|
||||||
|
'internalLink',
|
||||||
|
'imageLink',
|
||||||
|
'relationMapLink',
|
||||||
|
'includeMapLink',
|
||||||
|
'runOnNoteCreation',
|
||||||
|
'runOnNoteTitleChange',
|
||||||
|
'runOnNoteContentChange',
|
||||||
|
'runOnNoteChange',
|
||||||
|
'runOnChildNoteCreation',
|
||||||
|
'runOnAttributeCreation',
|
||||||
|
'runOnAttributeChange',
|
||||||
|
'template',
|
||||||
|
'inherit',
|
||||||
|
'widget',
|
||||||
|
'renderNote',
|
||||||
|
'shareCss',
|
||||||
|
'shareJs',
|
||||||
|
'shareFavicon',
|
||||||
|
'executeButton',
|
||||||
|
'keepCurrentHoisting',
|
||||||
|
'color',
|
||||||
|
'toc',
|
||||||
|
'excludeFromNoteMap',
|
||||||
|
'docName',
|
||||||
|
'launcherType',
|
||||||
|
'builtinWidget',
|
||||||
|
'baseSize',
|
||||||
|
'growthFactor'
|
||||||
|
);
|
||||||
|
|
||||||
UPDATE branches SET prefix = 'prefix' WHERE prefix IS NOT NULL AND prefix != 'recovered';
|
UPDATE branches SET prefix = 'prefix' WHERE prefix IS NOT NULL AND prefix != 'recovered';
|
||||||
UPDATE options SET value = 'anonymized' WHERE name IN
|
UPDATE options SET value = 'anonymized' WHERE name IN
|
||||||
('documentId', 'documentSecret', 'encryptedDataKey',
|
('documentId', 'documentSecret', 'encryptedDataKey',
|
||||||
|
|||||||
BIN
db/demo.zip
BIN
db/demo.zip
Binary file not shown.
@@ -1,7 +0,0 @@
|
|||||||
-- "randomize" branchIds so it's clear user should not rely on them
|
|
||||||
UPDATE branches SET branchId = '7LSsI2FnZPW2' WHERE parentNoteId = 'hidden' AND noteId = 'search';
|
|
||||||
UPDATE branches SET branchId = 'wEcmxk4CNC7G' WHERE parentNoteId = 'singles' AND noteId = 'globalnotemap';
|
|
||||||
UPDATE branches SET branchId = '191uVR6Cu6fA' WHERE parentNoteId = 'hidden' AND noteId = 'sqlconsole';
|
|
||||||
UPDATE branches SET branchId = 'OjX5Phxp6A4N' WHERE parentNoteId = 'root' AND noteId = 'hidden';
|
|
||||||
UPDATE branches SET branchId = 'glNBYFYZRH8P' WHERE parentNoteId = 'hidden' AND noteId = 'bulkaction';
|
|
||||||
UPDATE branches SET branchId = 'cAT25wvGMg3K' WHERE parentNoteId = 'root' AND noteId = 'share';
|
|
||||||
6
db/migrations/0198__rename_branchIds.sql
Normal file
6
db/migrations/0198__rename_branchIds.sql
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
UPDATE branches SET branchId = '_hidden__search' WHERE parentNoteId = 'hidden' AND noteId = 'search' AND isDeleted = 0;
|
||||||
|
UPDATE branches SET branchId = 'root__globalNoteMap' WHERE parentNoteId = 'singles' AND noteId = 'globalnotemap' AND isDeleted = 0;
|
||||||
|
UPDATE branches SET branchId = '_hidden__sqlConsole' WHERE parentNoteId = 'hidden' AND noteId = 'sqlconsole' AND isDeleted = 0;
|
||||||
|
UPDATE branches SET branchId = 'root__hidden' WHERE parentNoteId = 'root' AND noteId = 'hidden' AND isDeleted = 0;
|
||||||
|
UPDATE branches SET branchId = '_hidden__bulkAction' WHERE parentNoteId = 'hidden' AND noteId = 'bulkaction' AND isDeleted = 0;
|
||||||
|
UPDATE branches SET branchId = '_hidden__share' WHERE parentNoteId = 'root' AND noteId = 'share' AND isDeleted = 0;
|
||||||
@@ -7,6 +7,6 @@ module.exports = () => {
|
|||||||
beccaLoader.load();
|
beccaLoader.load();
|
||||||
// make sure the hidden subtree exists since the subsequent migrations we will move some existing notes into it (share...)
|
// make sure the hidden subtree exists since the subsequent migrations we will move some existing notes into it (share...)
|
||||||
// in previous releases hidden subtree was created lazily
|
// in previous releases hidden subtree was created lazily
|
||||||
hiddenSubtreeService.checkHiddenSubtree();
|
hiddenSubtreeService.checkHiddenSubtree(true);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
DELETE FROM branches WHERE noteId = '_globalNoteMap' AND parentNoteId != 'singles'; -- make sure there are no clones which would fail at the next line
|
DELETE FROM branches WHERE noteId = '_globalNoteMap' AND parentNoteId != 'singles' AND parentNoteId != '_hidden'; -- make sure there are no clones which would fail at the next line
|
||||||
UPDATE branches SET parentNoteId = '_hidden' WHERE noteId = '_globalNoteMap';
|
UPDATE branches SET parentNoteId = '_hidden' WHERE noteId = '_globalNoteMap';
|
||||||
|
|||||||
@@ -12,5 +12,10 @@ module.exports = () => {
|
|||||||
|
|
||||||
attr.markAsDeleted("0204__migrate_bookmarks_to_clones");
|
attr.markAsDeleted("0204__migrate_bookmarks_to_clones");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bookmarkFolder used to work in 0.57 without the bookmarked label
|
||||||
|
for (const attr of becca.findAttributes('label','bookmarkFolder')) {
|
||||||
|
cloningService.toggleNoteInParent(true, attr.noteId, '_lbBookmarks');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
24
db/migrations/0210__consistency_checks.js
Normal file
24
db/migrations/0210__consistency_checks.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
module.exports = async () => {
|
||||||
|
const cls = require("../../src/services/cls");
|
||||||
|
const beccaLoader = require("../../src/becca/becca_loader");
|
||||||
|
const log = require("../../src/services/log");
|
||||||
|
const consistencyChecks = require("../../src/services/consistency_checks");
|
||||||
|
const noteService = require("../../src/services/notes");
|
||||||
|
|
||||||
|
await cls.init(async () => {
|
||||||
|
// precaution for the 0211 migration
|
||||||
|
noteService.eraseDeletedNotesNow();
|
||||||
|
|
||||||
|
beccaLoader.load();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// precaution before running 211 which might produce unique constraint problems if the DB was not consistent
|
||||||
|
consistencyChecks.runOnDemandChecksWithoutExclusiveLock(true);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
// consistency checks might start failing in the future if there's some incompatible migration down the road
|
||||||
|
// we can optimistically assume the DB is consistent and still continue
|
||||||
|
log.error(`Consistency checks failed in migration 0210: ${e.message} ${e.stack}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
12
db/migrations/0211__rename_branchIds.sql
Normal file
12
db/migrations/0211__rename_branchIds.sql
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
-- case based on isDeleted is needed, otherwise 2 branches (1 deleted, 1 not) might get the same ID
|
||||||
|
UPDATE entity_changes SET entityId = COALESCE((
|
||||||
|
SELECT
|
||||||
|
CASE isDeleted
|
||||||
|
WHEN 0 THEN parentNoteId || '_' || noteId
|
||||||
|
WHEN 1 THEN branchId
|
||||||
|
END
|
||||||
|
FROM branches WHERE branchId = entityId
|
||||||
|
), entityId)
|
||||||
|
WHERE entityName = 'branches' AND isErased = 0;
|
||||||
|
|
||||||
|
UPDATE branches SET branchId = parentNoteId || '_' || noteId WHERE isDeleted = 0;
|
||||||
21
db/migrations/0212__delete_all_attributes_of_named_notes.js
Normal file
21
db/migrations/0212__delete_all_attributes_of_named_notes.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
module.exports = () => {
|
||||||
|
const cls = require("../../src/services/cls");
|
||||||
|
const beccaLoader = require("../../src/becca/becca_loader");
|
||||||
|
const becca = require("../../src/becca/becca");
|
||||||
|
|
||||||
|
cls.init(() => {
|
||||||
|
beccaLoader.load();
|
||||||
|
|
||||||
|
const hidden = becca.getNote("_hidden");
|
||||||
|
|
||||||
|
for (const noteId of hidden.getSubtreeNoteIds({includeHidden: true})) {
|
||||||
|
if (noteId.startsWith("_")) { // is "named" note
|
||||||
|
const note = becca.getNote(noteId);
|
||||||
|
|
||||||
|
for (const attr of note.getOwnedAttributes()) {
|
||||||
|
attr.markAsDeleted("0212__delete_all_attributes_of_named_notes");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
48
db/migrations/0213__migrate_scripts.js
Normal file
48
db/migrations/0213__migrate_scripts.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
module.exports = () => {
|
||||||
|
const beccaLoader = require("../../src/becca/becca_loader");
|
||||||
|
const becca = require("../../src/becca/becca");
|
||||||
|
const cls = require("../../src/services/cls");
|
||||||
|
const log = require("../../src/services/log");
|
||||||
|
|
||||||
|
cls.init(() => {
|
||||||
|
beccaLoader.load();
|
||||||
|
|
||||||
|
for (const note of Object.values(becca.notes)) {
|
||||||
|
try {
|
||||||
|
if (!note.isJavaScript()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!note.mime?.endsWith('env=frontend') && !note.mime?.endsWith('env=backend')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const origContent = note.getContent().toString();
|
||||||
|
const fixedContent = origContent
|
||||||
|
.replaceAll("runOnServer", "runOnBackend")
|
||||||
|
.replaceAll("api.refreshTree()", "")
|
||||||
|
.replaceAll("addTextToActiveTabEditor", "addTextToActiveContextEditor")
|
||||||
|
.replaceAll("getActiveTabNote", "getActiveContextNote")
|
||||||
|
.replaceAll("getActiveTabTextEditor", "getActiveContextTextEditor")
|
||||||
|
.replaceAll("getActiveTabNotePath", "getActiveContextNotePath")
|
||||||
|
.replaceAll("getDateNote", "getDayNote")
|
||||||
|
.replaceAll("utils.unescapeHtml", "unescapeHtml")
|
||||||
|
.replaceAll("sortNotesByTitle", "sortNotes")
|
||||||
|
.replaceAll("CollapsibleWidget", "RightPanelWidget")
|
||||||
|
.replaceAll("TabAwareWidget", "NoteContextAwareWidget")
|
||||||
|
.replaceAll("TabCachingWidget", "NoteContextAwareWidget")
|
||||||
|
.replaceAll("NoteContextCachingWidget", "NoteContextAwareWidget");
|
||||||
|
|
||||||
|
if (origContent !== fixedContent) {
|
||||||
|
log.info(`Replacing legacy API calls for note '${note.noteId}'`);
|
||||||
|
|
||||||
|
note.saveNoteRevision();
|
||||||
|
note.setContent(fixedContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
log.error(`Error during migration to 213 for note '${note.noteId}': ${e.message} ${e.stack}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
27
docker_healthcheck.js
Executable file
27
docker_healthcheck.js
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
const http = require("http");
|
||||||
|
const config = require("./src/services/config");
|
||||||
|
|
||||||
|
if (config.https) {
|
||||||
|
// built-in TLS (terminated by trilium) is not supported yet, PRs are welcome
|
||||||
|
// for reverse proxy terminated TLS this will works since config.https will be false
|
||||||
|
process.exit(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const port = require('./src/services/port');
|
||||||
|
const host = require('./src/services/host');
|
||||||
|
const url = `http://${host}:${port}/api/health-check`;
|
||||||
|
const options = { timeout: 2000 };
|
||||||
|
const request = http.request(url, options, res => {
|
||||||
|
console.log(`STATUS: ${res.statusCode}`);
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
process.exit(0);
|
||||||
|
} else {
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
request.on("error", err => {
|
||||||
|
console.log("ERROR");
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
request.end();
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Class: AbstractEntity</title>
|
<title>JSDoc: Class: AbstractBeccaEntity</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Class: AbstractEntity</h1>
|
<h1 class="page-title">Class: AbstractBeccaEntity</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>AbstractEntity<span class="signature">()</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>AbstractBeccaEntity<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">Base class for all backend entities.</div>
|
<div class="class-description">Base class for all backend entities.</div>
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="AbstractEntity"><span class="type-signature"></span>new AbstractEntity<span class="signature">()</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="AbstractBeccaEntity"><span class="type-signature"></span>new AbstractBeccaEntity<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line16">line 16</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line16">line 16</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line50">line 50</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line53">line 53</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line59">line 59</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line62">line 62</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line18">line 18</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line18">line 18</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -427,7 +427,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line30">line 30</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line30">line 30</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -511,7 +511,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line23">line 23</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line23">line 23</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -595,7 +595,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line71">line 71</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line74">line 74</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -679,7 +679,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line45">line 45</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line45">line 45</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -833,7 +833,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line125">line 125</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line128">line 128</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -869,7 +869,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {<a href="AbstractEntity.html">AbstractEntity</a>}</span></h4>
|
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {this}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -921,7 +921,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line80">line 80</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line83">line 83</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -957,7 +957,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
<span class="param-type">this</span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -985,13 +985,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Class: Attribute</title>
|
<title>JSDoc: Class: BAttribute</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Class: Attribute</h1>
|
<h1 class="page-title">Class: BAttribute</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>Attribute<span class="signature">()</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>BAttribute<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">Attribute is an abstract concept which has two real uses - label (key - value pair)
|
<div class="class-description">Attribute is an abstract concept which has two real uses - label (key - value pair)
|
||||||
and relation (representing named relationship between source and target note)</div>
|
and relation (representing named relationship between source and target note)</div>
|
||||||
@@ -46,7 +46,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="Attribute"><span class="type-signature"></span>new Attribute<span class="signature">()</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="BAttribute"><span class="type-signature"></span>new BAttribute<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line16">line 16</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line16">line 16</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line47">line 47</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line47">line 47</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -245,7 +245,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#becca">AbstractEntity#becca</a>
|
<a href="AbstractBeccaEntity.html#becca">AbstractBeccaEntity#becca</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -268,7 +268,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line50">line 50</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line53">line 53</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line59">line 59</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line59">line 59</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line53">line 53</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line53">line 53</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -472,7 +472,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line49">line 49</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line49">line 49</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -540,7 +540,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line55">line 55</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line55">line 55</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -608,7 +608,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line51">line 51</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line51">line 51</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -676,7 +676,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line61">line 61</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line61">line 61</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -744,7 +744,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line57">line 57</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line57">line 57</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -802,7 +802,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#addEntityChange">AbstractEntity#addEntityChange</a>
|
<a href="AbstractBeccaEntity.html#addEntityChange">AbstractBeccaEntity#addEntityChange</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -825,7 +825,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line59">line 59</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line62">line 62</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -891,7 +891,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#beforeSaving">AbstractEntity#beforeSaving</a>
|
<a href="AbstractBeccaEntity.html#beforeSaving">AbstractBeccaEntity#beforeSaving</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -914,7 +914,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line18">line 18</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line18">line 18</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -980,7 +980,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateHash">AbstractEntity#generateHash</a>
|
<a href="AbstractBeccaEntity.html#generateHash">AbstractBeccaEntity#generateHash</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1003,7 +1003,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line30">line 30</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line30">line 30</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1069,7 +1069,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateIdIfNecessary">AbstractEntity#generateIdIfNecessary</a>
|
<a href="AbstractBeccaEntity.html#generateIdIfNecessary">AbstractBeccaEntity#generateIdIfNecessary</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1092,7 +1092,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line23">line 23</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line23">line 23</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1128,7 +1128,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">()</span><span class="type-signature"> → {<a href="Note.html">Note</a>|null}</span></h4>
|
<h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">()</span><span class="type-signature"> → {<a href="BNote.html">BNote</a>|null}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1176,7 +1176,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line129">line 129</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line129">line 129</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1212,7 +1212,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="Note.html">Note</a></span>
|
<span class="param-type"><a href="BNote.html">BNote</a></span>
|
||||||
|
|
|
|
||||||
|
|
||||||
<span class="param-type">null</span>
|
<span class="param-type">null</span>
|
||||||
@@ -1263,7 +1263,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getPojoToSave">AbstractEntity#getPojoToSave</a>
|
<a href="AbstractBeccaEntity.html#getPojoToSave">AbstractBeccaEntity#getPojoToSave</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1286,7 +1286,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line71">line 71</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line74">line 74</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1322,7 +1322,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="getTargetNote"><span class="type-signature"></span>getTargetNote<span class="signature">()</span><span class="type-signature"> → {<a href="Note.html">Note</a>|null}</span></h4>
|
<h4 class="name" id="getTargetNote"><span class="type-signature"></span>getTargetNote<span class="signature">()</span><span class="type-signature"> → {<a href="BNote.html">BNote</a>|null}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1370,7 +1370,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line142">line 142</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line142">line 142</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1406,7 +1406,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="Note.html">Note</a></span>
|
<span class="param-type"><a href="BNote.html">BNote</a></span>
|
||||||
|
|
|
|
||||||
|
|
||||||
<span class="param-type">null</span>
|
<span class="param-type">null</span>
|
||||||
@@ -1457,7 +1457,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getUtcDateChanged">AbstractEntity#getUtcDateChanged</a>
|
<a href="AbstractBeccaEntity.html#getUtcDateChanged">AbstractBeccaEntity#getUtcDateChanged</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1480,7 +1480,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line45">line 45</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line45">line 45</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1564,7 +1564,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_attribute.js.html">becca/entities/attribute.js</a>, <a href="becca_entities_attribute.js.html#line157">line 157</a>
|
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line157">line 157</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1718,7 +1718,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#markAsDeleted">AbstractEntity#markAsDeleted</a>
|
<a href="AbstractBeccaEntity.html#markAsDeleted">AbstractBeccaEntity#markAsDeleted</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1741,7 +1741,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line125">line 125</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line128">line 128</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1777,7 +1777,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {<a href="AbstractEntity.html">AbstractEntity</a>}</span></h4>
|
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {this}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1811,7 +1811,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#save">AbstractEntity#save</a>
|
<a href="AbstractBeccaEntity.html#save">AbstractBeccaEntity#save</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1834,7 +1834,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line80">line 80</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line83">line 83</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1870,7 +1870,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
<span class="param-type">this</span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1898,13 +1898,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Class: Branch</title>
|
<title>JSDoc: Class: BBranch</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Class: Branch</h1>
|
<h1 class="page-title">Class: BBranch</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>Branch<span class="signature">()</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>BBranch<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
<div class="class-description">Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
||||||
parents.
|
parents.
|
||||||
@@ -49,7 +49,7 @@ Always check noteId instead.</div>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="Branch"><span class="type-signature"></span>new Branch<span class="signature">()</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="BBranch"><span class="type-signature"></span>new BBranch<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ Always check noteId instead.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line20">line 20</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line20">line 20</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ Always check noteId instead.</div>
|
|||||||
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ Always check noteId instead.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#becca">AbstractEntity#becca</a>
|
<a href="AbstractBeccaEntity.html#becca">AbstractBeccaEntity#becca</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ Always check noteId instead.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line50">line 50</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line53">line 53</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ Always check noteId instead.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line51">line 51</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line51">line 51</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -329,7 +329,7 @@ Always check noteId instead.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line97">line 97</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line97">line 97</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -397,7 +397,7 @@ Always check noteId instead.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line61">line 61</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line61">line 61</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -463,7 +463,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line133">line 133</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line133">line 133</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -531,7 +531,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line53">line 53</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line53">line 53</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -599,7 +599,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line59">line 59</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line59">line 59</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -657,7 +657,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line111">line 111</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line111">line 111</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -725,7 +725,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line55">line 55</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line55">line 55</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -743,7 +743,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="prefix"><span class="type-signature"></span>prefix<span class="type-signature"> :string</span></h4>
|
<h4 class="name" id="prefix"><span class="type-signature"></span>prefix<span class="type-signature"> :string|null</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -755,6 +755,9 @@ of deletion should not act as a clone.
|
|||||||
<li>
|
<li>
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
<span class="param-type">string</span>
|
||||||
|
|
|
||||||
|
|
||||||
|
<span class="param-type">null</span>
|
||||||
|
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
@@ -793,7 +796,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line57">line 57</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line57">line 57</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -861,7 +864,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line63">line 63</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line63">line 63</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -919,7 +922,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#addEntityChange">AbstractEntity#addEntityChange</a>
|
<a href="AbstractBeccaEntity.html#addEntityChange">AbstractBeccaEntity#addEntityChange</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -942,7 +945,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line59">line 59</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line62">line 62</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1008,7 +1011,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#beforeSaving">AbstractEntity#beforeSaving</a>
|
<a href="AbstractBeccaEntity.html#beforeSaving">AbstractBeccaEntity#beforeSaving</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1031,7 +1034,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line18">line 18</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line18">line 18</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1213,7 +1216,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line145">line 145</a>
|
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line145">line 145</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1301,7 +1304,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateHash">AbstractEntity#generateHash</a>
|
<a href="AbstractBeccaEntity.html#generateHash">AbstractBeccaEntity#generateHash</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1324,7 +1327,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line30">line 30</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line30">line 30</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1390,7 +1393,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateIdIfNecessary">AbstractEntity#generateIdIfNecessary</a>
|
<a href="AbstractBeccaEntity.html#generateIdIfNecessary">AbstractBeccaEntity#generateIdIfNecessary</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1413,7 +1416,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line23">line 23</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line23">line 23</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1479,7 +1482,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getPojoToSave">AbstractEntity#getPojoToSave</a>
|
<a href="AbstractBeccaEntity.html#getPojoToSave">AbstractBeccaEntity#getPojoToSave</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1502,7 +1505,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line71">line 71</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line74">line 74</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1568,7 +1571,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getUtcDateChanged">AbstractEntity#getUtcDateChanged</a>
|
<a href="AbstractBeccaEntity.html#getUtcDateChanged">AbstractBeccaEntity#getUtcDateChanged</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1591,7 +1594,7 @@ of deletion should not act as a clone.
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line45">line 45</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line45">line 45</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1727,7 +1730,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#markAsDeleted">AbstractEntity#markAsDeleted</a>
|
<a href="AbstractBeccaEntity.html#markAsDeleted">AbstractBeccaEntity#markAsDeleted</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1750,7 +1753,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line125">line 125</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line128">line 128</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1786,7 +1789,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {<a href="AbstractEntity.html">AbstractEntity</a>}</span></h4>
|
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {this}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1820,7 +1823,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#save">AbstractEntity#save</a>
|
<a href="AbstractBeccaEntity.html#save">AbstractBeccaEntity#save</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1843,7 +1846,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line80">line 80</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line83">line 83</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1879,7 +1882,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
<span class="param-type">this</span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1907,13 +1910,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Class: EtapiToken</title>
|
<title>JSDoc: Class: BEtapiToken</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Class: EtapiToken</h1>
|
<h1 class="page-title">Class: BEtapiToken</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>EtapiToken<span class="signature">()</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>BEtapiToken<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications.
|
<div class="class-description">EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications.
|
||||||
Used by:
|
Used by:
|
||||||
@@ -51,7 +51,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="EtapiToken"><span class="type-signature"></span>new EtapiToken<span class="signature">()</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="BEtapiToken"><span class="type-signature"></span>new BEtapiToken<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_etapi_token.js.html">becca/entities/etapi_token.js</a>, <a href="becca_entities_etapi_token.js.html#line17">line 17</a>
|
<a href="becca_entities_betapi_token.js.html">becca/entities/betapi_token.js</a>, <a href="becca_entities_betapi_token.js.html#line17">line 17</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#becca">AbstractEntity#becca</a>
|
<a href="AbstractBeccaEntity.html#becca">AbstractBeccaEntity#becca</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line50">line 50</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line53">line 53</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_etapi_token.js.html">becca/entities/etapi_token.js</a>, <a href="becca_entities_etapi_token.js.html#line35">line 35</a>
|
<a href="becca_entities_betapi_token.js.html">becca/entities/betapi_token.js</a>, <a href="becca_entities_betapi_token.js.html#line35">line 35</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -341,7 +341,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_etapi_token.js.html">becca/entities/etapi_token.js</a>, <a href="becca_entities_etapi_token.js.html#line45">line 45</a>
|
<a href="becca_entities_betapi_token.js.html">becca/entities/betapi_token.js</a>, <a href="becca_entities_betapi_token.js.html#line45">line 45</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -409,7 +409,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_etapi_token.js.html">becca/entities/etapi_token.js</a>, <a href="becca_entities_etapi_token.js.html#line37">line 37</a>
|
<a href="becca_entities_betapi_token.js.html">becca/entities/betapi_token.js</a>, <a href="becca_entities_betapi_token.js.html#line37">line 37</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -477,7 +477,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_etapi_token.js.html">becca/entities/etapi_token.js</a>, <a href="becca_entities_etapi_token.js.html#line39">line 39</a>
|
<a href="becca_entities_betapi_token.js.html">becca/entities/betapi_token.js</a>, <a href="becca_entities_betapi_token.js.html#line39">line 39</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -545,7 +545,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_etapi_token.js.html">becca/entities/etapi_token.js</a>, <a href="becca_entities_etapi_token.js.html#line41">line 41</a>
|
<a href="becca_entities_betapi_token.js.html">becca/entities/betapi_token.js</a>, <a href="becca_entities_betapi_token.js.html#line41">line 41</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -613,7 +613,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_etapi_token.js.html">becca/entities/etapi_token.js</a>, <a href="becca_entities_etapi_token.js.html#line43">line 43</a>
|
<a href="becca_entities_betapi_token.js.html">becca/entities/betapi_token.js</a>, <a href="becca_entities_betapi_token.js.html#line43">line 43</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -671,7 +671,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#addEntityChange">AbstractEntity#addEntityChange</a>
|
<a href="AbstractBeccaEntity.html#addEntityChange">AbstractBeccaEntity#addEntityChange</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -694,7 +694,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line59">line 59</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line62">line 62</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -760,7 +760,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#beforeSaving">AbstractEntity#beforeSaving</a>
|
<a href="AbstractBeccaEntity.html#beforeSaving">AbstractBeccaEntity#beforeSaving</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -783,7 +783,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line18">line 18</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line18">line 18</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -849,7 +849,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateHash">AbstractEntity#generateHash</a>
|
<a href="AbstractBeccaEntity.html#generateHash">AbstractBeccaEntity#generateHash</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -872,7 +872,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line30">line 30</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line30">line 30</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -938,7 +938,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateIdIfNecessary">AbstractEntity#generateIdIfNecessary</a>
|
<a href="AbstractBeccaEntity.html#generateIdIfNecessary">AbstractBeccaEntity#generateIdIfNecessary</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -961,7 +961,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line23">line 23</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line23">line 23</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1027,7 +1027,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getPojoToSave">AbstractEntity#getPojoToSave</a>
|
<a href="AbstractBeccaEntity.html#getPojoToSave">AbstractBeccaEntity#getPojoToSave</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1050,7 +1050,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line71">line 71</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line74">line 74</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1116,7 +1116,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getUtcDateChanged">AbstractEntity#getUtcDateChanged</a>
|
<a href="AbstractBeccaEntity.html#getUtcDateChanged">AbstractBeccaEntity#getUtcDateChanged</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1139,7 +1139,7 @@ from tokenHash and token.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line45">line 45</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line45">line 45</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1275,7 +1275,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#markAsDeleted">AbstractEntity#markAsDeleted</a>
|
<a href="AbstractBeccaEntity.html#markAsDeleted">AbstractBeccaEntity#markAsDeleted</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1298,7 +1298,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line125">line 125</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line128">line 128</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1334,7 +1334,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {<a href="AbstractEntity.html">AbstractEntity</a>}</span></h4>
|
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {this}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1368,7 +1368,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#save">AbstractEntity#save</a>
|
<a href="AbstractBeccaEntity.html#save">AbstractBeccaEntity#save</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1391,7 +1391,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line80">line 80</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line83">line 83</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1427,7 +1427,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
<span class="param-type">this</span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1455,13 +1455,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Class: NoteRevision</title>
|
<title>JSDoc: Class: BNoteRevision</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Class: NoteRevision</h1>
|
<h1 class="page-title">Class: BNoteRevision</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>NoteRevision<span class="signature">()</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>BNoteRevision<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">NoteRevision represents snapshot of note's title and content at some point in the past.
|
<div class="class-description">NoteRevision represents snapshot of note's title and content at some point in the past.
|
||||||
It's used for seamless note versioning.</div>
|
It's used for seamless note versioning.</div>
|
||||||
@@ -46,7 +46,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="NoteRevision"><span class="type-signature"></span>new NoteRevision<span class="signature">()</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="BNoteRevision"><span class="type-signature"></span>new BNoteRevision<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line17">line 17</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line17">line 17</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#becca">AbstractEntity#becca</a>
|
<a href="AbstractBeccaEntity.html#becca">AbstractBeccaEntity#becca</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line50">line 50</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line53">line 53</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -268,7 +268,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line48">line 48</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line48">line 48</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line40">line 40</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line40">line 40</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line38">line 38</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line38">line 38</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -472,7 +472,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line34">line 34</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line34">line 34</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -540,7 +540,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line32">line 32</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line32">line 32</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -608,7 +608,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line28">line 28</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line28">line 28</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -676,7 +676,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line26">line 26</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line26">line 26</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -744,7 +744,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line36">line 36</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line36">line 36</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -812,7 +812,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line30">line 30</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line30">line 30</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -880,7 +880,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line44">line 44</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line44">line 44</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -948,7 +948,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line42">line 42</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line42">line 42</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1016,7 +1016,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line46">line 46</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line46">line 46</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1074,7 +1074,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#addEntityChange">AbstractEntity#addEntityChange</a>
|
<a href="AbstractBeccaEntity.html#addEntityChange">AbstractBeccaEntity#addEntityChange</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1097,7 +1097,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line59">line 59</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line62">line 62</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1163,7 +1163,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#beforeSaving">AbstractEntity#beforeSaving</a>
|
<a href="AbstractBeccaEntity.html#beforeSaving">AbstractBeccaEntity#beforeSaving</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1186,7 +1186,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line18">line 18</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line18">line 18</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1252,7 +1252,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateHash">AbstractEntity#generateHash</a>
|
<a href="AbstractBeccaEntity.html#generateHash">AbstractBeccaEntity#generateHash</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1275,7 +1275,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line30">line 30</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line30">line 30</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1341,7 +1341,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateIdIfNecessary">AbstractEntity#generateIdIfNecessary</a>
|
<a href="AbstractBeccaEntity.html#generateIdIfNecessary">AbstractBeccaEntity#generateIdIfNecessary</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1364,7 +1364,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line23">line 23</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line23">line 23</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1448,7 +1448,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line76">line 76</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line76">line 76</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1550,7 +1550,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line140">line 140</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line140">line 140</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1634,7 +1634,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getPojoToSave">AbstractEntity#getPojoToSave</a>
|
<a href="AbstractBeccaEntity.html#getPojoToSave">AbstractBeccaEntity#getPojoToSave</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1657,7 +1657,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line71">line 71</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line74">line 74</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1723,7 +1723,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getUtcDateChanged">AbstractEntity#getUtcDateChanged</a>
|
<a href="AbstractBeccaEntity.html#getUtcDateChanged">AbstractBeccaEntity#getUtcDateChanged</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1746,7 +1746,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line45">line 45</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line45">line 45</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1830,7 +1830,7 @@ It's used for seamless note versioning.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_note_revision.js.html">becca/entities/note_revision.js</a>, <a href="becca_entities_note_revision.js.html#line62">line 62</a>
|
<a href="becca_entities_bnote_revision.js.html">becca/entities/bnote_revision.js</a>, <a href="becca_entities_bnote_revision.js.html#line62">line 62</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1988,7 +1988,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#markAsDeleted">AbstractEntity#markAsDeleted</a>
|
<a href="AbstractBeccaEntity.html#markAsDeleted">AbstractBeccaEntity#markAsDeleted</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -2011,7 +2011,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line125">line 125</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line128">line 128</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -2047,7 +2047,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {<a href="AbstractEntity.html">AbstractEntity</a>}</span></h4>
|
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {this}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2081,7 +2081,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#save">AbstractEntity#save</a>
|
<a href="AbstractBeccaEntity.html#save">AbstractBeccaEntity#save</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -2104,7 +2104,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line80">line 80</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line83">line 83</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -2140,7 +2140,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
<span class="param-type">this</span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -2168,13 +2168,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Class: Option</title>
|
<title>JSDoc: Class: BOption</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Class: Option</h1>
|
<h1 class="page-title">Class: BOption</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>Option<span class="signature">()</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>BOption<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">Option represents name-value pair, either directly configurable by the user or some system property.</div>
|
<div class="class-description">Option represents name-value pair, either directly configurable by the user or some system property.</div>
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="Option"><span class="type-signature"></span>new Option<span class="signature">()</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="BOption"><span class="type-signature"></span>new BOption<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_option.js.html">becca/entities/option.js</a>, <a href="becca_entities_option.js.html#line11">line 11</a>
|
<a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line11">line 11</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#becca">AbstractEntity#becca</a>
|
<a href="AbstractBeccaEntity.html#becca">AbstractBeccaEntity#becca</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line50">line 50</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line53">line 53</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -267,7 +267,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_option.js.html">becca/entities/option.js</a>, <a href="becca_entities_option.js.html#line24">line 24</a>
|
<a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line24">line 24</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -335,7 +335,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_option.js.html">becca/entities/option.js</a>, <a href="becca_entities_option.js.html#line20">line 20</a>
|
<a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line20">line 20</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -403,7 +403,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_option.js.html">becca/entities/option.js</a>, <a href="becca_entities_option.js.html#line26">line 26</a>
|
<a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line26">line 26</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -471,7 +471,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_option.js.html">becca/entities/option.js</a>, <a href="becca_entities_option.js.html#line22">line 22</a>
|
<a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line22">line 22</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -529,7 +529,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#addEntityChange">AbstractEntity#addEntityChange</a>
|
<a href="AbstractBeccaEntity.html#addEntityChange">AbstractBeccaEntity#addEntityChange</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -552,7 +552,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line59">line 59</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line62">line 62</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -618,7 +618,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#beforeSaving">AbstractEntity#beforeSaving</a>
|
<a href="AbstractBeccaEntity.html#beforeSaving">AbstractBeccaEntity#beforeSaving</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -641,7 +641,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line18">line 18</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line18">line 18</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -707,7 +707,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateHash">AbstractEntity#generateHash</a>
|
<a href="AbstractBeccaEntity.html#generateHash">AbstractBeccaEntity#generateHash</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -730,7 +730,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line30">line 30</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line30">line 30</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -796,7 +796,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateIdIfNecessary">AbstractEntity#generateIdIfNecessary</a>
|
<a href="AbstractBeccaEntity.html#generateIdIfNecessary">AbstractBeccaEntity#generateIdIfNecessary</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -819,7 +819,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line23">line 23</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line23">line 23</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -885,7 +885,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getPojoToSave">AbstractEntity#getPojoToSave</a>
|
<a href="AbstractBeccaEntity.html#getPojoToSave">AbstractBeccaEntity#getPojoToSave</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -908,7 +908,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line71">line 71</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line74">line 74</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -974,7 +974,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getUtcDateChanged">AbstractEntity#getUtcDateChanged</a>
|
<a href="AbstractBeccaEntity.html#getUtcDateChanged">AbstractBeccaEntity#getUtcDateChanged</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -997,7 +997,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line45">line 45</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line45">line 45</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1133,7 +1133,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#markAsDeleted">AbstractEntity#markAsDeleted</a>
|
<a href="AbstractBeccaEntity.html#markAsDeleted">AbstractBeccaEntity#markAsDeleted</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1156,7 +1156,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line125">line 125</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line128">line 128</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1192,7 +1192,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {<a href="AbstractEntity.html">AbstractEntity</a>}</span></h4>
|
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {this}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1226,7 +1226,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#save">AbstractEntity#save</a>
|
<a href="AbstractBeccaEntity.html#save">AbstractBeccaEntity#save</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1249,7 +1249,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line80">line 80</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line83">line 83</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1285,7 +1285,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
<span class="param-type">this</span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1313,13 +1313,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Class: RecentNote</title>
|
<title>JSDoc: Class: BRecentNote</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Class: RecentNote</h1>
|
<h1 class="page-title">Class: BRecentNote</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>RecentNote<span class="signature">()</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>BRecentNote<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">RecentNote represents recently visited note.</div>
|
<div class="class-description">RecentNote represents recently visited note.</div>
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="RecentNote"><span class="type-signature"></span>new RecentNote<span class="signature">()</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="BRecentNote"><span class="type-signature"></span>new BRecentNote<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_recent_note.js.html">becca/entities/recent_note.js</a>, <a href="becca_entities_recent_note.js.html#line11">line 11</a>
|
<a href="becca_entities_brecent_note.js.html">becca/entities/brecent_note.js</a>, <a href="becca_entities_brecent_note.js.html#line11">line 11</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#becca">AbstractEntity#becca</a>
|
<a href="AbstractBeccaEntity.html#becca">AbstractBeccaEntity#becca</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line50">line 50</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line53">line 53</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -267,7 +267,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_recent_note.js.html">becca/entities/recent_note.js</a>, <a href="becca_entities_recent_note.js.html#line19">line 19</a>
|
<a href="becca_entities_brecent_note.js.html">becca/entities/brecent_note.js</a>, <a href="becca_entities_brecent_note.js.html#line19">line 19</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -335,7 +335,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_recent_note.js.html">becca/entities/recent_note.js</a>, <a href="becca_entities_recent_note.js.html#line21">line 21</a>
|
<a href="becca_entities_brecent_note.js.html">becca/entities/brecent_note.js</a>, <a href="becca_entities_brecent_note.js.html#line21">line 21</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -403,7 +403,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_recent_note.js.html">becca/entities/recent_note.js</a>, <a href="becca_entities_recent_note.js.html#line23">line 23</a>
|
<a href="becca_entities_brecent_note.js.html">becca/entities/brecent_note.js</a>, <a href="becca_entities_brecent_note.js.html#line23">line 23</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -461,7 +461,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#addEntityChange">AbstractEntity#addEntityChange</a>
|
<a href="AbstractBeccaEntity.html#addEntityChange">AbstractBeccaEntity#addEntityChange</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -484,7 +484,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line59">line 59</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line62">line 62</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -550,7 +550,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#beforeSaving">AbstractEntity#beforeSaving</a>
|
<a href="AbstractBeccaEntity.html#beforeSaving">AbstractBeccaEntity#beforeSaving</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -573,7 +573,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line18">line 18</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line18">line 18</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -639,7 +639,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateHash">AbstractEntity#generateHash</a>
|
<a href="AbstractBeccaEntity.html#generateHash">AbstractBeccaEntity#generateHash</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -662,7 +662,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line30">line 30</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line30">line 30</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -728,7 +728,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#generateIdIfNecessary">AbstractEntity#generateIdIfNecessary</a>
|
<a href="AbstractBeccaEntity.html#generateIdIfNecessary">AbstractBeccaEntity#generateIdIfNecessary</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -751,7 +751,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line23">line 23</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line23">line 23</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -817,7 +817,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getPojoToSave">AbstractEntity#getPojoToSave</a>
|
<a href="AbstractBeccaEntity.html#getPojoToSave">AbstractBeccaEntity#getPojoToSave</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -840,7 +840,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line71">line 71</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line74">line 74</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -906,7 +906,7 @@
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#getUtcDateChanged">AbstractEntity#getUtcDateChanged</a>
|
<a href="AbstractBeccaEntity.html#getUtcDateChanged">AbstractBeccaEntity#getUtcDateChanged</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -929,7 +929,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line45">line 45</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line45">line 45</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1065,7 +1065,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#markAsDeleted">AbstractEntity#markAsDeleted</a>
|
<a href="AbstractBeccaEntity.html#markAsDeleted">AbstractBeccaEntity#markAsDeleted</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1088,7 +1088,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line125">line 125</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line128">line 128</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1124,7 +1124,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {<a href="AbstractEntity.html">AbstractEntity</a>}</span></h4>
|
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> → {this}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1158,7 +1158,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-overrides">Overrides:</dt>
|
<dt class="tag-overrides">Overrides:</dt>
|
||||||
<dd class="tag-overrides"><ul class="dummy"><li>
|
<dd class="tag-overrides"><ul class="dummy"><li>
|
||||||
<a href="AbstractEntity.html#save">AbstractEntity#save</a>
|
<a href="AbstractBeccaEntity.html#save">AbstractBeccaEntity#save</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1181,7 +1181,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="becca_entities_abstract_entity.js.html">becca/entities/abstract_entity.js</a>, <a href="becca_entities_abstract_entity.js.html#line80">line 80</a>
|
<a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line83">line 83</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1217,7 +1217,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
<span class="param-type">this</span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1245,13 +1245,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: becca/entities/abstract_entity.js</title>
|
<title>JSDoc: Source: becca/entities/abstract_becca_entity.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: becca/entities/abstract_entity.js</h1>
|
<h1 class="page-title">Source: becca/entities/abstract_becca_entity.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ let becca = null;
|
|||||||
/**
|
/**
|
||||||
* Base class for all backend entities.
|
* Base class for all backend entities.
|
||||||
*/
|
*/
|
||||||
class AbstractEntity {
|
class AbstractBeccaEntity {
|
||||||
/** @protected */
|
/** @protected */
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
this.generateIdIfNecessary();
|
this.generateIdIfNecessary();
|
||||||
@@ -74,7 +74,10 @@ class AbstractEntity {
|
|||||||
return this.utcDateModified || this.utcDateCreated;
|
return this.utcDateModified || this.utcDateCreated;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @protected */
|
/**
|
||||||
|
* @protected
|
||||||
|
* @returns {Becca}
|
||||||
|
*/
|
||||||
get becca() {
|
get becca() {
|
||||||
if (!becca) {
|
if (!becca) {
|
||||||
becca = require('../becca');
|
becca = require('../becca');
|
||||||
@@ -103,16 +106,16 @@ class AbstractEntity {
|
|||||||
/**
|
/**
|
||||||
* Saves entity - executes SQL, but doesn't commit the transaction on its own
|
* Saves entity - executes SQL, but doesn't commit the transaction on its own
|
||||||
*
|
*
|
||||||
* @returns {AbstractEntity}
|
* @returns {this}
|
||||||
*/
|
*/
|
||||||
save() {
|
save(opts = {}) {
|
||||||
const entityName = this.constructor.entityName;
|
const entityName = this.constructor.entityName;
|
||||||
const primaryKeyName = this.constructor.primaryKeyName;
|
const primaryKeyName = this.constructor.primaryKeyName;
|
||||||
|
|
||||||
const isNewEntity = !this[primaryKeyName];
|
const isNewEntity = !this[primaryKeyName];
|
||||||
|
|
||||||
if (this.beforeSaving) {
|
if (this.beforeSaving) {
|
||||||
this.beforeSaving();
|
this.beforeSaving(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pojo = this.getPojoToSave();
|
const pojo = this.getPojoToSave();
|
||||||
@@ -192,7 +195,7 @@ class AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = AbstractEntity;
|
module.exports = AbstractBeccaEntity;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -203,13 +206,13 @@ module.exports = AbstractEntity;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: becca/entities/attribute.js</title>
|
<title>JSDoc: Source: becca/entities/battribute.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: becca/entities/attribute.js</h1>
|
<h1 class="page-title">Source: becca/entities/battribute.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
<article>
|
<article>
|
||||||
<pre class="prettyprint source linenums"><code>"use strict";
|
<pre class="prettyprint source linenums"><code>"use strict";
|
||||||
|
|
||||||
const Note = require('./note');
|
const BNote = require('./bnote');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
const sql = require("../../services/sql");
|
const sql = require("../../services/sql");
|
||||||
const dateUtils = require("../../services/date_utils");
|
const dateUtils = require("../../services/date_utils");
|
||||||
const promotedAttributeDefinitionParser = require("../../services/promoted_attribute_definition_parser");
|
const promotedAttributeDefinitionParser = require("../../services/promoted_attribute_definition_parser");
|
||||||
@@ -39,9 +39,9 @@ const {sanitizeAttributeName} = require("../../services/sanitize_attribute_name"
|
|||||||
* Attribute is an abstract concept which has two real uses - label (key - value pair)
|
* Attribute is an abstract concept which has two real uses - label (key - value pair)
|
||||||
* and relation (representing named relationship between source and target note)
|
* and relation (representing named relationship between source and target note)
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class Attribute extends AbstractEntity {
|
class BAttribute extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "attributes"; }
|
static get entityName() { return "attributes"; }
|
||||||
static get primaryKeyName() { return "attributeId"; }
|
static get primaryKeyName() { return "attributeId"; }
|
||||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable"]; }
|
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable"]; }
|
||||||
@@ -98,7 +98,7 @@ class Attribute extends AbstractEntity {
|
|||||||
|
|
||||||
if (!(this.noteId in this.becca.notes)) {
|
if (!(this.noteId in this.becca.notes)) {
|
||||||
// entities can come out of order in sync, create skeleton which will be filled later
|
// entities can come out of order in sync, create skeleton which will be filled later
|
||||||
this.becca.addNote(this.noteId, new Note({noteId: this.noteId}));
|
this.becca.addNote(this.noteId, new BNote({noteId: this.noteId}));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.becca.notes[this.noteId].ownedAttributes.push(this);
|
this.becca.notes[this.noteId].ownedAttributes.push(this);
|
||||||
@@ -130,7 +130,7 @@ class Attribute extends AbstractEntity {
|
|||||||
|
|
||||||
get isAffectingSubtree() {
|
get isAffectingSubtree() {
|
||||||
return this.isInheritable
|
return this.isInheritable
|
||||||
|| (this.type === 'relation' && this.name === 'template');
|
|| (this.type === 'relation' && ['template', 'inherit'].includes(this.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
get targetNoteId() { // alias
|
get targetNoteId() { // alias
|
||||||
@@ -152,7 +152,7 @@ class Attribute extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
getNote() {
|
getNote() {
|
||||||
const note = this.becca.getNote(this.noteId);
|
const note = this.becca.getNote(this.noteId);
|
||||||
@@ -165,7 +165,7 @@ class Attribute extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
getTargetNote() {
|
getTargetNote() {
|
||||||
if (this.type !== 'relation') {
|
if (this.type !== 'relation') {
|
||||||
@@ -180,7 +180,7 @@ class Attribute extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
isDefinition() {
|
isDefinition() {
|
||||||
return this.type === 'label' && (this.name.startsWith('label:') || this.name.startsWith('relation:'));
|
return this.type === 'label' && (this.name.startsWith('label:') || this.name.startsWith('relation:'));
|
||||||
@@ -204,8 +204,10 @@ class Attribute extends AbstractEntity {
|
|||||||
return !(this.attributeId in this.becca.attributes);
|
return !(this.attributeId in this.becca.attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving(opts = {}) {
|
||||||
|
if (!opts.skipValidation) {
|
||||||
this.validate();
|
this.validate();
|
||||||
|
}
|
||||||
|
|
||||||
this.name = sanitizeAttributeName(this.name);
|
this.name = sanitizeAttributeName(this.name);
|
||||||
|
|
||||||
@@ -245,7 +247,7 @@ class Attribute extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createClone(type, name, value, isInheritable) {
|
createClone(type, name, value, isInheritable) {
|
||||||
return new Attribute({
|
return new BAttribute({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
type: type,
|
type: type,
|
||||||
name: name,
|
name: name,
|
||||||
@@ -257,7 +259,7 @@ class Attribute extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Attribute;
|
module.exports = BAttribute;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -268,13 +270,13 @@ module.exports = Attribute;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: becca/entities/branch.js</title>
|
<title>JSDoc: Source: becca/entities/bbranch.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: becca/entities/branch.js</h1>
|
<h1 class="page-title">Source: becca/entities/bbranch.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
<article>
|
<article>
|
||||||
<pre class="prettyprint source linenums"><code>"use strict";
|
<pre class="prettyprint source linenums"><code>"use strict";
|
||||||
|
|
||||||
const Note = require('./note');
|
const BNote = require('./bnote');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
const dateUtils = require("../../services/date_utils");
|
const dateUtils = require("../../services/date_utils");
|
||||||
const utils = require("../../services/utils");
|
const utils = require("../../services/utils");
|
||||||
const TaskContext = require("../../services/task_context");
|
const TaskContext = require("../../services/task_context");
|
||||||
@@ -43,9 +43,9 @@ const log = require("../../services/log");
|
|||||||
* Note that you should not rely on the branch's identity, since it can change easily with a note's move.
|
* Note that you should not rely on the branch's identity, since it can change easily with a note's move.
|
||||||
* Always check noteId instead.
|
* Always check noteId instead.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class Branch extends AbstractEntity {
|
class BBranch extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "branches"; }
|
static get entityName() { return "branches"; }
|
||||||
static get primaryKeyName() { return "branchId"; }
|
static get primaryKeyName() { return "branchId"; }
|
||||||
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
|
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
|
||||||
@@ -81,7 +81,7 @@ class Branch extends AbstractEntity {
|
|||||||
this.noteId = noteId;
|
this.noteId = noteId;
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
this.parentNoteId = parentNoteId;
|
this.parentNoteId = parentNoteId;
|
||||||
/** @type {string} */
|
/** @type {string|null} */
|
||||||
this.prefix = prefix;
|
this.prefix = prefix;
|
||||||
/** @type {int} */
|
/** @type {int} */
|
||||||
this.notePosition = notePosition;
|
this.notePosition = notePosition;
|
||||||
@@ -106,7 +106,7 @@ class Branch extends AbstractEntity {
|
|||||||
childNote.parentBranches.push(this);
|
childNote.parentBranches.push(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.branchId === 'root') {
|
if (this.noteId === 'root') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,11 +121,11 @@ class Branch extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note} */
|
/** @returns {BNote} */
|
||||||
get childNote() {
|
get childNote() {
|
||||||
if (!(this.noteId in this.becca.notes)) {
|
if (!(this.noteId in this.becca.notes)) {
|
||||||
// entities can come out of order in sync/import, create skeleton which will be filled later
|
// entities can come out of order in sync/import, create skeleton which will be filled later
|
||||||
this.becca.addNote(this.noteId, new Note({noteId: this.noteId}));
|
this.becca.addNote(this.noteId, new BNote({noteId: this.noteId}));
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.becca.notes[this.noteId];
|
return this.becca.notes[this.noteId];
|
||||||
@@ -135,11 +135,11 @@ class Branch extends AbstractEntity {
|
|||||||
return this.childNote;
|
return this.childNote;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note|undefined} - root branch will have undefined parent, all other branches have to have a parent note */
|
/** @returns {BNote|undefined} - root branch will have undefined parent, all other branches have to have a parent note */
|
||||||
get parentNote() {
|
get parentNote() {
|
||||||
if (!(this.parentNoteId in this.becca.notes) && this.parentNoteId !== 'none') {
|
if (!(this.parentNoteId in this.becca.notes) && this.parentNoteId !== 'none') {
|
||||||
// entities can come out of order in sync/import, create skeleton which will be filled later
|
// entities can come out of order in sync/import, create skeleton which will be filled later
|
||||||
this.becca.addNote(this.parentNoteId, new Note({noteId: this.parentNoteId}));
|
this.becca.addNote(this.parentNoteId, new BNote({noteId: this.parentNoteId}));
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.becca.notes[this.parentNoteId];
|
return this.becca.notes[this.parentNoteId];
|
||||||
@@ -168,7 +168,7 @@ class Branch extends AbstractEntity {
|
|||||||
* @param {string} [deleteId] - optional delete identified
|
* @param {string} [deleteId] - optional delete identified
|
||||||
* @param {TaskContext} [taskContext]
|
* @param {TaskContext} [taskContext]
|
||||||
*
|
*
|
||||||
* @return {boolean} - true if note has been deleted, false otherwise
|
* @returns {boolean} - true if note has been deleted, false otherwise
|
||||||
*/
|
*/
|
||||||
deleteBranch(deleteId, taskContext) {
|
deleteBranch(deleteId, taskContext) {
|
||||||
if (!deleteId) {
|
if (!deleteId) {
|
||||||
@@ -193,8 +193,7 @@ class Branch extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.branchId === 'root'
|
if (this.noteId === 'root'
|
||||||
|| this.noteId === 'root'
|
|
||||||
|| this.noteId === cls.getHoistedNoteId()) {
|
|| this.noteId === cls.getHoistedNoteId()) {
|
||||||
|
|
||||||
throw new Error("Can't delete root or hoisted branch/note");
|
throw new Error("Can't delete root or hoisted branch/note");
|
||||||
@@ -237,11 +236,19 @@ class Branch extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
|
if (!this.noteId || !this.parentNoteId) {
|
||||||
|
throw new Error(`noteId and parentNoteId are mandatory properties for Branch`);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.branchId = `${this.parentNoteId}_${this.noteId}`;
|
||||||
|
|
||||||
if (this.notePosition === undefined || this.notePosition === null) {
|
if (this.notePosition === undefined || this.notePosition === null) {
|
||||||
let maxNotePos = 0;
|
let maxNotePos = 0;
|
||||||
|
|
||||||
for (const childBranch of this.parentNote.getChildBranches()) {
|
for (const childBranch of this.parentNote.getChildBranches()) {
|
||||||
if (maxNotePos < childBranch.notePosition && childBranch.noteId !== '_hidden') {
|
if (maxNotePos < childBranch.notePosition
|
||||||
|
&& childBranch.noteId !== '_hidden' // hidden has very large notePosition to always stay last
|
||||||
|
) {
|
||||||
maxNotePos = childBranch.notePosition;
|
maxNotePos = childBranch.notePosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,6 +260,10 @@ class Branch extends AbstractEntity {
|
|||||||
this.isExpanded = false;
|
this.isExpanded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.prefix?.trim()) {
|
||||||
|
this.prefix = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||||
|
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
@@ -274,7 +285,13 @@ class Branch extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createClone(parentNoteId, notePosition) {
|
createClone(parentNoteId, notePosition) {
|
||||||
return new Branch({
|
const existingBranch = this.becca.getBranchFromChildAndParent(this.noteId, parentNoteId);
|
||||||
|
|
||||||
|
if (existingBranch) {
|
||||||
|
existingBranch.notePosition = notePosition;
|
||||||
|
return existingBranch;
|
||||||
|
} else {
|
||||||
|
return new BBranch({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
parentNoteId: parentNoteId,
|
parentNoteId: parentNoteId,
|
||||||
notePosition: notePosition,
|
notePosition: notePosition,
|
||||||
@@ -282,9 +299,10 @@ class Branch extends AbstractEntity {
|
|||||||
isExpanded: this.isExpanded
|
isExpanded: this.isExpanded
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Branch;
|
module.exports = BBranch;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -295,13 +313,13 @@ module.exports = Branch;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: becca/entities/etapi_token.js</title>
|
<title>JSDoc: Source: becca/entities/betapi_token.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: becca/entities/etapi_token.js</h1>
|
<h1 class="page-title">Source: becca/entities/betapi_token.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
<pre class="prettyprint source linenums"><code>"use strict";
|
<pre class="prettyprint source linenums"><code>"use strict";
|
||||||
|
|
||||||
const dateUtils = require('../../services/date_utils');
|
const dateUtils = require('../../services/date_utils');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications.
|
* EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications.
|
||||||
@@ -40,9 +40,9 @@ const AbstractEntity = require("./abstract_entity");
|
|||||||
* The format user is presented with is "<etapiTokenId>_<tokenHash>". This is also called "authToken" to distinguish it
|
* The format user is presented with is "<etapiTokenId>_<tokenHash>". This is also called "authToken" to distinguish it
|
||||||
* from tokenHash and token.
|
* from tokenHash and token.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class EtapiToken extends AbstractEntity {
|
class BEtapiToken extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "etapi_tokens"; }
|
static get entityName() { return "etapi_tokens"; }
|
||||||
static get primaryKeyName() { return "etapiTokenId"; }
|
static get primaryKeyName() { return "etapiTokenId"; }
|
||||||
static get hashedProperties() { return ["etapiTokenId", "name", "tokenHash", "utcDateCreated", "utcDateModified", "isDeleted"]; }
|
static get hashedProperties() { return ["etapiTokenId", "name", "tokenHash", "utcDateCreated", "utcDateModified", "isDeleted"]; }
|
||||||
@@ -103,7 +103,7 @@ class EtapiToken extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = EtapiToken;
|
module.exports = BEtapiToken;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -114,13 +114,13 @@ module.exports = EtapiToken;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: becca/entities/note.js</title>
|
<title>JSDoc: Source: becca/entities/bnote.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: becca/entities/note.js</h1>
|
<h1 class="page-title">Source: becca/entities/bnote.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -34,12 +34,13 @@ const sql = require('../../services/sql');
|
|||||||
const utils = require('../../services/utils');
|
const utils = require('../../services/utils');
|
||||||
const dateUtils = require('../../services/date_utils');
|
const dateUtils = require('../../services/date_utils');
|
||||||
const entityChangesService = require('../../services/entity_changes');
|
const entityChangesService = require('../../services/entity_changes');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
const NoteRevision = require("./note_revision");
|
const BNoteRevision = require("./bnote_revision");
|
||||||
const TaskContext = require("../../services/task_context");
|
const TaskContext = require("../../services/task_context");
|
||||||
const dayjs = require("dayjs");
|
const dayjs = require("dayjs");
|
||||||
const utc = require('dayjs/plugin/utc');
|
const utc = require('dayjs/plugin/utc');
|
||||||
dayjs.extend(utc)
|
const eventService = require("../../services/events");
|
||||||
|
dayjs.extend(utc);
|
||||||
|
|
||||||
const LABEL = 'label';
|
const LABEL = 'label';
|
||||||
const RELATION = 'relation';
|
const RELATION = 'relation';
|
||||||
@@ -47,9 +48,9 @@ const RELATION = 'relation';
|
|||||||
/**
|
/**
|
||||||
* Trilium's main entity which can represent text note, image, code note, file attachment etc.
|
* Trilium's main entity which can represent text note, image, code note, file attachment etc.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class Note extends AbstractEntity {
|
class BNote extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "notes"; }
|
static get entityName() { return "notes"; }
|
||||||
static get primaryKeyName() { return "noteId"; }
|
static get primaryKeyName() { return "noteId"; }
|
||||||
static get hashedProperties() { return ["noteId", "title", "isProtected", "type", "mime"]; }
|
static get hashedProperties() { return ["noteId", "title", "isProtected", "type", "mime"]; }
|
||||||
@@ -117,33 +118,33 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
/** @type {Branch[]}
|
/** @type {BBranch[]}
|
||||||
* @private */
|
* @private */
|
||||||
this.parentBranches = [];
|
this.parentBranches = [];
|
||||||
/** @type {Note[]}
|
/** @type {BNote[]}
|
||||||
* @private */
|
* @private */
|
||||||
this.parents = [];
|
this.parents = [];
|
||||||
/** @type {Note[]}
|
/** @type {BNote[]}
|
||||||
* @private*/
|
* @private*/
|
||||||
this.children = [];
|
this.children = [];
|
||||||
/** @type {Attribute[]}
|
/** @type {BAttribute[]}
|
||||||
* @private */
|
* @private */
|
||||||
this.ownedAttributes = [];
|
this.ownedAttributes = [];
|
||||||
|
|
||||||
/** @type {Attribute[]|null}
|
/** @type {BAttribute[]|null}
|
||||||
* @private */
|
* @private */
|
||||||
this.__attributeCache = null;
|
this.__attributeCache = null;
|
||||||
/** @type {Attribute[]|null}
|
/** @type {BAttribute[]|null}
|
||||||
* @private*/
|
* @private*/
|
||||||
this.inheritableAttributeCache = null;
|
this.inheritableAttributeCache = null;
|
||||||
|
|
||||||
/** @type {Attribute[]}
|
/** @type {BAttribute[]}
|
||||||
* @private*/
|
* @private*/
|
||||||
this.targetRelations = [];
|
this.targetRelations = [];
|
||||||
|
|
||||||
this.becca.addNote(this.noteId, this);
|
this.becca.addNote(this.noteId, this);
|
||||||
|
|
||||||
/** @type {Note[]|null}
|
/** @type {BNote[]|null}
|
||||||
* @private */
|
* @private */
|
||||||
this.ancestorCache = null;
|
this.ancestorCache = null;
|
||||||
|
|
||||||
@@ -179,7 +180,7 @@ class Note extends AbstractEntity {
|
|||||||
return this.isContentAvailable() ? this.title : '[protected]';
|
return this.isContentAvailable() ? this.title : '[protected]';
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Branch[]} */
|
/** @returns {BBranch[]} */
|
||||||
getParentBranches() {
|
getParentBranches() {
|
||||||
return this.parentBranches;
|
return this.parentBranches;
|
||||||
}
|
}
|
||||||
@@ -187,26 +188,26 @@ class Note extends AbstractEntity {
|
|||||||
/**
|
/**
|
||||||
* Returns <i>strong</i> (as opposed to <i>weak</i>) parent branches. See isWeak for details.
|
* Returns <i>strong</i> (as opposed to <i>weak</i>) parent branches. See isWeak for details.
|
||||||
*
|
*
|
||||||
* @returns {Branch[]}
|
* @returns {BBranch[]}
|
||||||
*/
|
*/
|
||||||
getStrongParentBranches() {
|
getStrongParentBranches() {
|
||||||
return this.getParentBranches().filter(branch => !branch.isWeak);
|
return this.getParentBranches().filter(branch => !branch.isWeak);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Branch[]}
|
* @returns {BBranch[]}
|
||||||
* @deprecated use getParentBranches() instead
|
* @deprecated use getParentBranches() instead
|
||||||
*/
|
*/
|
||||||
getBranches() {
|
getBranches() {
|
||||||
return this.parentBranches;
|
return this.parentBranches;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getParentNotes() {
|
getParentNotes() {
|
||||||
return this.parents;
|
return this.parents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getChildNotes() {
|
getChildNotes() {
|
||||||
return this.children;
|
return this.children;
|
||||||
}
|
}
|
||||||
@@ -216,16 +217,16 @@ class Note extends AbstractEntity {
|
|||||||
return this.children && this.children.length > 0;
|
return this.children && this.children.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Branch[]} */
|
/** @returns {BBranch[]} */
|
||||||
getChildBranches() {
|
getChildBranches() {
|
||||||
return this.children.map(childNote => this.becca.getBranchFromChildAndParent(childNote.noteId, this.noteId));
|
return this.children.map(childNote => this.becca.getBranchFromChildAndParent(childNote.noteId, this.noteId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note content has quite special handling - it's not a separate entity, but a lazily loaded
|
* Note content has quite special handling - it's not a separate entity, but a lazily loaded
|
||||||
* part of Note entity with it's own sync. Reasons behind this hybrid design has been:
|
* part of Note entity with its own sync. Reasons behind this hybrid design has been:
|
||||||
*
|
*
|
||||||
* - content can be quite large and it's not necessary to load it / fill memory for any note access even if we don't need a content, especially for bulk operations like search
|
* - content can be quite large, and it's not necessary to load it / fill memory for any note access even if we don't need a content, especially for bulk operations like search
|
||||||
* - changes in the note metadata or title should not trigger note content sync (so we keep separate utcDateModified and entity changes records)
|
* - changes in the note metadata or title should not trigger note content sync (so we keep separate utcDateModified and entity changes records)
|
||||||
* - but to the user note content and title changes are one and the same - single dateModified (so all changes must go through Note and content is not a separate entity)
|
* - but to the user note content and title changes are one and the same - single dateModified (so all changes must go through Note and content is not a separate entity)
|
||||||
*/
|
*/
|
||||||
@@ -342,6 +343,11 @@ class Note extends AbstractEntity {
|
|||||||
utcDateChanged: pojo.utcDateModified,
|
utcDateChanged: pojo.utcDateModified,
|
||||||
isSynced: true
|
isSynced: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventService.emit(eventService.ENTITY_CHANGED, {
|
||||||
|
entityName: 'note_contents',
|
||||||
|
entity: this
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setJsonContent(content) {
|
setJsonContent(content) {
|
||||||
@@ -372,6 +378,12 @@ class Note extends AbstractEntity {
|
|||||||
&& this.mime === "text/html";
|
&& this.mime === "text/html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @returns {boolean} true if this note is an image */
|
||||||
|
isImage() {
|
||||||
|
return this.type === 'image'
|
||||||
|
|| (this.type === 'file' && this.mime?.startsWith('image/'));
|
||||||
|
}
|
||||||
|
|
||||||
/** @returns {boolean} true if the note has string content (not binary) */
|
/** @returns {boolean} true if the note has string content (not binary) */
|
||||||
isStringNote() {
|
isStringNote() {
|
||||||
return utils.isStringNote(this.type, this.mime);
|
return utils.isStringNote(this.type, this.mime);
|
||||||
@@ -397,15 +409,14 @@ class Note extends AbstractEntity {
|
|||||||
/**
|
/**
|
||||||
* @param {string} [type] - (optional) attribute type to filter
|
* @param {string} [type] - (optional) attribute type to filter
|
||||||
* @param {string} [name] - (optional) attribute name to filter
|
* @param {string} [name] - (optional) attribute name to filter
|
||||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
* @returns {BAttribute[]} all note's attributes, including inherited ones
|
||||||
*/
|
*/
|
||||||
getAttributes(type, name) {
|
getAttributes(type, name) {
|
||||||
this.__validateTypeName(type, name);
|
this.__validateTypeName(type, name);
|
||||||
|
this.__ensureAttributeCacheIsAvailable();
|
||||||
this.__getAttributes([]);
|
|
||||||
|
|
||||||
if (type && name) {
|
if (type && name) {
|
||||||
return this.__attributeCache.filter(attr => attr.type === type && attr.name === name);
|
return this.__attributeCache.filter(attr => attr.name === name && attr.type === type);
|
||||||
}
|
}
|
||||||
else if (type) {
|
else if (type) {
|
||||||
return this.__attributeCache.filter(attr => attr.type === type);
|
return this.__attributeCache.filter(attr => attr.type === type);
|
||||||
@@ -419,6 +430,13 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @private */
|
||||||
|
__ensureAttributeCacheIsAvailable() {
|
||||||
|
if (!this.__attributeCache) {
|
||||||
|
this.__getAttributes([]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** @private */
|
/** @private */
|
||||||
__getAttributes(path) {
|
__getAttributes(path) {
|
||||||
if (path.includes(this.noteId)) {
|
if (path.includes(this.noteId)) {
|
||||||
@@ -429,7 +447,8 @@ class Note extends AbstractEntity {
|
|||||||
const parentAttributes = this.ownedAttributes.slice();
|
const parentAttributes = this.ownedAttributes.slice();
|
||||||
const newPath = [...path, this.noteId];
|
const newPath = [...path, this.noteId];
|
||||||
|
|
||||||
if (this.noteId !== 'root') {
|
// inheritable attrs on root are typically not intended to be applied to hidden subtree #3537
|
||||||
|
if (this.noteId !== 'root' && this.noteId !== '_hidden') {
|
||||||
for (const parentNote of this.parents) {
|
for (const parentNote of this.parents) {
|
||||||
parentAttributes.push(...parentNote.__getInheritableAttributes(newPath));
|
parentAttributes.push(...parentNote.__getInheritableAttributes(newPath));
|
||||||
}
|
}
|
||||||
@@ -438,7 +457,7 @@ class Note extends AbstractEntity {
|
|||||||
const templateAttributes = [];
|
const templateAttributes = [];
|
||||||
|
|
||||||
for (const ownedAttr of parentAttributes) { // parentAttributes so we process also inherited templates
|
for (const ownedAttr of parentAttributes) { // parentAttributes so we process also inherited templates
|
||||||
if (ownedAttr.type === 'relation' && ownedAttr.name === 'template') {
|
if (ownedAttr.type === 'relation' && ['template', 'inherit'].includes(ownedAttr.name)) {
|
||||||
const templateNote = this.becca.notes[ownedAttr.value];
|
const templateNote = this.becca.notes[ownedAttr.value];
|
||||||
|
|
||||||
if (templateNote) {
|
if (templateNote) {
|
||||||
@@ -477,7 +496,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @returns {Attribute[]}
|
* @returns {BAttribute[]}
|
||||||
*/
|
*/
|
||||||
__getInheritableAttributes(path) {
|
__getInheritableAttributes(path) {
|
||||||
if (path.includes(this.noteId)) {
|
if (path.includes(this.noteId)) {
|
||||||
@@ -512,9 +531,9 @@ class Note extends AbstractEntity {
|
|||||||
*/
|
*/
|
||||||
hasAttribute(type, name, value = null) {
|
hasAttribute(type, name, value = null) {
|
||||||
return !!this.getAttributes().find(attr =>
|
return !!this.getAttributes().find(attr =>
|
||||||
attr.type === type
|
attr.name === name
|
||||||
&& attr.name === name
|
|
||||||
&& (value === undefined || value === null || attr.value === value)
|
&& (value === undefined || value === null || attr.value === value)
|
||||||
|
&& attr.type === type
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -523,13 +542,13 @@ class Note extends AbstractEntity {
|
|||||||
value = value ? value.toLowerCase() : null;
|
value = value ? value.toLowerCase() : null;
|
||||||
|
|
||||||
return this.getAttributes().find(
|
return this.getAttributes().find(
|
||||||
attr => attr.type === type
|
attr => attr.name.toLowerCase() === name
|
||||||
&& attr.name.toLowerCase() === name
|
&& (!value || attr.value.toLowerCase() === value)
|
||||||
&& (!value || attr.value.toLowerCase() === value));
|
&& attr.type === type);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRelationTarget(name) {
|
getRelationTarget(name) {
|
||||||
const relation = this.getAttributes().find(attr => attr.type === 'relation' && attr.name === name);
|
const relation = this.getAttributes().find(attr => attr.name === name && attr.type === 'relation');
|
||||||
|
|
||||||
return relation ? relation.targetNote : null;
|
return relation ? relation.targetNote : null;
|
||||||
}
|
}
|
||||||
@@ -564,25 +583,25 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Attribute|null} label if it exists, null otherwise
|
* @returns {BAttribute|null} label if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getLabel(name) { return this.getAttribute(LABEL, name); }
|
getLabel(name) { return this.getAttribute(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Attribute|null} label if it exists, null otherwise
|
* @returns {BAttribute|null} label if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
|
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Attribute|null} relation if it exists, null otherwise
|
* @returns {BAttribute|null} relation if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getRelation(name) { return this.getAttribute(RELATION, name); }
|
getRelation(name) { return this.getAttribute(RELATION, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Attribute|null} relation if it exists, null otherwise
|
* @returns {BAttribute|null} relation if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
|
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
|
||||||
|
|
||||||
@@ -623,12 +642,12 @@ class Note extends AbstractEntity {
|
|||||||
/**
|
/**
|
||||||
* @param {string} type - attribute type (label, relation, etc.)
|
* @param {string} type - attribute type (label, relation, etc.)
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
* @returns {BAttribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||||
*/
|
*/
|
||||||
getAttribute(type, name) {
|
getAttribute(type, name) {
|
||||||
const attributes = this.getAttributes();
|
const attributes = this.getAttributes();
|
||||||
|
|
||||||
return attributes.find(attr => attr.type === type && attr.name === name);
|
return attributes.find(attr => attr.name === name && attr.type === type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -655,7 +674,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - label name to filter
|
* @param {string} [name] - label name to filter
|
||||||
* @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
|
* @returns {BAttribute[]} all note's labels (attributes with type label), including inherited ones
|
||||||
*/
|
*/
|
||||||
getLabels(name) {
|
getLabels(name) {
|
||||||
return this.getAttributes(LABEL, name);
|
return this.getAttributes(LABEL, name);
|
||||||
@@ -671,7 +690,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - label name to filter
|
* @param {string} [name] - label name to filter
|
||||||
* @returns {Attribute[]} all note's labels (attributes with type label), excluding inherited ones
|
* @returns {BAttribute[]} all note's labels (attributes with type label), excluding inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedLabels(name) {
|
getOwnedLabels(name) {
|
||||||
return this.getOwnedAttributes(LABEL, name);
|
return this.getOwnedAttributes(LABEL, name);
|
||||||
@@ -687,7 +706,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - relation name to filter
|
* @param {string} [name] - relation name to filter
|
||||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
* @returns {BAttribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||||
*/
|
*/
|
||||||
getRelations(name) {
|
getRelations(name) {
|
||||||
return this.getAttributes(RELATION, name);
|
return this.getAttributes(RELATION, name);
|
||||||
@@ -695,7 +714,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - relation name to filter
|
* @param {string} [name] - relation name to filter
|
||||||
* @returns {Attribute[]} all note's relations (attributes with type relation), excluding inherited ones
|
* @returns {BAttribute[]} all note's relations (attributes with type relation), excluding inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedRelations(name) {
|
getOwnedRelations(name) {
|
||||||
return this.getOwnedAttributes(RELATION, name);
|
return this.getOwnedAttributes(RELATION, name);
|
||||||
@@ -705,16 +724,16 @@ class Note extends AbstractEntity {
|
|||||||
* @param {string|null} [type] - (optional) attribute type to filter
|
* @param {string|null} [type] - (optional) attribute type to filter
|
||||||
* @param {string|null} [name] - (optional) attribute name to filter
|
* @param {string|null} [name] - (optional) attribute name to filter
|
||||||
* @param {string|null} [value] - (optional) attribute value to filter
|
* @param {string|null} [value] - (optional) attribute value to filter
|
||||||
* @returns {Attribute[]} note's "owned" attributes - excluding inherited ones
|
* @returns {BAttribute[]} note's "owned" attributes - excluding inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedAttributes(type = null, name = null, value = null) {
|
getOwnedAttributes(type = null, name = null, value = null) {
|
||||||
this.__validateTypeName(type, name);
|
this.__validateTypeName(type, name);
|
||||||
|
|
||||||
if (type && name && value !== undefined && value !== null) {
|
if (type && name && value !== undefined && value !== null) {
|
||||||
return this.ownedAttributes.filter(attr => attr.type === type && attr.name === name && attr.value === value);
|
return this.ownedAttributes.filter(attr => attr.name === name && attr.value === value && attr.type === type);
|
||||||
}
|
}
|
||||||
else if (type && name) {
|
else if (type && name) {
|
||||||
return this.ownedAttributes.filter(attr => attr.type === type && attr.name === name);
|
return this.ownedAttributes.filter(attr => attr.name === name && attr.type === type);
|
||||||
}
|
}
|
||||||
else if (type) {
|
else if (type) {
|
||||||
return this.ownedAttributes.filter(attr => attr.type === type);
|
return this.ownedAttributes.filter(attr => attr.type === type);
|
||||||
@@ -728,7 +747,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Attribute} attribute belonging to this specific note (excludes inherited attributes)
|
* @returns {BAttribute} attribute belonging to this specific note (excludes inherited attributes)
|
||||||
*
|
*
|
||||||
* This method can be significantly faster than the getAttribute()
|
* This method can be significantly faster than the getAttribute()
|
||||||
*/
|
*/
|
||||||
@@ -742,28 +761,55 @@ class Note extends AbstractEntity {
|
|||||||
return this.hasAttribute('label', 'archived');
|
return this.hasAttribute('label', 'archived');
|
||||||
}
|
}
|
||||||
|
|
||||||
hasInheritableOwnedArchivedLabel() {
|
hasInheritableArchivedLabel() {
|
||||||
return !!this.ownedAttributes.find(attr => attr.type === 'label' && attr.name === 'archived' && attr.isInheritable);
|
for (const attr of this.getAttributes()) {
|
||||||
|
if (attr.name === 'archived' && attr.type === LABEL && attr.isInheritable) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// will sort the parents so that non-search & non-archived are first and archived at the end
|
return false;
|
||||||
// this is done so that non-search & non-archived paths are always explored as first when looking for note path
|
}
|
||||||
|
|
||||||
|
// will sort the parents so that the non-archived are first and archived at the end
|
||||||
|
// this is done so that the non-archived paths are always explored as first when looking for note path
|
||||||
sortParents() {
|
sortParents() {
|
||||||
this.parentBranches.sort((a, b) =>
|
this.parentBranches.sort((a, b) => {
|
||||||
a.branchId.startsWith('virt-') // FIXME: search virtual notes appear only in froca so this is probably not necessary
|
if (a.parentNote?.isArchived) {
|
||||||
|| a.parentNote?.hasInheritableOwnedArchivedLabel() ? 1 : -1);
|
return 1;
|
||||||
|
} else if (a.parentNote?.isHiddenCompletely()) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.parents = this.parentBranches
|
this.parents = this.parentBranches
|
||||||
.map(branch => branch.parentNote)
|
.map(branch => branch.parentNote)
|
||||||
.filter(note => !!note);
|
.filter(note => !!note);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sortChildren() {
|
||||||
|
if (this.children.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const becca = this.becca;
|
||||||
|
|
||||||
|
this.children.sort((a, b) => {
|
||||||
|
const aBranch = becca.getBranchFromChildAndParent(a.noteId, this.noteId);
|
||||||
|
const bBranch = becca.getBranchFromChildAndParent(b.noteId, this.noteId);
|
||||||
|
|
||||||
|
return aBranch?.notePosition < bBranch?.notePosition ? -1 : 1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is used for:
|
* This is used for:
|
||||||
* - fast searching
|
* - fast searching
|
||||||
* - note similarity evaluation
|
* - note similarity evaluation
|
||||||
*
|
*
|
||||||
* @return {string} - returns flattened textual representation of note, prefixes and attributes
|
* @returns {string} - returns flattened textual representation of note, prefixes and attributes
|
||||||
*/
|
*/
|
||||||
getFlatText() {
|
getFlatText() {
|
||||||
if (!this.flatTextCache) {
|
if (!this.flatTextCache) {
|
||||||
@@ -818,7 +864,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const targetRelation of this.targetRelations) {
|
for (const targetRelation of this.targetRelations) {
|
||||||
if (targetRelation.name === 'template') {
|
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||||
const note = targetRelation.note;
|
const note = targetRelation.note;
|
||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
@@ -836,7 +882,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const targetRelation of this.targetRelations) {
|
for (const targetRelation of this.targetRelations) {
|
||||||
if (targetRelation.name === 'template') {
|
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||||
const note = targetRelation.note;
|
const note = targetRelation.note;
|
||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
@@ -856,16 +902,17 @@ class Note extends AbstractEntity {
|
|||||||
.filter(l => l.name.startsWith("relation:"));
|
.filter(l => l.name.startsWith("relation:"));
|
||||||
}
|
}
|
||||||
|
|
||||||
isTemplate() {
|
isInherited() {
|
||||||
return !!this.targetRelations.find(rel => rel.name === 'template');
|
return !!this.targetRelations.find(rel => rel.name === 'template' || rel.name === 'inherit');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getSubtreeNotesIncludingTemplated() {
|
getSubtreeNotesIncludingTemplated() {
|
||||||
const set = new Set();
|
const set = new Set();
|
||||||
|
|
||||||
function inner(note) {
|
function inner(note) {
|
||||||
if (set.has(note)) {
|
// _hidden is not counted as subtree for the purpose of inheritance
|
||||||
|
if (set.has(note) || note.noteId === '_hidden') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -876,7 +923,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const targetRelation of note.targetRelations) {
|
for (const targetRelation of note.targetRelations) {
|
||||||
if (targetRelation.name === 'template') {
|
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||||
const targetNote = targetRelation.note;
|
const targetNote = targetRelation.note;
|
||||||
|
|
||||||
if (targetNote) {
|
if (targetNote) {
|
||||||
@@ -891,7 +938,7 @@ class Note extends AbstractEntity {
|
|||||||
return Array.from(set);
|
return Array.from(set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getSearchResultNotes() {
|
getSearchResultNotes() {
|
||||||
if (this.type !== 'search') {
|
if (this.type !== 'search') {
|
||||||
return [];
|
return [];
|
||||||
@@ -913,7 +960,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {{notes: Note[], relationships: Array.<{parentNoteId: string, childNoteId: string}>}}
|
* @returns {{notes: BNote[], relationships: Array.<{parentNoteId: string, childNoteId: string}>}}
|
||||||
*/
|
*/
|
||||||
getSubtree({includeArchived = true, includeHidden = false, resolveSearch = false} = {}) {
|
getSubtree({includeArchived = true, includeHidden = false, resolveSearch = false} = {}) {
|
||||||
const noteSet = new Set();
|
const noteSet = new Set();
|
||||||
@@ -973,13 +1020,14 @@ class Note extends AbstractEntity {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {String[]} */
|
/** @returns {String[]} - includes the subtree node as well */
|
||||||
getSubtreeNoteIds({includeArchived = true, resolveSearch = false} = {}) {
|
getSubtreeNoteIds({includeArchived = true, includeHidden = false, resolveSearch = false} = {}) {
|
||||||
return this.getSubtree({includeArchived, resolveSearch})
|
return this.getSubtree({includeArchived, includeHidden, resolveSearch})
|
||||||
.notes
|
.notes
|
||||||
.map(note => note.noteId);
|
.map(note => note.noteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @deprecated use getSubtreeNoteIds() instead */
|
||||||
getDescendantNoteIds() {
|
getDescendantNoteIds() {
|
||||||
return this.getSubtreeNoteIds();
|
return this.getSubtreeNoteIds();
|
||||||
}
|
}
|
||||||
@@ -1029,10 +1077,10 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get ownedAttributeCount() {
|
get ownedAttributeCount() {
|
||||||
return this.getAttributes().length;
|
return this.getOwnedAttributes().length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getAncestors() {
|
getAncestors() {
|
||||||
if (!this.ancestorCache) {
|
if (!this.ancestorCache) {
|
||||||
const noteIds = new Set();
|
const noteIds = new Set();
|
||||||
@@ -1077,13 +1125,13 @@ class Note extends AbstractEntity {
|
|||||||
return this.targetRelations;
|
return this.targetRelations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} - returns only notes which are templated, does not include their subtrees
|
/** @returns {BNote[]} - returns only notes which are templated, does not include their subtrees
|
||||||
* in effect returns notes which are influenced by note's non-inheritable attributes */
|
* in effect returns notes which are influenced by note's non-inheritable attributes */
|
||||||
getTemplatedNotes() {
|
getInheritingNotes() {
|
||||||
const arr = [this];
|
const arr = [this];
|
||||||
|
|
||||||
for (const targetRelation of this.targetRelations) {
|
for (const targetRelation of this.targetRelations) {
|
||||||
if (targetRelation.name === 'template') {
|
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||||
const note = targetRelation.note;
|
const note = targetRelation.note;
|
||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
@@ -1109,13 +1157,14 @@ class Note extends AbstractEntity {
|
|||||||
return minDistance;
|
return minDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @returns {BNoteRevision[]} */
|
||||||
getNoteRevisions() {
|
getNoteRevisions() {
|
||||||
return sql.getRows("SELECT * FROM note_revisions WHERE noteId = ?", [this.noteId])
|
return sql.getRows("SELECT * FROM note_revisions WHERE noteId = ?", [this.noteId])
|
||||||
.map(row => new NoteRevision(row));
|
.map(row => new BNoteRevision(row));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {string[][]} - array of notePaths (each represented by array of noteIds constituting the particular note path)
|
* @returns {string[][]} - array of notePaths (each represented by array of noteIds constituting the particular note path)
|
||||||
*/
|
*/
|
||||||
getAllNotePaths() {
|
getAllNotePaths() {
|
||||||
if (this.noteId === 'root') {
|
if (this.noteId === 'root') {
|
||||||
@@ -1134,9 +1183,32 @@ class Note extends AbstractEntity {
|
|||||||
return notePaths;
|
return notePaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return boolean - true if there's no non-hidden path, note is not cloned to the visible tree
|
||||||
|
*/
|
||||||
|
isHiddenCompletely() {
|
||||||
|
if (this.noteId === 'root') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const parentNote of this.parents) {
|
||||||
|
if (parentNote.noteId === 'root') {
|
||||||
|
return false;
|
||||||
|
} else if (parentNote.noteId === '_hidden') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!parentNote.isHiddenCompletely()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ancestorNoteId
|
* @param ancestorNoteId
|
||||||
* @return {boolean} - true if ancestorNoteId occurs in at least one of the note's paths
|
* @returns {boolean} - true if ancestorNoteId occurs in at least one of the note's paths
|
||||||
*/
|
*/
|
||||||
isDescendantOfNote(ancestorNoteId) {
|
isDescendantOfNote(ancestorNoteId) {
|
||||||
const notePaths = this.getAllNotePaths();
|
const notePaths = this.getAllNotePaths();
|
||||||
@@ -1164,9 +1236,9 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const Attribute = require("./attribute");
|
const BAttribute = require("./battribute");
|
||||||
|
|
||||||
new Attribute({
|
new BAttribute({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
type: type,
|
type: type,
|
||||||
name: name,
|
name: name,
|
||||||
@@ -1199,13 +1271,14 @@ class Note extends AbstractEntity {
|
|||||||
* @param {string} type - attribute type (label / relation)
|
* @param {string} type - attribute type (label / relation)
|
||||||
* @param {string} name - name of the attribute, not including the leading ~/#
|
* @param {string} name - name of the attribute, not including the leading ~/#
|
||||||
* @param {string} [value] - value of the attribute - text for labels, target note ID for relations; optional.
|
* @param {string} [value] - value of the attribute - text for labels, target note ID for relations; optional.
|
||||||
*
|
* @param {boolean} [isInheritable=false]
|
||||||
* @return {Attribute}
|
* @param {int} [position]
|
||||||
|
* @returns {BAttribute}
|
||||||
*/
|
*/
|
||||||
addAttribute(type, name, value = "", isInheritable = false, position = 1000) {
|
addAttribute(type, name, value = "", isInheritable = false, position = 1000) {
|
||||||
const Attribute = require("./attribute");
|
const BAttribute = require("./battribute");
|
||||||
|
|
||||||
return new Attribute({
|
return new BAttribute({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
type: type,
|
type: type,
|
||||||
name: name,
|
name: name,
|
||||||
@@ -1220,8 +1293,8 @@ class Note extends AbstractEntity {
|
|||||||
*
|
*
|
||||||
* @param {string} name - name of the label, not including the leading #
|
* @param {string} name - name of the label, not including the leading #
|
||||||
* @param {string} [value] - text value of the label; optional
|
* @param {string} [value] - text value of the label; optional
|
||||||
*
|
* @param {boolean} [isInheritable=false]
|
||||||
* @return {Attribute}
|
* @returns {BAttribute}
|
||||||
*/
|
*/
|
||||||
addLabel(name, value = "", isInheritable = false) {
|
addLabel(name, value = "", isInheritable = false) {
|
||||||
return this.addAttribute(LABEL, name, value, isInheritable);
|
return this.addAttribute(LABEL, name, value, isInheritable);
|
||||||
@@ -1232,9 +1305,9 @@ class Note extends AbstractEntity {
|
|||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
* @param {string} name - name of the relation, not including the leading ~
|
* @param {string} name - name of the relation, not including the leading ~
|
||||||
* @param {string} value - ID of the target note of the relation
|
* @param {string} targetNoteId
|
||||||
*
|
* @param {boolean} [isInheritable=false]
|
||||||
* @return {Attribute}
|
* @returns {BAttribute}
|
||||||
*/
|
*/
|
||||||
addRelation(name, targetNoteId, isInheritable = false) {
|
addRelation(name, targetNoteId, isInheritable = false) {
|
||||||
return this.addAttribute(RELATION, name, targetNoteId, isInheritable);
|
return this.addAttribute(RELATION, name, targetNoteId, isInheritable);
|
||||||
@@ -1377,7 +1450,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isOptions() {
|
isOptions() {
|
||||||
return this.noteId.startsWith("options");
|
return this.noteId.startsWith("_options");
|
||||||
}
|
}
|
||||||
|
|
||||||
get isDeleted() {
|
get isDeleted() {
|
||||||
@@ -1385,7 +1458,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {NoteRevision|null}
|
* @returns {BNoteRevision|null}
|
||||||
*/
|
*/
|
||||||
saveNoteRevision() {
|
saveNoteRevision() {
|
||||||
const content = this.getContent();
|
const content = this.getContent();
|
||||||
@@ -1396,7 +1469,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
const contentMetadata = this.getContentMetadata();
|
const contentMetadata = this.getContentMetadata();
|
||||||
|
|
||||||
const noteRevision = new NoteRevision({
|
const noteRevision = new BNoteRevision({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
// title and text should be decrypted now
|
// title and text should be decrypted now
|
||||||
title: this.title,
|
title: this.title,
|
||||||
@@ -1460,7 +1533,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Note;
|
module.exports = BNote;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -1471,13 +1544,13 @@ module.exports = Note;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: becca/entities/note_revision.js</title>
|
<title>JSDoc: Source: becca/entities/bnote_revision.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: becca/entities/note_revision.js</h1>
|
<h1 class="page-title">Source: becca/entities/bnote_revision.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -34,15 +34,15 @@ const sql = require('../../services/sql');
|
|||||||
const dateUtils = require('../../services/date_utils');
|
const dateUtils = require('../../services/date_utils');
|
||||||
const becca = require('../becca');
|
const becca = require('../becca');
|
||||||
const entityChangesService = require('../../services/entity_changes');
|
const entityChangesService = require('../../services/entity_changes');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NoteRevision represents snapshot of note's title and content at some point in the past.
|
* NoteRevision represents snapshot of note's title and content at some point in the past.
|
||||||
* It's used for seamless note versioning.
|
* It's used for seamless note versioning.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class NoteRevision extends AbstractEntity {
|
class BNoteRevision extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "note_revisions"; }
|
static get entityName() { return "note_revisions"; }
|
||||||
static get primaryKeyName() { return "noteRevisionId"; }
|
static get primaryKeyName() { return "noteRevisionId"; }
|
||||||
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
||||||
@@ -134,7 +134,7 @@ class NoteRevision extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setContent(content, ignoreMissingProtectedSession = false) {
|
setContent(content) {
|
||||||
const pojo = {
|
const pojo = {
|
||||||
noteRevisionId: this.noteRevisionId,
|
noteRevisionId: this.noteRevisionId,
|
||||||
content: content,
|
content: content,
|
||||||
@@ -145,7 +145,7 @@ class NoteRevision extends AbstractEntity {
|
|||||||
if (protectedSessionService.isProtectedSessionAvailable()) {
|
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||||
pojo.content = protectedSessionService.encrypt(pojo.content);
|
pojo.content = protectedSessionService.encrypt(pojo.content);
|
||||||
}
|
}
|
||||||
else if (!ignoreMissingProtectedSession) {
|
else {
|
||||||
throw new Error(`Cannot update content of noteRevisionId=${this.noteRevisionId} since we're out of protected session.`);
|
throw new Error(`Cannot update content of noteRevisionId=${this.noteRevisionId} since we're out of protected session.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,14 +194,12 @@ class NoteRevision extends AbstractEntity {
|
|||||||
utcDateLastEdited: this.utcDateLastEdited,
|
utcDateLastEdited: this.utcDateLastEdited,
|
||||||
utcDateCreated: this.utcDateCreated,
|
utcDateCreated: this.utcDateCreated,
|
||||||
utcDateModified: this.utcDateModified,
|
utcDateModified: this.utcDateModified,
|
||||||
content: this.content,
|
|
||||||
contentLength: this.contentLength
|
contentLength: this.contentLength
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
getPojoToSave() {
|
getPojoToSave() {
|
||||||
const pojo = this.getPojo();
|
const pojo = this.getPojo();
|
||||||
delete pojo.content; // not getting persisted
|
|
||||||
delete pojo.contentLength; // not getting persisted
|
delete pojo.contentLength; // not getting persisted
|
||||||
|
|
||||||
if (pojo.isProtected) {
|
if (pojo.isProtected) {
|
||||||
@@ -218,7 +216,7 @@ class NoteRevision extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = NoteRevision;
|
module.exports = BNoteRevision;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -229,13 +227,13 @@ module.exports = NoteRevision;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: becca/entities/option.js</title>
|
<title>JSDoc: Source: becca/entities/boption.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: becca/entities/option.js</h1>
|
<h1 class="page-title">Source: becca/entities/boption.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -29,14 +29,14 @@
|
|||||||
<pre class="prettyprint source linenums"><code>"use strict";
|
<pre class="prettyprint source linenums"><code>"use strict";
|
||||||
|
|
||||||
const dateUtils = require('../../services/date_utils');
|
const dateUtils = require('../../services/date_utils');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Option represents name-value pair, either directly configurable by the user or some system property.
|
* Option represents name-value pair, either directly configurable by the user or some system property.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class Option extends AbstractEntity {
|
class BOption extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "options"; }
|
static get entityName() { return "options"; }
|
||||||
static get primaryKeyName() { return "name"; }
|
static get primaryKeyName() { return "name"; }
|
||||||
static get hashedProperties() { return ["name", "value"]; }
|
static get hashedProperties() { return ["name", "value"]; }
|
||||||
@@ -72,7 +72,7 @@ class Option extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Option;
|
module.exports = BOption;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -83,13 +83,13 @@ module.exports = Option;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: becca/entities/recent_note.js</title>
|
<title>JSDoc: Source: becca/entities/brecent_note.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: becca/entities/recent_note.js</h1>
|
<h1 class="page-title">Source: becca/entities/brecent_note.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -29,14 +29,14 @@
|
|||||||
<pre class="prettyprint source linenums"><code>"use strict";
|
<pre class="prettyprint source linenums"><code>"use strict";
|
||||||
|
|
||||||
const dateUtils = require('../../services/date_utils');
|
const dateUtils = require('../../services/date_utils');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RecentNote represents recently visited note.
|
* RecentNote represents recently visited note.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class RecentNote extends AbstractEntity {
|
class BRecentNote extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "recent_notes"; }
|
static get entityName() { return "recent_notes"; }
|
||||||
static get primaryKeyName() { return "noteId"; }
|
static get primaryKeyName() { return "noteId"; }
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ class RecentNote extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = RecentNote;
|
module.exports = BRecentNote;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -71,13 +71,13 @@ module.exports = RecentNote;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -50,13 +50,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -250,7 +250,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line361">line 361</a>
|
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line364">line 364</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -430,7 +430,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line352">line 352</a>
|
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line355">line 355</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -632,7 +632,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line342">line 342</a>
|
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line345">line 345</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -834,7 +834,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line318">line 318</a>
|
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line321">line 321</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1036,7 +1036,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line329">line 329</a>
|
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line332">line 332</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1238,7 +1238,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line308">line 308</a>
|
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line311">line 311</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1294,13 +1294,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -45,38 +45,37 @@ const becca = require("../becca/becca");
|
|||||||
const ws = require("./ws");
|
const ws = require("./ws");
|
||||||
const SpacedUpdate = require("./spaced_update");
|
const SpacedUpdate = require("./spaced_update");
|
||||||
const specialNotesService = require("./special_notes");
|
const specialNotesService = require("./special_notes");
|
||||||
const branchService = require("./branches.js");
|
const branchService = require("./branches");
|
||||||
|
const exportService = require("./export/zip");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the main backend API interface for scripts. It's published in the local "api" object.
|
* <p>This is the main backend API interface for scripts. All the properties and methods are published in the "api" object
|
||||||
|
* available in the JS backend notes. You can use e.g. <code>api.log(api.startNote.title);</code></p>
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @hideconstructor
|
|
||||||
*/
|
*/
|
||||||
function BackendScriptApi(currentNote, apiParams) {
|
function BackendScriptApi(currentNote, apiParams) {
|
||||||
/** @property {Note} note where script started executing */
|
/** @property {BNote} note where script started executing */
|
||||||
this.startNote = apiParams.startNote;
|
this.startNote = apiParams.startNote;
|
||||||
/** @property {Note} note where script is currently executing. Don't mix this up with concept of active note */
|
/** @property {BNote} note where script is currently executing. Don't mix this up with concept of active note */
|
||||||
this.currentNote = currentNote;
|
this.currentNote = currentNote;
|
||||||
/** @property {Entity} entity whose event triggered this executions */
|
/** @property {AbstractBeccaEntity} entity whose event triggered this executions */
|
||||||
this.originEntity = apiParams.originEntity;
|
this.originEntity = apiParams.originEntity;
|
||||||
|
|
||||||
for (const key in apiParams) {
|
for (const key in apiParams) {
|
||||||
this[key] = apiParams[key];
|
this[key] = apiParams[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @property {axios} Axios library for HTTP requests. See https://axios-http.com/ for documentation */
|
/**
|
||||||
|
* @property {axios} Axios library for HTTP requests. See {@link https://axios-http.com} for documentation
|
||||||
|
* @deprecated use native (browser compatible) fetch() instead
|
||||||
|
*/
|
||||||
this.axios = axios;
|
this.axios = axios;
|
||||||
/** @property {dayjs} day.js library for date manipulation. See https://day.js.org/ for documentation */
|
/** @property {dayjs} day.js library for date manipulation. See {@link https://day.js.org} for documentation */
|
||||||
this.dayjs = dayjs;
|
this.dayjs = dayjs;
|
||||||
/** @property {axios} xml2js library for XML parsing. See https://github.com/Leonidas-from-XIV/node-xml2js for documentation */
|
/** @property {axios} xml2js library for XML parsing. See {@link https://github.com/Leonidas-from-XIV/node-xml2js} for documentation */
|
||||||
this.xml2js = xml2js;
|
this.xml2js = xml2js;
|
||||||
|
|
||||||
// DEPRECATED - use direct api.unescapeHtml
|
|
||||||
this.utils = {
|
|
||||||
unescapeHtml: utils.unescapeHtml
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instance name identifies particular Trilium instance. It can be useful for scripts
|
* Instance name identifies particular Trilium instance. It can be useful for scripts
|
||||||
* if some action needs to happen on only one specific instance.
|
* if some action needs to happen on only one specific instance.
|
||||||
@@ -88,32 +87,32 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
* @param {string} noteId
|
* @param {string} noteId
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
this.getNote = noteId => becca.getNote(noteId);
|
this.getNote = noteId => becca.getNote(noteId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
* @param {string} branchId
|
* @param {string} branchId
|
||||||
* @returns {Branch|null}
|
* @returns {BBranch|null}
|
||||||
*/
|
*/
|
||||||
this.getBranch = branchId => becca.getBranch(branchId);
|
this.getBranch = branchId => becca.getBranch(branchId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
* @param {string} attributeId
|
* @param {string} attributeId
|
||||||
* @returns {Attribute|null}
|
* @returns {BAttribute|null}
|
||||||
*/
|
*/
|
||||||
this.getAttribute = attributeId => becca.getAttribute(attributeId);
|
this.getAttribute = attributeId => becca.getAttribute(attributeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a powerful search method - you can search by attributes and their values, e.g.:
|
* This is a powerful search method - you can search by attributes and their values, e.g.:
|
||||||
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
* "#dateModified =* MONTH AND #log". See {@link https://github.com/zadam/trilium/wiki/Search} for full documentation for all options
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} query
|
* @param {string} query
|
||||||
* @param {Object} [searchParams]
|
* @param {Object} [searchParams]
|
||||||
* @returns {Note[]}
|
* @returns {BNote[]}
|
||||||
*/
|
*/
|
||||||
this.searchForNotes = (query, searchParams = {}) => {
|
this.searchForNotes = (query, searchParams = {}) => {
|
||||||
if (searchParams.includeArchivedNotes === undefined) {
|
if (searchParams.includeArchivedNotes === undefined) {
|
||||||
@@ -132,12 +131,12 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a powerful search method - you can search by attributes and their values, e.g.:
|
* This is a powerful search method - you can search by attributes and their values, e.g.:
|
||||||
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
* "#dateModified =* MONTH AND #log". See {@link https://github.com/zadam/trilium/wiki/Search} for full documentation for all options
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} query
|
* @param {string} query
|
||||||
* @param {Object} [searchParams]
|
* @param {Object} [searchParams]
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
this.searchForNote = (query, searchParams = {}) => {
|
this.searchForNote = (query, searchParams = {}) => {
|
||||||
const notes = this.searchForNotes(query, searchParams);
|
const notes = this.searchForNotes(query, searchParams);
|
||||||
@@ -151,7 +150,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
* @method
|
* @method
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
* @param {string} [value] - attribute value
|
* @param {string} [value] - attribute value
|
||||||
* @returns {Note[]}
|
* @returns {BNote[]}
|
||||||
*/
|
*/
|
||||||
this.getNotesWithLabel = attributeService.getNotesWithLabel;
|
this.getNotesWithLabel = attributeService.getNotesWithLabel;
|
||||||
|
|
||||||
@@ -161,7 +160,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
* @method
|
* @method
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
* @param {string} [value] - attribute value
|
* @param {string} [value] - attribute value
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
this.getNoteWithLabel = attributeService.getNoteWithLabel;
|
this.getNoteWithLabel = attributeService.getNoteWithLabel;
|
||||||
|
|
||||||
@@ -198,20 +197,14 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
*/
|
*/
|
||||||
this.toggleNoteInParent = cloningService.toggleNoteInParent;
|
this.toggleNoteInParent = cloningService.toggleNoteInParent;
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {object} CreateNoteAttribute
|
|
||||||
* @property {string} type - attribute type - label, relation etc.
|
|
||||||
* @property {string} name - attribute name
|
|
||||||
* @property {string} [value] - attribute value
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create text note. See also createNewNote() for more options.
|
* Create text note. See also createNewNote() for more options.
|
||||||
*
|
*
|
||||||
|
* @method
|
||||||
* @param {string} parentNoteId
|
* @param {string} parentNoteId
|
||||||
* @param {string} title
|
* @param {string} title
|
||||||
* @param {string} content
|
* @param {string} content
|
||||||
* @return {{note: Note, branch: Branch}} - object having "note" and "branch" keys representing respective objects
|
* @returns {{note: BNote, branch: BBranch}} - object having "note" and "branch" keys representing respective objects
|
||||||
*/
|
*/
|
||||||
this.createTextNote = (parentNoteId, title, content = '') => noteService.createNewNote({
|
this.createTextNote = (parentNoteId, title, content = '') => noteService.createNewNote({
|
||||||
parentNoteId,
|
parentNoteId,
|
||||||
@@ -224,10 +217,11 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
* Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
|
* Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
|
||||||
* JSON MIME type. See also createNewNote() for more options.
|
* JSON MIME type. See also createNewNote() for more options.
|
||||||
*
|
*
|
||||||
|
* @method
|
||||||
* @param {string} parentNoteId
|
* @param {string} parentNoteId
|
||||||
* @param {string} title
|
* @param {string} title
|
||||||
* @param {object} content
|
* @param {object} content
|
||||||
* @return {{note: Note, branch: Branch}} object having "note" and "branch" keys representing respective objects
|
* @returns {{note: BNote, branch: BBranch}} object having "note" and "branch" keys representing respective objects
|
||||||
*/
|
*/
|
||||||
this.createDataNote = (parentNoteId, title, content = {}) => noteService.createNewNote({
|
this.createDataNote = (parentNoteId, title, content = {}) => noteService.createNewNote({
|
||||||
parentNoteId,
|
parentNoteId,
|
||||||
@@ -237,43 +231,23 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
mime: 'application/json'
|
mime: 'application/json'
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {object} CreateNewNoteParams
|
|
||||||
* @property {string} parentNoteId - MANDATORY
|
|
||||||
* @property {string} title - MANDATORY
|
|
||||||
* @property {string|buffer} content - MANDATORY
|
|
||||||
* @property {string} type - text, code, file, image, search, book, relationMap, canvas - MANDATORY
|
|
||||||
* @property {string} mime - value is derived from default mimes for type
|
|
||||||
* @property {boolean} isProtected - default is false
|
|
||||||
* @property {boolean} isExpanded - default is false
|
|
||||||
* @property {string} prefix - default is empty string
|
|
||||||
* @property {int} notePosition - default is last existing notePosition in a parent + 10
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
*
|
*
|
||||||
* @param {CreateNewNoteParams} [params]
|
* @property {object} params
|
||||||
* @returns {{note: Note, branch: Branch}} object contains newly created entities note and branch
|
* @property {string} params.parentNoteId
|
||||||
|
* @property {string} params.title
|
||||||
|
* @property {string|buffer} params.content
|
||||||
|
* @property {string} params.type - text, code, file, image, search, book, relationMap, canvas
|
||||||
|
* @property {string} [params.mime] - value is derived from default mimes for type
|
||||||
|
* @property {boolean} [params.isProtected=false]
|
||||||
|
* @property {boolean} [params.isExpanded=false]
|
||||||
|
* @property {string} [params.prefix='']
|
||||||
|
* @property {int} [params.notePosition] - default is last existing notePosition in a parent + 10
|
||||||
|
* @returns {{note: BNote, branch: BBranch}} object contains newly created entities note and branch
|
||||||
*/
|
*/
|
||||||
this.createNewNote = noteService.createNewNote;
|
this.createNewNote = noteService.createNewNote;
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {object} CreateNoteAttribute
|
|
||||||
* @property {string} type - attribute type - label, relation etc.
|
|
||||||
* @property {string} name - attribute name
|
|
||||||
* @property {string} [value] - attribute value
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {object} CreateNoteExtraOptions
|
|
||||||
* @property {boolean} [json=false] - should the note be JSON
|
|
||||||
* @property {boolean} [isProtected=false] - should the note be protected
|
|
||||||
* @property {string} [type='text'] - note type
|
|
||||||
* @property {string} [mime='text/html'] - MIME type of the note
|
|
||||||
* @property {CreateNoteAttribute[]} [attributes=[]] - attributes to be created for this note
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
* @deprecated please use createTextNote() with similar API for simpler use cases or createNewNote() for more complex needs
|
* @deprecated please use createTextNote() with similar API for simpler use cases or createNewNote() for more complex needs
|
||||||
@@ -281,8 +255,16 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
* @param {string} parentNoteId - create new note under this parent
|
* @param {string} parentNoteId - create new note under this parent
|
||||||
* @param {string} title
|
* @param {string} title
|
||||||
* @param {string} [content=""]
|
* @param {string} [content=""]
|
||||||
* @param {CreateNoteExtraOptions} [extraOptions={}]
|
* @param {object} [extraOptions={}]
|
||||||
* @returns {{note: Note, branch: Branch}} object contains newly created entities note and branch
|
* @property {boolean} [extraOptions.json=false] - should the note be JSON
|
||||||
|
* @property {boolean} [extraOptions.isProtected=false] - should the note be protected
|
||||||
|
* @property {string} [extraOptions.type='text'] - note type
|
||||||
|
* @property {string} [extraOptions.mime='text/html'] - MIME type of the note
|
||||||
|
* @property {object[]} [extraOptions.attributes=[]] - attributes to be created for this note
|
||||||
|
* @property {string} extraOptions.attributes.type - attribute type - label, relation etc.
|
||||||
|
* @property {string} extraOptions.attributes.name - attribute name
|
||||||
|
* @property {string} [extraOptions.attributes.value] - attribute value
|
||||||
|
* @returns {{note: BNote, branch: BBranch}} object contains newly created entities note and branch
|
||||||
*/
|
*/
|
||||||
this.createNote = (parentNoteId, title, content = "", extraOptions= {}) => {
|
this.createNote = (parentNoteId, title, content = "", extraOptions= {}) => {
|
||||||
extraOptions.parentNoteId = parentNoteId;
|
extraOptions.parentNoteId = parentNoteId;
|
||||||
@@ -326,7 +308,9 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
/**
|
/**
|
||||||
* Log given message to trilium logs and log pane in UI
|
* Log given message to trilium logs and log pane in UI
|
||||||
*
|
*
|
||||||
|
* @method
|
||||||
* @param message
|
* @param message
|
||||||
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
this.log = message => {
|
this.log = message => {
|
||||||
log.info(message);
|
log.info(message);
|
||||||
@@ -353,7 +337,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
* Returns root note of the calendar.
|
* Returns root note of the calendar.
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
this.getRootCalendarNote = dateNoteService.getRootCalendarNote;
|
this.getRootCalendarNote = dateNoteService.getRootCalendarNote;
|
||||||
|
|
||||||
@@ -362,19 +346,8 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} date in YYYY-MM-DD format
|
* @param {string} date in YYYY-MM-DD format
|
||||||
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
|
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
* @deprecated use getDayNote instead
|
|
||||||
*/
|
|
||||||
this.getDateNote = dateNoteService.getDayNote;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns day note for given date. If such note doesn't exist, it is created.
|
|
||||||
*
|
|
||||||
* @method
|
|
||||||
* @param {string} date in YYYY-MM-DD format
|
|
||||||
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
|
|
||||||
* @returns {Note|null}
|
|
||||||
*/
|
*/
|
||||||
this.getDayNote = dateNoteService.getDayNote;
|
this.getDayNote = dateNoteService.getDayNote;
|
||||||
|
|
||||||
@@ -382,8 +355,8 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
* Returns today's day note. If such note doesn't exist, it is created.
|
* Returns today's day note. If such note doesn't exist, it is created.
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
|
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
this.getTodayNote = dateNoteService.getTodayNote;
|
this.getTodayNote = dateNoteService.getTodayNote;
|
||||||
|
|
||||||
@@ -392,9 +365,10 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} date in YYYY-MM-DD format
|
* @param {string} date in YYYY-MM-DD format
|
||||||
* @param {object} [options] - "startOfTheWeek" - either "monday" (default) or "sunday"
|
* @param {object} [options]
|
||||||
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
|
* @param {string} [options.startOfTheWeek=monday] - either "monday" (default) or "sunday"
|
||||||
* @returns {Note|null}
|
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
|
||||||
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
this.getWeekNote = dateNoteService.getWeekNote;
|
this.getWeekNote = dateNoteService.getWeekNote;
|
||||||
|
|
||||||
@@ -403,8 +377,8 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} date in YYYY-MM format
|
* @param {string} date in YYYY-MM format
|
||||||
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
|
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
this.getMonthNote = dateNoteService.getMonthNote;
|
this.getMonthNote = dateNoteService.getMonthNote;
|
||||||
|
|
||||||
@@ -413,32 +387,22 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} year in YYYY format
|
* @param {string} year in YYYY format
|
||||||
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
|
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
this.getYearNote = dateNoteService.getYearNote;
|
this.getYearNote = dateNoteService.getYearNote;
|
||||||
|
|
||||||
/**
|
|
||||||
* @method
|
|
||||||
* @deprecated - use sortNotes instead
|
|
||||||
* @param {string} parentNoteId - this note's child notes will be sorted
|
|
||||||
*/
|
|
||||||
this.sortNotesByTitle = parentNoteId => treeService.sortNotes(parentNoteId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {Object} SortConfig
|
|
||||||
* @property {string} [sortBy=title] - 'title', 'dateCreated', 'dateModified' or a label name
|
|
||||||
* see https://github.com/zadam/trilium/wiki/Sorting for details.
|
|
||||||
* @property {boolean} [reverse=false]
|
|
||||||
* @property {boolean} [foldersFirst=false]
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sort child notes of a given note.
|
* Sort child notes of a given note.
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} parentNoteId - this note's child notes will be sorted
|
* @param {string} parentNoteId - this note's child notes will be sorted
|
||||||
* @param {SortConfig} [sortConfig]
|
* @param {object} [sortConfig]
|
||||||
|
* @property {string} [sortConfig.sortBy=title] - 'title', 'dateCreated', 'dateModified' or a label name
|
||||||
|
* See {@link https://github.com/zadam/trilium/wiki/Sorting} for details.
|
||||||
|
* @property {boolean} [sortConfig.reverse=false]
|
||||||
|
* @property {boolean} [sortConfig.foldersFirst=false]
|
||||||
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
this.sortNotes = (parentNoteId, sortConfig = {}) => treeService.sortNotes(
|
this.sortNotes = (parentNoteId, sortConfig = {}) => treeService.sortNotes(
|
||||||
parentNoteId,
|
parentNoteId,
|
||||||
@@ -454,10 +418,11 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
* This method looks similar to toggleNoteInParent() but differs because we're looking up branch by prefix.
|
* This method looks similar to toggleNoteInParent() but differs because we're looking up branch by prefix.
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @deprecated - this method is pretty confusing and serves specialized purpose only
|
* @deprecated this method is pretty confusing and serves specialized purpose only
|
||||||
* @param {string} noteId
|
* @param {string} noteId
|
||||||
* @param {string} prefix
|
* @param {string} prefix
|
||||||
* @param {string|null} parentNoteId
|
* @param {string|null} parentNoteId
|
||||||
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
this.setNoteToParent = treeService.setNoteToParent;
|
this.setNoteToParent = treeService.setNoteToParent;
|
||||||
|
|
||||||
@@ -501,37 +466,28 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
* @deprecated - this is now no-op since all the changes should be gracefully handled per widget
|
* @returns {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
|
||||||
*/
|
|
||||||
this.refreshTree = () => {
|
|
||||||
console.warn("api.refreshTree() is a NO-OP and can be removed from your script.")
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
|
|
||||||
*/
|
*/
|
||||||
this.getAppInfo = () => appInfo
|
this.getAppInfo = () => appInfo
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} CreateOrUpdateLauncher
|
* Creates a new launcher to the launchbar. If the launcher (id) already exists, it will be updated.
|
||||||
* @property {string} id - id of the launcher, only alphanumeric at least 6 characters long
|
*
|
||||||
* @property {string} type - one of
|
* @method
|
||||||
|
* @param {object} opts
|
||||||
|
* @property {string} opts.id - id of the launcher, only alphanumeric at least 6 characters long
|
||||||
|
* @property {string} opts.type - one of
|
||||||
* * "note" - activating the launcher will navigate to the target note (specified in targetNoteId param)
|
* * "note" - activating the launcher will navigate to the target note (specified in targetNoteId param)
|
||||||
* * "script" - activating the launcher will execute the script (specified in scriptNoteId param)
|
* * "script" - activating the launcher will execute the script (specified in scriptNoteId param)
|
||||||
* * "customWidget" - the launcher will be rendered with a custom widget (specified in widgetNoteId param)
|
* * "customWidget" - the launcher will be rendered with a custom widget (specified in widgetNoteId param)
|
||||||
* @property {string} title
|
* @property {string} opts.title
|
||||||
* @property {boolean} [isVisible=false] - if true, will be created in the "Visible launchers", otherwise in "Available launchers"
|
* @property {boolean} [opts.isVisible=false] - if true, will be created in the "Visible launchers", otherwise in "Available launchers"
|
||||||
* @property {string} [icon] - name of the boxicon to be used (e.g. "bx-time")
|
* @property {string} [opts.icon] - name of the boxicon to be used (e.g. "bx-time")
|
||||||
* @property {string} [keyboardShortcut] - will activate the target note/script upon pressing, e.g. "ctrl+e"
|
* @property {string} [opts.keyboardShortcut] - will activate the target note/script upon pressing, e.g. "ctrl+e"
|
||||||
* @property {string} [targetNoteId] - for type "note"
|
* @property {string} [opts.targetNoteId] - for type "note"
|
||||||
* @property {string} [scriptNoteId] - for type "script"
|
* @property {string} [opts.scriptNoteId] - for type "script"
|
||||||
* @property {string} [widgetNoteId] - for type "customWidget"
|
* @property {string} [opts.widgetNoteId] - for type "customWidget"
|
||||||
*/
|
* @returns {{note: BNote}}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new launcher to the launchbar. If the launcher (id) already exists, it will be updated.
|
|
||||||
*
|
|
||||||
* @param {CreateOrUpdateLauncher} opts
|
|
||||||
*/
|
*/
|
||||||
this.createOrUpdateLauncher = opts => {
|
this.createOrUpdateLauncher = opts => {
|
||||||
if (!opts.id) { throw new Error("ID is a mandatory parameter for api.createOrUpdateLauncher(opts)"); }
|
if (!opts.id) { throw new Error("ID is a mandatory parameter for api.createOrUpdateLauncher(opts)"); }
|
||||||
@@ -588,12 +544,23 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
} else {
|
} else {
|
||||||
launcherNote.removeLabel('keyboardShortcut');
|
launcherNote.removeLabel('keyboardShortcut');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return {note: launcherNote};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method
|
||||||
|
* @param {string} noteId
|
||||||
|
* @param {string} format - either 'html' or 'markdown'
|
||||||
|
* @param {string} zipFilePath
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
this.exportSubtreeToZipFile = async (noteId, format, zipFilePath) => await exportService.exportToZipFile(noteId, format, zipFilePath);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This object contains "at your risk" and "no BC guarantees" objects for advanced use cases.
|
* This object contains "at your risk" and "no BC guarantees" objects for advanced use cases.
|
||||||
*
|
*
|
||||||
* @type {{becca: Becca}}
|
* @property {Becca} becca - provides access to the backend in-memory object graph, see {@link https://github.com/zadam/trilium/blob/master/src/becca/becca.js}
|
||||||
*/
|
*/
|
||||||
this.__private = {
|
this.__private = {
|
||||||
becca
|
becca
|
||||||
@@ -611,13 +578,13 @@ module.exports = BackendScriptApi;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -284,6 +284,9 @@ function transactional(func) {
|
|||||||
require('../becca/becca_loader').load();
|
require('../becca/becca_loader').load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the maxEntityChangeId has been incremented during failed transaction, need to recalculate
|
||||||
|
require('./entity_changes').recalculateMaxEntityChangeId();
|
||||||
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -331,7 +334,7 @@ module.exports = {
|
|||||||
* @method
|
* @method
|
||||||
* @param {string} query - SQL query with ? used as parameter placeholder
|
* @param {string} query - SQL query with ? used as parameter placeholder
|
||||||
* @param {object[]} [params] - array of params if needed
|
* @param {object[]} [params] - array of params if needed
|
||||||
* @return [object] - single value
|
* @returns [object] - single value
|
||||||
*/
|
*/
|
||||||
getValue,
|
getValue,
|
||||||
|
|
||||||
@@ -341,7 +344,7 @@ module.exports = {
|
|||||||
* @method
|
* @method
|
||||||
* @param {string} query - SQL query with ? used as parameter placeholder
|
* @param {string} query - SQL query with ? used as parameter placeholder
|
||||||
* @param {object[]} [params] - array of params if needed
|
* @param {object[]} [params] - array of params if needed
|
||||||
* @return {object} - map of column name to column value
|
* @returns {object} - map of column name to column value
|
||||||
*/
|
*/
|
||||||
getRow,
|
getRow,
|
||||||
getRowOrNull,
|
getRowOrNull,
|
||||||
@@ -352,7 +355,7 @@ module.exports = {
|
|||||||
* @method
|
* @method
|
||||||
* @param {string} query - SQL query with ? used as parameter placeholder
|
* @param {string} query - SQL query with ? used as parameter placeholder
|
||||||
* @param {object[]} [params] - array of params if needed
|
* @param {object[]} [params] - array of params if needed
|
||||||
* @return {object[]} - array of all rows, each row is a map of column name to column value
|
* @returns {object[]} - array of all rows, each row is a map of column name to column value
|
||||||
*/
|
*/
|
||||||
getRows,
|
getRows,
|
||||||
getRawRows,
|
getRawRows,
|
||||||
@@ -365,7 +368,7 @@ module.exports = {
|
|||||||
* @method
|
* @method
|
||||||
* @param {string} query - SQL query with ? used as parameter placeholder
|
* @param {string} query - SQL query with ? used as parameter placeholder
|
||||||
* @param {object[]} [params] - array of params if needed
|
* @param {object[]} [params] - array of params if needed
|
||||||
* @return {object} - map of first column to second column
|
* @returns {object} - map of first column to second column
|
||||||
*/
|
*/
|
||||||
getMap,
|
getMap,
|
||||||
|
|
||||||
@@ -375,7 +378,7 @@ module.exports = {
|
|||||||
* @method
|
* @method
|
||||||
* @param {string} query - SQL query with ? used as parameter placeholder
|
* @param {string} query - SQL query with ? used as parameter placeholder
|
||||||
* @param {object[]} [params] - array of params if needed
|
* @param {object[]} [params] - array of params if needed
|
||||||
* @return {object[]} - array of first column of all returned rows
|
* @returns {object[]} - array of first column of all returned rows
|
||||||
*/
|
*/
|
||||||
getColumn,
|
getColumn,
|
||||||
|
|
||||||
@@ -404,13 +407,13 @@ module.exports = {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Class: Attribute</title>
|
<title>JSDoc: Class: FAttribute</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Class: Attribute</h1>
|
<h1 class="page-title">Class: FAttribute</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>Attribute<span class="signature">()</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>FAttribute<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">Attribute is an abstract concept which has two real uses - label (key - value pair)
|
<div class="class-description">Attribute is an abstract concept which has two real uses - label (key - value pair)
|
||||||
and relation (representing named relationship between source and target note)</div>
|
and relation (representing named relationship between source and target note)</div>
|
||||||
@@ -46,7 +46,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="Attribute"><span class="type-signature"></span>new Attribute<span class="signature">()</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="FAttribute"><span class="type-signature"></span>new FAttribute<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line7">line 7</a>
|
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line7">line 7</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line16">line 16</a>
|
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line16">line 16</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -262,7 +262,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line28">line 28</a>
|
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line28">line 28</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line22">line 22</a>
|
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line22">line 22</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -398,7 +398,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line18">line 18</a>
|
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line18">line 18</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line26">line 26</a>
|
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line26">line 26</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -534,7 +534,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line20">line 20</a>
|
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line20">line 20</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -602,7 +602,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line24">line 24</a>
|
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line24">line 24</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -630,7 +630,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">()</span><span class="type-signature"> → {<a href="NoteShort.html">NoteShort</a>}</span></h4>
|
<h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">()</span><span class="type-signature"> → {<a href="FNote.html">FNote</a>}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -678,7 +678,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line32">line 32</a>
|
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line32">line 32</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -714,7 +714,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
<span class="param-type"><a href="FNote.html">FNote</a></span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -732,7 +732,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="getTargetNote"><span class="type-signature">(async) </span>getTargetNote<span class="signature">()</span><span class="type-signature"> → {Promise.<<a href="NoteShort.html">NoteShort</a>>}</span></h4>
|
<h4 class="name" id="getTargetNote"><span class="type-signature">(async) </span>getTargetNote<span class="signature">()</span><span class="type-signature"> → {Promise.<<a href="FNote.html">FNote</a>>}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -780,7 +780,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line37">line 37</a>
|
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line37">line 37</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -816,7 +816,7 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type">Promise.<<a href="NoteShort.html">NoteShort</a>></span>
|
<span class="param-type">Promise.<<a href="FNote.html">FNote</a>></span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -844,13 +844,13 @@ and relation (representing named relationship between source and target note)</d
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FNoteComplement.html">FNoteComplement</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Class: Branch</title>
|
<title>JSDoc: Class: FBranch</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Class: Branch</h1>
|
<h1 class="page-title">Class: FBranch</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>Branch<span class="signature">()</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>FBranch<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
<div class="class-description">Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
||||||
parents.</div>
|
parents.</div>
|
||||||
@@ -46,7 +46,7 @@ parents.</div>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="Branch"><span class="type-signature"></span>new Branch<span class="signature">()</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="FBranch"><span class="type-signature"></span>new FBranch<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line5">line 5</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line5">line 5</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line17">line 17</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line17">line 17</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line29">line 29</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line29">line 29</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line27">line 27</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line27">line 27</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -402,7 +402,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line19">line 19</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line19">line 19</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -470,7 +470,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line23">line 23</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line23">line 23</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -538,7 +538,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line21">line 21</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line21">line 21</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -606,7 +606,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line25">line 25</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line25">line 25</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -634,7 +634,7 @@ parents.</div>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> → {<a href="NoteShort.html">NoteShort</a>}</span></h4>
|
<h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> → {<a href="FNote.html">FNote</a>}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -682,7 +682,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line33">line 33</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line33">line 33</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -718,7 +718,7 @@ parents.</div>
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
<span class="param-type"><a href="FNote.html">FNote</a></span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -736,7 +736,7 @@ parents.</div>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="getNoteFromCache"><span class="type-signature"></span>getNoteFromCache<span class="signature">()</span><span class="type-signature"> → {<a href="NoteShort.html">NoteShort</a>}</span></h4>
|
<h4 class="name" id="getNoteFromCache"><span class="type-signature"></span>getNoteFromCache<span class="signature">()</span><span class="type-signature"> → {<a href="FNote.html">FNote</a>}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -784,7 +784,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line38">line 38</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line38">line 38</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -820,7 +820,7 @@ parents.</div>
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
<span class="param-type"><a href="FNote.html">FNote</a></span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -838,7 +838,7 @@ parents.</div>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="getParentNote"><span class="type-signature">(async) </span>getParentNote<span class="signature">()</span><span class="type-signature"> → {<a href="NoteShort.html">NoteShort</a>}</span></h4>
|
<h4 class="name" id="getParentNote"><span class="type-signature">(async) </span>getParentNote<span class="signature">()</span><span class="type-signature"> → {<a href="FNote.html">FNote</a>}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -886,7 +886,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line43">line 43</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line43">line 43</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -922,7 +922,7 @@ parents.</div>
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
<span class="param-type"><a href="FNote.html">FNote</a></span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
@@ -988,7 +988,7 @@ parents.</div>
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line48">line 48</a>
|
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line48">line 48</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -1056,13 +1056,13 @@ parents.</div>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FNoteComplement.html">FNoteComplement</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Class: NoteComplement</title>
|
<title>JSDoc: Class: FNoteComplement</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Class: NoteComplement</h1>
|
<h1 class="page-title">Class: FNoteComplement</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>NoteComplement<span class="signature">()</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>FNoteComplement<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">Complements the NoteShort with the main note content and other extra attributes</div>
|
<div class="class-description">Complements the FNote with the main note content and other extra attributes</div>
|
||||||
|
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="NoteComplement"><span class="type-signature"></span>new NoteComplement<span class="signature">()</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="FNoteComplement"><span class="type-signature"></span>new FNoteComplement<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line4">line 4</a>
|
<a href="entities_fnote_complement.js.html">entities/fnote_complement.js</a>, <a href="entities_fnote_complement.js.html#line4">line 4</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line33">line 33</a>
|
<a href="entities_fnote_complement.js.html">entities/fnote_complement.js</a>, <a href="entities_fnote_complement.js.html#line33">line 33</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -261,7 +261,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line36">line 36</a>
|
<a href="entities_fnote_complement.js.html">entities/fnote_complement.js</a>, <a href="entities_fnote_complement.js.html#line36">line 36</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -333,7 +333,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line13">line 13</a>
|
<a href="entities_fnote_complement.js.html">entities/fnote_complement.js</a>, <a href="entities_fnote_complement.js.html#line13">line 13</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -401,7 +401,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line16">line 16</a>
|
<a href="entities_fnote_complement.js.html">entities/fnote_complement.js</a>, <a href="entities_fnote_complement.js.html#line16">line 16</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -469,7 +469,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line19">line 19</a>
|
<a href="entities_fnote_complement.js.html">entities/fnote_complement.js</a>, <a href="entities_fnote_complement.js.html#line19">line 19</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -537,7 +537,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line22">line 22</a>
|
<a href="entities_fnote_complement.js.html">entities/fnote_complement.js</a>, <a href="entities_fnote_complement.js.html#line22">line 22</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -605,7 +605,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line7">line 7</a>
|
<a href="entities_fnote_complement.js.html">entities/fnote_complement.js</a>, <a href="entities_fnote_complement.js.html#line7">line 7</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -673,7 +673,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line25">line 25</a>
|
<a href="entities_fnote_complement.js.html">entities/fnote_complement.js</a>, <a href="entities_fnote_complement.js.html#line25">line 25</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -741,7 +741,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line28">line 28</a>
|
<a href="entities_fnote_complement.js.html">entities/fnote_complement.js</a>, <a href="entities_fnote_complement.js.html#line28">line 28</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -775,13 +775,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FNoteComplement.html">FNoteComplement</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: entities/attribute.js</title>
|
<title>JSDoc: Source: entities/fattribute.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: entities/attribute.js</h1>
|
<h1 class="page-title">Source: entities/fattribute.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
* Attribute is an abstract concept which has two real uses - label (key - value pair)
|
* Attribute is an abstract concept which has two real uses - label (key - value pair)
|
||||||
* and relation (representing named relationship between source and target note)
|
* and relation (representing named relationship between source and target note)
|
||||||
*/
|
*/
|
||||||
class Attribute {
|
class FAttribute {
|
||||||
constructor(froca, row) {
|
constructor(froca, row) {
|
||||||
this.froca = froca;
|
this.froca = froca;
|
||||||
|
|
||||||
@@ -56,12 +56,12 @@ class Attribute {
|
|||||||
this.isInheritable = !!row.isInheritable;
|
this.isInheritable = !!row.isInheritable;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort} */
|
/** @returns {FNote} */
|
||||||
getNote() {
|
getNote() {
|
||||||
return this.froca.notes[this.noteId];
|
return this.froca.notes[this.noteId];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise<NoteShort>} */
|
/** @returns {Promise<FNote>} */
|
||||||
async getTargetNote() {
|
async getTargetNote() {
|
||||||
const targetNoteId = this.targetNoteId;
|
const targetNoteId = this.targetNoteId;
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ class Attribute {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get toString() {
|
get toString() {
|
||||||
return `Attribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name}, value=${this.value})`;
|
return `FAttribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name}, value=${this.value})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
isDefinition() {
|
isDefinition() {
|
||||||
@@ -104,7 +104,7 @@ class Attribute {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Attribute;
|
export default FAttribute;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -115,13 +115,13 @@ export default Attribute;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FNoteComplement.html">FNoteComplement</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: entities/branch.js</title>
|
<title>JSDoc: Source: entities/fbranch.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: entities/branch.js</h1>
|
<h1 class="page-title">Source: entities/fbranch.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
* Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
* Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
||||||
* parents.
|
* parents.
|
||||||
*/
|
*/
|
||||||
class Branch {
|
class FBranch {
|
||||||
constructor(froca, row) {
|
constructor(froca, row) {
|
||||||
this.froca = froca;
|
this.froca = froca;
|
||||||
|
|
||||||
@@ -57,17 +57,17 @@ class Branch {
|
|||||||
this.fromSearchNote = !!row.fromSearchNote;
|
this.fromSearchNote = !!row.fromSearchNote;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort} */
|
/** @returns {FNote} */
|
||||||
async getNote() {
|
async getNote() {
|
||||||
return this.froca.getNote(this.noteId);
|
return this.froca.getNote(this.noteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort} */
|
/** @returns {FNote} */
|
||||||
getNoteFromCache() {
|
getNoteFromCache() {
|
||||||
return this.froca.getNoteFromCache(this.noteId);
|
return this.froca.getNoteFromCache(this.noteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort} */
|
/** @returns {FNote} */
|
||||||
async getParentNote() {
|
async getParentNote() {
|
||||||
return this.froca.getNote(this.parentNoteId);
|
return this.froca.getNote(this.parentNoteId);
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ class Branch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get toString() {
|
get toString() {
|
||||||
return `Branch(branchId=${this.branchId})`;
|
return `FBranch(branchId=${this.branchId})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
get pojo() {
|
get pojo() {
|
||||||
@@ -88,7 +88,7 @@ class Branch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Branch;
|
export default FBranch;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -99,13 +99,13 @@ export default Branch;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FNoteComplement.html">FNoteComplement</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: entities/note_short.js</title>
|
<title>JSDoc: Source: entities/fnote.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: entities/note_short.js</h1>
|
<h1 class="page-title">Source: entities/fnote.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -54,12 +54,7 @@ const NOTE_TYPE_ICONS = {
|
|||||||
"contentWidget": "bx bxs-widget"
|
"contentWidget": "bx bxs-widget"
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
class FNote {
|
||||||
* FIXME: since there's no "full note" anymore we can rename this to Note
|
|
||||||
*
|
|
||||||
* This note's representation is used in note tree and is kept in Froca.
|
|
||||||
*/
|
|
||||||
class NoteShort {
|
|
||||||
/**
|
/**
|
||||||
* @param {Froca} froca
|
* @param {Froca} froca
|
||||||
* @param {Object.<string, Object>} row
|
* @param {Object.<string, Object>} row
|
||||||
@@ -146,7 +141,7 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getContent() {
|
async getContent() {
|
||||||
// we're not caching content since these objects are in froca and as such pretty long lived
|
// we're not caching content since these objects are in froca and as such pretty long-lived
|
||||||
const note = await server.get(`notes/${this.noteId}`);
|
const note = await server.get(`notes/${this.noteId}`);
|
||||||
|
|
||||||
return note.content;
|
return note.content;
|
||||||
@@ -181,7 +176,7 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Branch[]}
|
* @returns {FBranch[]}
|
||||||
*/
|
*/
|
||||||
getParentBranches() {
|
getParentBranches() {
|
||||||
const branchIds = Object.values(this.parentToBranch);
|
const branchIds = Object.values(this.parentToBranch);
|
||||||
@@ -190,7 +185,7 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Branch[]}
|
* @returns {FBranch[]}
|
||||||
* @deprecated use getParentBranches() instead
|
* @deprecated use getParentBranches() instead
|
||||||
*/
|
*/
|
||||||
getBranches() {
|
getBranches() {
|
||||||
@@ -202,7 +197,7 @@ class NoteShort {
|
|||||||
return this.children.length > 0;
|
return this.children.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Branch[]} */
|
/** @returns {FBranch[]} */
|
||||||
getChildBranches() {
|
getChildBranches() {
|
||||||
// don't use Object.values() to guarantee order
|
// don't use Object.values() to guarantee order
|
||||||
const branchIds = this.children.map(childNoteId => this.childToBranch[childNoteId]);
|
const branchIds = this.children.map(childNoteId => this.childToBranch[childNoteId]);
|
||||||
@@ -215,7 +210,7 @@ class NoteShort {
|
|||||||
return this.parents;
|
return this.parents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort[]} */
|
/** @returns {FNote[]} */
|
||||||
getParentNotes() {
|
getParentNotes() {
|
||||||
return this.froca.getNotesFromCache(this.parents);
|
return this.froca.getNotesFromCache(this.parents);
|
||||||
}
|
}
|
||||||
@@ -232,7 +227,7 @@ class NoteShort {
|
|||||||
|
|
||||||
const aNote = this.froca.getNoteFromCache([aNoteId]);
|
const aNote = this.froca.getNoteFromCache([aNoteId]);
|
||||||
|
|
||||||
if (aNote.hasLabel('archived')) {
|
if (aNote.isArchived || aNote.isHiddenCompletely()) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,12 +235,16 @@ class NoteShort {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isArchived() {
|
||||||
|
return this.hasAttribute('label', 'archived');
|
||||||
|
}
|
||||||
|
|
||||||
/** @returns {string[]} */
|
/** @returns {string[]} */
|
||||||
getChildNoteIds() {
|
getChildNoteIds() {
|
||||||
return this.children;
|
return this.children;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise<NoteShort[]>} */
|
/** @returns {Promise<FNote[]>} */
|
||||||
async getChildNotes() {
|
async getChildNotes() {
|
||||||
return await this.froca.getNotes(this.children);
|
return await this.froca.getNotes(this.children);
|
||||||
}
|
}
|
||||||
@@ -253,7 +252,7 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* @param {string} [type] - (optional) attribute type to filter
|
* @param {string} [type] - (optional) attribute type to filter
|
||||||
* @param {string} [name] - (optional) attribute name to filter
|
* @param {string} [name] - (optional) attribute name to filter
|
||||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
* @returns {FAttribute[]} all note's attributes, including inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedAttributes(type, name) {
|
getOwnedAttributes(type, name) {
|
||||||
const attrs = this.attributes
|
const attrs = this.attributes
|
||||||
@@ -266,7 +265,7 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* @param {string} [type] - (optional) attribute type to filter
|
* @param {string} [type] - (optional) attribute type to filter
|
||||||
* @param {string} [name] - (optional) attribute name to filter
|
* @param {string} [name] - (optional) attribute name to filter
|
||||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
* @returns {FAttribute[]} all note's attributes, including inherited ones
|
||||||
*/
|
*/
|
||||||
getAttributes(type, name) {
|
getAttributes(type, name) {
|
||||||
return this.__filterAttrs(this.__getCachedAttributes([]), type, name);
|
return this.__filterAttrs(this.__getCachedAttributes([]), type, name);
|
||||||
@@ -283,7 +282,8 @@ class NoteShort {
|
|||||||
const newPath = [...path, this.noteId];
|
const newPath = [...path, this.noteId];
|
||||||
const attrArrs = [ this.getOwnedAttributes() ];
|
const attrArrs = [ this.getOwnedAttributes() ];
|
||||||
|
|
||||||
if (this.noteId !== 'root') {
|
// inheritable attrs on root are typically not intended to be applied to hidden subtree #3537
|
||||||
|
if (this.noteId !== 'root' && this.noteId !== '_hidden') {
|
||||||
for (const parentNote of this.getParentNotes()) {
|
for (const parentNote of this.getParentNotes()) {
|
||||||
// these virtual parent-child relationships are also loaded into froca
|
// these virtual parent-child relationships are also loaded into froca
|
||||||
if (parentNote.type !== 'search') {
|
if (parentNote.type !== 'search') {
|
||||||
@@ -292,7 +292,7 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const templateAttr of attrArrs.flat().filter(attr => attr.type === 'relation' && attr.name === 'template')) {
|
for (const templateAttr of attrArrs.flat().filter(attr => attr.type === 'relation' && ['template', 'inherit'].includes(attr.name))) {
|
||||||
const templateNote = this.froca.notes[templateAttr.value];
|
const templateNote = this.froca.notes[templateAttr.value];
|
||||||
|
|
||||||
if (templateNote && templateNote.noteId !== this.noteId) {
|
if (templateNote && templateNote.noteId !== this.noteId) {
|
||||||
@@ -370,7 +370,7 @@ class NoteShort {
|
|||||||
const notePaths = this.getAllNotePaths().map(path => ({
|
const notePaths = this.getAllNotePaths().map(path => ({
|
||||||
notePath: path,
|
notePath: path,
|
||||||
isInHoistedSubTree: path.includes(hoistedNotePath),
|
isInHoistedSubTree: path.includes(hoistedNotePath),
|
||||||
isArchived: path.find(noteId => froca.notes[noteId].hasLabel('archived')),
|
isArchived: path.find(noteId => froca.notes[noteId].isArchived),
|
||||||
isSearch: path.find(noteId => froca.notes[noteId].type === 'search'),
|
isSearch: path.find(noteId => froca.notes[noteId].type === 'search'),
|
||||||
isHidden: path.includes('_hidden')
|
isHidden: path.includes('_hidden')
|
||||||
}));
|
}));
|
||||||
@@ -392,13 +392,36 @@ class NoteShort {
|
|||||||
return notePaths;
|
return notePaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return boolean - true if there's no non-hidden path, note is not cloned to the visible tree
|
||||||
|
*/
|
||||||
|
isHiddenCompletely() {
|
||||||
|
if (this.noteId === 'root') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const parentNote of this.getParentNotes()) {
|
||||||
|
if (parentNote.noteId === 'root') {
|
||||||
|
return false;
|
||||||
|
} else if (parentNote.noteId === '_hidden') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!parentNote.isHiddenCompletely()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
__filterAttrs(attributes, type, name) {
|
__filterAttrs(attributes, type, name) {
|
||||||
this.__validateTypeName(type, name);
|
this.__validateTypeName(type, name);
|
||||||
|
|
||||||
if (!type && !name) {
|
if (!type && !name) {
|
||||||
return attributes;
|
return attributes;
|
||||||
} else if (type && name) {
|
} else if (type && name) {
|
||||||
return attributes.filter(attr => attr.type === type && attr.name === name);
|
return attributes.filter(attr => attr.name === name && attr.type === type);
|
||||||
} else if (type) {
|
} else if (type) {
|
||||||
return attributes.filter(attr => attr.type === type);
|
return attributes.filter(attr => attr.type === type);
|
||||||
} else if (name) {
|
} else if (name) {
|
||||||
@@ -427,7 +450,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - label name to filter
|
* @param {string} [name] - label name to filter
|
||||||
* @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
|
* @returns {FAttribute[]} all note's labels (attributes with type label), including inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedLabels(name) {
|
getOwnedLabels(name) {
|
||||||
return this.getOwnedAttributes(LABEL, name);
|
return this.getOwnedAttributes(LABEL, name);
|
||||||
@@ -435,7 +458,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - label name to filter
|
* @param {string} [name] - label name to filter
|
||||||
* @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
|
* @returns {FAttribute[]} all note's labels (attributes with type label), including inherited ones
|
||||||
*/
|
*/
|
||||||
getLabels(name) {
|
getLabels(name) {
|
||||||
return this.getAttributes(LABEL, name);
|
return this.getAttributes(LABEL, name);
|
||||||
@@ -487,7 +510,7 @@ class NoteShort {
|
|||||||
let childBranches = this.getChildBranches();
|
let childBranches = this.getChildBranches();
|
||||||
|
|
||||||
if (!childBranches) {
|
if (!childBranches) {
|
||||||
ws.logError(`No children for ${parentNote}. This shouldn't happen.`);
|
ws.logError(`No children for '${this.noteId}'. This shouldn't happen.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,7 +531,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - relation name to filter
|
* @param {string} [name] - relation name to filter
|
||||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
* @returns {FAttribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedRelations(name) {
|
getOwnedRelations(name) {
|
||||||
return this.getOwnedAttributes(RELATION, name);
|
return this.getOwnedAttributes(RELATION, name);
|
||||||
@@ -516,7 +539,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - relation name to filter
|
* @param {string} [name] - relation name to filter
|
||||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
* @returns {FAttribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||||
*/
|
*/
|
||||||
getRelations(name) {
|
getRelations(name) {
|
||||||
return this.getAttributes(RELATION, name);
|
return this.getAttributes(RELATION, name);
|
||||||
@@ -543,23 +566,23 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* @param {string} type - attribute type (label, relation, etc.)
|
* @param {string} type - attribute type (label, relation, etc.)
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
* @returns {FAttribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||||
*/
|
*/
|
||||||
getOwnedAttribute(type, name) {
|
getOwnedAttribute(type, name) {
|
||||||
const attributes = this.getOwnedAttributes(type, name);
|
const attributes = this.getOwnedAttributes();
|
||||||
|
|
||||||
return attributes.length > 0 ? attributes[0] : 0;
|
return attributes.find(attr => attr.name === name && attr.type === type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type - attribute type (label, relation, etc.)
|
* @param {string} type - attribute type (label, relation, etc.)
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
* @returns {FAttribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||||
*/
|
*/
|
||||||
getAttribute(type, name) {
|
getAttribute(type, name) {
|
||||||
const attributes = this.getAttributes(type, name);
|
const attributes = this.getAttributes();
|
||||||
|
|
||||||
return attributes.length > 0 ? attributes[0] : null;
|
return attributes.find(attr => attr.name === name && attr.type === type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -610,25 +633,25 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Attribute} label if it exists, null otherwise
|
* @returns {FAttribute} label if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
|
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Attribute} label if it exists, null otherwise
|
* @returns {FAttribute} label if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getLabel(name) { return this.getAttribute(LABEL, name); }
|
getLabel(name) { return this.getAttribute(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Attribute} relation if it exists, null otherwise
|
* @returns {FAttribute} relation if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
|
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Attribute} relation if it exists, null otherwise
|
* @returns {FAttribute} relation if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getRelation(name) { return this.getAttribute(RELATION, name); }
|
getRelation(name) { return this.getAttribute(RELATION, name); }
|
||||||
|
|
||||||
@@ -658,7 +681,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
* @returns {Promise<NoteShort>|null} target note of the relation or null (if target is empty or note was not found)
|
* @returns {Promise<FNote>|null} target note of the relation or null (if target is empty or note was not found)
|
||||||
*/
|
*/
|
||||||
async getRelationTarget(name) {
|
async getRelationTarget(name) {
|
||||||
const targets = await this.getRelationTargets(name);
|
const targets = await this.getRelationTargets(name);
|
||||||
@@ -668,7 +691,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - relation name to filter
|
* @param {string} [name] - relation name to filter
|
||||||
* @returns {Promise<NoteShort[]>}
|
* @returns {Promise<FNote[]>}
|
||||||
*/
|
*/
|
||||||
async getRelationTargets(name) {
|
async getRelationTargets(name) {
|
||||||
const relations = this.getRelations(name);
|
const relations = this.getRelations(name);
|
||||||
@@ -682,10 +705,13 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {NoteShort[]}
|
* @returns {FNote[]}
|
||||||
*/
|
*/
|
||||||
getTemplateNotes() {
|
getNotesToInheritAttributesFrom() {
|
||||||
const relations = this.getRelations('template');
|
const relations = [
|
||||||
|
...this.getRelations('template'),
|
||||||
|
...this.getRelations('inherit')
|
||||||
|
];
|
||||||
|
|
||||||
return relations.map(rel => this.froca.notes[rel.value]);
|
return relations.map(rel => this.froca.notes[rel.value]);
|
||||||
}
|
}
|
||||||
@@ -709,7 +735,7 @@ class NoteShort {
|
|||||||
return promotedAttrs;
|
return promotedAttrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
hasAncestor(ancestorNoteId, visitedNoteIds = null) {
|
hasAncestor(ancestorNoteId, followTemplates = false, visitedNoteIds = null) {
|
||||||
if (this.noteId === ancestorNoteId) {
|
if (this.noteId === ancestorNoteId) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -723,14 +749,16 @@ class NoteShort {
|
|||||||
|
|
||||||
visitedNoteIds.add(this.noteId);
|
visitedNoteIds.add(this.noteId);
|
||||||
|
|
||||||
for (const templateNote of this.getTemplateNotes()) {
|
if (followTemplates) {
|
||||||
if (templateNote.hasAncestor(ancestorNoteId, visitedNoteIds)) {
|
for (const templateNote of this.getNotesToInheritAttributesFrom()) {
|
||||||
|
if (templateNote.hasAncestor(ancestorNoteId, followTemplates, visitedNoteIds)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const parentNote of this.getParentNotes()) {
|
for (const parentNote of this.getParentNotes()) {
|
||||||
if (parentNote.hasAncestor(ancestorNoteId, visitedNoteIds)) {
|
if (parentNote.hasAncestor(ancestorNoteId, followTemplates, visitedNoteIds)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -750,7 +778,7 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* Get relations which target this note
|
* Get relations which target this note
|
||||||
*
|
*
|
||||||
* @returns {Attribute[]}
|
* @returns {FAttribute[]}
|
||||||
*/
|
*/
|
||||||
getTargetRelations() {
|
getTargetRelations() {
|
||||||
return this.targetRelations
|
return this.targetRelations
|
||||||
@@ -760,7 +788,7 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* Get relations which target this note
|
* Get relations which target this note
|
||||||
*
|
*
|
||||||
* @returns {NoteShort[]}
|
* @returns {FNote[]}
|
||||||
*/
|
*/
|
||||||
async getTargetRelationSourceNotes() {
|
async getTargetRelationSourceNotes() {
|
||||||
const targetRelations = this.getTargetRelations();
|
const targetRelations = this.getTargetRelations();
|
||||||
@@ -771,7 +799,7 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* Return note complement which is most importantly note's content
|
* Return note complement which is most importantly note's content
|
||||||
*
|
*
|
||||||
* @return {Promise<NoteComplement>}
|
* @returns {Promise<FNoteComplement>}
|
||||||
*/
|
*/
|
||||||
async getNoteComplement() {
|
async getNoteComplement() {
|
||||||
return await this.froca.getNoteComplement(this.noteId);
|
return await this.froca.getNoteComplement(this.noteId);
|
||||||
@@ -803,7 +831,7 @@ class NoteShort {
|
|||||||
return labels.length > 0 ? labels[0].value : "";
|
return labels.length > 0 ? labels[0].value : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {boolean} true if this note is JavaScript (code or attachment) */
|
/** @returns {boolean} true if this note is JavaScript (code or file) */
|
||||||
isJavaScript() {
|
isJavaScript() {
|
||||||
return (this.type === "code" || this.type === "file" || this.type === 'launcher')
|
return (this.type === "code" || this.type === "file" || this.type === 'launcher')
|
||||||
&& (this.mime.startsWith("application/javascript")
|
&& (this.mime.startsWith("application/javascript")
|
||||||
@@ -881,11 +909,11 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isOptions() {
|
isOptions() {
|
||||||
return this.noteId.startsWith("options");
|
return this.noteId.startsWith("_options");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NoteShort;
|
export default FNote;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -896,13 +924,13 @@ export default NoteShort;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FNoteComplement.html">FNoteComplement</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: Source: entities/note_complement.js</title>
|
<title>JSDoc: Source: entities/fnote_complement.js</title>
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
<script src="scripts/prettify/prettify.js"> </script>
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
<script src="scripts/prettify/lang-css.js"> </script>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title">Source: entities/note_complement.js</h1>
|
<h1 class="page-title">Source: entities/fnote_complement.js</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -27,9 +27,9 @@
|
|||||||
<section>
|
<section>
|
||||||
<article>
|
<article>
|
||||||
<pre class="prettyprint source linenums"><code>/**
|
<pre class="prettyprint source linenums"><code>/**
|
||||||
* Complements the NoteShort with the main note content and other extra attributes
|
* Complements the FNote with the main note content and other extra attributes
|
||||||
*/
|
*/
|
||||||
class NoteComplement {
|
class FNoteComplement {
|
||||||
constructor(row) {
|
constructor(row) {
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
this.noteId = row.noteId;
|
this.noteId = row.noteId;
|
||||||
@@ -65,7 +65,7 @@ class NoteComplement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NoteComplement;
|
export default FNoteComplement;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
@@ -76,13 +76,13 @@ export default NoteComplement;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FNoteComplement.html">FNoteComplement</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
@@ -1,472 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>JSDoc: Global</title>
|
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="main">
|
|
||||||
|
|
||||||
<h1 class="page-title">Global</h1>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<section>
|
|
||||||
|
|
||||||
<header>
|
|
||||||
|
|
||||||
<h2></h2>
|
|
||||||
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<article>
|
|
||||||
<div class="container-overview">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3 class="subsection-title">Methods</h3>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="doRenderBody"><span class="type-signature">(async) </span>doRenderBody<span class="signature">()</span><span class="type-signature"></span></h4>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="description">
|
|
||||||
for overriding
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
|
||||||
<a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line37">line 37</a>
|
|
||||||
</li></ul></dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3 class="subsection-title">Type Definitions</h3>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="AddButtonToToolbarOptions">AddButtonToToolbarOptions</h4>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Type:</h5>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<span class="param-type">Object</span>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5 class="subsection-title">Properties:</h5>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<table class="props">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th>Name</th>
|
|
||||||
|
|
||||||
|
|
||||||
<th>Type</th>
|
|
||||||
|
|
||||||
|
|
||||||
<th>Attributes</th>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<th class="last">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>id</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="attributes">
|
|
||||||
|
|
||||||
<optional><br>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last">id of the button, used to identify the old instances of this button to be replaced
|
|
||||||
ID is optional because of BC, but not specifying it is deprecated. ID can be alphanumeric only.</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>title</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="attributes">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last"></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>icon</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="attributes">
|
|
||||||
|
|
||||||
<optional><br>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last">name of the boxicon to be used (e.g. "time" for "bx-time" icon)</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>action</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">function</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="attributes">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last">callback handling the click on the button</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>shortcut</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="attributes">
|
|
||||||
|
|
||||||
<optional><br>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last">keyboard shortcut for the button, e.g. "alt+t"</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#line108">line 108</a>
|
|
||||||
</li></ul></dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<nav>
|
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<br class="clear">
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
|
||||||
<script src="scripts/linenumber.js"> </script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -50,13 +50,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FNoteComplement.html">FNoteComplement</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -1,170 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>JSDoc: Class: exports</title>
|
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="main">
|
|
||||||
|
|
||||||
<h1 class="page-title">Class: exports</h1>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<section>
|
|
||||||
|
|
||||||
<header>
|
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>exports<span class="signature">()</span><span class="type-signature"></span></h2>
|
|
||||||
|
|
||||||
<div class="class-description">TODO: rename, it's not collapsible anymore</div>
|
|
||||||
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<article>
|
|
||||||
<div class="container-overview">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Constructor</h2>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="exports"><span class="type-signature"></span>new exports<span class="signature">()</span><span class="type-signature"></span></h4>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
|
||||||
<a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line15">line 15</a>
|
|
||||||
</li></ul></dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<nav>
|
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<br class="clear">
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
|
||||||
<script src="scripts/linenumber.js"> </script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -35,7 +35,7 @@ import noteTooltipService from './note_tooltip.js';
|
|||||||
import protectedSessionService from './protected_session.js';
|
import protectedSessionService from './protected_session.js';
|
||||||
import dateNotesService from './date_notes.js';
|
import dateNotesService from './date_notes.js';
|
||||||
import searchService from './search.js';
|
import searchService from './search.js';
|
||||||
import CollapsibleWidget from '../widgets/collapsible_widget.js';
|
import RightPanelWidget from '../widgets/right_panel_widget.js';
|
||||||
import ws from "./ws.js";
|
import ws from "./ws.js";
|
||||||
import appContext from "../components/app_context.js";
|
import appContext from "../components/app_context.js";
|
||||||
import NoteContextAwareWidget from "../widgets/note_context_aware_widget.js";
|
import NoteContextAwareWidget from "../widgets/note_context_aware_widget.js";
|
||||||
@@ -44,10 +44,10 @@ import SpacedUpdate from "./spaced_update.js";
|
|||||||
import shortcutService from "./shortcuts.js";
|
import shortcutService from "./shortcuts.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the main frontend API interface for scripts. It's published in the local "api" object.
|
* <p>This is the main frontend API interface for scripts. All the properties and methods are published in the "api" object
|
||||||
|
* available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.startNote.title);</code></p>
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @hideconstructor
|
|
||||||
*/
|
*/
|
||||||
function FrontendScriptApi(startNote, currentNote, originEntity = null, $container = null) {
|
function FrontendScriptApi(startNote, currentNote, originEntity = null, $container = null) {
|
||||||
/** @property {jQuery} container of all the rendered script content */
|
/** @property {jQuery} container of all the rendered script content */
|
||||||
@@ -60,15 +60,39 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
/** @property {object|null} entity whose event triggered this execution */
|
/** @property {object|null} entity whose event triggered this execution */
|
||||||
this.originEntity = originEntity;
|
this.originEntity = originEntity;
|
||||||
|
|
||||||
// to keep consistency with backend API
|
/** @property {dayjs} day.js library for date manipulation. See {@link https://day.js.org} for documentation */
|
||||||
this.dayjs = dayjs;
|
this.dayjs = dayjs;
|
||||||
|
|
||||||
/** @property {CollapsibleWidget} */
|
/**
|
||||||
this.CollapsibleWidget = CollapsibleWidget;
|
* @property {RightPanelWidget}
|
||||||
|
* @deprecated use api.RightPanelWidget instead
|
||||||
|
*/
|
||||||
|
this.CollapsibleWidget = RightPanelWidget;
|
||||||
|
|
||||||
|
/** @property {RightPanelWidget} */
|
||||||
|
this.RightPanelWidget = RightPanelWidget;
|
||||||
|
|
||||||
/** @property {NoteContextAwareWidget} */
|
/** @property {NoteContextAwareWidget} */
|
||||||
this.NoteContextAwareWidget = NoteContextAwareWidget;
|
this.NoteContextAwareWidget = NoteContextAwareWidget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {NoteContextAwareWidget}
|
||||||
|
* @deprecated use NoteContextAwareWidget instead
|
||||||
|
*/
|
||||||
|
this.TabAwareWidget = NoteContextAwareWidget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {NoteContextAwareWidget}
|
||||||
|
* @deprecated use NoteContextAwareWidget instead
|
||||||
|
*/
|
||||||
|
this.TabCachingWidget = NoteContextAwareWidget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {NoteContextAwareWidget}
|
||||||
|
* @deprecated use NoteContextAwareWidget instead
|
||||||
|
*/
|
||||||
|
this.NoteContextCachingWidget = NoteContextAwareWidget;
|
||||||
|
|
||||||
/** @property {BasicWidget} */
|
/** @property {BasicWidget} */
|
||||||
this.BasicWidget = BasicWidget;
|
this.BasicWidget = BasicWidget;
|
||||||
|
|
||||||
@@ -87,7 +111,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* Activates newly created note. Compared to this.activateNote() also makes sure that frontend has been fully synced.
|
* Activates newly created note. Compared to this.activateNote() also makes sure that frontend has been fully synced.
|
||||||
*
|
*
|
||||||
* @param {string} notePath (or noteId)
|
* @param {string} notePath (or noteId)
|
||||||
* @return {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.activateNewNote = async notePath => {
|
this.activateNewNote = async notePath => {
|
||||||
await ws.waitForMaxKnownEntityChangeId();
|
await ws.waitForMaxKnownEntityChangeId();
|
||||||
@@ -99,14 +123,15 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
/**
|
/**
|
||||||
* Open a note in a new tab.
|
* Open a note in a new tab.
|
||||||
*
|
*
|
||||||
|
* @method
|
||||||
* @param {string} notePath (or noteId)
|
* @param {string} notePath (or noteId)
|
||||||
* @param {boolean} activate - set to true to activate the new tab, false to stay on the current tab
|
* @param {boolean} activate - set to true to activate the new tab, false to stay on the current tab
|
||||||
* @return {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.openTabWithNote = async (notePath, activate) => {
|
this.openTabWithNote = async (notePath, activate) => {
|
||||||
await ws.waitForMaxKnownEntityChangeId();
|
await ws.waitForMaxKnownEntityChangeId();
|
||||||
|
|
||||||
await appContext.tabManager.openContextWithNote(notePath, activate);
|
await appContext.tabManager.openContextWithNote(notePath, { activate });
|
||||||
|
|
||||||
if (activate) {
|
if (activate) {
|
||||||
appContext.triggerEvent('focusAndSelectTitle');
|
appContext.triggerEvent('focusAndSelectTitle');
|
||||||
@@ -116,9 +141,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
/**
|
/**
|
||||||
* Open a note in a new split.
|
* Open a note in a new split.
|
||||||
*
|
*
|
||||||
|
* @method
|
||||||
* @param {string} notePath (or noteId)
|
* @param {string} notePath (or noteId)
|
||||||
* @param {boolean} activate - set to true to activate the new split, false to stay on the current split
|
* @param {boolean} activate - set to true to activate the new split, false to stay on the current split
|
||||||
* @return {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.openSplitWithNote = async (notePath, activate) => {
|
this.openSplitWithNote = async (notePath, activate) => {
|
||||||
await ws.waitForMaxKnownEntityChangeId();
|
await ws.waitForMaxKnownEntityChangeId();
|
||||||
@@ -133,22 +159,19 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {Object} AddButtonToToolbarOptions
|
|
||||||
* @property {string} [id] - id of the button, used to identify the old instances of this button to be replaced
|
|
||||||
* ID is optional because of BC, but not specifying it is deprecated. ID can be alphanumeric only.
|
|
||||||
* @property {string} title
|
|
||||||
* @property {string} [icon] - name of the boxicon to be used (e.g. "time" for "bx-time" icon)
|
|
||||||
* @property {function} action - callback handling the click on the button
|
|
||||||
* @property {string} [shortcut] - keyboard shortcut for the button, e.g. "alt+t"
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a new launcher to the launchbar. If the launcher (id) already exists, it will be updated.
|
* Adds a new launcher to the launchbar. If the launcher (id) already exists, it will be updated.
|
||||||
*
|
*
|
||||||
|
* @method
|
||||||
* @deprecated you can now create/modify launchers in the top-left Menu -> Configure Launchbar
|
* @deprecated you can now create/modify launchers in the top-left Menu -> Configure Launchbar
|
||||||
* for special needs there's also backend API's createOrUpdateLauncher()
|
* for special needs there's also backend API's createOrUpdateLauncher()
|
||||||
* @param {AddButtonToToolbarOptions} opts
|
* @param {object} opts
|
||||||
|
* @property {string} [opts.id] - id of the button, used to identify the old instances of this button to be replaced
|
||||||
|
* ID is optional because of BC, but not specifying it is deprecated. ID can be alphanumeric only.
|
||||||
|
* @property {string} opts.title
|
||||||
|
* @property {string} [opts.icon] - name of the boxicon to be used (e.g. "time" for "bx-time" icon)
|
||||||
|
* @property {function} opts.action - callback handling the click on the button
|
||||||
|
* @property {string} [opts.shortcut] - keyboard shortcut for the button, e.g. "alt+t"
|
||||||
*/
|
*/
|
||||||
this.addButtonToToolbar = async opts => {
|
this.addButtonToToolbar = async opts => {
|
||||||
console.warn("api.addButtonToToolbar() has been deprecated since v0.58 and may be removed in the future. Use Menu -> Configure Launchbar to create/update launchers instead.");
|
console.warn("api.addButtonToToolbar() has been deprecated since v0.58 and may be removed in the future. Use Menu -> Configure Launchbar to create/update launchers instead.");
|
||||||
@@ -178,9 +201,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* Executes given anonymous function on the backend.
|
* Executes given anonymous function on the backend.
|
||||||
* Internally this serializes the anonymous function into string and sends it to backend via AJAX.
|
* Internally this serializes the anonymous function into string and sends it to backend via AJAX.
|
||||||
*
|
*
|
||||||
|
* @method
|
||||||
* @param {string} script - script to be executed on the backend
|
* @param {string} script - script to be executed on the backend
|
||||||
* @param {Array.<?>} params - list of parameters to the anonymous function to be send to backend
|
* @param {Array.<?>} params - list of parameters to the anonymous function to be sent to backend
|
||||||
* @return {Promise<*>} return value of the executed function on the backend
|
* @returns {Promise<*>} return value of the executed function on the backend
|
||||||
*/
|
*/
|
||||||
this.runOnBackend = async (script, params = []) => {
|
this.runOnBackend = async (script, params = []) => {
|
||||||
if (typeof script === "function") {
|
if (typeof script === "function") {
|
||||||
@@ -206,19 +230,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated new name of this API call is runOnBackend so use that
|
|
||||||
* @method
|
|
||||||
*/
|
|
||||||
this.runOnServer = this.runOnBackend;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a powerful search method - you can search by attributes and their values, e.g.:
|
* This is a powerful search method - you can search by attributes and their values, e.g.:
|
||||||
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} searchString
|
* @param {string} searchString
|
||||||
* @returns {Promise<NoteShort[]>}
|
* @returns {Promise<FNote[]>}
|
||||||
*/
|
*/
|
||||||
this.searchForNotes = async searchString => {
|
this.searchForNotes = async searchString => {
|
||||||
return await searchService.searchForNotes(searchString);
|
return await searchService.searchForNotes(searchString);
|
||||||
@@ -230,7 +248,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} searchString
|
* @param {string} searchString
|
||||||
* @returns {Promise<NoteShort|null>}
|
* @returns {Promise<FNote|null>}
|
||||||
*/
|
*/
|
||||||
this.searchForNote = async searchString => {
|
this.searchForNote = async searchString => {
|
||||||
const notes = await this.searchForNotes(searchString);
|
const notes = await this.searchForNotes(searchString);
|
||||||
@@ -241,8 +259,9 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
/**
|
/**
|
||||||
* Returns note by given noteId. If note is missing from cache, it's loaded.
|
* Returns note by given noteId. If note is missing from cache, it's loaded.
|
||||||
**
|
**
|
||||||
|
* @method
|
||||||
* @param {string} noteId
|
* @param {string} noteId
|
||||||
* @return {Promise<NoteShort>}
|
* @returns {Promise<FNote>}
|
||||||
*/
|
*/
|
||||||
this.getNote = async noteId => await froca.getNote(noteId);
|
this.getNote = async noteId => await froca.getNote(noteId);
|
||||||
|
|
||||||
@@ -252,17 +271,18 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* This is often used to bulk-fill the cache with notes which would have to be picked one by one
|
* This is often used to bulk-fill the cache with notes which would have to be picked one by one
|
||||||
* otherwise (by e.g. createNoteLink())
|
* otherwise (by e.g. createNoteLink())
|
||||||
*
|
*
|
||||||
|
* @method
|
||||||
* @param {string[]} noteIds
|
* @param {string[]} noteIds
|
||||||
* @param {boolean} [silentNotFoundError] - don't report error if the note is not found
|
* @param {boolean} [silentNotFoundError] - don't report error if the note is not found
|
||||||
* @return {Promise<NoteShort[]>}
|
* @returns {Promise<FNote[]>}
|
||||||
*/
|
*/
|
||||||
this.getNotes = async (noteIds, silentNotFoundError = false) => await froca.getNotes(noteIds, silentNotFoundError);
|
this.getNotes = async (noteIds, silentNotFoundError = false) => await froca.getNotes(noteIds, silentNotFoundError);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update frontend tree (note) cache from the backend.
|
* Update frontend tree (note) cache from the backend.
|
||||||
*
|
*
|
||||||
* @param {string[]} noteIds
|
|
||||||
* @method
|
* @method
|
||||||
|
* @param {string[]} noteIds
|
||||||
*/
|
*/
|
||||||
this.reloadNotes = async noteIds => await froca.reloadNotes(noteIds);
|
this.reloadNotes = async noteIds => await froca.reloadNotes(noteIds);
|
||||||
|
|
||||||
@@ -270,7 +290,8 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* Instance name identifies particular Trilium instance. It can be useful for scripts
|
* Instance name identifies particular Trilium instance. It can be useful for scripts
|
||||||
* if some action needs to happen on only one specific instance.
|
* if some action needs to happen on only one specific instance.
|
||||||
*
|
*
|
||||||
* @return {string}
|
* @method
|
||||||
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
this.getInstanceName = () => window.glob.instanceName;
|
this.getInstanceName = () => window.glob.instanceName;
|
||||||
|
|
||||||
@@ -322,12 +343,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
*/
|
*/
|
||||||
this.triggerEvent = (name, data) => appContext.triggerEvent(name, data);
|
this.triggerEvent = (name, data) => appContext.triggerEvent(name, data);
|
||||||
|
|
||||||
/**
|
|
||||||
* @method
|
|
||||||
* @deprecated - this is now no-op since all the changes should be gracefully handled per widget
|
|
||||||
*/
|
|
||||||
this.refreshTree = () => {};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create note link (jQuery object) for given note.
|
* Create note link (jQuery object) for given note.
|
||||||
*
|
*
|
||||||
@@ -344,54 +359,17 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
/**
|
/**
|
||||||
* Adds given text to the editor cursor
|
* Adds given text to the editor cursor
|
||||||
*
|
*
|
||||||
* @deprecated use addTextToActiveContextEditor() instead
|
|
||||||
* @param {string} text - this must be clear text, HTML is not supported.
|
|
||||||
* @method
|
* @method
|
||||||
*/
|
|
||||||
this.addTextToActiveTabEditor = text => {
|
|
||||||
console.warn("api.addTextToActiveTabEditor() is deprecated, use addTextToActiveContextEditor() instead.");
|
|
||||||
|
|
||||||
return appContext.triggerCommand('addTextToActiveEditor', {text});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds given text to the editor cursor
|
|
||||||
*
|
|
||||||
* @param {string} text - this must be clear text, HTML is not supported.
|
* @param {string} text - this must be clear text, HTML is not supported.
|
||||||
* @method
|
|
||||||
*/
|
*/
|
||||||
this.addTextToActiveContextEditor = text => appContext.triggerCommand('addTextToActiveEditor', {text});
|
this.addTextToActiveContextEditor = text => appContext.triggerCommand('addTextToActiveEditor', {text});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
* @deprecated use getActiveContextNote() instead
|
* @returns {FNote} active note (loaded into right pane)
|
||||||
* @returns {NoteShort} active note (loaded into right pane)
|
|
||||||
*/
|
|
||||||
this.getActiveTabNote = () => {
|
|
||||||
console.warn("api.getActiveTabNote() is deprecated, use getActiveContextNote() instead.");
|
|
||||||
|
|
||||||
return appContext.tabManager.getActiveContextNote();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @method
|
|
||||||
* @returns {NoteShort} active note (loaded into right pane)
|
|
||||||
*/
|
*/
|
||||||
this.getActiveContextNote = () => appContext.tabManager.getActiveContextNote();
|
this.getActiveContextNote = () => appContext.tabManager.getActiveContextNote();
|
||||||
|
|
||||||
/**
|
|
||||||
* See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html for a documentation on the returned instance.
|
|
||||||
*
|
|
||||||
* @deprecated use getActiveContextTextEditor()
|
|
||||||
* @method
|
|
||||||
* @param [callback] - callback receiving "textEditor" instance
|
|
||||||
*/
|
|
||||||
this.getActiveTabTextEditor = callback => {
|
|
||||||
console.warn("api.getActiveTabTextEditor() is deprecated, use getActiveContextTextEditor() instead.");
|
|
||||||
|
|
||||||
return appContext.tabManager.getActiveContext()?.getTextEditor(callback);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html for a documentation on the returned instance.
|
* See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html for a documentation on the returned instance.
|
||||||
*
|
*
|
||||||
@@ -417,17 +395,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
*/
|
*/
|
||||||
this.getActiveNoteDetailWidget = () => new Promise(resolve => appContext.triggerCommand('executeInActiveNoteDetailWidget', {callback: resolve}));
|
this.getActiveNoteDetailWidget = () => new Promise(resolve => appContext.triggerCommand('executeInActiveNoteDetailWidget', {callback: resolve}));
|
||||||
|
|
||||||
/**
|
|
||||||
* @method
|
|
||||||
* @deprecated use getActiveContextNotePath() instead
|
|
||||||
* @returns {Promise<string|null>} returns note path of active note or null if there isn't active note
|
|
||||||
*/
|
|
||||||
this.getActiveTabNotePath = () => {
|
|
||||||
console.warn("api.getActiveTabNotePath() is deprecated, use getActiveContextNotePath() instead.");
|
|
||||||
|
|
||||||
return appContext.tabManager.getActiveContextNotePath();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
* @returns {Promise<string|null>} returns note path of active note or null if there isn't active note
|
* @returns {Promise<string|null>} returns note path of active note or null if there isn't active note
|
||||||
@@ -445,24 +412,16 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
* @param {object} $el - jquery object on which to setup the tooltip
|
* @param {object} $el - jquery object on which to set up the tooltip
|
||||||
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.setupElementTooltip = noteTooltipService.setupElementTooltip;
|
this.setupElementTooltip = noteTooltipService.setupElementTooltip;
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated use protectNote and protectSubtree instead
|
|
||||||
* @method
|
|
||||||
*/
|
|
||||||
this.protectActiveNote = async () => {
|
|
||||||
const activeNote = appContext.tabManager.getActiveContextNote();
|
|
||||||
|
|
||||||
await protectedSessionService.protectNote(activeNote.noteId, true, false);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
* @param {string} noteId
|
* @param {string} noteId
|
||||||
* @param {boolean} protect - true to protect note, false to unprotect
|
* @param {boolean} protect - true to protect note, false to unprotect
|
||||||
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.protectNote = async (noteId, protect) => {
|
this.protectNote = async (noteId, protect) => {
|
||||||
await protectedSessionService.protectNote(noteId, protect, false);
|
await protectedSessionService.protectNote(noteId, protect, false);
|
||||||
@@ -472,6 +431,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* @method
|
* @method
|
||||||
* @param {string} noteId
|
* @param {string} noteId
|
||||||
* @param {boolean} protect - true to protect subtree, false to unprotect
|
* @param {boolean} protect - true to protect subtree, false to unprotect
|
||||||
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.protectSubTree = async (noteId, protect) => {
|
this.protectSubTree = async (noteId, protect) => {
|
||||||
await protectedSessionService.protectNote(noteId, protect, true);
|
await protectedSessionService.protectNote(noteId, protect, true);
|
||||||
@@ -481,7 +441,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* Returns date-note for today. If it doesn't exist, it is automatically created.
|
* Returns date-note for today. If it doesn't exist, it is automatically created.
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @return {Promise<NoteShort>}
|
* @returns {Promise<FNote>}
|
||||||
*/
|
*/
|
||||||
this.getTodayNote = dateNotesService.getTodayNote;
|
this.getTodayNote = dateNotesService.getTodayNote;
|
||||||
|
|
||||||
@@ -490,17 +450,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} date - e.g. "2019-04-29"
|
* @param {string} date - e.g. "2019-04-29"
|
||||||
* @return {Promise<NoteShort>}
|
* @returns {Promise<FNote>}
|
||||||
* @deprecated use getDayNote instead
|
|
||||||
*/
|
|
||||||
this.getDateNote = dateNotesService.getDayNote;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns day note for a given date. If it doesn't exist, it is automatically created.
|
|
||||||
*
|
|
||||||
* @method
|
|
||||||
* @param {string} date - e.g. "2019-04-29"
|
|
||||||
* @return {Promise<NoteShort>}
|
|
||||||
*/
|
*/
|
||||||
this.getDayNote = dateNotesService.getDayNote;
|
this.getDayNote = dateNotesService.getDayNote;
|
||||||
|
|
||||||
@@ -509,7 +459,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} date - e.g. "2019-04-29"
|
* @param {string} date - e.g. "2019-04-29"
|
||||||
* @return {Promise<NoteShort>}
|
* @returns {Promise<FNote>}
|
||||||
*/
|
*/
|
||||||
this.getWeekNote = dateNotesService.getWeekNote;
|
this.getWeekNote = dateNotesService.getWeekNote;
|
||||||
|
|
||||||
@@ -518,7 +468,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} month - e.g. "2019-04"
|
* @param {string} month - e.g. "2019-04"
|
||||||
* @return {Promise<NoteShort>}
|
* @returns {Promise<FNote>}
|
||||||
*/
|
*/
|
||||||
this.getMonthNote = dateNotesService.getMonthNote;
|
this.getMonthNote = dateNotesService.getMonthNote;
|
||||||
|
|
||||||
@@ -527,7 +477,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} year - e.g. "2019"
|
* @param {string} year - e.g. "2019"
|
||||||
* @return {Promise<NoteShort>}
|
* @returns {Promise<FNote>}
|
||||||
*/
|
*/
|
||||||
this.getYearNote = dateNotesService.getYearNote;
|
this.getYearNote = dateNotesService.getYearNote;
|
||||||
|
|
||||||
@@ -536,7 +486,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} noteId - set hoisted note. 'root' will effectively unhoist
|
* @param {string} noteId - set hoisted note. 'root' will effectively unhoist
|
||||||
* @return {Promise}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.setHoistedNoteId = (noteId) => {
|
this.setHoistedNoteId = (noteId) => {
|
||||||
const activeNoteContext = appContext.tabManager.getActiveContext();
|
const activeNoteContext = appContext.tabManager.getActiveContext();
|
||||||
@@ -552,6 +502,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* @param {function} handler
|
* @param {function} handler
|
||||||
* @param {string} [namespace] - specify namespace of the handler for the cases where call for bind may be repeated.
|
* @param {string} [namespace] - specify namespace of the handler for the cases where call for bind may be repeated.
|
||||||
* If a handler with this ID exists, it's replaced by the new handler.
|
* If a handler with this ID exists, it's replaced by the new handler.
|
||||||
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.bindGlobalShortcut = shortcutService.bindGlobalShortcut;
|
this.bindGlobalShortcut = shortcutService.bindGlobalShortcut;
|
||||||
|
|
||||||
@@ -563,6 +514,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* Typical use case is when new note has been created, we should wait until it is synced into frontend and only then activate it.
|
* Typical use case is when new note has been created, we should wait until it is synced into frontend and only then activate it.
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.waitUntilSynced = ws.waitForMaxKnownEntityChangeId;
|
this.waitUntilSynced = ws.waitForMaxKnownEntityChangeId;
|
||||||
|
|
||||||
@@ -570,6 +522,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* This will refresh all currently opened notes which have included note specified in the parameter
|
* This will refresh all currently opened notes which have included note specified in the parameter
|
||||||
*
|
*
|
||||||
* @param includedNoteId - noteId of the included note
|
* @param includedNoteId - noteId of the included note
|
||||||
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.refreshIncludedNote = includedNoteId => appContext.triggerEvent('refreshIncludedNote', {noteId: includedNoteId});
|
this.refreshIncludedNote = includedNoteId => appContext.triggerEvent('refreshIncludedNote', {noteId: includedNoteId});
|
||||||
|
|
||||||
@@ -589,6 +542,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||||||
* Log given message to the log pane in UI
|
* Log given message to the log pane in UI
|
||||||
*
|
*
|
||||||
* @param message
|
* @param message
|
||||||
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
this.log = message => {
|
this.log = message => {
|
||||||
const {noteId} = this.startNote;
|
const {noteId} = this.startNote;
|
||||||
@@ -621,13 +575,13 @@ export default FrontendScriptApi;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FNoteComplement.html">FNoteComplement</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -1,89 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>JSDoc: Source: widgets/collapsible_widget.js</title>
|
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="main">
|
|
||||||
|
|
||||||
<h1 class="page-title">Source: widgets/collapsible_widget.js</h1>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<section>
|
|
||||||
<article>
|
|
||||||
<pre class="prettyprint source linenums"><code>import NoteContextAwareWidget from "./note_context_aware_widget.js";
|
|
||||||
|
|
||||||
const WIDGET_TPL = `
|
|
||||||
<div class="card widget">
|
|
||||||
<div class="card-header"></div>
|
|
||||||
|
|
||||||
<div id="[to be set]" class="body-wrapper">
|
|
||||||
<div class="card-body"></div>
|
|
||||||
</div>
|
|
||||||
</div>`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: rename, it's not collapsible anymore
|
|
||||||
*/
|
|
||||||
export default class CollapsibleWidget extends NoteContextAwareWidget {
|
|
||||||
get widgetTitle() { return "Untitled widget"; }
|
|
||||||
|
|
||||||
get help() { return {}; }
|
|
||||||
|
|
||||||
doRender() {
|
|
||||||
this.$widget = $(WIDGET_TPL);
|
|
||||||
this.contentSized();
|
|
||||||
this.$widget.find('[data-target]').attr('data-target', `#${this.componentId}`);
|
|
||||||
|
|
||||||
this.$bodyWrapper = this.$widget.find('.body-wrapper');
|
|
||||||
this.$bodyWrapper.attr('id', this.componentId); // for toggle to work we need id
|
|
||||||
|
|
||||||
this.$body = this.$bodyWrapper.find('.card-body');
|
|
||||||
|
|
||||||
this.$title = this.$widget.find('.card-header');
|
|
||||||
this.$title.text(this.widgetTitle);
|
|
||||||
|
|
||||||
this.initialized = this.doRenderBody();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** for overriding */
|
|
||||||
async doRenderBody() {}
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
</article>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<nav>
|
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<br class="clear">
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
|
||||||
<script src="scripts/linenumber.js"> </script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
15
dump-db/package-lock.json
generated
15
dump-db/package-lock.json
generated
@@ -387,9 +387,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minimist": {
|
"node_modules/minimist": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
|
||||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mkdirp-classic": {
|
"node_modules/mkdirp-classic": {
|
||||||
"version": "0.5.3",
|
"version": "0.5.3",
|
||||||
@@ -1163,9 +1166,9 @@
|
|||||||
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="
|
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="
|
||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
|
||||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g=="
|
||||||
},
|
},
|
||||||
"mkdirp-classic": {
|
"mkdirp-classic": {
|
||||||
"version": "0.5.3",
|
"version": "0.5.3",
|
||||||
|
|||||||
4
libraries/ckeditor/ckeditor.js
vendored
4
libraries/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3128
package-lock.json
generated
3128
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
37
package.json
37
package.json
@@ -2,7 +2,7 @@
|
|||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"productName": "Trilium Notes",
|
"productName": "Trilium Notes",
|
||||||
"description": "Trilium Notes",
|
"description": "Trilium Notes",
|
||||||
"version": "0.58.1-beta",
|
"version": "0.59.1",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"main": "electron.js",
|
"main": "electron.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -13,12 +13,14 @@
|
|||||||
"url": "https://github.com/zadam/trilium.git"
|
"url": "https://github.com/zadam/trilium.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start-server": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev node ./src/www",
|
"start-server": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 node ./src/www",
|
||||||
"start-electron": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev electron --inspect=5858 .",
|
"start-server-no-dir": "cross-env TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 node ./src/www",
|
||||||
"switch-server": "rm -r ./node_modules/better-sqlite3 && npm install",
|
"start-electron": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron --inspect=5858 .",
|
||||||
"switch-electron": "rm -r ./node_modules/better-sqlite3 && npm install && ./node_modules/.bin/electron-rebuild",
|
"start-electron-no-dir": "cross-env TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 electron --inspect=5858 .",
|
||||||
"build-backend-docs": "rm -r ./docs/backend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/becca/entities/*.js src/services/backend_script_api.js src/services/sql.js",
|
"switch-server": "rm -rf ./node_modules/better-sqlite3 && npm install",
|
||||||
"build-frontend-docs": "rm -r ./docs/frontend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/collapsible_widget.js",
|
"switch-electron": "rm -rf ./node_modules/better-sqlite3 && npm install && ./node_modules/.bin/electron-rebuild",
|
||||||
|
"build-backend-docs": "rm -rf ./docs/backend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/becca/entities/*.js src/services/backend_script_api.js src/services/sql.js",
|
||||||
|
"build-frontend-docs": "rm -rf ./docs/frontend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/right_panel_widget.js",
|
||||||
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs",
|
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs",
|
||||||
"webpack": "npx webpack -c webpack-desktop.config.js && npx webpack -c webpack-mobile.config.js && npx webpack -c webpack-setup.config.js",
|
"webpack": "npx webpack -c webpack-desktop.config.js && npx webpack -c webpack-mobile.config.js && npx webpack -c webpack-setup.config.js",
|
||||||
"test-jasmine": "jasmine",
|
"test-jasmine": "jasmine",
|
||||||
@@ -27,11 +29,12 @@
|
|||||||
"postinstall": "rimraf ./node_modules/canvas"
|
"postinstall": "rimraf ./node_modules/canvas"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@braintree/sanitize-url": "6.0.2",
|
||||||
"@electron/remote": "2.0.9",
|
"@electron/remote": "2.0.9",
|
||||||
"@excalidraw/excalidraw": "0.13.0",
|
"@excalidraw/excalidraw": "0.14.2",
|
||||||
"archiver": "5.3.1",
|
"archiver": "5.3.1",
|
||||||
"async-mutex": "0.4.0",
|
"async-mutex": "0.4.0",
|
||||||
"axios": "1.2.1",
|
"axios": "1.3.3",
|
||||||
"better-sqlite3": "7.4.5",
|
"better-sqlite3": "7.4.5",
|
||||||
"chokidar": "3.5.3",
|
"chokidar": "3.5.3",
|
||||||
"cls-hooked": "4.2.2",
|
"cls-hooked": "4.2.2",
|
||||||
@@ -46,6 +49,7 @@
|
|||||||
"electron-debug": "3.2.0",
|
"electron-debug": "3.2.0",
|
||||||
"electron-dl": "3.5.0",
|
"electron-dl": "3.5.0",
|
||||||
"electron-window-state": "5.0.3",
|
"electron-window-state": "5.0.3",
|
||||||
|
"escape-html": "^1.0.3",
|
||||||
"express": "4.18.2",
|
"express": "4.18.2",
|
||||||
"express-partial-content": "1.0.2",
|
"express-partial-content": "1.0.2",
|
||||||
"express-rate-limit": "6.7.0",
|
"express-rate-limit": "6.7.0",
|
||||||
@@ -60,14 +64,14 @@
|
|||||||
"ini": "3.0.1",
|
"ini": "3.0.1",
|
||||||
"is-animated": "2.0.2",
|
"is-animated": "2.0.2",
|
||||||
"is-svg": "4.3.2",
|
"is-svg": "4.3.2",
|
||||||
"jimp": "0.16.2",
|
"jimp": "0.22.4",
|
||||||
"joplin-turndown-plugin-gfm": "1.0.12",
|
"joplin-turndown-plugin-gfm": "1.0.12",
|
||||||
"jsdom": "20.0.3",
|
"jsdom": "21.1.0",
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
"multer": "1.4.5-lts.1",
|
"multer": "1.4.5-lts.1",
|
||||||
"node-abi": "3.30.0",
|
"node-abi": "3.33.0",
|
||||||
"normalize-strings": "1.1.1",
|
"normalize-strings": "1.1.1",
|
||||||
"open": "8.4.0",
|
"open": "8.4.1",
|
||||||
"rand-token": "1.0.1",
|
"rand-token": "1.0.1",
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
"react-dom": "17.0.2",
|
"react-dom": "17.0.2",
|
||||||
@@ -75,7 +79,7 @@
|
|||||||
"rimraf": "3.0.2",
|
"rimraf": "3.0.2",
|
||||||
"safe-compare": "1.1.4",
|
"safe-compare": "1.1.4",
|
||||||
"sanitize-filename": "1.6.3",
|
"sanitize-filename": "1.6.3",
|
||||||
"sanitize-html": "2.8.1",
|
"sanitize-html": "2.9.0",
|
||||||
"sax": "1.2.4",
|
"sax": "1.2.4",
|
||||||
"semver": "7.3.8",
|
"semver": "7.3.8",
|
||||||
"serve-favicon": "2.5.0",
|
"serve-favicon": "2.5.0",
|
||||||
@@ -85,7 +89,8 @@
|
|||||||
"tmp": "0.2.1",
|
"tmp": "0.2.1",
|
||||||
"turndown": "7.1.1",
|
"turndown": "7.1.1",
|
||||||
"unescape": "1.0.1",
|
"unescape": "1.0.1",
|
||||||
"ws": "8.11.0",
|
"ws": "8.12.1",
|
||||||
|
"xml2js": "0.4.23",
|
||||||
"yauzl": "2.10.0"
|
"yauzl": "2.10.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -96,7 +101,7 @@
|
|||||||
"electron-rebuild": "3.2.9",
|
"electron-rebuild": "3.2.9",
|
||||||
"esm": "3.2.25",
|
"esm": "3.2.25",
|
||||||
"jasmine": "4.5.0",
|
"jasmine": "4.5.0",
|
||||||
"jsdoc": "4.0.0",
|
"jsdoc": "4.0.1",
|
||||||
"lorem-ipsum": "2.0.8",
|
"lorem-ipsum": "2.0.8",
|
||||||
"rcedit": "3.0.1",
|
"rcedit": "3.0.1",
|
||||||
"webpack": "5.75.0",
|
"webpack": "5.75.0",
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
const Note = require('../../src/becca/entities/note');
|
const BNote = require('../../src/becca/entities/bnote');
|
||||||
const Branch = require('../../src/becca/entities/branch');
|
const BBranch = require('../../src/becca/entities/bbranch');
|
||||||
const Attribute = require('../../src/becca/entities/attribute');
|
const BAttribute = require('../../src/becca/entities/battribute');
|
||||||
const becca = require('../../src/becca/becca');
|
const becca = require('../../src/becca/becca');
|
||||||
const randtoken = require('rand-token').generator({source: 'crypto'});
|
const randtoken = require('rand-token').generator({source: 'crypto'});
|
||||||
|
|
||||||
/** @returns {Note} */
|
/** @returns {BNote} */
|
||||||
function findNoteByTitle(searchResults, title) {
|
function findNoteByTitle(searchResults, title) {
|
||||||
return searchResults
|
return searchResults
|
||||||
.map(sr => becca.notes[sr.noteId])
|
.map(sr => becca.notes[sr.noteId])
|
||||||
@@ -17,7 +17,7 @@ class NoteBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
label(name, value = '', isInheritable = false) {
|
label(name, value = '', isInheritable = false) {
|
||||||
new Attribute({
|
new BAttribute({
|
||||||
attributeId: id(),
|
attributeId: id(),
|
||||||
noteId: this.note.noteId,
|
noteId: this.note.noteId,
|
||||||
type: 'label',
|
type: 'label',
|
||||||
@@ -30,7 +30,7 @@ class NoteBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
relation(name, targetNote) {
|
relation(name, targetNote) {
|
||||||
new Attribute({
|
new BAttribute({
|
||||||
attributeId: id(),
|
attributeId: id(),
|
||||||
noteId: this.note.noteId,
|
noteId: this.note.noteId,
|
||||||
type: 'relation',
|
type: 'relation',
|
||||||
@@ -42,7 +42,7 @@ class NoteBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
child(childNoteBuilder, prefix = "") {
|
child(childNoteBuilder, prefix = "") {
|
||||||
new Branch({
|
new BBranch({
|
||||||
branchId: id(),
|
branchId: id(),
|
||||||
noteId: childNoteBuilder.note.noteId,
|
noteId: childNoteBuilder.note.noteId,
|
||||||
parentNoteId: this.note.noteId,
|
parentNoteId: this.note.noteId,
|
||||||
@@ -66,7 +66,7 @@ function note(title, extraParams = {}) {
|
|||||||
mime: 'text/html'
|
mime: 'text/html'
|
||||||
}, extraParams);
|
}, extraParams);
|
||||||
|
|
||||||
const note = new Note(row);
|
const note = new BNote(row);
|
||||||
|
|
||||||
return new NoteBuilder(note);
|
return new NoteBuilder(note);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const searchService = require('../../src/services/search/services/search');
|
const searchService = require('../../src/services/search/services/search');
|
||||||
const Note = require('../../src/becca/entities/note');
|
const BNote = require('../../src/becca/entities/bnote');
|
||||||
const Branch = require('../../src/becca/entities/branch');
|
const BBranch = require('../../src/becca/entities/bbranch');
|
||||||
const SearchContext = require('../../src/services/search/search_context');
|
const SearchContext = require('../../src/services/search/search_context');
|
||||||
const dateUtils = require('../../src/services/date_utils');
|
const dateUtils = require('../../src/services/date_utils');
|
||||||
const becca = require('../../src/becca/becca');
|
const becca = require('../../src/becca/becca');
|
||||||
@@ -12,8 +12,8 @@ describe("Search", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
becca.reset();
|
becca.reset();
|
||||||
|
|
||||||
rootNote = new NoteBuilder(new Note({noteId: 'root', title: 'root', type: 'text'}));
|
rootNote = new NoteBuilder(new BNote({noteId: 'root', title: 'root', type: 'text'}));
|
||||||
new Branch({branchId: 'root', noteId: 'root', parentNoteId: 'none', notePosition: 10});
|
new BBranch({branchId: 'none_root', noteId: 'root', parentNoteId: 'none', notePosition: 10});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("simple path match", () => {
|
it("simple path match", () => {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
const backupService = require('./services/backup');
|
const anonymizationService = require('./services/anonymization');
|
||||||
const sqlInit = require('./services/sql_init');
|
const sqlInit = require('./services/sql_init');
|
||||||
require('./entities/entity_constructor');
|
require('./becca/entity_constructor');
|
||||||
|
|
||||||
sqlInit.dbReady.then(async () => {
|
sqlInit.dbReady.then(async () => {
|
||||||
try {
|
try {
|
||||||
console.log("Starting anonymization...");
|
console.log("Starting anonymization...");
|
||||||
|
|
||||||
const resp = await backupService.anonymize();
|
const resp = await anonymizationService.createAnonymizedCopy('full');
|
||||||
|
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
console.log(`Anonymized file has been saved to: ${resp.anonymizedFilePath}`);
|
console.log(`Anonymized file has been saved to: ${resp.anonymizedFilePath}`);
|
||||||
|
|||||||
@@ -12,19 +12,19 @@ class Becca {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
/** @type {Object.<String, Note>} */
|
/** @type {Object.<String, BNote>} */
|
||||||
this.notes = {};
|
this.notes = {};
|
||||||
/** @type {Object.<String, Branch>} */
|
/** @type {Object.<String, BBranch>} */
|
||||||
this.branches = {};
|
this.branches = {};
|
||||||
/** @type {Object.<String, Branch>} */
|
/** @type {Object.<String, BBranch>} */
|
||||||
this.childParentToBranch = {};
|
this.childParentToBranch = {};
|
||||||
/** @type {Object.<String, Attribute>} */
|
/** @type {Object.<String, BAttribute>} */
|
||||||
this.attributes = {};
|
this.attributes = {};
|
||||||
/** @type {Object.<String, Attribute[]>} Points from attribute type-name to list of attributes */
|
/** @type {Object.<String, BAttribute[]>} Points from attribute type-name to list of attributes */
|
||||||
this.attributeIndex = {};
|
this.attributeIndex = {};
|
||||||
/** @type {Object.<String, Option>} */
|
/** @type {Object.<String, BOption>} */
|
||||||
this.options = {};
|
this.options = {};
|
||||||
/** @type {Object.<String, EtapiToken>} */
|
/** @type {Object.<String, BEtapiToken>} */
|
||||||
this.etapiTokens = {};
|
this.etapiTokens = {};
|
||||||
|
|
||||||
this.dirtyNoteSetCache();
|
this.dirtyNoteSetCache();
|
||||||
@@ -36,7 +36,7 @@ class Becca {
|
|||||||
return this.getNote('root');
|
return this.getNote('root');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Attribute[]} */
|
/** @returns {BAttribute[]} */
|
||||||
findAttributes(type, name) {
|
findAttributes(type, name) {
|
||||||
name = name.trim().toLowerCase();
|
name = name.trim().toLowerCase();
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ class Becca {
|
|||||||
return this.attributeIndex[`${type}-${name}`] || [];
|
return this.attributeIndex[`${type}-${name}`] || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Attribute[]} */
|
/** @returns {BAttribute[]} */
|
||||||
findAttributesWithPrefix(type, name) {
|
findAttributesWithPrefix(type, name) {
|
||||||
const resArr = [];
|
const resArr = [];
|
||||||
const key = `${type}-${name}`;
|
const key = `${type}-${name}`;
|
||||||
@@ -72,12 +72,12 @@ class Becca {
|
|||||||
this.dirtyNoteSetCache();
|
this.dirtyNoteSetCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note|null} */
|
/** @returns {BNote|null} */
|
||||||
getNote(noteId) {
|
getNote(noteId) {
|
||||||
return this.notes[noteId];
|
return this.notes[noteId];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getNotes(noteIds, ignoreMissing = false) {
|
getNotes(noteIds, ignoreMissing = false) {
|
||||||
const filteredNotes = [];
|
const filteredNotes = [];
|
||||||
|
|
||||||
@@ -98,40 +98,40 @@ class Becca {
|
|||||||
return filteredNotes;
|
return filteredNotes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Branch|null} */
|
/** @returns {BBranch|null} */
|
||||||
getBranch(branchId) {
|
getBranch(branchId) {
|
||||||
return this.branches[branchId];
|
return this.branches[branchId];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Attribute|null} */
|
/** @returns {BAttribute|null} */
|
||||||
getAttribute(attributeId) {
|
getAttribute(attributeId) {
|
||||||
return this.attributes[attributeId];
|
return this.attributes[attributeId];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Branch|null} */
|
/** @returns {BBranch|null} */
|
||||||
getBranchFromChildAndParent(childNoteId, parentNoteId) {
|
getBranchFromChildAndParent(childNoteId, parentNoteId) {
|
||||||
return this.childParentToBranch[`${childNoteId}-${parentNoteId}`];
|
return this.childParentToBranch[`${childNoteId}-${parentNoteId}`];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteRevision|null} */
|
/** @returns {BNoteRevision|null} */
|
||||||
getNoteRevision(noteRevisionId) {
|
getNoteRevision(noteRevisionId) {
|
||||||
const row = sql.getRow("SELECT * FROM note_revisions WHERE noteRevisionId = ?", [noteRevisionId]);
|
const row = sql.getRow("SELECT * FROM note_revisions WHERE noteRevisionId = ?", [noteRevisionId]);
|
||||||
|
|
||||||
const NoteRevision = require("./entities/note_revision"); // avoiding circular dependency problems
|
const BNoteRevision = require("./entities/bnote_revision"); // avoiding circular dependency problems
|
||||||
return row ? new NoteRevision(row) : null;
|
return row ? new BNoteRevision(row) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Option|null} */
|
/** @returns {BOption|null} */
|
||||||
getOption(name) {
|
getOption(name) {
|
||||||
return this.options[name];
|
return this.options[name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {EtapiToken[]} */
|
/** @returns {BEtapiToken[]} */
|
||||||
getEtapiTokens() {
|
getEtapiTokens() {
|
||||||
return Object.values(this.etapiTokens);
|
return Object.values(this.etapiTokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {EtapiToken|null} */
|
/** @returns {BEtapiToken|null} */
|
||||||
getEtapiToken(etapiTokenId) {
|
getEtapiToken(etapiTokenId) {
|
||||||
return this.etapiTokens[etapiTokenId];
|
return this.etapiTokens[etapiTokenId];
|
||||||
}
|
}
|
||||||
@@ -152,23 +152,27 @@ class Becca {
|
|||||||
.replace('_', '')
|
.replace('_', '')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!(camelCaseEntityName in this)) {
|
||||||
|
throw new Error(`Unknown entity name '${camelCaseEntityName}' (original argument '${entityName}')`);
|
||||||
|
}
|
||||||
|
|
||||||
return this[camelCaseEntityName][entityId];
|
return this[camelCaseEntityName][entityId];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {RecentNote[]} */
|
/** @returns {BRecentNote[]} */
|
||||||
getRecentNotesFromQuery(query, params = []) {
|
getRecentNotesFromQuery(query, params = []) {
|
||||||
const rows = sql.getRows(query, params);
|
const rows = sql.getRows(query, params);
|
||||||
|
|
||||||
const RecentNote = require("./entities/recent_note"); // avoiding circular dependency problems
|
const BRecentNote = require("./entities/brecent_note"); // avoiding circular dependency problems
|
||||||
return rows.map(row => new RecentNote(row));
|
return rows.map(row => new BRecentNote(row));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteRevision[]} */
|
/** @returns {BNoteRevision[]} */
|
||||||
getNoteRevisionsFromQuery(query, params = []) {
|
getNoteRevisionsFromQuery(query, params = []) {
|
||||||
const rows = sql.getRows(query, params);
|
const rows = sql.getRows(query, params);
|
||||||
|
|
||||||
const NoteRevision = require("./entities/note_revision"); // avoiding circular dependency problems
|
const BNoteRevision = require("./entities/bnote_revision"); // avoiding circular dependency problems
|
||||||
return rows.map(row => new NoteRevision(row));
|
return rows.map(row => new BNoteRevision(row));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Should be called when the set of all non-skeleton notes changes (added/removed) */
|
/** Should be called when the set of all non-skeleton notes changes (added/removed) */
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ const eventService = require('../services/events');
|
|||||||
const becca = require('./becca');
|
const becca = require('./becca');
|
||||||
const sqlInit = require('../services/sql_init');
|
const sqlInit = require('../services/sql_init');
|
||||||
const log = require('../services/log');
|
const log = require('../services/log');
|
||||||
const Note = require('./entities/note');
|
const BNote = require('./entities/bnote');
|
||||||
const Branch = require('./entities/branch');
|
const BBranch = require('./entities/bbranch');
|
||||||
const Attribute = require('./entities/attribute');
|
const BAttribute = require('./entities/battribute');
|
||||||
const Option = require('./entities/option');
|
const BOption = require('./entities/boption');
|
||||||
const EtapiToken = require("./entities/etapi_token");
|
const BEtapiToken = require("./entities/betapi_token");
|
||||||
const cls = require("../services/cls");
|
const cls = require("../services/cls");
|
||||||
const entityConstructor = require("../becca/entity_constructor");
|
const entityConstructor = require("../becca/entity_constructor");
|
||||||
|
|
||||||
@@ -31,23 +31,27 @@ function load() {
|
|||||||
// this is worth it for becca load since it happens every run and blocks the app until finished
|
// this is worth it for becca load since it happens every run and blocks the app until finished
|
||||||
|
|
||||||
for (const row of sql.getRawRows(`SELECT noteId, title, type, mime, isProtected, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes WHERE isDeleted = 0`)) {
|
for (const row of sql.getRawRows(`SELECT noteId, title, type, mime, isProtected, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes WHERE isDeleted = 0`)) {
|
||||||
new Note().update(row).init();
|
new BNote().update(row).init();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const row of sql.getRawRows(`SELECT branchId, noteId, parentNoteId, prefix, notePosition, isExpanded, utcDateModified FROM branches WHERE isDeleted = 0`)) {
|
const branchRows = sql.getRawRows(`SELECT branchId, noteId, parentNoteId, prefix, notePosition, isExpanded, utcDateModified FROM branches WHERE isDeleted = 0`);
|
||||||
new Branch().update(row).init();
|
// in-memory sort is faster than in the DB
|
||||||
|
branchRows.sort((a, b) => a.notePosition - b.notePosition);
|
||||||
|
|
||||||
|
for (const row of branchRows) {
|
||||||
|
new BBranch().update(row).init();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const row of sql.getRawRows(`SELECT attributeId, noteId, type, name, value, isInheritable, position, utcDateModified FROM attributes WHERE isDeleted = 0`)) {
|
for (const row of sql.getRawRows(`SELECT attributeId, noteId, type, name, value, isInheritable, position, utcDateModified FROM attributes WHERE isDeleted = 0`)) {
|
||||||
new Attribute().update(row).init();
|
new BAttribute().update(row).init();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const row of sql.getRows(`SELECT name, value, isSynced, utcDateModified FROM options`)) {
|
for (const row of sql.getRows(`SELECT name, value, isSynced, utcDateModified FROM options`)) {
|
||||||
new Option(row);
|
new BOption(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const row of sql.getRows(`SELECT etapiTokenId, name, tokenHash, utcDateCreated, utcDateModified FROM etapi_tokens WHERE isDeleted = 0`)) {
|
for (const row of sql.getRows(`SELECT etapiTokenId, name, tokenHash, utcDateCreated, utcDateModified FROM etapi_tokens WHERE isDeleted = 0`)) {
|
||||||
new EtapiToken(row);
|
new BEtapiToken(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const noteId in becca.notes) {
|
for (const noteId in becca.notes) {
|
||||||
@@ -80,7 +84,7 @@ eventService.subscribeBeccaLoader([eventService.ENTITY_CHANGE_SYNCED], ({entity
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (["notes", "branches", "attributes", "etapi_tokens"].includes(entityName)) {
|
if (["notes", "branches", "attributes", "etapi_tokens", "options"].includes(entityName)) {
|
||||||
const EntityClass = entityConstructor.getEntityFromEntityName(entityName);
|
const EntityClass = entityConstructor.getEntityFromEntityName(entityName);
|
||||||
const primaryKeyName = EntityClass.primaryKeyName;
|
const primaryKeyName = EntityClass.primaryKeyName;
|
||||||
|
|
||||||
@@ -164,6 +168,12 @@ function branchUpdated(branch) {
|
|||||||
childNote.flatTextCache = null;
|
childNote.flatTextCache = null;
|
||||||
childNote.sortParents();
|
childNote.sortParents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const parentNote = becca.notes[branch.parentNoteId];
|
||||||
|
|
||||||
|
if (parentNote) {
|
||||||
|
parentNote.sortChildren();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function attributeDeleted(attributeId) {
|
function attributeDeleted(attributeId) {
|
||||||
@@ -177,7 +187,7 @@ function attributeDeleted(attributeId) {
|
|||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
// first invalidate and only then remove the attribute (otherwise invalidation wouldn't be complete)
|
// first invalidate and only then remove the attribute (otherwise invalidation wouldn't be complete)
|
||||||
if (attribute.isAffectingSubtree || note.isTemplate()) {
|
if (attribute.isAffectingSubtree || note.isInherited()) {
|
||||||
note.invalidateSubTree();
|
note.invalidateSubTree();
|
||||||
} else {
|
} else {
|
||||||
note.invalidateThisCache();
|
note.invalidateThisCache();
|
||||||
@@ -205,7 +215,7 @@ function attributeUpdated(attribute) {
|
|||||||
const note = becca.notes[attribute.noteId];
|
const note = becca.notes[attribute.noteId];
|
||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
if (attribute.isAffectingSubtree || note.isTemplate()) {
|
if (attribute.isAffectingSubtree || note.isInherited()) {
|
||||||
note.invalidateSubTree();
|
note.invalidateSubTree();
|
||||||
} else {
|
} else {
|
||||||
note.invalidateThisCache();
|
note.invalidateThisCache();
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
const becca = require('./becca');
|
const becca = require('./becca');
|
||||||
const cls = require('../services/cls');
|
const cls = require('../services/cls');
|
||||||
const protectedSessionService = require('../services/protected_session');
|
|
||||||
const log = require('../services/log');
|
const log = require('../services/log');
|
||||||
|
|
||||||
function isNotePathArchived(notePath) {
|
function isNotePathArchived(notePath) {
|
||||||
@@ -17,7 +16,7 @@ function isNotePathArchived(notePath) {
|
|||||||
const note = becca.notes[notePath[i]];
|
const note = becca.notes[notePath[i]];
|
||||||
|
|
||||||
// this is going through parents so archived must be inheritable
|
// this is going through parents so archived must be inheritable
|
||||||
if (note.hasInheritableOwnedArchivedLabel()) {
|
if (note.hasInheritableArchivedLabel()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,7 +39,7 @@ function isArchived(noteId) {
|
|||||||
/**
|
/**
|
||||||
* @param {string} noteId
|
* @param {string} noteId
|
||||||
* @param {string} ancestorNoteId
|
* @param {string} ancestorNoteId
|
||||||
* @return {boolean} - true if given noteId has ancestorNoteId in any of its paths (even archived)
|
* @returns {boolean} - true if given noteId has ancestorNoteId in any of its paths (even archived)
|
||||||
*/
|
*/
|
||||||
function isInAncestor(noteId, ancestorNoteId) {
|
function isInAncestor(noteId, ancestorNoteId) {
|
||||||
if (ancestorNoteId === 'root' || ancestorNoteId === noteId) {
|
if (ancestorNoteId === 'root' || ancestorNoteId === noteId) {
|
||||||
@@ -83,10 +82,8 @@ function getNoteTitleArrayForPath(notePathArray) {
|
|||||||
throw new Error(`${notePathArray} is not an array.`);
|
throw new Error(`${notePathArray} is not an array.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const hoistedNoteId = cls.getHoistedNoteId();
|
if (notePathArray.length === 1) {
|
||||||
|
return [getNoteTitle(notePathArray[0])];
|
||||||
if (notePathArray.length === 1 && notePathArray[0] === hoistedNoteId) {
|
|
||||||
return [getNoteTitle(hoistedNoteId)];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const titles = [];
|
const titles = [];
|
||||||
@@ -95,6 +92,7 @@ function getNoteTitleArrayForPath(notePathArray) {
|
|||||||
let hoistedNotePassed = false;
|
let hoistedNotePassed = false;
|
||||||
|
|
||||||
// this is a notePath from outside of hoisted subtree so full title path needs to be returned
|
// this is a notePath from outside of hoisted subtree so full title path needs to be returned
|
||||||
|
const hoistedNoteId = cls.getHoistedNoteId();
|
||||||
const outsideOfHoistedSubtree = !notePathArray.includes(hoistedNoteId);
|
const outsideOfHoistedSubtree = !notePathArray.includes(hoistedNoteId);
|
||||||
|
|
||||||
for (const noteId of notePathArray) {
|
for (const noteId of notePathArray) {
|
||||||
@@ -126,35 +124,43 @@ function getNoteTitleForPath(notePathArray) {
|
|||||||
* Archived (and hidden) notes are also returned, but non-archived paths are preferred if available
|
* Archived (and hidden) notes are also returned, but non-archived paths are preferred if available
|
||||||
* - this means that archived paths is returned only if there's no non-archived path
|
* - this means that archived paths is returned only if there's no non-archived path
|
||||||
* - you can check whether returned path is archived using isArchived
|
* - you can check whether returned path is archived using isArchived
|
||||||
|
*
|
||||||
|
* @param {BNote} note
|
||||||
|
* @param {string[]} path
|
||||||
*/
|
*/
|
||||||
function getSomePath(note, path = []) {
|
function getSomePath(note, path = []) {
|
||||||
// first try to find note within hoisted note, otherwise take any existing note path
|
// first try to find note within hoisted note, otherwise take any existing note path
|
||||||
// each branch needs a separate copy since it's mutable
|
return getSomePathInner(note, path, true)
|
||||||
return getSomePathInner(note, [...path], true)
|
|| getSomePathInner(note, path, false);
|
||||||
|| getSomePathInner(note, [...path], false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {BNote} note
|
||||||
|
* @param {string[]} path
|
||||||
|
* @param {boolean}respectHoisting
|
||||||
|
* @returns {string[]|false}
|
||||||
|
*/
|
||||||
function getSomePathInner(note, path, respectHoisting) {
|
function getSomePathInner(note, path, respectHoisting) {
|
||||||
if (note.isRoot()) {
|
if (note.isRoot()) {
|
||||||
path.push(note.noteId);
|
const foundPath = [...path, note.noteId];
|
||||||
path.reverse();
|
foundPath.reverse();
|
||||||
|
|
||||||
if (respectHoisting && !path.includes(cls.getHoistedNoteId())) {
|
if (respectHoisting && !foundPath.includes(cls.getHoistedNoteId())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return path;
|
return foundPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const parents = note.parents;
|
const parents = note.parents;
|
||||||
if (parents.length === 0) {
|
if (parents.length === 0) {
|
||||||
console.log(`Note ${note.noteId} - "${note.title}" has no parents.`);
|
console.log(`Note '${note.noteId}' - '${note.title}' has no parents.`);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const parentNote of parents) {
|
for (const parentNote of parents) {
|
||||||
const retPath = getSomePathInner(parentNote, path.concat([note.noteId]), respectHoisting);
|
const retPath = getSomePathInner(parentNote, [...path, note.noteId], respectHoisting);
|
||||||
|
|
||||||
if (retPath) {
|
if (retPath) {
|
||||||
return retPath;
|
return retPath;
|
||||||
@@ -180,7 +186,7 @@ function getNotePath(noteId) {
|
|||||||
let branchId;
|
let branchId;
|
||||||
|
|
||||||
if (note.isRoot()) {
|
if (note.isRoot()) {
|
||||||
branchId = 'root';
|
branchId = 'none_root';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const parentNote = note.parents[0];
|
const parentNote = note.parents[0];
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ let becca = null;
|
|||||||
/**
|
/**
|
||||||
* Base class for all backend entities.
|
* Base class for all backend entities.
|
||||||
*/
|
*/
|
||||||
class AbstractEntity {
|
class AbstractBeccaEntity {
|
||||||
/** @protected */
|
/** @protected */
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
this.generateIdIfNecessary();
|
this.generateIdIfNecessary();
|
||||||
@@ -46,7 +46,10 @@ class AbstractEntity {
|
|||||||
return this.utcDateModified || this.utcDateCreated;
|
return this.utcDateModified || this.utcDateCreated;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @protected */
|
/**
|
||||||
|
* @protected
|
||||||
|
* @returns {Becca}
|
||||||
|
*/
|
||||||
get becca() {
|
get becca() {
|
||||||
if (!becca) {
|
if (!becca) {
|
||||||
becca = require('../becca');
|
becca = require('../becca');
|
||||||
@@ -75,16 +78,16 @@ class AbstractEntity {
|
|||||||
/**
|
/**
|
||||||
* Saves entity - executes SQL, but doesn't commit the transaction on its own
|
* Saves entity - executes SQL, but doesn't commit the transaction on its own
|
||||||
*
|
*
|
||||||
* @returns {AbstractEntity}
|
* @returns {this}
|
||||||
*/
|
*/
|
||||||
save() {
|
save(opts = {}) {
|
||||||
const entityName = this.constructor.entityName;
|
const entityName = this.constructor.entityName;
|
||||||
const primaryKeyName = this.constructor.primaryKeyName;
|
const primaryKeyName = this.constructor.primaryKeyName;
|
||||||
|
|
||||||
const isNewEntity = !this[primaryKeyName];
|
const isNewEntity = !this[primaryKeyName];
|
||||||
|
|
||||||
if (this.beforeSaving) {
|
if (this.beforeSaving) {
|
||||||
this.beforeSaving();
|
this.beforeSaving(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pojo = this.getPojoToSave();
|
const pojo = this.getPojoToSave();
|
||||||
@@ -164,4 +167,4 @@ class AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = AbstractEntity;
|
module.exports = AbstractBeccaEntity;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const Note = require('./note');
|
const BNote = require('./bnote');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
const sql = require("../../services/sql");
|
const sql = require("../../services/sql");
|
||||||
const dateUtils = require("../../services/date_utils");
|
const dateUtils = require("../../services/date_utils");
|
||||||
const promotedAttributeDefinitionParser = require("../../services/promoted_attribute_definition_parser");
|
const promotedAttributeDefinitionParser = require("../../services/promoted_attribute_definition_parser");
|
||||||
@@ -11,9 +11,9 @@ const {sanitizeAttributeName} = require("../../services/sanitize_attribute_name"
|
|||||||
* Attribute is an abstract concept which has two real uses - label (key - value pair)
|
* Attribute is an abstract concept which has two real uses - label (key - value pair)
|
||||||
* and relation (representing named relationship between source and target note)
|
* and relation (representing named relationship between source and target note)
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class Attribute extends AbstractEntity {
|
class BAttribute extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "attributes"; }
|
static get entityName() { return "attributes"; }
|
||||||
static get primaryKeyName() { return "attributeId"; }
|
static get primaryKeyName() { return "attributeId"; }
|
||||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable"]; }
|
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable"]; }
|
||||||
@@ -70,7 +70,7 @@ class Attribute extends AbstractEntity {
|
|||||||
|
|
||||||
if (!(this.noteId in this.becca.notes)) {
|
if (!(this.noteId in this.becca.notes)) {
|
||||||
// entities can come out of order in sync, create skeleton which will be filled later
|
// entities can come out of order in sync, create skeleton which will be filled later
|
||||||
this.becca.addNote(this.noteId, new Note({noteId: this.noteId}));
|
this.becca.addNote(this.noteId, new BNote({noteId: this.noteId}));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.becca.notes[this.noteId].ownedAttributes.push(this);
|
this.becca.notes[this.noteId].ownedAttributes.push(this);
|
||||||
@@ -102,7 +102,7 @@ class Attribute extends AbstractEntity {
|
|||||||
|
|
||||||
get isAffectingSubtree() {
|
get isAffectingSubtree() {
|
||||||
return this.isInheritable
|
return this.isInheritable
|
||||||
|| (this.type === 'relation' && this.name === 'template');
|
|| (this.type === 'relation' && ['template', 'inherit'].includes(this.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
get targetNoteId() { // alias
|
get targetNoteId() { // alias
|
||||||
@@ -124,7 +124,7 @@ class Attribute extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
getNote() {
|
getNote() {
|
||||||
const note = this.becca.getNote(this.noteId);
|
const note = this.becca.getNote(this.noteId);
|
||||||
@@ -137,7 +137,7 @@ class Attribute extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Note|null}
|
* @returns {BNote|null}
|
||||||
*/
|
*/
|
||||||
getTargetNote() {
|
getTargetNote() {
|
||||||
if (this.type !== 'relation') {
|
if (this.type !== 'relation') {
|
||||||
@@ -152,7 +152,7 @@ class Attribute extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
isDefinition() {
|
isDefinition() {
|
||||||
return this.type === 'label' && (this.name.startsWith('label:') || this.name.startsWith('relation:'));
|
return this.type === 'label' && (this.name.startsWith('label:') || this.name.startsWith('relation:'));
|
||||||
@@ -176,8 +176,10 @@ class Attribute extends AbstractEntity {
|
|||||||
return !(this.attributeId in this.becca.attributes);
|
return !(this.attributeId in this.becca.attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving(opts = {}) {
|
||||||
|
if (!opts.skipValidation) {
|
||||||
this.validate();
|
this.validate();
|
||||||
|
}
|
||||||
|
|
||||||
this.name = sanitizeAttributeName(this.name);
|
this.name = sanitizeAttributeName(this.name);
|
||||||
|
|
||||||
@@ -217,7 +219,7 @@ class Attribute extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createClone(type, name, value, isInheritable) {
|
createClone(type, name, value, isInheritable) {
|
||||||
return new Attribute({
|
return new BAttribute({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
type: type,
|
type: type,
|
||||||
name: name,
|
name: name,
|
||||||
@@ -229,4 +231,4 @@ class Attribute extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Attribute;
|
module.exports = BAttribute;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const Note = require('./note');
|
const BNote = require('./bnote');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
const dateUtils = require("../../services/date_utils");
|
const dateUtils = require("../../services/date_utils");
|
||||||
const utils = require("../../services/utils");
|
const utils = require("../../services/utils");
|
||||||
const TaskContext = require("../../services/task_context");
|
const TaskContext = require("../../services/task_context");
|
||||||
@@ -15,9 +15,9 @@ const log = require("../../services/log");
|
|||||||
* Note that you should not rely on the branch's identity, since it can change easily with a note's move.
|
* Note that you should not rely on the branch's identity, since it can change easily with a note's move.
|
||||||
* Always check noteId instead.
|
* Always check noteId instead.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class Branch extends AbstractEntity {
|
class BBranch extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "branches"; }
|
static get entityName() { return "branches"; }
|
||||||
static get primaryKeyName() { return "branchId"; }
|
static get primaryKeyName() { return "branchId"; }
|
||||||
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
|
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
|
||||||
@@ -53,7 +53,7 @@ class Branch extends AbstractEntity {
|
|||||||
this.noteId = noteId;
|
this.noteId = noteId;
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
this.parentNoteId = parentNoteId;
|
this.parentNoteId = parentNoteId;
|
||||||
/** @type {string} */
|
/** @type {string|null} */
|
||||||
this.prefix = prefix;
|
this.prefix = prefix;
|
||||||
/** @type {int} */
|
/** @type {int} */
|
||||||
this.notePosition = notePosition;
|
this.notePosition = notePosition;
|
||||||
@@ -78,7 +78,7 @@ class Branch extends AbstractEntity {
|
|||||||
childNote.parentBranches.push(this);
|
childNote.parentBranches.push(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.branchId === 'root') {
|
if (this.noteId === 'root') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,11 +93,11 @@ class Branch extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note} */
|
/** @returns {BNote} */
|
||||||
get childNote() {
|
get childNote() {
|
||||||
if (!(this.noteId in this.becca.notes)) {
|
if (!(this.noteId in this.becca.notes)) {
|
||||||
// entities can come out of order in sync/import, create skeleton which will be filled later
|
// entities can come out of order in sync/import, create skeleton which will be filled later
|
||||||
this.becca.addNote(this.noteId, new Note({noteId: this.noteId}));
|
this.becca.addNote(this.noteId, new BNote({noteId: this.noteId}));
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.becca.notes[this.noteId];
|
return this.becca.notes[this.noteId];
|
||||||
@@ -107,11 +107,11 @@ class Branch extends AbstractEntity {
|
|||||||
return this.childNote;
|
return this.childNote;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note|undefined} - root branch will have undefined parent, all other branches have to have a parent note */
|
/** @returns {BNote|undefined} - root branch will have undefined parent, all other branches have to have a parent note */
|
||||||
get parentNote() {
|
get parentNote() {
|
||||||
if (!(this.parentNoteId in this.becca.notes) && this.parentNoteId !== 'none') {
|
if (!(this.parentNoteId in this.becca.notes) && this.parentNoteId !== 'none') {
|
||||||
// entities can come out of order in sync/import, create skeleton which will be filled later
|
// entities can come out of order in sync/import, create skeleton which will be filled later
|
||||||
this.becca.addNote(this.parentNoteId, new Note({noteId: this.parentNoteId}));
|
this.becca.addNote(this.parentNoteId, new BNote({noteId: this.parentNoteId}));
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.becca.notes[this.parentNoteId];
|
return this.becca.notes[this.parentNoteId];
|
||||||
@@ -140,7 +140,7 @@ class Branch extends AbstractEntity {
|
|||||||
* @param {string} [deleteId] - optional delete identified
|
* @param {string} [deleteId] - optional delete identified
|
||||||
* @param {TaskContext} [taskContext]
|
* @param {TaskContext} [taskContext]
|
||||||
*
|
*
|
||||||
* @return {boolean} - true if note has been deleted, false otherwise
|
* @returns {boolean} - true if note has been deleted, false otherwise
|
||||||
*/
|
*/
|
||||||
deleteBranch(deleteId, taskContext) {
|
deleteBranch(deleteId, taskContext) {
|
||||||
if (!deleteId) {
|
if (!deleteId) {
|
||||||
@@ -165,8 +165,7 @@ class Branch extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.branchId === 'root'
|
if (this.noteId === 'root'
|
||||||
|| this.noteId === 'root'
|
|
||||||
|| this.noteId === cls.getHoistedNoteId()) {
|
|| this.noteId === cls.getHoistedNoteId()) {
|
||||||
|
|
||||||
throw new Error("Can't delete root or hoisted branch/note");
|
throw new Error("Can't delete root or hoisted branch/note");
|
||||||
@@ -209,11 +208,19 @@ class Branch extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
|
if (!this.noteId || !this.parentNoteId) {
|
||||||
|
throw new Error(`noteId and parentNoteId are mandatory properties for Branch`);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.branchId = `${this.parentNoteId}_${this.noteId}`;
|
||||||
|
|
||||||
if (this.notePosition === undefined || this.notePosition === null) {
|
if (this.notePosition === undefined || this.notePosition === null) {
|
||||||
let maxNotePos = 0;
|
let maxNotePos = 0;
|
||||||
|
|
||||||
for (const childBranch of this.parentNote.getChildBranches()) {
|
for (const childBranch of this.parentNote.getChildBranches()) {
|
||||||
if (maxNotePos < childBranch.notePosition && childBranch.noteId !== '_hidden') {
|
if (maxNotePos < childBranch.notePosition
|
||||||
|
&& childBranch.noteId !== '_hidden' // hidden has very large notePosition to always stay last
|
||||||
|
) {
|
||||||
maxNotePos = childBranch.notePosition;
|
maxNotePos = childBranch.notePosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -225,6 +232,10 @@ class Branch extends AbstractEntity {
|
|||||||
this.isExpanded = false;
|
this.isExpanded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.prefix?.trim()) {
|
||||||
|
this.prefix = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||||
|
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
@@ -246,7 +257,13 @@ class Branch extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createClone(parentNoteId, notePosition) {
|
createClone(parentNoteId, notePosition) {
|
||||||
return new Branch({
|
const existingBranch = this.becca.getBranchFromChildAndParent(this.noteId, parentNoteId);
|
||||||
|
|
||||||
|
if (existingBranch) {
|
||||||
|
existingBranch.notePosition = notePosition;
|
||||||
|
return existingBranch;
|
||||||
|
} else {
|
||||||
|
return new BBranch({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
parentNoteId: parentNoteId,
|
parentNoteId: parentNoteId,
|
||||||
notePosition: notePosition,
|
notePosition: notePosition,
|
||||||
@@ -254,6 +271,7 @@ class Branch extends AbstractEntity {
|
|||||||
isExpanded: this.isExpanded
|
isExpanded: this.isExpanded
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Branch;
|
module.exports = BBranch;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const dateUtils = require('../../services/date_utils');
|
const dateUtils = require('../../services/date_utils');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications.
|
* EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications.
|
||||||
@@ -12,9 +12,9 @@ const AbstractEntity = require("./abstract_entity");
|
|||||||
* The format user is presented with is "<etapiTokenId>_<tokenHash>". This is also called "authToken" to distinguish it
|
* The format user is presented with is "<etapiTokenId>_<tokenHash>". This is also called "authToken" to distinguish it
|
||||||
* from tokenHash and token.
|
* from tokenHash and token.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class EtapiToken extends AbstractEntity {
|
class BEtapiToken extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "etapi_tokens"; }
|
static get entityName() { return "etapi_tokens"; }
|
||||||
static get primaryKeyName() { return "etapiTokenId"; }
|
static get primaryKeyName() { return "etapiTokenId"; }
|
||||||
static get hashedProperties() { return ["etapiTokenId", "name", "tokenHash", "utcDateCreated", "utcDateModified", "isDeleted"]; }
|
static get hashedProperties() { return ["etapiTokenId", "name", "tokenHash", "utcDateCreated", "utcDateModified", "isDeleted"]; }
|
||||||
@@ -75,4 +75,4 @@ class EtapiToken extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = EtapiToken;
|
module.exports = BEtapiToken;
|
||||||
@@ -6,12 +6,13 @@ const sql = require('../../services/sql');
|
|||||||
const utils = require('../../services/utils');
|
const utils = require('../../services/utils');
|
||||||
const dateUtils = require('../../services/date_utils');
|
const dateUtils = require('../../services/date_utils');
|
||||||
const entityChangesService = require('../../services/entity_changes');
|
const entityChangesService = require('../../services/entity_changes');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
const NoteRevision = require("./note_revision");
|
const BNoteRevision = require("./bnote_revision");
|
||||||
const TaskContext = require("../../services/task_context");
|
const TaskContext = require("../../services/task_context");
|
||||||
const dayjs = require("dayjs");
|
const dayjs = require("dayjs");
|
||||||
const utc = require('dayjs/plugin/utc');
|
const utc = require('dayjs/plugin/utc');
|
||||||
dayjs.extend(utc)
|
const eventService = require("../../services/events");
|
||||||
|
dayjs.extend(utc);
|
||||||
|
|
||||||
const LABEL = 'label';
|
const LABEL = 'label';
|
||||||
const RELATION = 'relation';
|
const RELATION = 'relation';
|
||||||
@@ -19,9 +20,9 @@ const RELATION = 'relation';
|
|||||||
/**
|
/**
|
||||||
* Trilium's main entity which can represent text note, image, code note, file attachment etc.
|
* Trilium's main entity which can represent text note, image, code note, file attachment etc.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class Note extends AbstractEntity {
|
class BNote extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "notes"; }
|
static get entityName() { return "notes"; }
|
||||||
static get primaryKeyName() { return "noteId"; }
|
static get primaryKeyName() { return "noteId"; }
|
||||||
static get hashedProperties() { return ["noteId", "title", "isProtected", "type", "mime"]; }
|
static get hashedProperties() { return ["noteId", "title", "isProtected", "type", "mime"]; }
|
||||||
@@ -89,33 +90,33 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
/** @type {Branch[]}
|
/** @type {BBranch[]}
|
||||||
* @private */
|
* @private */
|
||||||
this.parentBranches = [];
|
this.parentBranches = [];
|
||||||
/** @type {Note[]}
|
/** @type {BNote[]}
|
||||||
* @private */
|
* @private */
|
||||||
this.parents = [];
|
this.parents = [];
|
||||||
/** @type {Note[]}
|
/** @type {BNote[]}
|
||||||
* @private*/
|
* @private*/
|
||||||
this.children = [];
|
this.children = [];
|
||||||
/** @type {Attribute[]}
|
/** @type {BAttribute[]}
|
||||||
* @private */
|
* @private */
|
||||||
this.ownedAttributes = [];
|
this.ownedAttributes = [];
|
||||||
|
|
||||||
/** @type {Attribute[]|null}
|
/** @type {BAttribute[]|null}
|
||||||
* @private */
|
* @private */
|
||||||
this.__attributeCache = null;
|
this.__attributeCache = null;
|
||||||
/** @type {Attribute[]|null}
|
/** @type {BAttribute[]|null}
|
||||||
* @private*/
|
* @private*/
|
||||||
this.inheritableAttributeCache = null;
|
this.inheritableAttributeCache = null;
|
||||||
|
|
||||||
/** @type {Attribute[]}
|
/** @type {BAttribute[]}
|
||||||
* @private*/
|
* @private*/
|
||||||
this.targetRelations = [];
|
this.targetRelations = [];
|
||||||
|
|
||||||
this.becca.addNote(this.noteId, this);
|
this.becca.addNote(this.noteId, this);
|
||||||
|
|
||||||
/** @type {Note[]|null}
|
/** @type {BNote[]|null}
|
||||||
* @private */
|
* @private */
|
||||||
this.ancestorCache = null;
|
this.ancestorCache = null;
|
||||||
|
|
||||||
@@ -151,7 +152,7 @@ class Note extends AbstractEntity {
|
|||||||
return this.isContentAvailable() ? this.title : '[protected]';
|
return this.isContentAvailable() ? this.title : '[protected]';
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Branch[]} */
|
/** @returns {BBranch[]} */
|
||||||
getParentBranches() {
|
getParentBranches() {
|
||||||
return this.parentBranches;
|
return this.parentBranches;
|
||||||
}
|
}
|
||||||
@@ -159,26 +160,26 @@ class Note extends AbstractEntity {
|
|||||||
/**
|
/**
|
||||||
* Returns <i>strong</i> (as opposed to <i>weak</i>) parent branches. See isWeak for details.
|
* Returns <i>strong</i> (as opposed to <i>weak</i>) parent branches. See isWeak for details.
|
||||||
*
|
*
|
||||||
* @returns {Branch[]}
|
* @returns {BBranch[]}
|
||||||
*/
|
*/
|
||||||
getStrongParentBranches() {
|
getStrongParentBranches() {
|
||||||
return this.getParentBranches().filter(branch => !branch.isWeak);
|
return this.getParentBranches().filter(branch => !branch.isWeak);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Branch[]}
|
* @returns {BBranch[]}
|
||||||
* @deprecated use getParentBranches() instead
|
* @deprecated use getParentBranches() instead
|
||||||
*/
|
*/
|
||||||
getBranches() {
|
getBranches() {
|
||||||
return this.parentBranches;
|
return this.parentBranches;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getParentNotes() {
|
getParentNotes() {
|
||||||
return this.parents;
|
return this.parents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getChildNotes() {
|
getChildNotes() {
|
||||||
return this.children;
|
return this.children;
|
||||||
}
|
}
|
||||||
@@ -188,16 +189,16 @@ class Note extends AbstractEntity {
|
|||||||
return this.children && this.children.length > 0;
|
return this.children && this.children.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Branch[]} */
|
/** @returns {BBranch[]} */
|
||||||
getChildBranches() {
|
getChildBranches() {
|
||||||
return this.children.map(childNote => this.becca.getBranchFromChildAndParent(childNote.noteId, this.noteId));
|
return this.children.map(childNote => this.becca.getBranchFromChildAndParent(childNote.noteId, this.noteId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note content has quite special handling - it's not a separate entity, but a lazily loaded
|
* Note content has quite special handling - it's not a separate entity, but a lazily loaded
|
||||||
* part of Note entity with it's own sync. Reasons behind this hybrid design has been:
|
* part of Note entity with its own sync. Reasons behind this hybrid design has been:
|
||||||
*
|
*
|
||||||
* - content can be quite large and it's not necessary to load it / fill memory for any note access even if we don't need a content, especially for bulk operations like search
|
* - content can be quite large, and it's not necessary to load it / fill memory for any note access even if we don't need a content, especially for bulk operations like search
|
||||||
* - changes in the note metadata or title should not trigger note content sync (so we keep separate utcDateModified and entity changes records)
|
* - changes in the note metadata or title should not trigger note content sync (so we keep separate utcDateModified and entity changes records)
|
||||||
* - but to the user note content and title changes are one and the same - single dateModified (so all changes must go through Note and content is not a separate entity)
|
* - but to the user note content and title changes are one and the same - single dateModified (so all changes must go through Note and content is not a separate entity)
|
||||||
*/
|
*/
|
||||||
@@ -314,6 +315,11 @@ class Note extends AbstractEntity {
|
|||||||
utcDateChanged: pojo.utcDateModified,
|
utcDateChanged: pojo.utcDateModified,
|
||||||
isSynced: true
|
isSynced: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventService.emit(eventService.ENTITY_CHANGED, {
|
||||||
|
entityName: 'note_contents',
|
||||||
|
entity: this
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setJsonContent(content) {
|
setJsonContent(content) {
|
||||||
@@ -344,6 +350,12 @@ class Note extends AbstractEntity {
|
|||||||
&& this.mime === "text/html";
|
&& this.mime === "text/html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @returns {boolean} true if this note is an image */
|
||||||
|
isImage() {
|
||||||
|
return this.type === 'image'
|
||||||
|
|| (this.type === 'file' && this.mime?.startsWith('image/'));
|
||||||
|
}
|
||||||
|
|
||||||
/** @returns {boolean} true if the note has string content (not binary) */
|
/** @returns {boolean} true if the note has string content (not binary) */
|
||||||
isStringNote() {
|
isStringNote() {
|
||||||
return utils.isStringNote(this.type, this.mime);
|
return utils.isStringNote(this.type, this.mime);
|
||||||
@@ -369,15 +381,14 @@ class Note extends AbstractEntity {
|
|||||||
/**
|
/**
|
||||||
* @param {string} [type] - (optional) attribute type to filter
|
* @param {string} [type] - (optional) attribute type to filter
|
||||||
* @param {string} [name] - (optional) attribute name to filter
|
* @param {string} [name] - (optional) attribute name to filter
|
||||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
* @returns {BAttribute[]} all note's attributes, including inherited ones
|
||||||
*/
|
*/
|
||||||
getAttributes(type, name) {
|
getAttributes(type, name) {
|
||||||
this.__validateTypeName(type, name);
|
this.__validateTypeName(type, name);
|
||||||
|
this.__ensureAttributeCacheIsAvailable();
|
||||||
this.__getAttributes([]);
|
|
||||||
|
|
||||||
if (type && name) {
|
if (type && name) {
|
||||||
return this.__attributeCache.filter(attr => attr.type === type && attr.name === name);
|
return this.__attributeCache.filter(attr => attr.name === name && attr.type === type);
|
||||||
}
|
}
|
||||||
else if (type) {
|
else if (type) {
|
||||||
return this.__attributeCache.filter(attr => attr.type === type);
|
return this.__attributeCache.filter(attr => attr.type === type);
|
||||||
@@ -391,6 +402,13 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @private */
|
||||||
|
__ensureAttributeCacheIsAvailable() {
|
||||||
|
if (!this.__attributeCache) {
|
||||||
|
this.__getAttributes([]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** @private */
|
/** @private */
|
||||||
__getAttributes(path) {
|
__getAttributes(path) {
|
||||||
if (path.includes(this.noteId)) {
|
if (path.includes(this.noteId)) {
|
||||||
@@ -401,7 +419,8 @@ class Note extends AbstractEntity {
|
|||||||
const parentAttributes = this.ownedAttributes.slice();
|
const parentAttributes = this.ownedAttributes.slice();
|
||||||
const newPath = [...path, this.noteId];
|
const newPath = [...path, this.noteId];
|
||||||
|
|
||||||
if (this.noteId !== 'root') {
|
// inheritable attrs on root are typically not intended to be applied to hidden subtree #3537
|
||||||
|
if (this.noteId !== 'root' && this.noteId !== '_hidden') {
|
||||||
for (const parentNote of this.parents) {
|
for (const parentNote of this.parents) {
|
||||||
parentAttributes.push(...parentNote.__getInheritableAttributes(newPath));
|
parentAttributes.push(...parentNote.__getInheritableAttributes(newPath));
|
||||||
}
|
}
|
||||||
@@ -410,7 +429,7 @@ class Note extends AbstractEntity {
|
|||||||
const templateAttributes = [];
|
const templateAttributes = [];
|
||||||
|
|
||||||
for (const ownedAttr of parentAttributes) { // parentAttributes so we process also inherited templates
|
for (const ownedAttr of parentAttributes) { // parentAttributes so we process also inherited templates
|
||||||
if (ownedAttr.type === 'relation' && ownedAttr.name === 'template') {
|
if (ownedAttr.type === 'relation' && ['template', 'inherit'].includes(ownedAttr.name)) {
|
||||||
const templateNote = this.becca.notes[ownedAttr.value];
|
const templateNote = this.becca.notes[ownedAttr.value];
|
||||||
|
|
||||||
if (templateNote) {
|
if (templateNote) {
|
||||||
@@ -449,7 +468,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @returns {Attribute[]}
|
* @returns {BAttribute[]}
|
||||||
*/
|
*/
|
||||||
__getInheritableAttributes(path) {
|
__getInheritableAttributes(path) {
|
||||||
if (path.includes(this.noteId)) {
|
if (path.includes(this.noteId)) {
|
||||||
@@ -484,9 +503,9 @@ class Note extends AbstractEntity {
|
|||||||
*/
|
*/
|
||||||
hasAttribute(type, name, value = null) {
|
hasAttribute(type, name, value = null) {
|
||||||
return !!this.getAttributes().find(attr =>
|
return !!this.getAttributes().find(attr =>
|
||||||
attr.type === type
|
attr.name === name
|
||||||
&& attr.name === name
|
|
||||||
&& (value === undefined || value === null || attr.value === value)
|
&& (value === undefined || value === null || attr.value === value)
|
||||||
|
&& attr.type === type
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -495,13 +514,13 @@ class Note extends AbstractEntity {
|
|||||||
value = value ? value.toLowerCase() : null;
|
value = value ? value.toLowerCase() : null;
|
||||||
|
|
||||||
return this.getAttributes().find(
|
return this.getAttributes().find(
|
||||||
attr => attr.type === type
|
attr => attr.name.toLowerCase() === name
|
||||||
&& attr.name.toLowerCase() === name
|
&& (!value || attr.value.toLowerCase() === value)
|
||||||
&& (!value || attr.value.toLowerCase() === value));
|
&& attr.type === type);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRelationTarget(name) {
|
getRelationTarget(name) {
|
||||||
const relation = this.getAttributes().find(attr => attr.type === 'relation' && attr.name === name);
|
const relation = this.getAttributes().find(attr => attr.name === name && attr.type === 'relation');
|
||||||
|
|
||||||
return relation ? relation.targetNote : null;
|
return relation ? relation.targetNote : null;
|
||||||
}
|
}
|
||||||
@@ -536,25 +555,25 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Attribute|null} label if it exists, null otherwise
|
* @returns {BAttribute|null} label if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getLabel(name) { return this.getAttribute(LABEL, name); }
|
getLabel(name) { return this.getAttribute(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Attribute|null} label if it exists, null otherwise
|
* @returns {BAttribute|null} label if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
|
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Attribute|null} relation if it exists, null otherwise
|
* @returns {BAttribute|null} relation if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getRelation(name) { return this.getAttribute(RELATION, name); }
|
getRelation(name) { return this.getAttribute(RELATION, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Attribute|null} relation if it exists, null otherwise
|
* @returns {BAttribute|null} relation if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
|
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
|
||||||
|
|
||||||
@@ -595,12 +614,12 @@ class Note extends AbstractEntity {
|
|||||||
/**
|
/**
|
||||||
* @param {string} type - attribute type (label, relation, etc.)
|
* @param {string} type - attribute type (label, relation, etc.)
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
* @returns {BAttribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||||
*/
|
*/
|
||||||
getAttribute(type, name) {
|
getAttribute(type, name) {
|
||||||
const attributes = this.getAttributes();
|
const attributes = this.getAttributes();
|
||||||
|
|
||||||
return attributes.find(attr => attr.type === type && attr.name === name);
|
return attributes.find(attr => attr.name === name && attr.type === type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -627,7 +646,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - label name to filter
|
* @param {string} [name] - label name to filter
|
||||||
* @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
|
* @returns {BAttribute[]} all note's labels (attributes with type label), including inherited ones
|
||||||
*/
|
*/
|
||||||
getLabels(name) {
|
getLabels(name) {
|
||||||
return this.getAttributes(LABEL, name);
|
return this.getAttributes(LABEL, name);
|
||||||
@@ -643,7 +662,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - label name to filter
|
* @param {string} [name] - label name to filter
|
||||||
* @returns {Attribute[]} all note's labels (attributes with type label), excluding inherited ones
|
* @returns {BAttribute[]} all note's labels (attributes with type label), excluding inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedLabels(name) {
|
getOwnedLabels(name) {
|
||||||
return this.getOwnedAttributes(LABEL, name);
|
return this.getOwnedAttributes(LABEL, name);
|
||||||
@@ -659,7 +678,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - relation name to filter
|
* @param {string} [name] - relation name to filter
|
||||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
* @returns {BAttribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||||
*/
|
*/
|
||||||
getRelations(name) {
|
getRelations(name) {
|
||||||
return this.getAttributes(RELATION, name);
|
return this.getAttributes(RELATION, name);
|
||||||
@@ -667,7 +686,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - relation name to filter
|
* @param {string} [name] - relation name to filter
|
||||||
* @returns {Attribute[]} all note's relations (attributes with type relation), excluding inherited ones
|
* @returns {BAttribute[]} all note's relations (attributes with type relation), excluding inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedRelations(name) {
|
getOwnedRelations(name) {
|
||||||
return this.getOwnedAttributes(RELATION, name);
|
return this.getOwnedAttributes(RELATION, name);
|
||||||
@@ -677,16 +696,16 @@ class Note extends AbstractEntity {
|
|||||||
* @param {string|null} [type] - (optional) attribute type to filter
|
* @param {string|null} [type] - (optional) attribute type to filter
|
||||||
* @param {string|null} [name] - (optional) attribute name to filter
|
* @param {string|null} [name] - (optional) attribute name to filter
|
||||||
* @param {string|null} [value] - (optional) attribute value to filter
|
* @param {string|null} [value] - (optional) attribute value to filter
|
||||||
* @returns {Attribute[]} note's "owned" attributes - excluding inherited ones
|
* @returns {BAttribute[]} note's "owned" attributes - excluding inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedAttributes(type = null, name = null, value = null) {
|
getOwnedAttributes(type = null, name = null, value = null) {
|
||||||
this.__validateTypeName(type, name);
|
this.__validateTypeName(type, name);
|
||||||
|
|
||||||
if (type && name && value !== undefined && value !== null) {
|
if (type && name && value !== undefined && value !== null) {
|
||||||
return this.ownedAttributes.filter(attr => attr.type === type && attr.name === name && attr.value === value);
|
return this.ownedAttributes.filter(attr => attr.name === name && attr.value === value && attr.type === type);
|
||||||
}
|
}
|
||||||
else if (type && name) {
|
else if (type && name) {
|
||||||
return this.ownedAttributes.filter(attr => attr.type === type && attr.name === name);
|
return this.ownedAttributes.filter(attr => attr.name === name && attr.type === type);
|
||||||
}
|
}
|
||||||
else if (type) {
|
else if (type) {
|
||||||
return this.ownedAttributes.filter(attr => attr.type === type);
|
return this.ownedAttributes.filter(attr => attr.type === type);
|
||||||
@@ -700,7 +719,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Attribute} attribute belonging to this specific note (excludes inherited attributes)
|
* @returns {BAttribute} attribute belonging to this specific note (excludes inherited attributes)
|
||||||
*
|
*
|
||||||
* This method can be significantly faster than the getAttribute()
|
* This method can be significantly faster than the getAttribute()
|
||||||
*/
|
*/
|
||||||
@@ -714,28 +733,55 @@ class Note extends AbstractEntity {
|
|||||||
return this.hasAttribute('label', 'archived');
|
return this.hasAttribute('label', 'archived');
|
||||||
}
|
}
|
||||||
|
|
||||||
hasInheritableOwnedArchivedLabel() {
|
hasInheritableArchivedLabel() {
|
||||||
return !!this.ownedAttributes.find(attr => attr.type === 'label' && attr.name === 'archived' && attr.isInheritable);
|
for (const attr of this.getAttributes()) {
|
||||||
|
if (attr.name === 'archived' && attr.type === LABEL && attr.isInheritable) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// will sort the parents so that non-search & non-archived are first and archived at the end
|
return false;
|
||||||
// this is done so that non-search & non-archived paths are always explored as first when looking for note path
|
}
|
||||||
|
|
||||||
|
// will sort the parents so that the non-archived are first and archived at the end
|
||||||
|
// this is done so that the non-archived paths are always explored as first when looking for note path
|
||||||
sortParents() {
|
sortParents() {
|
||||||
this.parentBranches.sort((a, b) =>
|
this.parentBranches.sort((a, b) => {
|
||||||
a.branchId.startsWith('virt-') // FIXME: search virtual notes appear only in froca so this is probably not necessary
|
if (a.parentNote?.isArchived) {
|
||||||
|| a.parentNote?.hasInheritableOwnedArchivedLabel() ? 1 : -1);
|
return 1;
|
||||||
|
} else if (a.parentNote?.isHiddenCompletely()) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.parents = this.parentBranches
|
this.parents = this.parentBranches
|
||||||
.map(branch => branch.parentNote)
|
.map(branch => branch.parentNote)
|
||||||
.filter(note => !!note);
|
.filter(note => !!note);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sortChildren() {
|
||||||
|
if (this.children.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const becca = this.becca;
|
||||||
|
|
||||||
|
this.children.sort((a, b) => {
|
||||||
|
const aBranch = becca.getBranchFromChildAndParent(a.noteId, this.noteId);
|
||||||
|
const bBranch = becca.getBranchFromChildAndParent(b.noteId, this.noteId);
|
||||||
|
|
||||||
|
return aBranch?.notePosition < bBranch?.notePosition ? -1 : 1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is used for:
|
* This is used for:
|
||||||
* - fast searching
|
* - fast searching
|
||||||
* - note similarity evaluation
|
* - note similarity evaluation
|
||||||
*
|
*
|
||||||
* @return {string} - returns flattened textual representation of note, prefixes and attributes
|
* @returns {string} - returns flattened textual representation of note, prefixes and attributes
|
||||||
*/
|
*/
|
||||||
getFlatText() {
|
getFlatText() {
|
||||||
if (!this.flatTextCache) {
|
if (!this.flatTextCache) {
|
||||||
@@ -790,7 +836,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const targetRelation of this.targetRelations) {
|
for (const targetRelation of this.targetRelations) {
|
||||||
if (targetRelation.name === 'template') {
|
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||||
const note = targetRelation.note;
|
const note = targetRelation.note;
|
||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
@@ -808,7 +854,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const targetRelation of this.targetRelations) {
|
for (const targetRelation of this.targetRelations) {
|
||||||
if (targetRelation.name === 'template') {
|
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||||
const note = targetRelation.note;
|
const note = targetRelation.note;
|
||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
@@ -828,16 +874,17 @@ class Note extends AbstractEntity {
|
|||||||
.filter(l => l.name.startsWith("relation:"));
|
.filter(l => l.name.startsWith("relation:"));
|
||||||
}
|
}
|
||||||
|
|
||||||
isTemplate() {
|
isInherited() {
|
||||||
return !!this.targetRelations.find(rel => rel.name === 'template');
|
return !!this.targetRelations.find(rel => rel.name === 'template' || rel.name === 'inherit');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getSubtreeNotesIncludingTemplated() {
|
getSubtreeNotesIncludingTemplated() {
|
||||||
const set = new Set();
|
const set = new Set();
|
||||||
|
|
||||||
function inner(note) {
|
function inner(note) {
|
||||||
if (set.has(note)) {
|
// _hidden is not counted as subtree for the purpose of inheritance
|
||||||
|
if (set.has(note) || note.noteId === '_hidden') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -848,7 +895,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const targetRelation of note.targetRelations) {
|
for (const targetRelation of note.targetRelations) {
|
||||||
if (targetRelation.name === 'template') {
|
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||||
const targetNote = targetRelation.note;
|
const targetNote = targetRelation.note;
|
||||||
|
|
||||||
if (targetNote) {
|
if (targetNote) {
|
||||||
@@ -863,7 +910,7 @@ class Note extends AbstractEntity {
|
|||||||
return Array.from(set);
|
return Array.from(set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getSearchResultNotes() {
|
getSearchResultNotes() {
|
||||||
if (this.type !== 'search') {
|
if (this.type !== 'search') {
|
||||||
return [];
|
return [];
|
||||||
@@ -885,7 +932,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {{notes: Note[], relationships: Array.<{parentNoteId: string, childNoteId: string}>}}
|
* @returns {{notes: BNote[], relationships: Array.<{parentNoteId: string, childNoteId: string}>}}
|
||||||
*/
|
*/
|
||||||
getSubtree({includeArchived = true, includeHidden = false, resolveSearch = false} = {}) {
|
getSubtree({includeArchived = true, includeHidden = false, resolveSearch = false} = {}) {
|
||||||
const noteSet = new Set();
|
const noteSet = new Set();
|
||||||
@@ -945,13 +992,14 @@ class Note extends AbstractEntity {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {String[]} */
|
/** @returns {String[]} - includes the subtree node as well */
|
||||||
getSubtreeNoteIds({includeArchived = true, resolveSearch = false} = {}) {
|
getSubtreeNoteIds({includeArchived = true, includeHidden = false, resolveSearch = false} = {}) {
|
||||||
return this.getSubtree({includeArchived, resolveSearch})
|
return this.getSubtree({includeArchived, includeHidden, resolveSearch})
|
||||||
.notes
|
.notes
|
||||||
.map(note => note.noteId);
|
.map(note => note.noteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @deprecated use getSubtreeNoteIds() instead */
|
||||||
getDescendantNoteIds() {
|
getDescendantNoteIds() {
|
||||||
return this.getSubtreeNoteIds();
|
return this.getSubtreeNoteIds();
|
||||||
}
|
}
|
||||||
@@ -1001,10 +1049,10 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get ownedAttributeCount() {
|
get ownedAttributeCount() {
|
||||||
return this.getAttributes().length;
|
return this.getOwnedAttributes().length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} */
|
/** @returns {BNote[]} */
|
||||||
getAncestors() {
|
getAncestors() {
|
||||||
if (!this.ancestorCache) {
|
if (!this.ancestorCache) {
|
||||||
const noteIds = new Set();
|
const noteIds = new Set();
|
||||||
@@ -1049,13 +1097,13 @@ class Note extends AbstractEntity {
|
|||||||
return this.targetRelations;
|
return this.targetRelations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Note[]} - returns only notes which are templated, does not include their subtrees
|
/** @returns {BNote[]} - returns only notes which are templated, does not include their subtrees
|
||||||
* in effect returns notes which are influenced by note's non-inheritable attributes */
|
* in effect returns notes which are influenced by note's non-inheritable attributes */
|
||||||
getTemplatedNotes() {
|
getInheritingNotes() {
|
||||||
const arr = [this];
|
const arr = [this];
|
||||||
|
|
||||||
for (const targetRelation of this.targetRelations) {
|
for (const targetRelation of this.targetRelations) {
|
||||||
if (targetRelation.name === 'template') {
|
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||||
const note = targetRelation.note;
|
const note = targetRelation.note;
|
||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
@@ -1081,13 +1129,14 @@ class Note extends AbstractEntity {
|
|||||||
return minDistance;
|
return minDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @returns {BNoteRevision[]} */
|
||||||
getNoteRevisions() {
|
getNoteRevisions() {
|
||||||
return sql.getRows("SELECT * FROM note_revisions WHERE noteId = ?", [this.noteId])
|
return sql.getRows("SELECT * FROM note_revisions WHERE noteId = ?", [this.noteId])
|
||||||
.map(row => new NoteRevision(row));
|
.map(row => new BNoteRevision(row));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {string[][]} - array of notePaths (each represented by array of noteIds constituting the particular note path)
|
* @returns {string[][]} - array of notePaths (each represented by array of noteIds constituting the particular note path)
|
||||||
*/
|
*/
|
||||||
getAllNotePaths() {
|
getAllNotePaths() {
|
||||||
if (this.noteId === 'root') {
|
if (this.noteId === 'root') {
|
||||||
@@ -1106,9 +1155,30 @@ class Note extends AbstractEntity {
|
|||||||
return notePaths;
|
return notePaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return boolean - true if there's no non-hidden path, note is not cloned to the visible tree
|
||||||
|
*/
|
||||||
|
isHiddenCompletely() {
|
||||||
|
if (this.noteId === 'root') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const parentNote of this.parents) {
|
||||||
|
if (parentNote.noteId === 'root') {
|
||||||
|
return false;
|
||||||
|
} else if (parentNote.noteId === '_hidden') {
|
||||||
|
continue;
|
||||||
|
} else if (!parentNote.isHiddenCompletely()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ancestorNoteId
|
* @param ancestorNoteId
|
||||||
* @return {boolean} - true if ancestorNoteId occurs in at least one of the note's paths
|
* @returns {boolean} - true if ancestorNoteId occurs in at least one of the note's paths
|
||||||
*/
|
*/
|
||||||
isDescendantOfNote(ancestorNoteId) {
|
isDescendantOfNote(ancestorNoteId) {
|
||||||
const notePaths = this.getAllNotePaths();
|
const notePaths = this.getAllNotePaths();
|
||||||
@@ -1136,9 +1206,9 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const Attribute = require("./attribute");
|
const BAttribute = require("./battribute");
|
||||||
|
|
||||||
new Attribute({
|
new BAttribute({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
type: type,
|
type: type,
|
||||||
name: name,
|
name: name,
|
||||||
@@ -1171,13 +1241,14 @@ class Note extends AbstractEntity {
|
|||||||
* @param {string} type - attribute type (label / relation)
|
* @param {string} type - attribute type (label / relation)
|
||||||
* @param {string} name - name of the attribute, not including the leading ~/#
|
* @param {string} name - name of the attribute, not including the leading ~/#
|
||||||
* @param {string} [value] - value of the attribute - text for labels, target note ID for relations; optional.
|
* @param {string} [value] - value of the attribute - text for labels, target note ID for relations; optional.
|
||||||
*
|
* @param {boolean} [isInheritable=false]
|
||||||
* @return {Attribute}
|
* @param {int} [position]
|
||||||
|
* @returns {BAttribute}
|
||||||
*/
|
*/
|
||||||
addAttribute(type, name, value = "", isInheritable = false, position = 1000) {
|
addAttribute(type, name, value = "", isInheritable = false, position = 1000) {
|
||||||
const Attribute = require("./attribute");
|
const BAttribute = require("./battribute");
|
||||||
|
|
||||||
return new Attribute({
|
return new BAttribute({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
type: type,
|
type: type,
|
||||||
name: name,
|
name: name,
|
||||||
@@ -1192,8 +1263,8 @@ class Note extends AbstractEntity {
|
|||||||
*
|
*
|
||||||
* @param {string} name - name of the label, not including the leading #
|
* @param {string} name - name of the label, not including the leading #
|
||||||
* @param {string} [value] - text value of the label; optional
|
* @param {string} [value] - text value of the label; optional
|
||||||
*
|
* @param {boolean} [isInheritable=false]
|
||||||
* @return {Attribute}
|
* @returns {BAttribute}
|
||||||
*/
|
*/
|
||||||
addLabel(name, value = "", isInheritable = false) {
|
addLabel(name, value = "", isInheritable = false) {
|
||||||
return this.addAttribute(LABEL, name, value, isInheritable);
|
return this.addAttribute(LABEL, name, value, isInheritable);
|
||||||
@@ -1204,9 +1275,9 @@ class Note extends AbstractEntity {
|
|||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
* @param {string} name - name of the relation, not including the leading ~
|
* @param {string} name - name of the relation, not including the leading ~
|
||||||
* @param {string} value - ID of the target note of the relation
|
* @param {string} targetNoteId
|
||||||
*
|
* @param {boolean} [isInheritable=false]
|
||||||
* @return {Attribute}
|
* @returns {BAttribute}
|
||||||
*/
|
*/
|
||||||
addRelation(name, targetNoteId, isInheritable = false) {
|
addRelation(name, targetNoteId, isInheritable = false) {
|
||||||
return this.addAttribute(RELATION, name, targetNoteId, isInheritable);
|
return this.addAttribute(RELATION, name, targetNoteId, isInheritable);
|
||||||
@@ -1349,7 +1420,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isOptions() {
|
isOptions() {
|
||||||
return this.noteId.startsWith("options");
|
return this.noteId.startsWith("_options");
|
||||||
}
|
}
|
||||||
|
|
||||||
get isDeleted() {
|
get isDeleted() {
|
||||||
@@ -1357,7 +1428,7 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {NoteRevision|null}
|
* @returns {BNoteRevision|null}
|
||||||
*/
|
*/
|
||||||
saveNoteRevision() {
|
saveNoteRevision() {
|
||||||
const content = this.getContent();
|
const content = this.getContent();
|
||||||
@@ -1368,7 +1439,7 @@ class Note extends AbstractEntity {
|
|||||||
|
|
||||||
const contentMetadata = this.getContentMetadata();
|
const contentMetadata = this.getContentMetadata();
|
||||||
|
|
||||||
const noteRevision = new NoteRevision({
|
const noteRevision = new BNoteRevision({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
// title and text should be decrypted now
|
// title and text should be decrypted now
|
||||||
title: this.title,
|
title: this.title,
|
||||||
@@ -1432,4 +1503,4 @@ class Note extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Note;
|
module.exports = BNote;
|
||||||
@@ -6,15 +6,15 @@ const sql = require('../../services/sql');
|
|||||||
const dateUtils = require('../../services/date_utils');
|
const dateUtils = require('../../services/date_utils');
|
||||||
const becca = require('../becca');
|
const becca = require('../becca');
|
||||||
const entityChangesService = require('../../services/entity_changes');
|
const entityChangesService = require('../../services/entity_changes');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NoteRevision represents snapshot of note's title and content at some point in the past.
|
* NoteRevision represents snapshot of note's title and content at some point in the past.
|
||||||
* It's used for seamless note versioning.
|
* It's used for seamless note versioning.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class NoteRevision extends AbstractEntity {
|
class BNoteRevision extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "note_revisions"; }
|
static get entityName() { return "note_revisions"; }
|
||||||
static get primaryKeyName() { return "noteRevisionId"; }
|
static get primaryKeyName() { return "noteRevisionId"; }
|
||||||
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
||||||
@@ -106,7 +106,7 @@ class NoteRevision extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setContent(content, ignoreMissingProtectedSession = false) {
|
setContent(content) {
|
||||||
const pojo = {
|
const pojo = {
|
||||||
noteRevisionId: this.noteRevisionId,
|
noteRevisionId: this.noteRevisionId,
|
||||||
content: content,
|
content: content,
|
||||||
@@ -117,7 +117,7 @@ class NoteRevision extends AbstractEntity {
|
|||||||
if (protectedSessionService.isProtectedSessionAvailable()) {
|
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||||
pojo.content = protectedSessionService.encrypt(pojo.content);
|
pojo.content = protectedSessionService.encrypt(pojo.content);
|
||||||
}
|
}
|
||||||
else if (!ignoreMissingProtectedSession) {
|
else {
|
||||||
throw new Error(`Cannot update content of noteRevisionId=${this.noteRevisionId} since we're out of protected session.`);
|
throw new Error(`Cannot update content of noteRevisionId=${this.noteRevisionId} since we're out of protected session.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ class NoteRevision extends AbstractEntity {
|
|||||||
utcDateLastEdited: this.utcDateLastEdited,
|
utcDateLastEdited: this.utcDateLastEdited,
|
||||||
utcDateCreated: this.utcDateCreated,
|
utcDateCreated: this.utcDateCreated,
|
||||||
utcDateModified: this.utcDateModified,
|
utcDateModified: this.utcDateModified,
|
||||||
content: this.content,
|
content: this.content, // used when retrieving full note revision to frontend
|
||||||
contentLength: this.contentLength
|
contentLength: this.contentLength
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -190,4 +190,4 @@ class NoteRevision extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = NoteRevision;
|
module.exports = BNoteRevision;
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const dateUtils = require('../../services/date_utils');
|
const dateUtils = require('../../services/date_utils');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Option represents name-value pair, either directly configurable by the user or some system property.
|
* Option represents name-value pair, either directly configurable by the user or some system property.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class Option extends AbstractEntity {
|
class BOption extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "options"; }
|
static get entityName() { return "options"; }
|
||||||
static get primaryKeyName() { return "name"; }
|
static get primaryKeyName() { return "name"; }
|
||||||
static get hashedProperties() { return ["name", "value"]; }
|
static get hashedProperties() { return ["name", "value"]; }
|
||||||
@@ -16,6 +16,11 @@ class Option extends AbstractEntity {
|
|||||||
constructor(row) {
|
constructor(row) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
this.updateFromRow(row);
|
||||||
|
this.becca.options[this.name] = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateFromRow(row) {
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
this.name = row.name;
|
this.name = row.name;
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
@@ -24,8 +29,6 @@ class Option extends AbstractEntity {
|
|||||||
this.isSynced = !!row.isSynced;
|
this.isSynced = !!row.isSynced;
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
this.utcDateModified = row.utcDateModified;
|
this.utcDateModified = row.utcDateModified;
|
||||||
|
|
||||||
this.becca.options[this.name] = this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
@@ -44,4 +47,4 @@ class Option extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Option;
|
module.exports = BOption;
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const dateUtils = require('../../services/date_utils');
|
const dateUtils = require('../../services/date_utils');
|
||||||
const AbstractEntity = require("./abstract_entity");
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RecentNote represents recently visited note.
|
* RecentNote represents recently visited note.
|
||||||
*
|
*
|
||||||
* @extends AbstractEntity
|
* @extends AbstractBeccaEntity
|
||||||
*/
|
*/
|
||||||
class RecentNote extends AbstractEntity {
|
class BRecentNote extends AbstractBeccaEntity {
|
||||||
static get entityName() { return "recent_notes"; }
|
static get entityName() { return "recent_notes"; }
|
||||||
static get primaryKeyName() { return "noteId"; }
|
static get primaryKeyName() { return "noteId"; }
|
||||||
|
|
||||||
@@ -32,4 +32,4 @@ class RecentNote extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = RecentNote;
|
module.exports = BRecentNote;
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
const Note = require('./entities/note');
|
const BNote = require('./entities/bnote');
|
||||||
const NoteRevision = require('./entities/note_revision');
|
const BNoteRevision = require('./entities/bnote_revision');
|
||||||
const Branch = require('./entities/branch');
|
const BBranch = require('./entities/bbranch');
|
||||||
const Attribute = require('./entities/attribute');
|
const BAttribute = require('./entities/battribute');
|
||||||
const RecentNote = require('./entities/recent_note');
|
const BRecentNote = require('./entities/brecent_note');
|
||||||
const EtapiToken = require('./entities/etapi_token');
|
const BEtapiToken = require('./entities/betapi_token');
|
||||||
const Option = require('./entities/option');
|
const BOption = require('./entities/boption');
|
||||||
|
|
||||||
const ENTITY_NAME_TO_ENTITY = {
|
const ENTITY_NAME_TO_ENTITY = {
|
||||||
"attributes": Attribute,
|
"attributes": BAttribute,
|
||||||
"branches": Branch,
|
"branches": BBranch,
|
||||||
"notes": Note,
|
"notes": BNote,
|
||||||
"note_contents": Note,
|
"note_contents": BNote,
|
||||||
"note_revisions": NoteRevision,
|
"note_revisions": BNoteRevision,
|
||||||
"note_revision_contents": NoteRevision,
|
"note_revision_contents": BNoteRevision,
|
||||||
"recent_notes": RecentNote,
|
"recent_notes": BRecentNote,
|
||||||
"etapi_tokens": EtapiToken,
|
"etapi_tokens": BEtapiToken,
|
||||||
"options": Option
|
"options": BOption
|
||||||
};
|
};
|
||||||
|
|
||||||
function getEntityFromEntityName(entityName) {
|
function getEntityFromEntityName(entityName) {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function filterUrlValue(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Note} note
|
* @param {BNote} note
|
||||||
*/
|
*/
|
||||||
function buildRewardMap(note) {
|
function buildRewardMap(note) {
|
||||||
// Need to use Map instead of object: https://github.com/zadam/trilium/issues/1895
|
// Need to use Map instead of object: https://github.com/zadam/trilium/issues/1895
|
||||||
@@ -261,7 +261,7 @@ async function findSimilarNotes(noteId) {
|
|||||||
|
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
|
|
||||||
// when the title is very long then weight of each individual word should be lower
|
// when the title is very long then weight of each individual word should be lowered
|
||||||
// also pretty important in e.g. long URLs in label values
|
// also pretty important in e.g. long URLs in label values
|
||||||
const lengthPenalization = 1 / Math.pow(text.length, 0.3);
|
const lengthPenalization = 1 / Math.pow(text.length, 0.3);
|
||||||
|
|
||||||
@@ -448,7 +448,7 @@ async function findSimilarNotes(noteId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Point of this is to break up long running sync process to avoid blocking
|
* Point of this is to break up long-running sync process to avoid blocking
|
||||||
* see https://snyk.io/blog/nodejs-how-even-quick-async-functions-can-block-the-event-loop-starve-io/
|
* see https://snyk.io/blog/nodejs-how-even-quick-async-functions-can-block-the-event-loop-starve-io/
|
||||||
*/
|
*/
|
||||||
function setImmediatePromise() {
|
function setImmediatePromise() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const becca = require("../becca/becca");
|
const becca = require("../becca/becca");
|
||||||
const eu = require("./etapi_utils");
|
const eu = require("./etapi_utils");
|
||||||
const mappers = require("./mappers");
|
const mappers = require("./mappers");
|
||||||
const Branch = require("../becca/entities/branch");
|
const BBranch = require("../becca/entities/bbranch");
|
||||||
const entityChangesService = require("../services/entity_changes");
|
const entityChangesService = require("../services/entity_changes");
|
||||||
const v = require("./validators");
|
const v = require("./validators");
|
||||||
|
|
||||||
@@ -35,16 +35,15 @@ function register(router) {
|
|||||||
existing.save();
|
existing.save();
|
||||||
|
|
||||||
return res.status(200).json(mappers.mapBranchToPojo(existing));
|
return res.status(200).json(mappers.mapBranchToPojo(existing));
|
||||||
}
|
} else {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const branch = new Branch(params).save();
|
const branch = new BBranch(params).save();
|
||||||
|
|
||||||
res.status(201).json(mappers.mapBranchToPojo(branch));
|
res.status(201).json(mappers.mapBranchToPojo(branch));
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
throw new eu.EtapiError(400, eu.GENERIC_CODE, e.message);
|
throw new eu.EtapiError(400, eu.GENERIC_CODE, e.message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const ALLOWED_PROPERTIES_FOR_PATCH = {
|
const ALLOWED_PROPERTIES_FOR_PATCH = {
|
||||||
|
|||||||
@@ -291,6 +291,33 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Error'
|
$ref: '#/components/schemas/Error'
|
||||||
|
/notes/{noteId}/note-revision:
|
||||||
|
parameters:
|
||||||
|
- name: noteId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/EntityId'
|
||||||
|
- name: format
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
enum:
|
||||||
|
- html
|
||||||
|
- markdown
|
||||||
|
default: html
|
||||||
|
post:
|
||||||
|
description: Create a note revision for the given note
|
||||||
|
operationId: createNoteRevision
|
||||||
|
responses:
|
||||||
|
'204':
|
||||||
|
description: revision has been created
|
||||||
|
default:
|
||||||
|
description: unexpected error
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
/branches/{branchId}:
|
/branches/{branchId}:
|
||||||
parameters:
|
parameters:
|
||||||
- name: branchId
|
- name: branchId
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ function register(router) {
|
|||||||
|
|
||||||
note.setContent(req.body);
|
note.setContent(req.body);
|
||||||
|
|
||||||
|
noteService.asyncPostProcessContent(note, req.body);
|
||||||
|
|
||||||
return res.sendStatus(204);
|
return res.sendStatus(204);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -143,18 +145,26 @@ function register(router) {
|
|||||||
|
|
||||||
zipExportService.exportToZip(taskContext, branch, format, res);
|
zipExportService.exportToZip(taskContext, branch, format, res);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eu.route(router, 'post' ,'/etapi/notes/:noteId/note-revision', (req, res, next) => {
|
||||||
|
const note = eu.getAndCheckNote(req.params.noteId);
|
||||||
|
|
||||||
|
note.saveNoteRevision();
|
||||||
|
|
||||||
|
return res.sendStatus(204);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseSearchParams(req) {
|
function parseSearchParams(req) {
|
||||||
const rawSearchParams = {
|
const rawSearchParams = {
|
||||||
'fastSearch': parseBoolean(req.query, 'fastSearch'),
|
fastSearch: parseBoolean(req.query, 'fastSearch'),
|
||||||
'includeArchivedNotes': parseBoolean(req.query, 'includeArchivedNotes'),
|
includeArchivedNotes: parseBoolean(req.query, 'includeArchivedNotes'),
|
||||||
'ancestorNoteId': req.query['ancestorNoteId'],
|
ancestorNoteId: req.query['ancestorNoteId'],
|
||||||
'ancestorDepth': parseInteger(req.query, 'ancestorDepth'),
|
ancestorDepth: req.query['ancestorDepth'], // e.g. "eq5"
|
||||||
'orderBy': req.query['orderBy'],
|
orderBy: req.query['orderBy'],
|
||||||
'orderDirection': parseOrderDirection(req.query, 'orderDirection'),
|
orderDirection: parseOrderDirection(req.query, 'orderDirection'),
|
||||||
'limit': parseInteger(req.query, 'limit'),
|
limit: parseInteger(req.query, 'limit'),
|
||||||
'debug': parseBoolean(req.query, 'debug')
|
debug: parseBoolean(req.query, 'debug')
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchParams = {};
|
const searchParams = {};
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ function isValidEntityId(obj) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof obj !== 'string' || !/^[A-Za-z0-9]{4,32}$/.test(obj)) {
|
if (typeof obj !== 'string' || !/^[A-Za-z0-9_]{4,128}$/.test(obj)) {
|
||||||
return `'${obj}' is not a valid entityId. Only alphanumeric characters are allowed of length 4 to 32.`;
|
return `'${obj}' is not a valid entityId. Only alphanumeric characters are allowed of length 4 to 32.`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,12 +88,12 @@ class AppContext extends Component {
|
|||||||
this.triggerEvent('initialRenderComplete');
|
this.triggerEvent('initialRenderComplete');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise} */
|
/** @returns {Promise<void>} */
|
||||||
triggerEvent(name, data) {
|
triggerEvent(name, data = {}) {
|
||||||
return this.handleEvent(name, data);
|
return this.handleEvent(name, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise} */
|
/** @returns {Promise<*>} */
|
||||||
triggerCommand(name, data = {}) {
|
triggerCommand(name, data = {}) {
|
||||||
for (const executor of this.components) {
|
for (const executor of this.components) {
|
||||||
const fun = executor[`${name}Command`];
|
const fun = executor[`${name}Command`];
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import utils from '../services/utils.js';
|
|||||||
* Abstract class for all components in the Trilium's frontend.
|
* Abstract class for all components in the Trilium's frontend.
|
||||||
*
|
*
|
||||||
* Contains also event implementation with following properties:
|
* Contains also event implementation with following properties:
|
||||||
* - event / command distribution is synchronous which among others mean that events are well ordered - event
|
* - event / command distribution is synchronous which among others mean that events are well-ordered - event
|
||||||
* which was sent out first will also be processed first by the component
|
* which was sent out first will also be processed first by the component
|
||||||
* - execution of the event / command is asynchronous - each component executes the event on its own without regard for
|
* - execution of the event / command is asynchronous - each component executes the event on its own without regard for
|
||||||
* other components.
|
* other components.
|
||||||
* - although the execution is async, we are collecting all the promises and therefore it is possible to wait until the
|
* - although the execution is async, we are collecting all the promises, and therefore it is possible to wait until the
|
||||||
* event / command is executed in all components - by simply awaiting the `triggerEvent()`.
|
* event / command is executed in all components - by simply awaiting the `triggerEvent()`.
|
||||||
*/
|
*/
|
||||||
export default class Component {
|
export default class Component {
|
||||||
@@ -40,7 +40,7 @@ export default class Component {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise} */
|
/** @returns {Promise<void>} */
|
||||||
handleEvent(name, data) {
|
handleEvent(name, data) {
|
||||||
try {
|
try {
|
||||||
const callMethodPromise = this.initialized
|
const callMethodPromise = this.initialized
|
||||||
@@ -61,13 +61,13 @@ export default class Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise} */
|
/** @returns {Promise<void>} */
|
||||||
triggerEvent(name, data) {
|
triggerEvent(name, data = {}) {
|
||||||
return this.parent.triggerEvent(name, data);
|
return this.parent.triggerEvent(name, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise} */
|
/** @returns {Promise<void>} */
|
||||||
handleEventInChildren(name, data) {
|
handleEventInChildren(name, data = {}) {
|
||||||
const promises = [];
|
const promises = [];
|
||||||
|
|
||||||
for (const child of this.children) {
|
for (const child of this.children) {
|
||||||
@@ -82,7 +82,7 @@ export default class Component {
|
|||||||
return promises.length > 0 ? Promise.all(promises) : null;
|
return promises.length > 0 ? Promise.all(promises) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise} */
|
/** @returns {Promise<*>} */
|
||||||
triggerCommand(name, data = {}) {
|
triggerCommand(name, data = {}) {
|
||||||
const fun = this[`${name}Command`];
|
const fun = this[`${name}Command`];
|
||||||
|
|
||||||
|
|||||||
@@ -9,15 +9,14 @@ import hoistedNoteService from "../services/hoisted_note.js";
|
|||||||
import options from "../services/options.js";
|
import options from "../services/options.js";
|
||||||
|
|
||||||
class NoteContext extends Component {
|
class NoteContext extends Component {
|
||||||
/**
|
|
||||||
* @param {string|null} ntxId
|
|
||||||
*/
|
|
||||||
constructor(ntxId = null, hoistedNoteId = 'root', mainNtxId = null) {
|
constructor(ntxId = null, hoistedNoteId = 'root', mainNtxId = null) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.ntxId = ntxId || utils.randomString(4);
|
this.ntxId = ntxId || utils.randomString(4);
|
||||||
this.hoistedNoteId = hoistedNoteId;
|
this.hoistedNoteId = hoistedNoteId;
|
||||||
this.mainNtxId = mainNtxId;
|
this.mainNtxId = mainNtxId;
|
||||||
|
|
||||||
|
this.resetViewScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
setEmpty() {
|
setEmpty() {
|
||||||
@@ -30,13 +29,17 @@ class NoteContext extends Component {
|
|||||||
noteContext: this,
|
noteContext: this,
|
||||||
notePath: this.notePath
|
notePath: this.notePath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.resetViewScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
isEmpty() {
|
isEmpty() {
|
||||||
return !this.noteId;
|
return !this.noteId;
|
||||||
}
|
}
|
||||||
|
|
||||||
async setNote(inputNotePath, triggerSwitchEvent = true) {
|
async setNote(inputNotePath, opts = {}) {
|
||||||
|
opts.triggerSwitchEvent = opts.triggerSwitchEvent !== undefined ? opts.triggerSwitchEvent : true;
|
||||||
|
|
||||||
const resolvedNotePath = await this.getResolvedNotePath(inputNotePath);
|
const resolvedNotePath = await this.getResolvedNotePath(inputNotePath);
|
||||||
|
|
||||||
if (!resolvedNotePath) {
|
if (!resolvedNotePath) {
|
||||||
@@ -50,19 +53,28 @@ class NoteContext extends Component {
|
|||||||
this.notePath = resolvedNotePath;
|
this.notePath = resolvedNotePath;
|
||||||
({noteId: this.noteId, parentNoteId: this.parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(resolvedNotePath));
|
({noteId: this.noteId, parentNoteId: this.parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(resolvedNotePath));
|
||||||
|
|
||||||
this.readOnlyTemporarilyDisabled = false;
|
this.resetViewScope();
|
||||||
|
this.viewScope.viewMode = opts.viewMode || "default";
|
||||||
|
|
||||||
this.saveToRecentNotes(resolvedNotePath);
|
this.saveToRecentNotes(resolvedNotePath);
|
||||||
|
|
||||||
protectedSessionHolder.touchProtectedSessionIfNecessary(this.note);
|
protectedSessionHolder.touchProtectedSessionIfNecessary(this.note);
|
||||||
|
|
||||||
if (triggerSwitchEvent) {
|
if (opts.triggerSwitchEvent) {
|
||||||
await this.triggerEvent('noteSwitched', {
|
await this.triggerEvent('noteSwitched', {
|
||||||
noteContext: this,
|
noteContext: this,
|
||||||
notePath: this.notePath
|
notePath: this.notePath
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await this.setHoistedNoteIfNeeded();
|
||||||
|
|
||||||
|
if (utils.isMobile()) {
|
||||||
|
this.triggerCommand('setActiveScreen', {screen: 'detail'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async setHoistedNoteIfNeeded() {
|
||||||
if (this.hoistedNoteId === 'root'
|
if (this.hoistedNoteId === 'root'
|
||||||
&& this.notePath.startsWith("root/_hidden")
|
&& this.notePath.startsWith("root/_hidden")
|
||||||
&& !this.note.hasLabel("keepCurrentHoisting")
|
&& !this.note.hasLabel("keepCurrentHoisting")
|
||||||
@@ -79,10 +91,6 @@ class NoteContext extends Component {
|
|||||||
|
|
||||||
await this.setHoistedNoteId(hoistedNoteId);
|
await this.setHoistedNoteId(hoistedNoteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (utils.isMobile()) {
|
|
||||||
this.triggerCommand('setActiveScreen', {screen: 'detail'});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getSubContexts() {
|
getSubContexts() {
|
||||||
@@ -140,7 +148,7 @@ class NoteContext extends Component {
|
|||||||
return resolvedNotePath;
|
return resolvedNotePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @property {NoteShort} */
|
/** @property {FNote} */
|
||||||
get note() {
|
get note() {
|
||||||
if (!this.noteId || !(this.noteId in froca.notes)) {
|
if (!this.noteId || !(this.noteId in froca.notes)) {
|
||||||
return null;
|
return null;
|
||||||
@@ -154,7 +162,7 @@ class NoteContext extends Component {
|
|||||||
return this.notePath ? this.notePath.split('/') : [];
|
return this.notePath ? this.notePath.split('/') : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteComplement} */
|
/** @returns {FNoteComplement} */
|
||||||
async getNoteComplement() {
|
async getNoteComplement() {
|
||||||
if (!this.noteId) {
|
if (!this.noteId) {
|
||||||
return null;
|
return null;
|
||||||
@@ -178,7 +186,8 @@ class NoteContext extends Component {
|
|||||||
mainNtxId: this.mainNtxId,
|
mainNtxId: this.mainNtxId,
|
||||||
notePath: this.notePath,
|
notePath: this.notePath,
|
||||||
hoistedNoteId: this.hoistedNoteId,
|
hoistedNoteId: this.hoistedNoteId,
|
||||||
active: this.isActive()
|
active: this.isActive(),
|
||||||
|
viewMode: this.viewScope.viewMode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,7 +213,7 @@ class NoteContext extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async isReadOnly() {
|
async isReadOnly() {
|
||||||
if (this.readOnlyTemporarilyDisabled) {
|
if (this.viewScope.readOnlyTemporarilyDisabled) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,8 +228,8 @@ class NoteContext extends Component {
|
|||||||
|
|
||||||
const noteComplement = await this.getNoteComplement();
|
const noteComplement = await this.getNoteComplement();
|
||||||
|
|
||||||
const sizeLimit = this.note.type === 'text' ?
|
const sizeLimit = this.note.type === 'text'
|
||||||
options.getInt('autoReadonlySizeText')
|
? options.getInt('autoReadonlySizeText')
|
||||||
: options.getInt('autoReadonlySizeCode');
|
: options.getInt('autoReadonlySizeCode');
|
||||||
|
|
||||||
return noteComplement.content
|
return noteComplement.content
|
||||||
@@ -246,6 +255,7 @@ class NoteContext extends Component {
|
|||||||
|
|
||||||
hasNoteList() {
|
hasNoteList() {
|
||||||
return this.note
|
return this.note
|
||||||
|
&& this.viewScope.viewMode === 'default'
|
||||||
&& this.note.hasChildren()
|
&& this.note.hasChildren()
|
||||||
&& ['book', 'text', 'code'].includes(this.note.type)
|
&& ['book', 'text', 'code'].includes(this.note.type)
|
||||||
&& this.note.mime !== 'text/x-sqlite;schema=trilium'
|
&& this.note.mime !== 'text/x-sqlite;schema=trilium'
|
||||||
@@ -280,6 +290,13 @@ class NoteContext extends Component {
|
|||||||
ntxId: this.ntxId
|
ntxId: this.ntxId
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resetViewScope() {
|
||||||
|
// view scope contains data specific to one note context and one "view".
|
||||||
|
// it is used to e.g. make read-only note temporarily editable or to hide TOC
|
||||||
|
// this is reset after navigating to a different note
|
||||||
|
this.viewScope = {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NoteContext;
|
export default NoteContext;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import froca from "../services/froca.js";
|
|||||||
export default class RootCommandExecutor extends Component {
|
export default class RootCommandExecutor extends Component {
|
||||||
editReadOnlyNoteCommand() {
|
editReadOnlyNoteCommand() {
|
||||||
const noteContext = appContext.tabManager.getActiveContext();
|
const noteContext = appContext.tabManager.getActiveContext();
|
||||||
noteContext.readOnlyTemporarilyDisabled = true;
|
noteContext.viewScope.readOnlyTemporarilyDisabled = true;
|
||||||
|
|
||||||
appContext.triggerEvent("readOnlyTemporarilyDisabled", { noteContext });
|
appContext.triggerEvent("readOnlyTemporarilyDisabled", { noteContext });
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ export default class RootCommandExecutor extends Component {
|
|||||||
async showSQLConsoleCommand() {
|
async showSQLConsoleCommand() {
|
||||||
const sqlConsoleNote = await dateNoteService.createSqlConsole();
|
const sqlConsoleNote = await dateNoteService.createSqlConsole();
|
||||||
|
|
||||||
const noteContext = await appContext.tabManager.openContextWithNote(sqlConsoleNote.noteId, true);
|
const noteContext = await appContext.tabManager.openContextWithNote(sqlConsoleNote.noteId, { activate: true });
|
||||||
|
|
||||||
appContext.triggerEvent('focusOnDetail', {ntxId: noteContext.ntxId});
|
appContext.triggerEvent('focusOnDetail', {ntxId: noteContext.ntxId});
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,10 @@ export default class RootCommandExecutor extends Component {
|
|||||||
const activeNoteContext = appContext.tabManager.getActiveContext();
|
const activeNoteContext = appContext.tabManager.getActiveContext();
|
||||||
const hoistedNoteId = activeNoteContext?.hoistedNoteId || 'root';
|
const hoistedNoteId = activeNoteContext?.hoistedNoteId || 'root';
|
||||||
|
|
||||||
const noteContext = await appContext.tabManager.openContextWithNote(searchNote.noteId, true, null, hoistedNoteId);
|
const noteContext = await appContext.tabManager.openContextWithNote(searchNote.noteId, {
|
||||||
|
activate: true,
|
||||||
|
hoistedNoteId
|
||||||
|
});
|
||||||
|
|
||||||
appContext.triggerCommand('focusOnSearchDefinition', {ntxId: noteContext.ntxId});
|
appContext.triggerCommand('focusOnSearchDefinition', {ntxId: noteContext.ntxId});
|
||||||
}
|
}
|
||||||
@@ -73,7 +76,7 @@ export default class RootCommandExecutor extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async showBackendLogCommand() {
|
async showBackendLogCommand() {
|
||||||
await appContext.tabManager.openContextWithNote('_backendLog', true);
|
await appContext.tabManager.openContextWithNote('_backendLog', { activate: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
async showLaunchBarSubtreeCommand() {
|
async showLaunchBarSubtreeCommand() {
|
||||||
@@ -88,8 +91,11 @@ export default class RootCommandExecutor extends Component {
|
|||||||
await this.showAndHoistSubtree('_hidden');
|
await this.showAndHoistSubtree('_hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
async showOptionsCommand() {
|
async showOptionsCommand({section}) {
|
||||||
await this.showAndHoistSubtree('_options');
|
await appContext.tabManager.openContextWithNote(section || '_options', {
|
||||||
|
activate: true,
|
||||||
|
hoistedNoteId: '_options'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async showSQLConsoleHistoryCommand() {
|
async showSQLConsoleHistoryCommand() {
|
||||||
@@ -101,6 +107,17 @@ export default class RootCommandExecutor extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async showAndHoistSubtree(subtreeNoteId) {
|
async showAndHoistSubtree(subtreeNoteId) {
|
||||||
await appContext.tabManager.openContextWithNote(subtreeNoteId, true, null, subtreeNoteId);
|
await appContext.tabManager.openContextWithNote(subtreeNoteId, {
|
||||||
|
activate: true,
|
||||||
|
hoistedNoteId: subtreeNoteId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async showNoteSourceCommand() {
|
||||||
|
const notePath = appContext.tabManager.getActiveContextNotePath();
|
||||||
|
|
||||||
|
if (notePath) {
|
||||||
|
await appContext.tabManager.openContextWithNote(notePath, { activate: true, viewMode: 'source' });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,11 +79,12 @@ export default class TabManager extends Component {
|
|||||||
filteredTabs = filteredTabs.filter(tab => tab.active);
|
filteredTabs = filteredTabs.filter(tab => tab.active);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filteredTabs.length === 0) {
|
// resolve before opened tabs can change this
|
||||||
const [notePath] = treeService.getHashValueFromAddress();
|
const [notePathInUrl, ntxIdInUrl] = treeService.getHashValueFromAddress();
|
||||||
|
|
||||||
|
if (filteredTabs.length === 0) {
|
||||||
filteredTabs.push({
|
filteredTabs.push({
|
||||||
notePath: notePath || 'root',
|
notePath: notePathInUrl || 'root',
|
||||||
active: true,
|
active: true,
|
||||||
hoistedNoteId: glob.extraHoistedNoteId || 'root'
|
hoistedNoteId: glob.extraHoistedNoteId || 'root'
|
||||||
});
|
});
|
||||||
@@ -95,17 +96,20 @@ export default class TabManager extends Component {
|
|||||||
|
|
||||||
await this.tabsUpdate.allowUpdateWithoutChange(async () => {
|
await this.tabsUpdate.allowUpdateWithoutChange(async () => {
|
||||||
for (const tab of filteredTabs) {
|
for (const tab of filteredTabs) {
|
||||||
|
await this.openContextWithNote(tab.notePath, {
|
||||||
await this.openContextWithNote(tab.notePath, tab.active, tab.ntxId, tab.hoistedNoteId, tab.mainNtxId);
|
activate: tab.active,
|
||||||
|
ntxId: tab.ntxId,
|
||||||
|
mainNtxId: tab.mainNtxId,
|
||||||
|
hoistedNoteId: tab.hoistedNoteId,
|
||||||
|
viewMode: tab.viewMode
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// if there's notePath in the URL, make sure it's open and active
|
// if there's notePath in the URL, make sure it's open and active
|
||||||
// (useful, for e.g. opening clipped notes from clipper or opening link in an extra window)
|
// (useful, for e.g. opening clipped notes from clipper or opening link in an extra window)
|
||||||
if (treeService.isNotePathInAddress()) {
|
if (notePathInUrl) {
|
||||||
const [notePath, ntxId] = treeService.getHashValueFromAddress();
|
await appContext.tabManager.switchToNoteContext(ntxIdInUrl, notePathInUrl);
|
||||||
|
|
||||||
await appContext.tabManager.switchToNoteContext(ntxId, notePath);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
@@ -181,7 +185,7 @@ export default class TabManager extends Component {
|
|||||||
return activeContext ? activeContext.notePath : null;
|
return activeContext ? activeContext.notePath : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort} */
|
/** @returns {FNote} */
|
||||||
getActiveContextNote() {
|
getActiveContextNote() {
|
||||||
const activeContext = this.getActiveContext();
|
const activeContext = this.getActiveContext();
|
||||||
return activeContext ? activeContext.note : null;
|
return activeContext ? activeContext.note : null;
|
||||||
@@ -279,14 +283,24 @@ export default class TabManager extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.openContextWithNote(notePath, activate, null, hoistedNoteId);
|
return this.openContextWithNote(notePath, { activate, hoistedNoteId });
|
||||||
}
|
}
|
||||||
|
|
||||||
async openContextWithNote(notePath, activate, ntxId = null, hoistedNoteId = 'root', mainNtxId = null) {
|
async openContextWithNote(notePath, opts = {}) {
|
||||||
|
const activate = !!opts.activate;
|
||||||
|
const ntxId = opts.ntxId || null;
|
||||||
|
const mainNtxId = opts.mainNtxId || null;
|
||||||
|
const hoistedNoteId = opts.hoistedNoteId || 'root';
|
||||||
|
const viewMode = opts.viewMode || "default";
|
||||||
|
|
||||||
const noteContext = await this.openEmptyTab(ntxId, hoistedNoteId, mainNtxId);
|
const noteContext = await this.openEmptyTab(ntxId, hoistedNoteId, mainNtxId);
|
||||||
|
|
||||||
if (notePath) {
|
if (notePath) {
|
||||||
await noteContext.setNote(notePath, !activate); // if activate is false then send normal noteSwitched event
|
await noteContext.setNote(notePath, {
|
||||||
|
// if activate is false then send normal noteSwitched event
|
||||||
|
triggerSwitchEvent: !activate,
|
||||||
|
viewMode: viewMode
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activate) {
|
if (activate) {
|
||||||
@@ -312,7 +326,7 @@ export default class TabManager extends Component {
|
|||||||
|
|
||||||
// if no tab with this note has been found we'll create new tab
|
// if no tab with this note has been found we'll create new tab
|
||||||
|
|
||||||
await this.openContextWithNote(noteId, true);
|
await this.openContextWithNote(noteId, { activate: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
async activateNoteContext(ntxId, triggerEvent = true) {
|
async activateNoteContext(ntxId, triggerEvent = true) {
|
||||||
@@ -477,13 +491,13 @@ export default class TabManager extends Component {
|
|||||||
this.openAndActivateEmptyTab();
|
this.openAndActivateEmptyTab();
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeAllTabsCommand() {
|
async closeAllTabsCommand() {
|
||||||
for (const ntxIdToRemove of this.mainNoteContexts.map(nc => nc.ntxId)) {
|
for (const ntxIdToRemove of this.mainNoteContexts.map(nc => nc.ntxId)) {
|
||||||
await this.removeNoteContext(ntxIdToRemove);
|
await this.removeNoteContext(ntxIdToRemove);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeAllTabsExceptForThisCommand({ntxId}) {
|
async closeOtherTabsCommand({ntxId}) {
|
||||||
for (const ntxIdToRemove of this.mainNoteContexts.map(nc => nc.ntxId)) {
|
for (const ntxIdToRemove of this.mainNoteContexts.map(nc => nc.ntxId)) {
|
||||||
if (ntxIdToRemove !== ntxId) {
|
if (ntxIdToRemove !== ntxId) {
|
||||||
await this.removeNoteContext(ntxIdToRemove);
|
await this.removeNoteContext(ntxIdToRemove);
|
||||||
@@ -491,6 +505,10 @@ export default class TabManager extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async closeTabCommand({ntxId}) {
|
||||||
|
await this.removeNoteContext(ntxId);
|
||||||
|
}
|
||||||
|
|
||||||
async moveTabToNewWindowCommand({ntxId}) {
|
async moveTabToNewWindowCommand({ntxId}) {
|
||||||
const {notePath, hoistedNoteId} = this.getNoteContextById(ntxId);
|
const {notePath, hoistedNoteId} = this.getNoteContextById(ntxId);
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class ZoomComponent extends Component {
|
|||||||
|
|
||||||
async setZoomFactorAndSave(zoomFactor) {
|
async setZoomFactorAndSave(zoomFactor) {
|
||||||
if (zoomFactor >= MIN_ZOOM && zoomFactor <= MAX_ZOOM) {
|
if (zoomFactor >= MIN_ZOOM && zoomFactor <= MAX_ZOOM) {
|
||||||
zoomFactor = Math.round(zoomFactor * 1000) / 1000;
|
zoomFactor = Math.round(zoomFactor * 10) / 10;
|
||||||
|
|
||||||
this.setZoomFactor(zoomFactor);
|
this.setZoomFactor(zoomFactor);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<p>Back and Forward buttons allow you to move in the navigation history.</p>
|
||||||
|
|
||||||
|
<p>These launchers are active only in the desktop build and will be ignored in the server edition where you can use the native browser navigation buttons instead.</p>
|
||||||
@@ -8,5 +8,5 @@
|
|||||||
<h4>Example script</h4>
|
<h4>Example script</h4>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
alert("Current note is " + api.getActiveContextNote().title);
|
api.showMessage("Current note is " + api.getActiveContextNote().title);
|
||||||
</pre>
|
</pre>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import promotedAttributeDefinitionParser from '../services/promoted_attribute_de
|
|||||||
* Attribute is an abstract concept which has two real uses - label (key - value pair)
|
* Attribute is an abstract concept which has two real uses - label (key - value pair)
|
||||||
* and relation (representing named relationship between source and target note)
|
* and relation (representing named relationship between source and target note)
|
||||||
*/
|
*/
|
||||||
class Attribute {
|
class FAttribute {
|
||||||
constructor(froca, row) {
|
constructor(froca, row) {
|
||||||
this.froca = froca;
|
this.froca = froca;
|
||||||
|
|
||||||
@@ -28,12 +28,12 @@ class Attribute {
|
|||||||
this.isInheritable = !!row.isInheritable;
|
this.isInheritable = !!row.isInheritable;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort} */
|
/** @returns {FNote} */
|
||||||
getNote() {
|
getNote() {
|
||||||
return this.froca.notes[this.noteId];
|
return this.froca.notes[this.noteId];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise<NoteShort>} */
|
/** @returns {Promise<FNote>} */
|
||||||
async getTargetNote() {
|
async getTargetNote() {
|
||||||
const targetNoteId = this.targetNoteId;
|
const targetNoteId = this.targetNoteId;
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class Attribute {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get toString() {
|
get toString() {
|
||||||
return `Attribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name}, value=${this.value})`;
|
return `FAttribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name}, value=${this.value})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
isDefinition() {
|
isDefinition() {
|
||||||
@@ -76,4 +76,4 @@ class Attribute {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Attribute;
|
export default FAttribute;
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
* Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
* Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
||||||
* parents.
|
* parents.
|
||||||
*/
|
*/
|
||||||
class Branch {
|
class FBranch {
|
||||||
constructor(froca, row) {
|
constructor(froca, row) {
|
||||||
this.froca = froca;
|
this.froca = froca;
|
||||||
|
|
||||||
@@ -29,17 +29,17 @@ class Branch {
|
|||||||
this.fromSearchNote = !!row.fromSearchNote;
|
this.fromSearchNote = !!row.fromSearchNote;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort} */
|
/** @returns {FNote} */
|
||||||
async getNote() {
|
async getNote() {
|
||||||
return this.froca.getNote(this.noteId);
|
return this.froca.getNote(this.noteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort} */
|
/** @returns {FNote} */
|
||||||
getNoteFromCache() {
|
getNoteFromCache() {
|
||||||
return this.froca.getNoteFromCache(this.noteId);
|
return this.froca.getNoteFromCache(this.noteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort} */
|
/** @returns {FNote} */
|
||||||
async getParentNote() {
|
async getParentNote() {
|
||||||
return this.froca.getNote(this.parentNoteId);
|
return this.froca.getNote(this.parentNoteId);
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ class Branch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get toString() {
|
get toString() {
|
||||||
return `Branch(branchId=${this.branchId})`;
|
return `FBranch(branchId=${this.branchId})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
get pojo() {
|
get pojo() {
|
||||||
@@ -60,4 +60,4 @@ class Branch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Branch;
|
export default FBranch;
|
||||||
@@ -26,12 +26,7 @@ const NOTE_TYPE_ICONS = {
|
|||||||
"contentWidget": "bx bxs-widget"
|
"contentWidget": "bx bxs-widget"
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
class FNote {
|
||||||
* FIXME: since there's no "full note" anymore we can rename this to Note
|
|
||||||
*
|
|
||||||
* This note's representation is used in note tree and is kept in Froca.
|
|
||||||
*/
|
|
||||||
class NoteShort {
|
|
||||||
/**
|
/**
|
||||||
* @param {Froca} froca
|
* @param {Froca} froca
|
||||||
* @param {Object.<string, Object>} row
|
* @param {Object.<string, Object>} row
|
||||||
@@ -78,7 +73,7 @@ class NoteShort {
|
|||||||
this.mime = row.mime;
|
this.mime = row.mime;
|
||||||
}
|
}
|
||||||
|
|
||||||
addParent(parentNoteId, branchId) {
|
addParent(parentNoteId, branchId, sort = true) {
|
||||||
if (parentNoteId === 'none') {
|
if (parentNoteId === 'none') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -88,6 +83,10 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.parentToBranch[parentNoteId] = branchId;
|
this.parentToBranch[parentNoteId] = branchId;
|
||||||
|
|
||||||
|
if (sort) {
|
||||||
|
this.sortParents();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addChild(childNoteId, branchId, sort = true) {
|
addChild(childNoteId, branchId, sort = true) {
|
||||||
@@ -118,7 +117,7 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getContent() {
|
async getContent() {
|
||||||
// we're not caching content since these objects are in froca and as such pretty long lived
|
// we're not caching content since these objects are in froca and as such pretty long-lived
|
||||||
const note = await server.get(`notes/${this.noteId}`);
|
const note = await server.get(`notes/${this.noteId}`);
|
||||||
|
|
||||||
return note.content;
|
return note.content;
|
||||||
@@ -153,7 +152,7 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Branch[]}
|
* @returns {FBranch[]}
|
||||||
*/
|
*/
|
||||||
getParentBranches() {
|
getParentBranches() {
|
||||||
const branchIds = Object.values(this.parentToBranch);
|
const branchIds = Object.values(this.parentToBranch);
|
||||||
@@ -162,7 +161,7 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Branch[]}
|
* @returns {FBranch[]}
|
||||||
* @deprecated use getParentBranches() instead
|
* @deprecated use getParentBranches() instead
|
||||||
*/
|
*/
|
||||||
getBranches() {
|
getBranches() {
|
||||||
@@ -174,7 +173,7 @@ class NoteShort {
|
|||||||
return this.children.length > 0;
|
return this.children.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Branch[]} */
|
/** @returns {FBranch[]} */
|
||||||
getChildBranches() {
|
getChildBranches() {
|
||||||
// don't use Object.values() to guarantee order
|
// don't use Object.values() to guarantee order
|
||||||
const branchIds = this.children.map(childNoteId => this.childToBranch[childNoteId]);
|
const branchIds = this.children.map(childNoteId => this.childToBranch[childNoteId]);
|
||||||
@@ -187,14 +186,14 @@ class NoteShort {
|
|||||||
return this.parents;
|
return this.parents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {NoteShort[]} */
|
/** @returns {FNote[]} */
|
||||||
getParentNotes() {
|
getParentNotes() {
|
||||||
return this.froca.getNotesFromCache(this.parents);
|
return this.froca.getNotesFromCache(this.parents);
|
||||||
}
|
}
|
||||||
|
|
||||||
// will sort the parents so that non-search & non-archived are first and archived at the end
|
// will sort the parents so that non-search & non-archived are first and archived at the end
|
||||||
// this is done so that non-search & non-archived paths are always explored as first when looking for note path
|
// this is done so that non-search & non-archived paths are always explored as first when looking for note path
|
||||||
resortParents() {
|
sortParents() {
|
||||||
this.parents.sort((aNoteId, bNoteId) => {
|
this.parents.sort((aNoteId, bNoteId) => {
|
||||||
const aBranchId = this.parentToBranch[aNoteId];
|
const aBranchId = this.parentToBranch[aNoteId];
|
||||||
|
|
||||||
@@ -202,9 +201,9 @@ class NoteShort {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const aNote = this.froca.getNoteFromCache([aNoteId]);
|
const aNote = this.froca.getNoteFromCache(aNoteId);
|
||||||
|
|
||||||
if (aNote.hasLabel('archived')) {
|
if (aNote.isArchived || aNote.isHiddenCompletely()) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,12 +211,16 @@ class NoteShort {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isArchived() {
|
||||||
|
return this.hasAttribute('label', 'archived');
|
||||||
|
}
|
||||||
|
|
||||||
/** @returns {string[]} */
|
/** @returns {string[]} */
|
||||||
getChildNoteIds() {
|
getChildNoteIds() {
|
||||||
return this.children;
|
return this.children;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise<NoteShort[]>} */
|
/** @returns {Promise<FNote[]>} */
|
||||||
async getChildNotes() {
|
async getChildNotes() {
|
||||||
return await this.froca.getNotes(this.children);
|
return await this.froca.getNotes(this.children);
|
||||||
}
|
}
|
||||||
@@ -225,7 +228,7 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* @param {string} [type] - (optional) attribute type to filter
|
* @param {string} [type] - (optional) attribute type to filter
|
||||||
* @param {string} [name] - (optional) attribute name to filter
|
* @param {string} [name] - (optional) attribute name to filter
|
||||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
* @returns {FAttribute[]} all note's attributes, including inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedAttributes(type, name) {
|
getOwnedAttributes(type, name) {
|
||||||
const attrs = this.attributes
|
const attrs = this.attributes
|
||||||
@@ -238,7 +241,7 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* @param {string} [type] - (optional) attribute type to filter
|
* @param {string} [type] - (optional) attribute type to filter
|
||||||
* @param {string} [name] - (optional) attribute name to filter
|
* @param {string} [name] - (optional) attribute name to filter
|
||||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
* @returns {FAttribute[]} all note's attributes, including inherited ones
|
||||||
*/
|
*/
|
||||||
getAttributes(type, name) {
|
getAttributes(type, name) {
|
||||||
return this.__filterAttrs(this.__getCachedAttributes([]), type, name);
|
return this.__filterAttrs(this.__getCachedAttributes([]), type, name);
|
||||||
@@ -255,7 +258,8 @@ class NoteShort {
|
|||||||
const newPath = [...path, this.noteId];
|
const newPath = [...path, this.noteId];
|
||||||
const attrArrs = [ this.getOwnedAttributes() ];
|
const attrArrs = [ this.getOwnedAttributes() ];
|
||||||
|
|
||||||
if (this.noteId !== 'root') {
|
// inheritable attrs on root are typically not intended to be applied to hidden subtree #3537
|
||||||
|
if (this.noteId !== 'root' && this.noteId !== '_hidden') {
|
||||||
for (const parentNote of this.getParentNotes()) {
|
for (const parentNote of this.getParentNotes()) {
|
||||||
// these virtual parent-child relationships are also loaded into froca
|
// these virtual parent-child relationships are also loaded into froca
|
||||||
if (parentNote.type !== 'search') {
|
if (parentNote.type !== 'search') {
|
||||||
@@ -264,7 +268,7 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const templateAttr of attrArrs.flat().filter(attr => attr.type === 'relation' && attr.name === 'template')) {
|
for (const templateAttr of attrArrs.flat().filter(attr => attr.type === 'relation' && ['template', 'inherit'].includes(attr.name))) {
|
||||||
const templateNote = this.froca.notes[templateAttr.value];
|
const templateNote = this.froca.notes[templateAttr.value];
|
||||||
|
|
||||||
if (templateNote && templateNote.noteId !== this.noteId) {
|
if (templateNote && templateNote.noteId !== this.noteId) {
|
||||||
@@ -342,7 +346,7 @@ class NoteShort {
|
|||||||
const notePaths = this.getAllNotePaths().map(path => ({
|
const notePaths = this.getAllNotePaths().map(path => ({
|
||||||
notePath: path,
|
notePath: path,
|
||||||
isInHoistedSubTree: path.includes(hoistedNotePath),
|
isInHoistedSubTree: path.includes(hoistedNotePath),
|
||||||
isArchived: path.find(noteId => froca.notes[noteId].hasLabel('archived')),
|
isArchived: path.find(noteId => froca.notes[noteId].isArchived),
|
||||||
isSearch: path.find(noteId => froca.notes[noteId].type === 'search'),
|
isSearch: path.find(noteId => froca.notes[noteId].type === 'search'),
|
||||||
isHidden: path.includes('_hidden')
|
isHidden: path.includes('_hidden')
|
||||||
}));
|
}));
|
||||||
@@ -364,13 +368,36 @@ class NoteShort {
|
|||||||
return notePaths;
|
return notePaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return boolean - true if there's no non-hidden path, note is not cloned to the visible tree
|
||||||
|
*/
|
||||||
|
isHiddenCompletely() {
|
||||||
|
if (this.noteId === 'root') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const parentNote of this.getParentNotes()) {
|
||||||
|
if (parentNote.noteId === 'root') {
|
||||||
|
return false;
|
||||||
|
} else if (parentNote.noteId === '_hidden') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!parentNote.isHiddenCompletely()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
__filterAttrs(attributes, type, name) {
|
__filterAttrs(attributes, type, name) {
|
||||||
this.__validateTypeName(type, name);
|
this.__validateTypeName(type, name);
|
||||||
|
|
||||||
if (!type && !name) {
|
if (!type && !name) {
|
||||||
return attributes;
|
return attributes;
|
||||||
} else if (type && name) {
|
} else if (type && name) {
|
||||||
return attributes.filter(attr => attr.type === type && attr.name === name);
|
return attributes.filter(attr => attr.name === name && attr.type === type);
|
||||||
} else if (type) {
|
} else if (type) {
|
||||||
return attributes.filter(attr => attr.type === type);
|
return attributes.filter(attr => attr.type === type);
|
||||||
} else if (name) {
|
} else if (name) {
|
||||||
@@ -399,7 +426,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - label name to filter
|
* @param {string} [name] - label name to filter
|
||||||
* @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
|
* @returns {FAttribute[]} all note's labels (attributes with type label), including inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedLabels(name) {
|
getOwnedLabels(name) {
|
||||||
return this.getOwnedAttributes(LABEL, name);
|
return this.getOwnedAttributes(LABEL, name);
|
||||||
@@ -407,7 +434,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - label name to filter
|
* @param {string} [name] - label name to filter
|
||||||
* @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
|
* @returns {FAttribute[]} all note's labels (attributes with type label), including inherited ones
|
||||||
*/
|
*/
|
||||||
getLabels(name) {
|
getLabels(name) {
|
||||||
return this.getAttributes(LABEL, name);
|
return this.getAttributes(LABEL, name);
|
||||||
@@ -459,7 +486,7 @@ class NoteShort {
|
|||||||
let childBranches = this.getChildBranches();
|
let childBranches = this.getChildBranches();
|
||||||
|
|
||||||
if (!childBranches) {
|
if (!childBranches) {
|
||||||
ws.logError(`No children for ${parentNote}. This shouldn't happen.`);
|
ws.logError(`No children for '${this.noteId}'. This shouldn't happen.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,7 +507,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - relation name to filter
|
* @param {string} [name] - relation name to filter
|
||||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
* @returns {FAttribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||||
*/
|
*/
|
||||||
getOwnedRelations(name) {
|
getOwnedRelations(name) {
|
||||||
return this.getOwnedAttributes(RELATION, name);
|
return this.getOwnedAttributes(RELATION, name);
|
||||||
@@ -488,7 +515,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - relation name to filter
|
* @param {string} [name] - relation name to filter
|
||||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
* @returns {FAttribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||||
*/
|
*/
|
||||||
getRelations(name) {
|
getRelations(name) {
|
||||||
return this.getAttributes(RELATION, name);
|
return this.getAttributes(RELATION, name);
|
||||||
@@ -515,23 +542,23 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* @param {string} type - attribute type (label, relation, etc.)
|
* @param {string} type - attribute type (label, relation, etc.)
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
* @returns {FAttribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||||
*/
|
*/
|
||||||
getOwnedAttribute(type, name) {
|
getOwnedAttribute(type, name) {
|
||||||
const attributes = this.getOwnedAttributes(type, name);
|
const attributes = this.getOwnedAttributes();
|
||||||
|
|
||||||
return attributes.length > 0 ? attributes[0] : 0;
|
return attributes.find(attr => attr.name === name && attr.type === type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type - attribute type (label, relation, etc.)
|
* @param {string} type - attribute type (label, relation, etc.)
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
* @returns {FAttribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||||
*/
|
*/
|
||||||
getAttribute(type, name) {
|
getAttribute(type, name) {
|
||||||
const attributes = this.getAttributes(type, name);
|
const attributes = this.getAttributes();
|
||||||
|
|
||||||
return attributes.length > 0 ? attributes[0] : null;
|
return attributes.find(attr => attr.name === name && attr.type === type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -582,25 +609,25 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Attribute} label if it exists, null otherwise
|
* @returns {FAttribute} label if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
|
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Attribute} label if it exists, null otherwise
|
* @returns {FAttribute} label if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getLabel(name) { return this.getAttribute(LABEL, name); }
|
getLabel(name) { return this.getAttribute(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Attribute} relation if it exists, null otherwise
|
* @returns {FAttribute} relation if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
|
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Attribute} relation if it exists, null otherwise
|
* @returns {FAttribute} relation if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
getRelation(name) { return this.getAttribute(RELATION, name); }
|
getRelation(name) { return this.getAttribute(RELATION, name); }
|
||||||
|
|
||||||
@@ -630,7 +657,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
* @returns {Promise<NoteShort>|null} target note of the relation or null (if target is empty or note was not found)
|
* @returns {Promise<FNote>|null} target note of the relation or null (if target is empty or note was not found)
|
||||||
*/
|
*/
|
||||||
async getRelationTarget(name) {
|
async getRelationTarget(name) {
|
||||||
const targets = await this.getRelationTargets(name);
|
const targets = await this.getRelationTargets(name);
|
||||||
@@ -640,7 +667,7 @@ class NoteShort {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - relation name to filter
|
* @param {string} [name] - relation name to filter
|
||||||
* @returns {Promise<NoteShort[]>}
|
* @returns {Promise<FNote[]>}
|
||||||
*/
|
*/
|
||||||
async getRelationTargets(name) {
|
async getRelationTargets(name) {
|
||||||
const relations = this.getRelations(name);
|
const relations = this.getRelations(name);
|
||||||
@@ -654,10 +681,13 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {NoteShort[]}
|
* @returns {FNote[]}
|
||||||
*/
|
*/
|
||||||
getTemplateNotes() {
|
getNotesToInheritAttributesFrom() {
|
||||||
const relations = this.getRelations('template');
|
const relations = [
|
||||||
|
...this.getRelations('template'),
|
||||||
|
...this.getRelations('inherit')
|
||||||
|
];
|
||||||
|
|
||||||
return relations.map(rel => this.froca.notes[rel.value]);
|
return relations.map(rel => this.froca.notes[rel.value]);
|
||||||
}
|
}
|
||||||
@@ -681,7 +711,7 @@ class NoteShort {
|
|||||||
return promotedAttrs;
|
return promotedAttrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
hasAncestor(ancestorNoteId, visitedNoteIds = null) {
|
hasAncestor(ancestorNoteId, followTemplates = false, visitedNoteIds = null) {
|
||||||
if (this.noteId === ancestorNoteId) {
|
if (this.noteId === ancestorNoteId) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -695,14 +725,16 @@ class NoteShort {
|
|||||||
|
|
||||||
visitedNoteIds.add(this.noteId);
|
visitedNoteIds.add(this.noteId);
|
||||||
|
|
||||||
for (const templateNote of this.getTemplateNotes()) {
|
if (followTemplates) {
|
||||||
if (templateNote.hasAncestor(ancestorNoteId, visitedNoteIds)) {
|
for (const templateNote of this.getNotesToInheritAttributesFrom()) {
|
||||||
|
if (templateNote.hasAncestor(ancestorNoteId, followTemplates, visitedNoteIds)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const parentNote of this.getParentNotes()) {
|
for (const parentNote of this.getParentNotes()) {
|
||||||
if (parentNote.hasAncestor(ancestorNoteId, visitedNoteIds)) {
|
if (parentNote.hasAncestor(ancestorNoteId, followTemplates, visitedNoteIds)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -722,7 +754,7 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* Get relations which target this note
|
* Get relations which target this note
|
||||||
*
|
*
|
||||||
* @returns {Attribute[]}
|
* @returns {FAttribute[]}
|
||||||
*/
|
*/
|
||||||
getTargetRelations() {
|
getTargetRelations() {
|
||||||
return this.targetRelations
|
return this.targetRelations
|
||||||
@@ -732,7 +764,7 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* Get relations which target this note
|
* Get relations which target this note
|
||||||
*
|
*
|
||||||
* @returns {NoteShort[]}
|
* @returns {FNote[]}
|
||||||
*/
|
*/
|
||||||
async getTargetRelationSourceNotes() {
|
async getTargetRelationSourceNotes() {
|
||||||
const targetRelations = this.getTargetRelations();
|
const targetRelations = this.getTargetRelations();
|
||||||
@@ -743,7 +775,7 @@ class NoteShort {
|
|||||||
/**
|
/**
|
||||||
* Return note complement which is most importantly note's content
|
* Return note complement which is most importantly note's content
|
||||||
*
|
*
|
||||||
* @return {Promise<NoteComplement>}
|
* @returns {Promise<FNoteComplement>}
|
||||||
*/
|
*/
|
||||||
async getNoteComplement() {
|
async getNoteComplement() {
|
||||||
return await this.froca.getNoteComplement(this.noteId);
|
return await this.froca.getNoteComplement(this.noteId);
|
||||||
@@ -775,7 +807,7 @@ class NoteShort {
|
|||||||
return labels.length > 0 ? labels[0].value : "";
|
return labels.length > 0 ? labels[0].value : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {boolean} true if this note is JavaScript (code or attachment) */
|
/** @returns {boolean} true if this note is JavaScript (code or file) */
|
||||||
isJavaScript() {
|
isJavaScript() {
|
||||||
return (this.type === "code" || this.type === "file" || this.type === 'launcher')
|
return (this.type === "code" || this.type === "file" || this.type === 'launcher')
|
||||||
&& (this.mime.startsWith("application/javascript")
|
&& (this.mime.startsWith("application/javascript")
|
||||||
@@ -853,8 +885,8 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isOptions() {
|
isOptions() {
|
||||||
return this.noteId.startsWith("options");
|
return this.noteId.startsWith("_options");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NoteShort;
|
export default FNote;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Complements the NoteShort with the main note content and other extra attributes
|
* Complements the FNote with the main note content and other extra attributes
|
||||||
*/
|
*/
|
||||||
class NoteComplement {
|
class FNoteComplement {
|
||||||
constructor(row) {
|
constructor(row) {
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
this.noteId = row.noteId;
|
this.noteId = row.noteId;
|
||||||
@@ -37,4 +37,4 @@ class NoteComplement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NoteComplement;
|
export default FNoteComplement;
|
||||||
@@ -46,10 +46,8 @@ import FindWidget from "../widgets/find.js";
|
|||||||
import TocWidget from "../widgets/toc.js";
|
import TocWidget from "../widgets/toc.js";
|
||||||
import BulkActionsDialog from "../widgets/dialogs/bulk_actions.js";
|
import BulkActionsDialog from "../widgets/dialogs/bulk_actions.js";
|
||||||
import AboutDialog from "../widgets/dialogs/about.js";
|
import AboutDialog from "../widgets/dialogs/about.js";
|
||||||
import NoteSourceDialog from "../widgets/dialogs/note_source.js";
|
|
||||||
import HelpDialog from "../widgets/dialogs/help.js";
|
import HelpDialog from "../widgets/dialogs/help.js";
|
||||||
import RecentChangesDialog from "../widgets/dialogs/recent_changes.js";
|
import RecentChangesDialog from "../widgets/dialogs/recent_changes.js";
|
||||||
import BackendLogDialog from "../widgets/dialogs/backend_log.js";
|
|
||||||
import BranchPrefixDialog from "../widgets/dialogs/branch_prefix.js";
|
import BranchPrefixDialog from "../widgets/dialogs/branch_prefix.js";
|
||||||
import SortChildNotesDialog from "../widgets/dialogs/sort_child_notes.js";
|
import SortChildNotesDialog from "../widgets/dialogs/sort_child_notes.js";
|
||||||
import PasswordNoteSetDialog from "../widgets/dialogs/password_not_set.js";
|
import PasswordNoteSetDialog from "../widgets/dialogs/password_not_set.js";
|
||||||
@@ -186,10 +184,8 @@ export default class DesktopLayout {
|
|||||||
)
|
)
|
||||||
.child(new BulkActionsDialog())
|
.child(new BulkActionsDialog())
|
||||||
.child(new AboutDialog())
|
.child(new AboutDialog())
|
||||||
.child(new NoteSourceDialog())
|
|
||||||
.child(new HelpDialog())
|
.child(new HelpDialog())
|
||||||
.child(new RecentChangesDialog())
|
.child(new RecentChangesDialog())
|
||||||
.child(new BackendLogDialog())
|
|
||||||
.child(new BranchPrefixDialog())
|
.child(new BranchPrefixDialog())
|
||||||
.child(new SortChildNotesDialog())
|
.child(new SortChildNotesDialog())
|
||||||
.child(new PasswordNoteSetDialog())
|
.child(new PasswordNoteSetDialog())
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class ContextMenu {
|
|||||||
|
|
||||||
positionMenu() {
|
positionMenu() {
|
||||||
// code below tries to detect when dropdown would overflow from page
|
// code below tries to detect when dropdown would overflow from page
|
||||||
// in such case we'll position it above click coordinates so it will fit into client
|
// in such case we'll position it above click coordinates, so it will fit into client
|
||||||
|
|
||||||
const CONTEXT_MENU_PADDING = 5; // How many pixels to pad context menu from edge of screen
|
const CONTEXT_MENU_PADDING = 5; // How many pixels to pad context menu from edge of screen
|
||||||
const CONTEXT_MENU_OFFSET = 0; // How many pixels to offset context menu by relative to cursor, see #3157
|
const CONTEXT_MENU_OFFSET = 0; // How many pixels to offset context menu by relative to cursor, see #3157
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default class LauncherContextMenu {
|
|||||||
x: e.pageX,
|
x: e.pageX,
|
||||||
y: e.pageY,
|
y: e.pageY,
|
||||||
items: await this.getMenuItems(),
|
items: await this.getMenuItems(),
|
||||||
selectMenuItemHandler: (item, e) => this.selectMenuItemHandler(item, e)
|
selectMenuItemHandler: (item, e) => this.selectMenuItemHandler(item)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user