mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 07:46:30 +01:00
Compare commits
446 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63a70f2ffa | ||
|
|
d8e9086bde | ||
|
|
af4470ead1 | ||
|
|
7cda81ec68 | ||
|
|
b1153f8d01 | ||
|
|
54e21bf249 | ||
|
|
eebf329983 | ||
|
|
7b1d6c3937 | ||
|
|
e6803e9a9b | ||
|
|
0b24011468 | ||
|
|
2699c995ee | ||
|
|
697f6ee2a9 | ||
|
|
35429f6a93 | ||
|
|
29eae4eeb6 | ||
|
|
8de67b6945 | ||
|
|
4f63284d41 | ||
|
|
0c806024fb | ||
|
|
9a08aa2ab5 | ||
|
|
02f218389b | ||
|
|
4cd54e5a9a | ||
|
|
6b4800d2d6 | ||
|
|
f60e4a1355 | ||
|
|
03897c5c9d | ||
|
|
ef90f1ff3f | ||
|
|
177a67f59b | ||
|
|
1e551581f8 | ||
|
|
62c2547557 | ||
|
|
2389ab30f8 | ||
|
|
fdffc27bb6 | ||
|
|
540d19c67c | ||
|
|
46eebdc7aa | ||
|
|
700c6ffc75 | ||
|
|
6b013c05cc | ||
|
|
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 | ||
|
|
701911b766 | ||
|
|
5fea90491c | ||
|
|
d665b7e584 | ||
|
|
7a8bbdced8 | ||
|
|
affd8062e2 | ||
|
|
45b94ecaeb | ||
|
|
acda37e334 | ||
|
|
2cfc43a4fd | ||
|
|
fb789b7bd8 | ||
|
|
b906efb23b | ||
|
|
f249d6cb26 | ||
|
|
afb6e860ea | ||
|
|
435e042ae9 | ||
|
|
d64df5e3e7 | ||
|
|
bd59802ca4 | ||
|
|
7c98ade72b | ||
|
|
c6485f8e03 | ||
|
|
a083917db1 | ||
|
|
3b5f2b86d5 | ||
|
|
f08fbf7bca | ||
|
|
e2b227df34 | ||
|
|
4c51588270 | ||
|
|
b13ea72152 | ||
|
|
5a2907b670 | ||
|
|
b6f7c604c7 | ||
|
|
c5fb2cccd5 | ||
|
|
1d1e6ae782 | ||
|
|
bff33932d9 | ||
|
|
392b89e6dd | ||
|
|
5ae0a5cf1e | ||
|
|
1a1fb126c1 | ||
|
|
5c4db266a4 | ||
|
|
e5e0add1a2 | ||
|
|
e1d20b8ff8 | ||
|
|
c6a05d8853 | ||
|
|
c34bccf7e8 | ||
|
|
0441e7396a | ||
|
|
698eb53006 | ||
|
|
3804d2df8c | ||
|
|
7147cc267e | ||
|
|
29713de6cd | ||
|
|
46f40ee534 | ||
|
|
a882ad41c5 | ||
|
|
062e8c4b84 | ||
|
|
0f0ca51bd6 | ||
|
|
af654a171f | ||
|
|
186e06bc01 | ||
|
|
4cc9bdf5e4 | ||
|
|
e05e4bec32 | ||
|
|
5a3882f388 | ||
|
|
8ec2547b4a | ||
|
|
059c339c09 | ||
|
|
724f99f17c | ||
|
|
1b24276a4a | ||
|
|
ea006993f6 | ||
|
|
7a46159539 | ||
|
|
50faa40bad | ||
|
|
9d9305300c | ||
|
|
c89455f93f | ||
|
|
7c6d67f1ad | ||
|
|
8c4dda45ef | ||
|
|
db5e76fe8c | ||
|
|
5413a1aa79 | ||
|
|
e41104208a | ||
|
|
5fca606730 | ||
|
|
0de0b6fd06 | ||
|
|
db6dbc7821 | ||
|
|
e5171e434b | ||
|
|
2df7d99a91 | ||
|
|
6def541e78 | ||
|
|
5af506e268 | ||
|
|
967919b400 | ||
|
|
575f09d97f | ||
|
|
c28383de4f | ||
|
|
c496519095 | ||
|
|
ecaa9a1d56 | ||
|
|
d34a0a9fc0 | ||
|
|
b202b43bf5 | ||
|
|
648dd73fa1 | ||
|
|
1640a8aa7d | ||
|
|
698a6bf91c | ||
|
|
c409d7ff2a | ||
|
|
f8dd175837 | ||
|
|
195c6a4089 | ||
|
|
6c431ae5ed | ||
|
|
8c01a77a7a | ||
|
|
239c68a33c | ||
|
|
df3212c304 | ||
|
|
4026c2be4f | ||
|
|
c6614bc85b | ||
|
|
31b3af4129 | ||
|
|
c4b0c44919 | ||
|
|
223ca95829 | ||
|
|
b9ae68d559 | ||
|
|
e7470e31a0 | ||
|
|
1b6d0c9bbc | ||
|
|
75639c53f0 | ||
|
|
587387dd46 | ||
|
|
ffb3c044fa | ||
|
|
921f75beba | ||
|
|
f739259407 | ||
|
|
173b28062e | ||
|
|
4f51f73b89 | ||
|
|
ca968a9e31 | ||
|
|
2957e1d78a | ||
|
|
d1b989ac12 | ||
|
|
e3047ee450 | ||
|
|
f45478260e | ||
|
|
bbdb7375ff | ||
|
|
23322455a3 | ||
|
|
c1d4d3fc8a | ||
|
|
fc40e54261 | ||
|
|
87e833d373 | ||
|
|
dcfa9c4c0b | ||
|
|
c231b3cb79 | ||
|
|
1f468f81cc | ||
|
|
494f8d2153 | ||
|
|
0f822b2761 | ||
|
|
5ac332960e | ||
|
|
dfb462cf35 | ||
|
|
342ae6e5e2 | ||
|
|
eaf195e0c8 | ||
|
|
9460cfdc55 | ||
|
|
c44bc60667 | ||
|
|
8d6801bb85 | ||
|
|
c22b6b29e0 | ||
|
|
44997f5cd1 | ||
|
|
95f4195ca7 | ||
|
|
73eb585398 | ||
|
|
e5ba6ff496 | ||
|
|
653f80f7d8 | ||
|
|
d06d4ba437 | ||
|
|
2a68bdb690 | ||
|
|
5f6a10ef22 | ||
|
|
2ad19ddd36 | ||
|
|
5fc9f5f3f9 | ||
|
|
b9632a7814 | ||
|
|
f336435adb | ||
|
|
9e83368f87 | ||
|
|
d619a7a2d7 | ||
|
|
012fb1f50b | ||
|
|
d64b575e60 | ||
|
|
aec2c2d5cd | ||
|
|
74fdaad032 | ||
|
|
d3bf0c1d8e | ||
|
|
27ce273d29 | ||
|
|
cd60ad4267 | ||
|
|
56e01046c8 | ||
|
|
29923af17d | ||
|
|
99a5774148 | ||
|
|
b85f335561 | ||
|
|
7b36709e18 | ||
|
|
0d50cdb0f5 | ||
|
|
eec2ff043e | ||
|
|
0e68e8069b | ||
|
|
7aa801fc1f | ||
|
|
fc080f785b | ||
|
|
1a6c9be065 | ||
|
|
b55c2d3dbc | ||
|
|
720fb0f73e | ||
|
|
0985314fb7 | ||
|
|
e759b4846a | ||
|
|
eecfce3cc9 | ||
|
|
a459230aa9 | ||
|
|
e4f57ab2fe | ||
|
|
6a9ac6f90a | ||
|
|
6883b71ce7 | ||
|
|
70552d58ac | ||
|
|
c7bda4d0be | ||
|
|
e4e20c8007 | ||
|
|
2fbcd9aaf7 | ||
|
|
723db97094 | ||
|
|
65be882b49 | ||
|
|
48765cc87d | ||
|
|
e2f6191229 | ||
|
|
19126b7c6d | ||
|
|
c92b451033 | ||
|
|
3122d0cc6b | ||
|
|
06e6fec4ca | ||
|
|
12943cc808 | ||
|
|
6ec734df13 | ||
|
|
657c54efd4 | ||
|
|
4f1f632a7d | ||
|
|
7e83d3a54d | ||
|
|
8d30d5d689 | ||
|
|
c16f7a5e02 | ||
|
|
5705efc998 | ||
|
|
2694bcff67 | ||
|
|
df7c089344 | ||
|
|
616e2c1c29 | ||
|
|
3c26e00fe1 | ||
|
|
fc920becac | ||
|
|
8d608c3c1c | ||
|
|
08aa65bddb | ||
|
|
54900b35dc | ||
|
|
7696702a2a | ||
|
|
42cade17cb | ||
|
|
7565458332 | ||
|
|
b86dbc088d | ||
|
|
82c596d1e3 | ||
|
|
b3097b59c7 | ||
|
|
5ec359e929 | ||
|
|
dff2d3e989 | ||
|
|
53affed8d3 | ||
|
|
102bfcebd0 |
8
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
8
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -7,7 +7,7 @@ body:
|
||||
attributes:
|
||||
label: Trilium Version
|
||||
description: What version of Trilium are you using?
|
||||
placeholder: 0.48.0-beta
|
||||
placeholder: 0.57.0-beta
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
@@ -44,3 +44,9 @@ body:
|
||||
description: A clear and concise description of the bug and any additional information.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Error logs
|
||||
description: Please provide error logs, see [wiki page](https://github.com/zadam/trilium/wiki/Error-logs) for instructions on how to submit them.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,3 +11,4 @@ cert.crt
|
||||
server-package.json
|
||||
.idea/httpRequests/
|
||||
data/
|
||||
tmp/
|
||||
|
||||
@@ -2,7 +2,7 @@ image:
|
||||
file: .gitpod.dockerfile
|
||||
|
||||
tasks:
|
||||
- before: nvm install 16.18.0 && nvm use 16.18.0
|
||||
- before: nvm install 16.19.1 && nvm use 16.19.1
|
||||
init: npm install
|
||||
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>
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,7 +3,7 @@
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_16" default="true" project-jdk-name="openjdk-16" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
3
.vscode/launch.json
vendored
3
.vscode/launch.json
vendored
@@ -9,7 +9,8 @@
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"env": {
|
||||
"TRILIUM_ENV": "dev"
|
||||
"TRILIUM_ENV": "dev",
|
||||
"TRILIUM_DATA_DIR": "./data"
|
||||
},
|
||||
"outputCapture": "std",
|
||||
"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
|
||||
12
Dockerfile
12
Dockerfile
@@ -1,5 +1,5 @@
|
||||
# !!! Don't try to build this Dockerfile directly, run it through bin/build-docker.sh script !!!
|
||||
FROM node:16.18.0-alpine
|
||||
FROM node:16.19.1-alpine
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
@@ -25,11 +25,9 @@ RUN set -x \
|
||||
&& apk del .build-dependencies \
|
||||
&& npm run webpack \
|
||||
&& npm prune --omit=dev \
|
||||
# Set the path to the newly created webpack bundle
|
||||
&& sed -i -e 's/app\/desktop.js/app-dist\/desktop.js/g' src/views/desktop.ejs \
|
||||
&& sed -i -e 's/app\/mobile.js/app-dist\/mobile.js/g' src/views/mobile.ejs \
|
||||
&& sed -i -e 's/app\/setup.js/app-dist\/setup.js/g' src/views/setup.ejs \
|
||||
&& sed -i -e 's/app\/share.js/app-dist\/share.js/g' src/views/share/*.ejs
|
||||
&& cp src/public/app/share.js src/public/app-dist/. \
|
||||
&& cp -r src/public/app/doc_notes src/public/app-dist/. \
|
||||
&& rm -rf src/public/app
|
||||
|
||||
# Some setup tools need to be kept
|
||||
RUN apk add --no-cache su-exec shadow
|
||||
@@ -41,4 +39,4 @@ RUN adduser -s /bin/false node; exit 0
|
||||
EXPOSE 8080
|
||||
CMD [ "./start-docker.sh" ]
|
||||
|
||||
HEALTHCHECK CMD sh DockerHealthcheck.sh
|
||||
HEALTHCHECK --start-period=10s CMD exec su-exec node node docker_healthcheck.js
|
||||
|
||||
@@ -1,49 +1,57 @@
|
||||
# Trilium笔记
|
||||
# Trilium Notes
|
||||
|
||||
[English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md)
|
||||
|
||||
[](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
Trilium Notes是一个分层的笔记应用程序,专注于建立大型个人知识库。请参阅[屏幕截图](https://github.com/zadam/trilium/wiki/Screenshot-tour)以快速了解:
|
||||
Trilium Notes 是一个层次化的笔记应用程序,专注于建立大型个人知识库。请参阅[屏幕截图](https://github.com/zadam/trilium/wiki/Screenshot-tour)以快速了解:
|
||||
|
||||

|
||||
|
||||
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://signmyrocket.com//uploads/2b2a523cd0c0e76cdbba95a89a9636b2_1676971281.jpg" alt="Trilium Notes supports Ukraine!" width="600"/>
|
||||
|
||||
## 特性
|
||||
|
||||
* 笔记可以排列成任意深的树。单个笔记可以放在树中的多个位置(请参阅[克隆](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
||||
* 丰富的所见即所得笔记编辑功能,包括带有markdown[自动格式化功能的](https://github.com/zadam/trilium/wiki/Text-notes#autoformat)表格,图像和[数学](https://github.com/zadam/trilium/wiki/Text-notes#math-support)
|
||||
* 丰富的所见即所得笔记编辑功能,包括带有 Markdown [自动格式化功能的](https://github.com/zadam/trilium/wiki/Text-notes#autoformat)表格,图像和[数学](https://github.com/zadam/trilium/wiki/Text-notes#math-support)
|
||||
* 支持编辑[使用源代码的笔记](https://github.com/zadam/trilium/wiki/Code-notes),包括语法高亮显示
|
||||
* 笔记之间快速[导航](https://github.com/zadam/trilium/wiki/Note-navigation),全文搜索和[笔记挂起](https://github.com/zadam/trilium/wiki/Note-hoisting)
|
||||
* 笔记之间快速[导航](https://github.com/zadam/trilium/wiki/Note-navigation),全文搜索和[笔记聚焦](https://github.com/zadam/trilium/wiki/Note-hoisting)
|
||||
* 无缝[笔记版本控制](https://github.com/zadam/trilium/wiki/Note-revisions)
|
||||
* 笔记[属性](https://github.com/zadam/trilium/wiki/Attributes)可用于笔记组织,查询和高级[脚本编写](https://github.com/zadam/trilium/wiki/Scripts)
|
||||
* [同步](https://github.com/zadam/trilium/wiki/Synchronization)与自托管同步服务器
|
||||
* 有一个[第三方提供的同步服务器托管服务](https://trilium.cc/paid-hosting)
|
||||
* 公开地[分享](https://github.com/zadam/trilium/wiki/Sharing)(发布)笔记到互联网
|
||||
* 具有按笔记粒度的强大的[笔记加密](https://github.com/zadam/trilium/wiki/Protected-notes)
|
||||
* 使用自带的 Excalidraw 来绘制图表(笔记类型“画布”)
|
||||
* [关系图](https://github.com/zadam/trilium/wiki/Relation-map)和[链接图](https://github.com/zadam/trilium/wiki/Link-map),用于可视化笔记及其关系
|
||||
* [脚本](https://github.com/zadam/trilium/wiki/Scripts)-请参阅[高级展示](https://github.com/zadam/trilium/wiki/Advanced-showcases)
|
||||
* 可用性和性能均能很好地扩展至超过10万个笔记
|
||||
* 针对智能手机和平板电脑进行触摸优化的[移动前端](https://github.com/zadam/trilium/wiki/Mobile-frontend)
|
||||
* [脚本](https://github.com/zadam/trilium/wiki/Scripts) - 请参阅[高级功能展示](https://github.com/zadam/trilium/wiki/Advanced-showcases)
|
||||
* 在拥有超过 10 万条笔记时仍能保持良好的可用性和性能
|
||||
* 针对智能手机和平板电脑进行优化的[用于移动设备的前端](https://github.com/zadam/trilium/wiki/Mobile-frontend)
|
||||
* [夜间主题](https://github.com/zadam/trilium/wiki/Themes)
|
||||
* [Evernote](https://github.com/zadam/trilium/wiki/Evernote-import)和[Markdown导入导出](https://github.com/zadam/trilium/wiki/Markdown)
|
||||
* [Web Clipper](https://github.com/zadam/trilium/wiki/Web-clipper)可轻松保存Web内容
|
||||
* [Evernote](https://github.com/zadam/trilium/wiki/Evernote-import) 和 [Markdown 导入导出](https://github.com/zadam/trilium/wiki/Markdown)功能
|
||||
* 使用[网页剪藏](https://github.com/zadam/trilium/wiki/Web-clipper)轻松保存互联网上的内容
|
||||
|
||||
## 构建
|
||||
|
||||
Trilium是作为桌面应用程序(Linux和Windows)或服务器上托管的Web应用程序(Linux)提供的。Mac OS桌面版本可用,但[不受支持](https://github.com/zadam/trilium/wiki/FAQ#mac-os-support)。
|
||||
Trilium 可以用作桌面应用程序(Linux 和 Windows)或服务器(Linux)上托管的 Web 应用程序。虽然有 macOS 版本的桌面应用程序,但它[不受支持](https://github.com/zadam/trilium/wiki/FAQ#mac-os-support)。
|
||||
|
||||
* 如果要在桌面上使用Trilium,请从[最新版本](https://github.com/zadam/trilium/releases/latest)下载适用于您平台的二进制[版本](https://github.com/zadam/trilium/releases/latest),解压缩该软件包并运行`trilium`可执行文件。
|
||||
* 如果要在服务器上安装Trilium,请遵循[此页面](https://github.com/zadam/trilium/wiki/Server-installation)。
|
||||
* 当前仅支持(经过测试)最新的Chrome和Firefox浏览器。
|
||||
* 如果要在桌面上使用 Trilium,请从[最新版本](https://github.com/zadam/trilium/releases/latest)下载适用于您平台的二进制版本,解压缩该软件包并运行`trilium`可执行文件。
|
||||
* 如果要在服务器上安装 Trilium,请参考[此页面](https://github.com/zadam/trilium/wiki/Server-installation)。
|
||||
* 当前仅支持(测试过)最近发布的 Chrome 和 Firefox 浏览器。
|
||||
|
||||
Trilium 也提供 Flatpak:
|
||||
|
||||
[<img width="240" src="https://flathub.org/assets/badges/flathub-badge-en.png">](https://flathub.org/apps/details/com.github.zadam.trilium)
|
||||
|
||||
## 文档
|
||||
|
||||
[有关文档页面的完整列表,请参见Wiki。](https://github.com/zadam/trilium/wiki/)
|
||||
[有关文档页面的完整列表,请参见 Wiki。](https://github.com/zadam/trilium/wiki/)
|
||||
|
||||
[中文Wiki在这里](https://github.com/baddate/trilium/wiki/)
|
||||
* [Wiki 的中文翻译版本](https://github.com/baddate/trilium/wiki/)
|
||||
|
||||
您还可以阅读[个人知识库模式](https://github.com/zadam/trilium/wiki/Patterns-of-personal-knowledge-base),以获取有关如何使用Trilium的灵感。
|
||||
您还可以阅读[个人知识库模式](https://github.com/zadam/trilium/wiki/Patterns-of-personal-knowledge-base),以获取有关如何使用 Trilium 的灵感。
|
||||
|
||||
## 贡献
|
||||
|
||||
@@ -51,7 +59,7 @@ Trilium是作为桌面应用程序(Linux和Windows)或服务器上托管的W
|
||||
|
||||
[](https://gitpod.io/#https://github.com/zadam/trilium)
|
||||
|
||||
或在本地克隆并运行
|
||||
或者克隆本仓库到本地,并运行
|
||||
|
||||
```
|
||||
npm install
|
||||
@@ -60,7 +68,15 @@ npm run start-server
|
||||
|
||||
## 致谢
|
||||
|
||||
* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - 市场上最好的所见即所得编辑器,互动性强且聆听能力强的团队
|
||||
* [FancyTree](https://github.com/mar10/fancytree) - 一个非常丰富的关于树的库,强大的没有对手。没有它,Trilium Notes将不会如此。
|
||||
* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - 市面上最好的所见即所得编辑器,拥有互动性强且聆听能力强的团队
|
||||
* [FancyTree](https://github.com/mar10/fancytree) - 一个非常丰富的关于树的库,强大到没有对手。没有它,Trilium Notes 将不会如此。
|
||||
* [CodeMirror](https://github.com/codemirror/CodeMirror) - 支持大量语言的代码编辑器
|
||||
* [jsPlumb](https://github.com/jsplumb/jsplumb)强大的可视化连接库。- 用于[关系图](https://github.com/zadam/trilium/wiki/Relation-map)和[链接图](https://github.com/zadam/trilium/wiki/Link-map)
|
||||
* [jsPlumb](https://github.com/jsplumb/jsplumb) - 强大的可视化连接库。用于[关系图](https://github.com/zadam/trilium/wiki/Relation-map)和[链接图](https://github.com/zadam/trilium/wiki/Link-map)
|
||||
|
||||
## 捐赠
|
||||
|
||||
你可以通过 GitHub Sponsors,[PayPal](https://paypal.me/za4am) 或者比特币 (bitcoin:bc1qv3svjn40v89mnkre5vyvs2xw6y8phaltl385d2) 来捐赠。
|
||||
|
||||
## 许可证
|
||||
|
||||
本程序是自由软件:你可以再发布本软件和/或修改本软件,只要你遵循 Free Software Foundation 发布的 GNU Affero General Public License 的第三版或者任何(由你选择)更晚的版本。
|
||||
|
||||
28
README.md
28
README.md
@@ -1,17 +1,19 @@
|
||||
# Trilium Notes
|
||||
|
||||
[English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md)
|
||||
[](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md)
|
||||
|
||||
[](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
Trilium Notes is a hierarchical note taking application with focus on building large personal knowledge bases. See [screenshots](https://github.com/zadam/trilium/wiki/Screenshot-tour) for quick overview:
|
||||
|
||||

|
||||
<a href="https://github.com/zadam/trilium/wiki/Screenshot-tour"><img src="https://raw.githubusercontent.com/wiki/zadam/trilium/images/screenshot.png" alt="Trilium Screenshot" width="1000"></a>
|
||||
|
||||
Ukraine is currently defending itself from Russian aggression, please consider [donating to Ukrainian Army or humanitarian charities](https://standforukraine.com/).
|
||||
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
|
||||
<p float="left">
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="400"/>
|
||||
<img src="https://signmyrocket.com//uploads/2b2a523cd0c0e76cdbba95a89a9636b2_1676971281.jpg" alt="Trilium Notes supports Ukraine!" width="570"/>
|
||||
</p>
|
||||
|
||||
## 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))
|
||||
* Rich WYSIWYG note editing including e.g. tables, images and [math](https://github.com/zadam/trilium/wiki/Text-notes#math-support) with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-notes#autoformat)
|
||||
@@ -33,7 +35,9 @@ Ukraine is currently defending itself from Russian aggression, please consider [
|
||||
* [Evernote](https://github.com/zadam/trilium/wiki/Evernote-import) and [Markdown import & export](https://github.com/zadam/trilium/wiki/Markdown)
|
||||
* [Web Clipper](https://github.com/zadam/trilium/wiki/Web-clipper) for easy saving of web content
|
||||
|
||||
## Builds
|
||||
Check out [awesome-trilium](https://github.com/Nriver/awesome-trilium) for 3rd party themes, scripts, plugins and more.
|
||||
|
||||
## 🏗 Builds
|
||||
|
||||
Trilium is provided as either desktop application (Linux and Windows) or web application hosted on your server (Linux). Mac OS desktop build is available, but it is [unsupported](https://github.com/zadam/trilium/wiki/FAQ#mac-os-support).
|
||||
|
||||
@@ -45,13 +49,13 @@ Trilium is also provided as a Flatpak:
|
||||
|
||||
[<img width="240" src="https://flathub.org/assets/badges/flathub-badge-en.png">](https://flathub.org/apps/details/com.github.zadam.trilium)
|
||||
|
||||
## Documentation
|
||||
## 📝 Documentation
|
||||
|
||||
[See wiki for complete list of documentation pages.](https://github.com/zadam/trilium/wiki/)
|
||||
|
||||
You can also read [Patterns of personal knowledge base](https://github.com/zadam/trilium/wiki/Patterns-of-personal-knowledge-base) to get some inspiration on how you might use Trilium.
|
||||
|
||||
## Contribute
|
||||
## 💻 Contribute
|
||||
|
||||
Use a browser based dev environment
|
||||
|
||||
@@ -63,17 +67,17 @@ npm install
|
||||
npm run start-server
|
||||
```
|
||||
|
||||
## Shoutouts
|
||||
## 📢 Shoutouts
|
||||
|
||||
* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - best WYSIWYG editor on the market, very interactive and listening team
|
||||
* [FancyTree](https://github.com/mar10/fancytree) - very feature rich tree library without real competition. Trilium Notes would not be the same without it.
|
||||
* [CodeMirror](https://github.com/codemirror/CodeMirror) - code editor with support for huge amount of languages
|
||||
* [jsPlumb](https://github.com/jsplumb/jsplumb) - visual connectivity library without competition. Used in [relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map)
|
||||
|
||||
## Donating
|
||||
## 🤝 Support
|
||||
|
||||
You can donate using GitHub Sponsors, [PayPal](https://paypal.me/za4am) or Bitcoin (bitcoin:bc1qv3svjn40v89mnkre5vyvs2xw6y8phaltl385d2).
|
||||
You can support Trilum using GitHub Sponsors, [PayPal](https://paypal.me/za4am) or Bitcoin (bitcoin:bc1qv3svjn40v89mnkre5vyvs2xw6y8phaltl385d2).
|
||||
|
||||
## License
|
||||
## 🔑 License
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
@@ -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/).
|
||||
|
||||
<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
|
||||
|
||||
PKG_DIR=dist/trilium-linux-x64-server
|
||||
NODE_VERSION=16.18.0
|
||||
NODE_VERSION=16.19.1
|
||||
|
||||
if [ "$1" != "DONTCOPY" ]
|
||||
then
|
||||
|
||||
@@ -30,7 +30,7 @@ cp bin/tpl/anonymize-database.sql $BUILD_DIR/
|
||||
cp -r dump-db $BUILD_DIR/
|
||||
rm -rf $BUILD_DIR/dump-db/node_modules
|
||||
|
||||
cp bin/tpl/trilium-{portable,no-cert-check,safe-mode}.{bat,ps1} $BUILD_DIR/
|
||||
cp bin/tpl/trilium-{portable,no-cert-check,safe-mode}.bat $BUILD_DIR/
|
||||
|
||||
echo "Zipping windows x64 electron distribution..."
|
||||
VERSION=`jq -r ".version" package.json`
|
||||
|
||||
@@ -5,7 +5,7 @@ if [[ $# -eq 0 ]] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
n exec 16.18.0 npm run webpack
|
||||
n exec 16.19.1 npm run webpack
|
||||
|
||||
DIR=$1
|
||||
|
||||
@@ -27,7 +27,7 @@ cp -r electron.js $DIR/
|
||||
cp webpack-* $DIR/
|
||||
|
||||
# run in subshell (so we return to original dir)
|
||||
(cd $DIR && n exec 16.18.0 npm install --only=prod)
|
||||
(cd $DIR && n exec 16.19.1 npm install --only=prod)
|
||||
|
||||
# cleanup of useless files in dependencies
|
||||
rm -r $DIR/node_modules/image-q/demo
|
||||
@@ -45,10 +45,6 @@ find $DIR/node_modules -name demo -exec rm -rf {} \;
|
||||
find $DIR/libraries -name "*.map" -type f -delete
|
||||
|
||||
cp $DIR/src/public/app/share.js $DIR/src/public/app-dist/
|
||||
cp -r $DIR/src/public/app/doc_notes $DIR/src/public/app-dist/
|
||||
|
||||
rm -rf $DIR/src/public/app
|
||||
|
||||
sed -i -e 's/app\/desktop.js/app-dist\/desktop.js/g' $DIR/src/views/desktop.ejs
|
||||
sed -i -e 's/app\/mobile.js/app-dist\/mobile.js/g' $DIR/src/views/mobile.ejs
|
||||
sed -i -e 's/app\/setup.js/app-dist\/setup.js/g' $DIR/src/views/setup.ejs
|
||||
sed -i -e 's/app\/share.js/app-dist\/share.js/g' $DIR/src/views/share/*.ejs
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
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"
|
||||
@@ -1,17 +1,166 @@
|
||||
|
||||
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_revisions SET title = 'title';
|
||||
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', 'hoistedCssClass', 'cssClass', 'iconClass', 'keyboardShortcut', 'run', 'runOnInstance', 'runAtHour', 'customRequestHandler', 'customResourceProvider', 'widget', 'noteInfoWidgetDisabled', 'linkMapWidgetDisabled', 'noteRevisionsWidgetDisabled', 'whatLinksHereWidgetDisabled', 'similarNotesWidgetDisabled', 'workspace', 'workspaceIconClass', 'workspaceTabBackgroundColor', 'searchHome', 'hoistedInbox', 'hoistedSearchHome', 'sqlConsoleHome', 'datePattern', 'pageSize', 'viewType', 'mapRootNoteId', 'bookmarked', 'bookmarkFolder', 'sorted', 'top', 'fullContentWidth', 'shareHiddenFromTree', 'shareAlias', 'shareOmitDefaultCss', 'shareRoot', 'shareDescription', 'internalLink', 'imageLink', 'relationMapLink', 'includeMapLink', 'runOnNoteCreation', 'runOnNoteTitleChange', 'runOnNoteChange', 'runOnChildNoteCreation', 'runOnAttributeCreation', 'runOnAttributeChange', 'template', 'widget', 'renderNote', 'shareCss', 'shareJs', 'shareFavicon');
|
||||
UPDATE attributes SET name = 'name' WHERE type = 'relation' AND name NOT IN ('inbox', 'disableVersioning', 'calendarRoot', 'archived', 'excludeFromExport', 'disableInclusion', 'appCss', 'appTheme', 'hidePromotedAttributes', 'readOnly', 'autoReadOnlyDisabled', 'hoistedCssClass', 'cssClass', 'iconClass', 'keyboardShortcut', 'run', 'runOnInstance', 'runAtHour', 'customRequestHandler', 'customResourceProvider', 'widget', 'noteInfoWidgetDisabled', 'linkMapWidgetDisabled', 'noteRevisionsWidgetDisabled', 'whatLinksHereWidgetDisabled', 'similarNotesWidgetDisabled', 'workspace', 'workspaceIconClass', 'workspaceTabBackgroundColor', 'searchHome', 'hoistedInbox', 'hoistedSearchHome', 'sqlConsoleHome', 'datePattern', 'pageSize', 'viewType', 'mapRootNoteId', 'bookmarked', 'bookmarkFolder', 'sorted', 'top', 'fullContentWidth', 'shareHiddenFromTree', 'shareAlias', 'shareOmitDefaultCss', 'shareRoot', 'shareDescription', 'internalLink', 'imageLink', 'relationMapLink', 'includeMapLink', 'runOnNoteCreation', 'runOnNoteTitleChange', 'runOnNoteChange', 'runOnChildNoteCreation', 'runOnAttributeCreation', 'runOnAttributeChange', 'template', 'widget', 'renderNote', 'shareCss', 'shareJs', 'shareFavicon');
|
||||
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',
|
||||
'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 options SET value = 'anonymized' WHERE name IN
|
||||
('documentId', 'documentSecret', 'encryptedDataKey',
|
||||
'passwordVerificationHash', 'passwordVerificationSalt',
|
||||
'passwordDerivedKeySalt', 'username', 'syncServerHost', 'syncProxy')
|
||||
('documentId', 'documentSecret', 'encryptedDataKey',
|
||||
'passwordVerificationHash', 'passwordVerificationSalt',
|
||||
'passwordDerivedKeySalt', 'username', 'syncServerHost', 'syncProxy')
|
||||
AND value != '';
|
||||
|
||||
VACUUM;
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
@echo off
|
||||
:: Try to get powershell to launch Trilium since it deals with UTF-8 characters in current path
|
||||
:: If there's no powershell available, fallback to unicode enabled command interpreter
|
||||
|
||||
WHERE powershell.exe > NUL 2>&1
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO BATCH ELSE GOTO POWERSHELL
|
||||
|
||||
:POWERSHELL
|
||||
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo "Set-Item -Path Env:NODE_TLS_REJECT_UNAUTHORIZED -Value 0; ./trilium.exe"
|
||||
GOTO END
|
||||
|
||||
:BATCH
|
||||
:: Make sure we support UTF-8 characters
|
||||
chcp 65001
|
||||
|
||||
:: Get Current Trilium executable directory and compute data directory
|
||||
SET DIR=%~dp0
|
||||
set NODE_TLS_REJECT_UNAUTHORIZED=0
|
||||
cd %DIR%
|
||||
WHERE powershell.exe
|
||||
IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-no-cert-check.ps1)
|
||||
start trilium.exe
|
||||
GOTO END
|
||||
|
||||
:END
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Set-Item -Path Env:NODE_TLS_REJECT_UNAUTHORIZED -Value 0
|
||||
./trilium.exe
|
||||
@@ -1,5 +1,23 @@
|
||||
@echo off
|
||||
:: Try to get powershell to launch Trilium since it deals with UTF-8 characters in current path
|
||||
:: If there's no powershell available, fallback to unicode enabled command interpreter
|
||||
|
||||
WHERE powershell.exe > NUL 2>&1
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO BATCH ELSE GOTO POWERSHELL
|
||||
|
||||
:POWERSHELL
|
||||
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo "Set-Item -Path Env:TRILIUM_DATA_DIR -Value './trilium-data'; ./trilium.exe"
|
||||
GOTO END
|
||||
|
||||
:BATCH
|
||||
:: Make sure we support UTF-8 characters
|
||||
chcp 65001
|
||||
|
||||
:: Get Current Trilium executable directory and compute data directory
|
||||
SET DIR=%~dp0
|
||||
SET TRILIUM_DATA_DIR=%DIR%\trilium-data
|
||||
cd %DIR%
|
||||
WHERE powershell.exe
|
||||
IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-portable.ps1)
|
||||
start trilium.exe
|
||||
GOTO END
|
||||
|
||||
:END
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Set-Item -Path Env:TRILIUM_DATA_DIR -Value './trilium-data'
|
||||
./trilium.exe
|
||||
@@ -1,5 +1,23 @@
|
||||
@echo off
|
||||
:: Try to get powershell to launch Trilium since it deals with UTF-8 characters in current path
|
||||
:: If there's no powershell available, fallback to unicode enabled command interpreter
|
||||
|
||||
WHERE powershell.exe > NUL 2>&1
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO BATCH ELSE GOTO POWERSHELL
|
||||
|
||||
:POWERSHELL
|
||||
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo "Set-Item -Path Env:TRILIUM_SAFE_MODE -Value 1; ./trilium.exe --disable-gpu"
|
||||
GOTO END
|
||||
|
||||
:BATCH
|
||||
:: Make sure we support UTF-8 characters
|
||||
chcp 65001
|
||||
|
||||
:: Get Current Trilium executable directory and compute data directory
|
||||
SET DIR=%~dp0
|
||||
SET TRILIUM_SAFE_MODE=1
|
||||
cd %DIR%
|
||||
WHERE powershell.exe
|
||||
IF %ERRORLEVEL% NEQ 0 (start trilium.exe --disable-gpu) ELSE (powershell.exe ./trilium-safe-mode.ps1)
|
||||
start trilium.exe --disable-gpu
|
||||
GOTO END
|
||||
|
||||
:END
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Set-Item -Path Env:TRILIUM_SAFE_MODE -Value 1
|
||||
./trilium.exe --disable-gpu
|
||||
BIN
db/demo.zip
BIN
db/demo.zip
Binary file not shown.
@@ -1,4 +1,7 @@
|
||||
CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
||||
DROP TABLE entity_changes;
|
||||
-- not preserving the data because of https://github.com/zadam/trilium/issues/3447
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "entity_changes" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
@@ -11,13 +14,6 @@ CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
||||
`utcDateChanged` TEXT NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO mig_entity_changes (id, entityName, entityId, hash, isErased, changeId, componentId, instanceId, isSynced, utcDateChanged)
|
||||
SELECT id, entityName, entityId, hash, isErased, changeId, '', '', isSynced, utcDateChanged FROM entity_changes;
|
||||
|
||||
DROP TABLE entity_changes;
|
||||
|
||||
ALTER TABLE mig_entity_changes RENAME TO entity_changes;
|
||||
|
||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
|
||||
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;
|
||||
53
db/migrations/0199__rename_ids.sql
Normal file
53
db/migrations/0199__rename_ids.sql
Normal file
@@ -0,0 +1,53 @@
|
||||
UPDATE notes SET noteId = '_globalNoteMap', title = 'Note Map' WHERE noteId = 'globalnotemap';
|
||||
UPDATE note_contents SET noteId = '_globalNoteMap' WHERE noteId = 'globalnotemap';
|
||||
UPDATE note_revisions SET noteId = '_globalNoteMap' WHERE noteId = 'globalnotemap';
|
||||
UPDATE branches SET noteId = '_globalNoteMap' WHERE noteId = 'globalnotemap';
|
||||
UPDATE branches SET parentNoteId = '_globalNoteMap' WHERE parentNoteId = 'globalnotemap';
|
||||
UPDATE attributes SET noteId = '_globalNoteMap' WHERE noteId = 'globalnotemap';
|
||||
UPDATE attributes SET value = '_globalNoteMap' WHERE type = 'relation' AND value = 'globalnotemap';
|
||||
UPDATE entity_changes SET entityId = '_globalNoteMap' WHERE entityId = 'globalnotemap';
|
||||
|
||||
UPDATE notes SET noteId = '_bulkAction', title = 'Bulk Action' WHERE noteId = 'bulkaction';
|
||||
UPDATE note_contents SET noteId = '_bulkAction' WHERE noteId = 'bulkaction';
|
||||
UPDATE note_revisions SET noteId = '_bulkAction' WHERE noteId = 'bulkaction';
|
||||
UPDATE branches SET parentNoteId = '_bulkAction' WHERE parentNoteId = 'bulkaction';
|
||||
UPDATE branches SET noteId = '_bulkAction' WHERE noteId = 'bulkaction';
|
||||
UPDATE attributes SET noteId = '_bulkAction' WHERE noteId = 'bulkaction';
|
||||
UPDATE attributes SET value = '_bulkAction' WHERE type = 'relation' AND value = 'bulkaction';
|
||||
UPDATE entity_changes SET entityId = '_bulkAction' WHERE entityId = 'bulkaction';
|
||||
|
||||
UPDATE notes SET noteId = '_sqlConsole', title = 'SQL Console History' WHERE noteId = 'sqlconsole';
|
||||
UPDATE note_contents SET noteId = '_sqlConsole' WHERE noteId = 'sqlconsole';
|
||||
UPDATE note_revisions SET noteId = '_sqlConsole' WHERE noteId = 'sqlconsole';
|
||||
UPDATE branches SET noteId = '_sqlConsole' WHERE noteId = 'sqlconsole';
|
||||
UPDATE branches SET parentNoteId = '_sqlConsole' WHERE parentNoteId = 'sqlconsole';
|
||||
UPDATE attributes SET noteId = '_sqlConsole' WHERE noteId = 'sqlconsole';
|
||||
UPDATE attributes SET value = '_sqlConsole' WHERE type = 'relation' AND value = 'sqlconsole';
|
||||
UPDATE entity_changes SET entityId = '_sqlConsole' WHERE entityId = 'sqlconsole';
|
||||
|
||||
UPDATE notes SET noteId = '_hidden', title = 'Hidden Notes' WHERE noteId = 'hidden';
|
||||
UPDATE note_contents SET noteId = '_hidden' WHERE noteId = 'hidden';
|
||||
UPDATE note_revisions SET noteId = '_hidden' WHERE noteId = 'hidden';
|
||||
UPDATE branches SET noteId = '_hidden', prefix = NULL WHERE noteId = 'hidden';
|
||||
UPDATE branches SET parentNoteId = '_hidden' WHERE parentNoteId = 'hidden';
|
||||
UPDATE attributes SET noteId = '_hidden' WHERE noteId = 'hidden';
|
||||
UPDATE attributes SET value = '_hidden' WHERE type = 'relation' AND value = 'hidden';
|
||||
UPDATE entity_changes SET entityId = '_hidden' WHERE entityId = 'hidden';
|
||||
|
||||
UPDATE notes SET noteId = '_search', title = 'Search History' WHERE noteId = 'search';
|
||||
UPDATE note_contents SET noteId = '_search' WHERE noteId = 'search';
|
||||
UPDATE note_revisions SET noteId = '_search' WHERE noteId = 'search';
|
||||
UPDATE branches SET noteId = '_search' WHERE noteId = 'search';
|
||||
UPDATE branches SET parentNoteId = '_search' WHERE parentNoteId = 'search';
|
||||
UPDATE attributes SET noteId = '_search' WHERE noteId = 'search';
|
||||
UPDATE attributes SET value = '_search' WHERE type = 'relation' AND value = 'search';
|
||||
UPDATE entity_changes SET entityId = '_search' WHERE entityId = 'search';
|
||||
|
||||
UPDATE notes SET noteId = '_share', title = 'Shared Notes' WHERE noteId = 'share';
|
||||
UPDATE note_contents SET noteId = '_share' WHERE noteId = 'share';
|
||||
UPDATE note_revisions SET noteId = '_share' WHERE noteId = 'share';
|
||||
UPDATE branches SET noteId = '_share' WHERE noteId = 'share';
|
||||
UPDATE branches SET parentNoteId = '_share' WHERE parentNoteId = 'share';
|
||||
UPDATE attributes SET noteId = '_share' WHERE noteId = 'share';
|
||||
UPDATE attributes SET value = '_share' WHERE type = 'relation' AND value = 'share';
|
||||
UPDATE entity_changes SET entityId = '_share' WHERE entityId = 'share';
|
||||
12
db/migrations/0200__create_hidden_subtree.js
Normal file
12
db/migrations/0200__create_hidden_subtree.js
Normal file
@@ -0,0 +1,12 @@
|
||||
module.exports = () => {
|
||||
const hiddenSubtreeService = require('../../src/services/hidden_subtree');
|
||||
const cls = require("../../src/services/cls");
|
||||
const beccaLoader = require("../../src/becca/becca_loader");
|
||||
|
||||
cls.init(() => {
|
||||
beccaLoader.load();
|
||||
// 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
|
||||
hiddenSubtreeService.checkHiddenSubtree(true);
|
||||
});
|
||||
};
|
||||
2
db/migrations/0201__move_share_under_hidden.sql
Normal file
2
db/migrations/0201__move_share_under_hidden.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
DELETE FROM branches WHERE noteId = '_share' AND parentNoteId != 'root' AND parentNoteId != '_hidden'; -- delete all other branches of _share if any
|
||||
UPDATE branches SET parentNoteId = '_hidden' WHERE noteId = '_share';
|
||||
@@ -0,0 +1,2 @@
|
||||
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';
|
||||
6
db/migrations/0203__delete_singles_special_note.sql
Normal file
6
db/migrations/0203__delete_singles_special_note.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
DELETE FROM branches WHERE noteId = 'singles';
|
||||
DELETE FROM notes WHERE noteId = 'singles';
|
||||
DELETE FROM note_contents WHERE noteId = 'singles';
|
||||
DELETE FROM note_revisions WHERE noteId = 'singles';
|
||||
DELETE FROM attributes WHERE noteId = 'singles';
|
||||
DELETE FROM entity_changes WHERE entityId = 'singles';
|
||||
21
db/migrations/0204__migrate_bookmarks_to_clones.js
Normal file
21
db/migrations/0204__migrate_bookmarks_to_clones.js
Normal file
@@ -0,0 +1,21 @@
|
||||
module.exports = () => {
|
||||
const cls = require("../../src/services/cls");
|
||||
const cloningService = require("../../src/services/cloning");
|
||||
const beccaLoader = require("../../src/becca/becca_loader");
|
||||
const becca = require("../../src/becca/becca");
|
||||
|
||||
cls.init(() => {
|
||||
beccaLoader.load();
|
||||
|
||||
for (const attr of becca.findAttributes('label','bookmarked')) {
|
||||
cloningService.toggleNoteInParent(true, attr.noteId, '_lbBookmarks');
|
||||
|
||||
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');
|
||||
}
|
||||
});
|
||||
};
|
||||
3
db/migrations/0205__rename_note_types.sql
Normal file
3
db/migrations/0205__rename_note_types.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
UPDATE notes SET type = 'relationMap' WHERE type = 'relation-map';
|
||||
UPDATE notes SET type = 'noteMap' WHERE type = 'note-map';
|
||||
UPDATE notes SET type = 'webView' WHERE type = 'web-view';
|
||||
33
db/migrations/0206__delete_search_and_sql_console_history.js
Normal file
33
db/migrations/0206__delete_search_and_sql_console_history.js
Normal file
@@ -0,0 +1,33 @@
|
||||
// the history was previously not exposed and the fact they were not cleaned up is rather a side-effect than an intention
|
||||
|
||||
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();
|
||||
|
||||
// deleting just branches because they might be cloned (and therefore saved) also outside of the hidden subtree
|
||||
|
||||
const searchRoot = becca.getNote('_search');
|
||||
|
||||
for (const searchBranch of searchRoot.getChildBranches()) {
|
||||
const searchNote = searchBranch.getNote();
|
||||
|
||||
if (searchNote.type === 'search') {
|
||||
searchBranch.deleteBranch('0206__delete_search_and_sql_console_history');
|
||||
}
|
||||
}
|
||||
|
||||
const sqlConsoleRoot = becca.getNote('_sqlConsole');
|
||||
|
||||
for (const sqlConsoleBranch of sqlConsoleRoot.getChildBranches()) {
|
||||
const sqlConsoleNote = sqlConsoleBranch.getNote();
|
||||
|
||||
if (sqlConsoleNote.type === 'code' && sqlConsoleNote.mime === 'text/x-sqlite;schema=trilium') {
|
||||
sqlConsoleBranch.deleteBranch('0206__delete_search_and_sql_console_history');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
2
db/migrations/0207__rename_search_and_sql_console.sql
Normal file
2
db/migrations/0207__rename_search_and_sql_console.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
UPDATE notes SET title = 'SQL Console History' WHERE noteId = '_sqlConsole';
|
||||
UPDATE notes SET title = 'Search History' WHERE noteId = '_search';
|
||||
13
db/migrations/0208__remove_archived_from_hidden.js
Normal file
13
db/migrations/0208__remove_archived_from_hidden.js
Normal file
@@ -0,0 +1,13 @@
|
||||
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();
|
||||
|
||||
for (const label of becca.getNote('_hidden').getLabels('archived')) {
|
||||
label.markAsDeleted('0208__remove_archived_from_hidden');
|
||||
}
|
||||
});
|
||||
};
|
||||
5
db/migrations/0209__rename_hoisted_labels.sql
Normal file
5
db/migrations/0209__rename_hoisted_labels.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
UPDATE attributes SET name = 'workspaceInbox' WHERE type = 'label' AND name = 'hoistedInbox';
|
||||
UPDATE entity_changes SET entityId = 'workspaceInbox' WHERE entityName = 'attributes' AND entityId = 'hoistedInbox';
|
||||
|
||||
UPDATE attributes SET name = 'workspaceSearchHome' WHERE type = 'label' AND name = 'hoistedSearchHome';
|
||||
UPDATE entity_changes SET entityId = 'workspaceSearchHome' WHERE entityName = 'attributes' AND entityId = 'hoistedSearchHome';
|
||||
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}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
43
docker_healthcheck.js
Executable file
43
docker_healthcheck.js
Executable file
@@ -0,0 +1,43 @@
|
||||
const http = require("http");
|
||||
const ini = require("ini");
|
||||
const fs = require("fs");
|
||||
const dataDir = require("./src/services/data_dir");
|
||||
const config = ini.parse(fs.readFileSync(dataDir.CONFIG_INI_PATH, 'utf-8'));
|
||||
|
||||
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 options = { timeout: 2000 };
|
||||
|
||||
const callback = res => {
|
||||
console.log(`STATUS: ${res.statusCode}`);
|
||||
if (res.statusCode === 200) {
|
||||
process.exit(0);
|
||||
} else {
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
let request;
|
||||
|
||||
if (port !== 0) { // TCP socket.
|
||||
const url = `http://${host}:${port}/api/health-check`;
|
||||
request = http.request(url, options, callback);
|
||||
} else { // Unix socket.
|
||||
options.socketPath = host;
|
||||
options.path = '/api/health-check';
|
||||
request = http.request(options, callback);
|
||||
}
|
||||
|
||||
request.on("error", err => {
|
||||
console.log("ERROR");
|
||||
process.exit(1);
|
||||
});
|
||||
request.end();
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: AbstractEntity</h1>
|
||||
<h1 class="page-title">Class: AbstractBeccaEntity</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -511,7 +511,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -595,7 +595,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -679,7 +679,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -833,7 +833,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -957,7 +957,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
||||
<span class="param-type">this</span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -985,13 +985,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: Attribute</h1>
|
||||
<h1 class="page-title">Class: BAttribute</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<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)
|
||||
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>
|
||||
<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#line15">line 15</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>
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
||||
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line46">line 46</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>
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -336,7 +336,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line58">line 58</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>
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line52">line 52</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>
|
||||
|
||||
|
||||
@@ -472,7 +472,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line48">line 48</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>
|
||||
|
||||
|
||||
@@ -540,7 +540,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line54">line 54</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>
|
||||
|
||||
|
||||
@@ -608,7 +608,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line50">line 50</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>
|
||||
|
||||
|
||||
@@ -676,7 +676,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line60">line 60</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>
|
||||
|
||||
|
||||
@@ -744,7 +744,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line56">line 56</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>
|
||||
|
||||
|
||||
@@ -802,7 +802,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -825,7 +825,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -891,7 +891,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -914,7 +914,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -980,7 +980,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1003,7 +1003,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1069,7 +1069,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1092,7 +1092,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<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#line115">line 115</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>
|
||||
|
||||
|
||||
@@ -1212,7 +1212,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
</dt>
|
||||
<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>
|
||||
@@ -1263,7 +1263,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1286,7 +1286,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<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#line122">line 122</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>
|
||||
|
||||
|
||||
@@ -1406,7 +1406,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
</dt>
|
||||
<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>
|
||||
@@ -1457,7 +1457,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1480,7 +1480,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1564,7 +1564,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line137">line 137</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>
|
||||
|
||||
|
||||
@@ -1718,7 +1718,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1741,7 +1741,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1834,7 +1834,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1870,7 +1870,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
||||
<span class="param-type">this</span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -1898,13 +1898,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: Branch</h1>
|
||||
<h1 class="page-title">Class: BBranch</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,10 +28,13 @@
|
||||
|
||||
<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
|
||||
parents.</div>
|
||||
parents.
|
||||
|
||||
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.</div>
|
||||
|
||||
|
||||
</header>
|
||||
@@ -46,7 +49,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="BBranch"><span class="type-signature"></span>new BBranch<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +97,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line18">line 18</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>
|
||||
|
||||
|
||||
@@ -134,7 +137,7 @@ parents.</div>
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
||||
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -177,7 +180,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -200,7 +203,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -268,7 +271,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line49">line 49</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>
|
||||
|
||||
|
||||
@@ -326,7 +329,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line95">line 95</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>
|
||||
|
||||
|
||||
@@ -394,7 +397,73 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line61">line 61</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="isWeak"><span class="type-signature"></span>isWeak<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Branch is weak when its existence should not hinder deletion of its note.
|
||||
As a result, note with only weak branches should be immediately deleted.
|
||||
An example is shared or bookmarked clones - they are created automatically and exist for technical reasons,
|
||||
not as user-intended actions. From user perspective, they don't count as real clones and for the purpose
|
||||
of deletion should not act as a clone.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -462,7 +531,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line53">line 53</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -530,7 +599,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line59">line 59</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -588,7 +657,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line109">line 109</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>
|
||||
|
||||
|
||||
@@ -656,7 +725,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line55">line 55</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -674,7 +743,7 @@ parents.</div>
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
@@ -686,6 +755,9 @@ parents.</div>
|
||||
<li>
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
|
||||
|
||||
<span class="param-type">null</span>
|
||||
|
||||
|
||||
</li>
|
||||
@@ -724,7 +796,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line57">line 57</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -792,7 +864,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line63">line 63</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -850,7 +922,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -873,7 +945,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -939,7 +1011,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -962,7 +1034,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1144,7 +1216,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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#line130">line 130</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>
|
||||
|
||||
|
||||
@@ -1232,7 +1304,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1255,7 +1327,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1321,7 +1393,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1344,7 +1416,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1410,7 +1482,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1433,7 +1505,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1499,7 +1571,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1522,7 +1594,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1658,7 +1730,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1681,7 +1753,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1717,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>
|
||||
|
||||
|
||||
|
||||
@@ -1751,7 +1823,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1774,7 +1846,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1810,7 +1882,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
||||
<span class="param-type">this</span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -1838,13 +1910,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: EtapiToken</h1>
|
||||
<h1 class="page-title">Class: BEtapiToken</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<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.
|
||||
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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ from tokenHash and token.</div>
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
||||
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -409,7 +409,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -477,7 +477,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -545,7 +545,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -613,7 +613,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -671,7 +671,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -694,7 +694,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -760,7 +760,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -783,7 +783,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -849,7 +849,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -872,7 +872,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -938,7 +938,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -961,7 +961,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1027,7 +1027,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1050,7 +1050,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1116,7 +1116,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1139,7 +1139,7 @@ from tokenHash and token.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1275,7 +1275,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1298,7 +1298,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1391,7 +1391,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1427,7 +1427,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
||||
<span class="param-type">this</span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -1455,13 +1455,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: NoteRevision</h1>
|
||||
<h1 class="page-title">Class: BNoteRevision</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<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.
|
||||
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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
||||
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -336,7 +336,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -472,7 +472,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -540,7 +540,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -608,7 +608,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -676,7 +676,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -744,7 +744,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -812,7 +812,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -880,7 +880,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -948,7 +948,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1016,7 +1016,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1074,7 +1074,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1097,7 +1097,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1163,7 +1163,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1186,7 +1186,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1252,7 +1252,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1275,7 +1275,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1341,7 +1341,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1364,7 +1364,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1448,7 +1448,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1550,7 +1550,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1634,7 +1634,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1657,7 +1657,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1723,7 +1723,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1746,7 +1746,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1830,7 +1830,7 @@ It's used for seamless note versioning.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1988,7 +1988,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -2011,7 +2011,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -2104,7 +2104,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -2140,7 +2140,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
||||
<span class="param-type">this</span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -2168,13 +2168,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: Option</h1>
|
||||
<h1 class="page-title">Class: BOption</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
||||
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -471,7 +471,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -529,7 +529,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -618,7 +618,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -641,7 +641,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -707,7 +707,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -730,7 +730,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -796,7 +796,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -819,7 +819,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -885,7 +885,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -908,7 +908,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -974,7 +974,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -997,7 +997,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1133,7 +1133,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1156,7 +1156,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1249,7 +1249,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1285,7 +1285,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
||||
<span class="param-type">this</span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -1313,13 +1313,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: RecentNote</h1>
|
||||
<h1 class="page-title">Class: BRecentNote</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
|
||||
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -484,7 +484,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -550,7 +550,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -573,7 +573,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -639,7 +639,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -662,7 +662,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -728,7 +728,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -751,7 +751,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -817,7 +817,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -840,7 +840,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -906,7 +906,7 @@
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -929,7 +929,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1065,7 +1065,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-overrides">Overrides:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1088,7 +1088,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1181,7 +1181,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1217,7 +1217,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="AbstractEntity.html">AbstractEntity</a></span>
|
||||
<span class="param-type">this</span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -1245,13 +1245,13 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<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.
|
||||
*/
|
||||
class AbstractEntity {
|
||||
class AbstractBeccaEntity {
|
||||
/** @protected */
|
||||
beforeSaving() {
|
||||
this.generateIdIfNecessary();
|
||||
@@ -59,7 +59,7 @@ class AbstractEntity {
|
||||
let contentToHash = "";
|
||||
|
||||
for (const propertyName of this.constructor.hashedProperties) {
|
||||
contentToHash += "|" + this[propertyName];
|
||||
contentToHash += `|${this[propertyName]}`;
|
||||
}
|
||||
|
||||
if (isDeleted) {
|
||||
@@ -74,7 +74,10 @@ class AbstractEntity {
|
||||
return this.utcDateModified || this.utcDateCreated;
|
||||
}
|
||||
|
||||
/** @protected */
|
||||
/**
|
||||
* @protected
|
||||
* @returns {Becca}
|
||||
*/
|
||||
get becca() {
|
||||
if (!becca) {
|
||||
becca = require('../becca');
|
||||
@@ -103,16 +106,16 @@ class AbstractEntity {
|
||||
/**
|
||||
* 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 primaryKeyName = this.constructor.primaryKeyName;
|
||||
|
||||
const isNewEntity = !this[primaryKeyName];
|
||||
|
||||
if (this.beforeSaving) {
|
||||
this.beforeSaving();
|
||||
this.beforeSaving(opts);
|
||||
}
|
||||
|
||||
const pojo = this.getPojoToSave();
|
||||
@@ -192,7 +195,7 @@ class AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AbstractEntity;
|
||||
module.exports = AbstractBeccaEntity;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -203,13 +206,13 @@ module.exports = AbstractEntity;
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Source: becca/entities/attribute.js</h1>
|
||||
<h1 class="page-title">Source: becca/entities/battribute.js</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,19 +28,20 @@
|
||||
<article>
|
||||
<pre class="prettyprint source linenums"><code>"use strict";
|
||||
|
||||
const Note = require('./note');
|
||||
const AbstractEntity = require("./abstract_entity");
|
||||
const BNote = require('./bnote');
|
||||
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||
const sql = require("../../services/sql");
|
||||
const dateUtils = require("../../services/date_utils");
|
||||
const promotedAttributeDefinitionParser = require("../../services/promoted_attribute_definition_parser");
|
||||
const {sanitizeAttributeName} = require("../../services/sanitize_attribute_name");
|
||||
|
||||
/**
|
||||
* Attribute is an abstract concept which has two real uses - label (key - value pair)
|
||||
* 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 primaryKeyName() { return "attributeId"; }
|
||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable"]; }
|
||||
@@ -90,7 +91,6 @@ class Attribute extends AbstractEntity {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
init() {
|
||||
if (this.attributeId) {
|
||||
this.becca.attributes[this.attributeId] = this;
|
||||
@@ -98,7 +98,7 @@ class Attribute extends AbstractEntity {
|
||||
|
||||
if (!(this.noteId in this.becca.notes)) {
|
||||
// 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);
|
||||
@@ -114,9 +114,23 @@ class Attribute extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
validate() {
|
||||
if (!["label", "relation"].includes(this.type)) {
|
||||
throw new Error(`Invalid attribute type '${this.type}' in attribute '${this.attributeId}' of note '${this.noteId}'`);
|
||||
}
|
||||
|
||||
if (!this.name?.trim()) {
|
||||
throw new Error(`Invalid empty name in attribute '${this.attributeId}' of note '${this.noteId}'`);
|
||||
}
|
||||
|
||||
if (this.type === 'relation' && !(this.value in this.becca.notes)) {
|
||||
throw new Error(`Cannot save relation '${this.name}' of note '${this.noteId}' since it target not existing note '${this.value}'.`);
|
||||
}
|
||||
}
|
||||
|
||||
get isAffectingSubtree() {
|
||||
return this.isInheritable
|
||||
|| (this.type === 'relation' && this.name === 'template');
|
||||
|| (this.type === 'relation' && ['template', 'inherit'].includes(this.name));
|
||||
}
|
||||
|
||||
get targetNoteId() { // alias
|
||||
@@ -138,14 +152,20 @@ class Attribute extends AbstractEntity {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Note|null}
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
getNote() {
|
||||
return this.becca.getNote(this.noteId);
|
||||
const note = this.becca.getNote(this.noteId);
|
||||
|
||||
if (!note) {
|
||||
throw new Error(`Note '${this.noteId}' of attribute '${this.attributeId}', type '${this.type}', name '${this.name}' does not exist.`);
|
||||
}
|
||||
|
||||
return note;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Note|null}
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
getTargetNote() {
|
||||
if (this.type !== 'relation') {
|
||||
@@ -160,7 +180,7 @@ class Attribute extends AbstractEntity {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {boolean}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isDefinition() {
|
||||
return this.type === 'label' && (this.name.startsWith('label:') || this.name.startsWith('relation:'));
|
||||
@@ -184,12 +204,14 @@ class Attribute extends AbstractEntity {
|
||||
return !(this.attributeId in this.becca.attributes);
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
if (!this.value) {
|
||||
if (this.type === 'relation') {
|
||||
throw new Error(`Cannot save relation ${this.name} since it does not target any note.`);
|
||||
}
|
||||
beforeSaving(opts = {}) {
|
||||
if (!opts.skipValidation) {
|
||||
this.validate();
|
||||
}
|
||||
|
||||
this.name = sanitizeAttributeName(this.name);
|
||||
|
||||
if (!this.value) {
|
||||
// null value isn't allowed
|
||||
this.value = "";
|
||||
}
|
||||
@@ -225,7 +247,7 @@ class Attribute extends AbstractEntity {
|
||||
}
|
||||
|
||||
createClone(type, name, value, isInheritable) {
|
||||
return new Attribute({
|
||||
return new BAttribute({
|
||||
noteId: this.noteId,
|
||||
type: type,
|
||||
name: name,
|
||||
@@ -237,7 +259,7 @@ class Attribute extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Attribute;
|
||||
module.exports = BAttribute;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -248,13 +270,13 @@ module.exports = Attribute;
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Source: becca/entities/branch.js</h1>
|
||||
<h1 class="page-title">Source: becca/entities/bbranch.js</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,11 +28,10 @@
|
||||
<article>
|
||||
<pre class="prettyprint source linenums"><code>"use strict";
|
||||
|
||||
const Note = require('./note');
|
||||
const AbstractEntity = require("./abstract_entity");
|
||||
const sql = require("../../services/sql");
|
||||
const BNote = require('./bnote');
|
||||
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||
const dateUtils = require("../../services/date_utils");
|
||||
const utils = require("../../services/utils.js");
|
||||
const utils = require("../../services/utils");
|
||||
const TaskContext = require("../../services/task_context");
|
||||
const cls = require("../../services/cls");
|
||||
const log = require("../../services/log");
|
||||
@@ -41,9 +40,12 @@ const log = require("../../services/log");
|
||||
* Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
||||
* parents.
|
||||
*
|
||||
* @extends AbstractEntity
|
||||
* 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.
|
||||
*
|
||||
* @extends AbstractBeccaEntity
|
||||
*/
|
||||
class Branch extends AbstractEntity {
|
||||
class BBranch extends AbstractBeccaEntity {
|
||||
static get entityName() { return "branches"; }
|
||||
static get primaryKeyName() { return "branchId"; }
|
||||
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
|
||||
@@ -79,7 +81,7 @@ class Branch extends AbstractEntity {
|
||||
this.noteId = noteId;
|
||||
/** @type {string} */
|
||||
this.parentNoteId = parentNoteId;
|
||||
/** @type {string} */
|
||||
/** @type {string|null} */
|
||||
this.prefix = prefix;
|
||||
/** @type {int} */
|
||||
this.notePosition = notePosition;
|
||||
@@ -104,7 +106,7 @@ class Branch extends AbstractEntity {
|
||||
childNote.parentBranches.push(this);
|
||||
}
|
||||
|
||||
if (this.branchId === 'root') {
|
||||
if (this.noteId === 'root') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,11 +121,11 @@ class Branch extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {Note} */
|
||||
/** @returns {BNote} */
|
||||
get childNote() {
|
||||
if (!(this.noteId in this.becca.notes)) {
|
||||
// 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];
|
||||
@@ -133,11 +135,11 @@ class Branch extends AbstractEntity {
|
||||
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() {
|
||||
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
|
||||
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];
|
||||
@@ -147,13 +149,26 @@ class Branch extends AbstractEntity {
|
||||
return !(this.branchId in this.becca.branches);
|
||||
}
|
||||
|
||||
/**
|
||||
* Branch is weak when its existence should not hinder deletion of its note.
|
||||
* As a result, note with only weak branches should be immediately deleted.
|
||||
* An example is shared or bookmarked clones - they are created automatically and exist for technical reasons,
|
||||
* not as user-intended actions. From user perspective, they don't count as real clones and for the purpose
|
||||
* of deletion should not act as a clone.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
get isWeak() {
|
||||
return ['_share', '_lbBookmarks'].includes(this.parentNoteId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a branch. If this is a last note's branch, delete the note as well.
|
||||
*
|
||||
* @param {string} [deleteId] - optional delete identified
|
||||
* @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) {
|
||||
if (!deleteId) {
|
||||
@@ -178,8 +193,7 @@ class Branch extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.branchId === 'root'
|
||||
|| this.noteId === 'root'
|
||||
if (this.noteId === 'root'
|
||||
|| this.noteId === cls.getHoistedNoteId()) {
|
||||
|
||||
throw new Error("Can't delete root or hoisted branch/note");
|
||||
@@ -187,20 +201,22 @@ class Branch extends AbstractEntity {
|
||||
|
||||
this.markAsDeleted(deleteId);
|
||||
|
||||
const notDeletedBranches = note.getParentBranches();
|
||||
const notDeletedBranches = note.getStrongParentBranches();
|
||||
|
||||
if (notDeletedBranches.length === 0) {
|
||||
for (const weakBranch of note.getParentBranches()) {
|
||||
weakBranch.markAsDeleted(deleteId);
|
||||
}
|
||||
|
||||
for (const childBranch of note.getChildBranches()) {
|
||||
childBranch.deleteBranch(deleteId, taskContext);
|
||||
}
|
||||
|
||||
// first delete children and then parent - this will show up better in recent changes
|
||||
|
||||
log.info("Deleting note " + note.noteId);
|
||||
log.info(`Deleting note ${note.noteId}`);
|
||||
|
||||
// marking note as deleted as a signal to event handlers that the note is being deleted
|
||||
// (isDeleted is being checked against becca)
|
||||
delete this.becca.notes[note.noteId];
|
||||
this.becca.notes[note.noteId].isBeingDeleted = true;
|
||||
|
||||
for (const attribute of note.getOwnedAttributes()) {
|
||||
attribute.markAsDeleted(deleteId);
|
||||
@@ -220,16 +236,34 @@ class Branch extends AbstractEntity {
|
||||
}
|
||||
|
||||
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) {
|
||||
// TODO finding new position can be refactored into becca
|
||||
const maxNotePos = sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
|
||||
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 10;
|
||||
let maxNotePos = 0;
|
||||
|
||||
for (const childBranch of this.parentNote.getChildBranches()) {
|
||||
if (maxNotePos < childBranch.notePosition
|
||||
&& childBranch.noteId !== '_hidden' // hidden has very large notePosition to always stay last
|
||||
) {
|
||||
maxNotePos = childBranch.notePosition;
|
||||
}
|
||||
}
|
||||
|
||||
this.notePosition = maxNotePos + 10;
|
||||
}
|
||||
|
||||
if (!this.isExpanded) {
|
||||
this.isExpanded = false;
|
||||
}
|
||||
|
||||
if (!this.prefix?.trim()) {
|
||||
this.prefix = null;
|
||||
}
|
||||
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
|
||||
super.beforeSaving();
|
||||
@@ -251,17 +285,24 @@ class Branch extends AbstractEntity {
|
||||
}
|
||||
|
||||
createClone(parentNoteId, notePosition) {
|
||||
return new Branch({
|
||||
noteId: this.noteId,
|
||||
parentNoteId: parentNoteId,
|
||||
notePosition: notePosition,
|
||||
prefix: this.prefix,
|
||||
isExpanded: this.isExpanded
|
||||
});
|
||||
const existingBranch = this.becca.getBranchFromChildAndParent(this.noteId, parentNoteId);
|
||||
|
||||
if (existingBranch) {
|
||||
existingBranch.notePosition = notePosition;
|
||||
return existingBranch;
|
||||
} else {
|
||||
return new BBranch({
|
||||
noteId: this.noteId,
|
||||
parentNoteId: parentNoteId,
|
||||
notePosition: notePosition,
|
||||
prefix: this.prefix,
|
||||
isExpanded: this.isExpanded
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Branch;
|
||||
module.exports = BBranch;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -272,13 +313,13 @@ module.exports = Branch;
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<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";
|
||||
|
||||
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.
|
||||
@@ -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
|
||||
* from tokenHash and token.
|
||||
*
|
||||
* @extends AbstractEntity
|
||||
* @extends AbstractBeccaEntity
|
||||
*/
|
||||
class EtapiToken extends AbstractEntity {
|
||||
class BEtapiToken extends AbstractBeccaEntity {
|
||||
static get entityName() { return "etapi_tokens"; }
|
||||
static get primaryKeyName() { return "etapiTokenId"; }
|
||||
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>
|
||||
</article>
|
||||
</section>
|
||||
@@ -114,13 +114,13 @@ module.exports = EtapiToken;
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Source: becca/entities/note.js</h1>
|
||||
<h1 class="page-title">Source: becca/entities/bnote.js</h1>
|
||||
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@ const sql = require('../../services/sql');
|
||||
const utils = require('../../services/utils');
|
||||
const dateUtils = require('../../services/date_utils');
|
||||
const entityChangesService = require('../../services/entity_changes');
|
||||
const AbstractEntity = require("./abstract_entity");
|
||||
const NoteRevision = require("./note_revision");
|
||||
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||
const BNoteRevision = require("./bnote_revision");
|
||||
const TaskContext = require("../../services/task_context");
|
||||
const dayjs = require("dayjs");
|
||||
const utc = require('dayjs/plugin/utc');
|
||||
const searchService = require("../../services/search/services/search.js");
|
||||
dayjs.extend(utc)
|
||||
const eventService = require("../../services/events");
|
||||
dayjs.extend(utc);
|
||||
|
||||
const LABEL = 'label';
|
||||
const RELATION = 'relation';
|
||||
@@ -48,9 +48,9 @@ const RELATION = 'relation';
|
||||
/**
|
||||
* 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 primaryKeyName() { return "noteId"; }
|
||||
static get hashedProperties() { return ["noteId", "title", "isProtected", "type", "mime"]; }
|
||||
@@ -101,6 +101,8 @@ class Note extends AbstractEntity {
|
||||
this.utcDateCreated = utcDateCreated || dateUtils.utcNowDateTime();
|
||||
/** @type {string} */
|
||||
this.utcDateModified = utcDateModified;
|
||||
/** @type {boolean} - set during the deletion operation, before it is completed (removed from becca completely) */
|
||||
this.isBeingDeleted = false;
|
||||
|
||||
// ------ Derived attributes ------
|
||||
|
||||
@@ -116,33 +118,33 @@ class Note extends AbstractEntity {
|
||||
}
|
||||
|
||||
init() {
|
||||
/** @type {Branch[]}
|
||||
/** @type {BBranch[]}
|
||||
* @private */
|
||||
this.parentBranches = [];
|
||||
/** @type {Note[]}
|
||||
/** @type {BNote[]}
|
||||
* @private */
|
||||
this.parents = [];
|
||||
/** @type {Note[]}
|
||||
/** @type {BNote[]}
|
||||
* @private*/
|
||||
this.children = [];
|
||||
/** @type {Attribute[]}
|
||||
/** @type {BAttribute[]}
|
||||
* @private */
|
||||
this.ownedAttributes = [];
|
||||
|
||||
/** @type {Attribute[]|null}
|
||||
/** @type {BAttribute[]|null}
|
||||
* @private */
|
||||
this.__attributeCache = null;
|
||||
/** @type {Attribute[]|null}
|
||||
/** @type {BAttribute[]|null}
|
||||
* @private*/
|
||||
this.inheritableAttributeCache = null;
|
||||
|
||||
/** @type {Attribute[]}
|
||||
/** @type {BAttribute[]}
|
||||
* @private*/
|
||||
this.targetRelations = [];
|
||||
|
||||
this.becca.addNote(this.noteId, this);
|
||||
|
||||
/** @type {Note[]|null}
|
||||
/** @type {BNote[]|null}
|
||||
* @private */
|
||||
this.ancestorCache = null;
|
||||
|
||||
@@ -178,25 +180,34 @@ class Note extends AbstractEntity {
|
||||
return this.isContentAvailable() ? this.title : '[protected]';
|
||||
}
|
||||
|
||||
/** @returns {Branch[]} */
|
||||
/** @returns {BBranch[]} */
|
||||
getParentBranches() {
|
||||
return this.parentBranches;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Branch[]}
|
||||
* Returns <i>strong</i> (as opposed to <i>weak</i>) parent branches. See isWeak for details.
|
||||
*
|
||||
* @returns {BBranch[]}
|
||||
*/
|
||||
getStrongParentBranches() {
|
||||
return this.getParentBranches().filter(branch => !branch.isWeak);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {BBranch[]}
|
||||
* @deprecated use getParentBranches() instead
|
||||
*/
|
||||
getBranches() {
|
||||
return this.parentBranches;
|
||||
}
|
||||
|
||||
/** @returns {Note[]} */
|
||||
/** @returns {BNote[]} */
|
||||
getParentNotes() {
|
||||
return this.parents;
|
||||
}
|
||||
|
||||
/** @returns {Note[]} */
|
||||
/** @returns {BNote[]} */
|
||||
getChildNotes() {
|
||||
return this.children;
|
||||
}
|
||||
@@ -206,16 +217,16 @@ class Note extends AbstractEntity {
|
||||
return this.children && this.children.length > 0;
|
||||
}
|
||||
|
||||
/** @returns {Branch[]} */
|
||||
/** @returns {BBranch[]} */
|
||||
getChildBranches() {
|
||||
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
|
||||
* 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)
|
||||
* - 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)
|
||||
*/
|
||||
@@ -229,7 +240,7 @@ class Note extends AbstractEntity {
|
||||
return undefined;
|
||||
}
|
||||
else {
|
||||
throw new Error("Cannot find note content for noteId=" + this.noteId);
|
||||
throw new Error(`Cannot find note content for noteId=${this.noteId}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +333,7 @@ class Note extends AbstractEntity {
|
||||
|
||||
sql.upsert("note_contents", "noteId", pojo);
|
||||
|
||||
const hash = utils.hash(this.noteId + "|" + pojo.content.toString());
|
||||
const hash = utils.hash(`${this.noteId}|${pojo.content.toString()}`);
|
||||
|
||||
entityChangesService.addEntityChange({
|
||||
entityName: 'note_contents',
|
||||
@@ -332,6 +343,11 @@ class Note extends AbstractEntity {
|
||||
utcDateChanged: pojo.utcDateModified,
|
||||
isSynced: true
|
||||
});
|
||||
|
||||
eventService.emit(eventService.ENTITY_CHANGED, {
|
||||
entityName: 'note_contents',
|
||||
entity: this
|
||||
});
|
||||
}
|
||||
|
||||
setJsonContent(content) {
|
||||
@@ -350,7 +366,7 @@ class Note extends AbstractEntity {
|
||||
|
||||
/** @returns {boolean} true if this note is JavaScript (code or attachment) */
|
||||
isJavaScript() {
|
||||
return (this.type === "code" || this.type === "file")
|
||||
return (this.type === "code" || this.type === "file" || this.type === 'launcher')
|
||||
&& (this.mime.startsWith("application/javascript")
|
||||
|| this.mime === "application/x-javascript"
|
||||
|| this.mime === "text/javascript");
|
||||
@@ -362,6 +378,12 @@ class Note extends AbstractEntity {
|
||||
&& 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) */
|
||||
isStringNote() {
|
||||
return utils.isStringNote(this.type, this.mime);
|
||||
@@ -387,13 +409,14 @@ class Note extends AbstractEntity {
|
||||
/**
|
||||
* @param {string} [type] - (optional) attribute type to filter
|
||||
* @param {string} [name] - (optional) attribute name to filter
|
||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
||||
* @returns {BAttribute[]} all note's attributes, including inherited ones
|
||||
*/
|
||||
getAttributes(type, name) {
|
||||
this.__getAttributes([]);
|
||||
this.__validateTypeName(type, name);
|
||||
this.__ensureAttributeCacheIsAvailable();
|
||||
|
||||
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) {
|
||||
return this.__attributeCache.filter(attr => attr.type === type);
|
||||
@@ -402,7 +425,15 @@ class Note extends AbstractEntity {
|
||||
return this.__attributeCache.filter(attr => attr.name === name);
|
||||
}
|
||||
else {
|
||||
return this.__attributeCache.slice();
|
||||
// a bit unsafe to return the original array, but defensive copy would be costly
|
||||
return this.__attributeCache;
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
__ensureAttributeCacheIsAvailable() {
|
||||
if (!this.__attributeCache) {
|
||||
this.__getAttributes([]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,7 +447,8 @@ class Note extends AbstractEntity {
|
||||
const parentAttributes = this.ownedAttributes.slice();
|
||||
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) {
|
||||
parentAttributes.push(...parentNote.__getInheritableAttributes(newPath));
|
||||
}
|
||||
@@ -425,7 +457,7 @@ class Note extends AbstractEntity {
|
||||
const templateAttributes = [];
|
||||
|
||||
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];
|
||||
|
||||
if (templateNote) {
|
||||
@@ -464,7 +496,7 @@ class Note extends AbstractEntity {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @returns {Attribute[]}
|
||||
* @returns {BAttribute[]}
|
||||
*/
|
||||
__getInheritableAttributes(path) {
|
||||
if (path.includes(this.noteId)) {
|
||||
@@ -478,17 +510,30 @@ class Note extends AbstractEntity {
|
||||
return this.inheritableAttributeCache;
|
||||
}
|
||||
|
||||
__validateTypeName(type, name) {
|
||||
if (type && type !== 'label' && type !== 'relation') {
|
||||
throw new Error(`Unrecognized attribute type '${type}'. Only 'label' and 'relation' are possible values.`);
|
||||
}
|
||||
|
||||
if (name) {
|
||||
const firstLetter = name.charAt(0);
|
||||
if (firstLetter === '#' || firstLetter === '~') {
|
||||
throw new Error(`Detect '#' or '~' in the attribute's name. In the API, attribute names should be set without these characters.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* @param name
|
||||
* @param [value]
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasAttribute(type, name, value) {
|
||||
hasAttribute(type, name, value = null) {
|
||||
return !!this.getAttributes().find(attr =>
|
||||
attr.type === type
|
||||
&& attr.name === name
|
||||
attr.name === name
|
||||
&& (value === undefined || value === null || attr.value === value)
|
||||
&& attr.type === type
|
||||
);
|
||||
}
|
||||
|
||||
@@ -497,13 +542,13 @@ class Note extends AbstractEntity {
|
||||
value = value ? value.toLowerCase() : null;
|
||||
|
||||
return this.getAttributes().find(
|
||||
attr => attr.type === type
|
||||
&& attr.name.toLowerCase() === name
|
||||
&& (!value || attr.value.toLowerCase() === value));
|
||||
attr => attr.name.toLowerCase() === name
|
||||
&& (!value || attr.value.toLowerCase() === value)
|
||||
&& attr.type === type);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -538,25 +583,25 @@ class Note extends AbstractEntity {
|
||||
|
||||
/**
|
||||
* @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); }
|
||||
|
||||
/**
|
||||
* @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); }
|
||||
|
||||
/**
|
||||
* @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); }
|
||||
|
||||
/**
|
||||
* @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); }
|
||||
|
||||
@@ -597,12 +642,12 @@ class Note extends AbstractEntity {
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||
* @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) {
|
||||
const attributes = this.getAttributes();
|
||||
|
||||
return attributes.find(attr => attr.type === type && attr.name === name);
|
||||
return attributes.find(attr => attr.name === name && attr.type === type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -629,7 +674,7 @@ class Note extends AbstractEntity {
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
return this.getAttributes(LABEL, name);
|
||||
@@ -645,7 +690,7 @@ class Note extends AbstractEntity {
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
return this.getOwnedAttributes(LABEL, name);
|
||||
@@ -661,7 +706,7 @@ class Note extends AbstractEntity {
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
return this.getAttributes(RELATION, name);
|
||||
@@ -669,29 +714,26 @@ class Note extends AbstractEntity {
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
return this.getOwnedAttributes(RELATION, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [type] - (optional) attribute type to filter
|
||||
* @param {string} [name] - (optional) attribute name to filter
|
||||
* @param {string} [value] - (optional) attribute value to filter
|
||||
* @returns {Attribute[]} note's "owned" attributes - excluding inherited ones
|
||||
* @param {string|null} [type] - (optional) attribute type to filter
|
||||
* @param {string|null} [name] - (optional) attribute name to filter
|
||||
* @param {string|null} [value] - (optional) attribute value to filter
|
||||
* @returns {BAttribute[]} note's "owned" attributes - excluding inherited ones
|
||||
*/
|
||||
getOwnedAttributes(type, name, value) {
|
||||
// it's a common mistake to include # or ~ into attribute name
|
||||
if (name && ["#", "~"].includes(name[0])) {
|
||||
name = name.substr(1);
|
||||
}
|
||||
getOwnedAttributes(type = null, name = null, value = null) {
|
||||
this.__validateTypeName(type, name);
|
||||
|
||||
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) {
|
||||
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) {
|
||||
return this.ownedAttributes.filter(attr => attr.type === type);
|
||||
@@ -705,11 +747,11 @@ 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()
|
||||
*/
|
||||
getOwnedAttribute(type, name, value) {
|
||||
getOwnedAttribute(type, name, value = null) {
|
||||
const attrs = this.getOwnedAttributes(type, name, value);
|
||||
|
||||
return attrs.length > 0 ? attrs[0] : null;
|
||||
@@ -719,47 +761,74 @@ class Note extends AbstractEntity {
|
||||
return this.hasAttribute('label', 'archived');
|
||||
}
|
||||
|
||||
hasInheritableOwnedArchivedLabel() {
|
||||
return !!this.ownedAttributes.find(attr => attr.type === 'label' && attr.name === 'archived' && attr.isInheritable);
|
||||
hasInheritableArchivedLabel() {
|
||||
for (const attr of this.getAttributes()) {
|
||||
if (attr.name === 'archived' && attr.type === LABEL && attr.isInheritable) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// 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
|
||||
// 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() {
|
||||
this.parentBranches.sort((a, b) =>
|
||||
a.branchId.startsWith('virt-') // FIXME: search virtual notes appear only in froca so this is probably not necessary
|
||||
|| a.parentNote?.hasInheritableOwnedArchivedLabel() ? 1 : -1);
|
||||
this.parentBranches.sort((a, b) => {
|
||||
if (a.parentNote?.isArchived) {
|
||||
return 1;
|
||||
} else if (a.parentNote?.isHiddenCompletely()) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
});
|
||||
|
||||
this.parents = this.parentBranches
|
||||
.map(branch => branch.parentNote)
|
||||
.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:
|
||||
* - fast searching
|
||||
* - 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() {
|
||||
if (!this.flatTextCache) {
|
||||
this.flatTextCache = this.noteId + ' ' + this.type + ' ' + this.mime + ' ';
|
||||
this.flatTextCache = `${this.noteId} ${this.type} ${this.mime} `;
|
||||
|
||||
for (const branch of this.parentBranches) {
|
||||
if (branch.prefix) {
|
||||
this.flatTextCache += branch.prefix + ' ';
|
||||
this.flatTextCache += `${branch.prefix} `;
|
||||
}
|
||||
}
|
||||
|
||||
this.flatTextCache += this.title + ' ';
|
||||
this.flatTextCache += `${this.title} `;
|
||||
|
||||
for (const attr of this.getAttributes()) {
|
||||
// it's best to use space as separator since spaces are filtered from the search string by the tokenization into words
|
||||
this.flatTextCache += (attr.type === 'label' ? '#' : '~') + attr.name;
|
||||
this.flatTextCache += `${attr.type === 'label' ? '#' : '~'}${attr.name}`;
|
||||
|
||||
if (attr.value) {
|
||||
this.flatTextCache += '=' + attr.value;
|
||||
this.flatTextCache += `=${attr.value}`;
|
||||
}
|
||||
|
||||
this.flatTextCache += ' ';
|
||||
@@ -795,7 +864,7 @@ class Note extends AbstractEntity {
|
||||
}
|
||||
|
||||
for (const targetRelation of this.targetRelations) {
|
||||
if (targetRelation.name === 'template') {
|
||||
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||
const note = targetRelation.note;
|
||||
|
||||
if (note) {
|
||||
@@ -813,7 +882,7 @@ class Note extends AbstractEntity {
|
||||
}
|
||||
|
||||
for (const targetRelation of this.targetRelations) {
|
||||
if (targetRelation.name === 'template') {
|
||||
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||
const note = targetRelation.note;
|
||||
|
||||
if (note) {
|
||||
@@ -833,16 +902,17 @@ class Note extends AbstractEntity {
|
||||
.filter(l => l.name.startsWith("relation:"));
|
||||
}
|
||||
|
||||
isTemplate() {
|
||||
return !!this.targetRelations.find(rel => rel.name === 'template');
|
||||
isInherited() {
|
||||
return !!this.targetRelations.find(rel => rel.name === 'template' || rel.name === 'inherit');
|
||||
}
|
||||
|
||||
/** @returns {Note[]} */
|
||||
/** @returns {BNote[]} */
|
||||
getSubtreeNotesIncludingTemplated() {
|
||||
const set = new Set();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -853,7 +923,7 @@ class Note extends AbstractEntity {
|
||||
}
|
||||
|
||||
for (const targetRelation of note.targetRelations) {
|
||||
if (targetRelation.name === 'template') {
|
||||
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||
const targetNote = targetRelation.note;
|
||||
|
||||
if (targetNote) {
|
||||
@@ -868,7 +938,7 @@ class Note extends AbstractEntity {
|
||||
return Array.from(set);
|
||||
}
|
||||
|
||||
/** @return {Note[]} */
|
||||
/** @returns {BNote[]} */
|
||||
getSearchResultNotes() {
|
||||
if (this.type !== 'search') {
|
||||
return [];
|
||||
@@ -890,9 +960,9 @@ 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, resolveSearch = false} = {}) {
|
||||
getSubtree({includeArchived = true, includeHidden = false, resolveSearch = false} = {}) {
|
||||
const noteSet = new Set();
|
||||
const relationships = []; // list of tuples parentNoteId -> childNoteId
|
||||
|
||||
@@ -908,8 +978,7 @@ class Note extends AbstractEntity {
|
||||
}
|
||||
|
||||
function addSubtreeNotesInner(note, parentNote = null) {
|
||||
// share can be removed after 0.57 since it will be put under hidden
|
||||
if (note.noteId === 'hidden' || note.noteId === 'share') {
|
||||
if (note.noteId === '_hidden' && !includeHidden) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -951,13 +1020,14 @@ class Note extends AbstractEntity {
|
||||
};
|
||||
}
|
||||
|
||||
/** @returns {String[]} */
|
||||
getSubtreeNoteIds({includeArchived = true, resolveSearch = false} = {}) {
|
||||
return this.getSubtree({includeArchived, resolveSearch})
|
||||
/** @returns {String[]} - includes the subtree node as well */
|
||||
getSubtreeNoteIds({includeArchived = true, includeHidden = false, resolveSearch = false} = {}) {
|
||||
return this.getSubtree({includeArchived, includeHidden, resolveSearch})
|
||||
.notes
|
||||
.map(note => note.noteId);
|
||||
}
|
||||
|
||||
/** @deprecated use getSubtreeNoteIds() instead */
|
||||
getDescendantNoteIds() {
|
||||
return this.getSubtreeNoteIds();
|
||||
}
|
||||
@@ -1007,10 +1077,10 @@ class Note extends AbstractEntity {
|
||||
}
|
||||
|
||||
get ownedAttributeCount() {
|
||||
return this.getAttributes().length;
|
||||
return this.getOwnedAttributes().length;
|
||||
}
|
||||
|
||||
/** @returns {Note[]} */
|
||||
/** @returns {BNote[]} */
|
||||
getAncestors() {
|
||||
if (!this.ancestorCache) {
|
||||
const noteIds = new Set();
|
||||
@@ -1047,17 +1117,21 @@ class Note extends AbstractEntity {
|
||||
return false;
|
||||
}
|
||||
|
||||
isInHiddenSubtree() {
|
||||
return this.noteId === '_hidden' || this.hasAncestor('_hidden');
|
||||
}
|
||||
|
||||
getTargetRelations() {
|
||||
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 */
|
||||
getTemplatedNotes() {
|
||||
getInheritingNotes() {
|
||||
const arr = [this];
|
||||
|
||||
for (const targetRelation of this.targetRelations) {
|
||||
if (targetRelation.name === 'template') {
|
||||
if (targetRelation.name === 'template' || targetRelation.name === 'inherit') {
|
||||
const note = targetRelation.note;
|
||||
|
||||
if (note) {
|
||||
@@ -1083,13 +1157,14 @@ class Note extends AbstractEntity {
|
||||
return minDistance;
|
||||
}
|
||||
|
||||
/** @returns {BNoteRevision[]} */
|
||||
getNoteRevisions() {
|
||||
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() {
|
||||
if (this.noteId === 'root') {
|
||||
@@ -1108,9 +1183,32 @@ class Note extends AbstractEntity {
|
||||
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
|
||||
* @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) {
|
||||
const notePaths = this.getAllNotePaths();
|
||||
@@ -1129,7 +1227,7 @@ class Note extends AbstractEntity {
|
||||
const attributes = this.getOwnedAttributes();
|
||||
const attr = attributes.find(attr => attr.type === type && attr.name === name);
|
||||
|
||||
value = value !== null && value !== undefined ? value.toString() : "";
|
||||
value = value?.toString() || "";
|
||||
|
||||
if (attr) {
|
||||
if (attr.value !== value) {
|
||||
@@ -1138,9 +1236,9 @@ class Note extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
else {
|
||||
const Attribute = require("./attribute");
|
||||
const BAttribute = require("./battribute");
|
||||
|
||||
new Attribute({
|
||||
new BAttribute({
|
||||
noteId: this.noteId,
|
||||
type: type,
|
||||
name: name,
|
||||
@@ -1173,13 +1271,14 @@ class Note extends AbstractEntity {
|
||||
* @param {string} type - attribute type (label / relation)
|
||||
* @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.
|
||||
*
|
||||
* @return {Attribute}
|
||||
* @param {boolean} [isInheritable=false]
|
||||
* @param {int} [position]
|
||||
* @returns {BAttribute}
|
||||
*/
|
||||
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,
|
||||
type: type,
|
||||
name: name,
|
||||
@@ -1194,8 +1293,8 @@ class Note extends AbstractEntity {
|
||||
*
|
||||
* @param {string} name - name of the label, not including the leading #
|
||||
* @param {string} [value] - text value of the label; optional
|
||||
*
|
||||
* @return {Attribute}
|
||||
* @param {boolean} [isInheritable=false]
|
||||
* @returns {BAttribute}
|
||||
*/
|
||||
addLabel(name, value = "", isInheritable = false) {
|
||||
return this.addAttribute(LABEL, name, value, isInheritable);
|
||||
@@ -1206,9 +1305,9 @@ class Note extends AbstractEntity {
|
||||
* returned.
|
||||
*
|
||||
* @param {string} name - name of the relation, not including the leading ~
|
||||
* @param {string} value - ID of the target note of the relation
|
||||
*
|
||||
* @return {Attribute}
|
||||
* @param {string} targetNoteId
|
||||
* @param {boolean} [isInheritable=false]
|
||||
* @returns {BAttribute}
|
||||
*/
|
||||
addRelation(name, targetNoteId, isInheritable = false) {
|
||||
return this.addAttribute(RELATION, name, targetNoteId, isInheritable);
|
||||
@@ -1346,12 +1445,20 @@ class Note extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
isLaunchBarConfig() {
|
||||
return this.type === 'launcher' || ['_lbRoot', '_lbAvailableLaunchers', '_lbVisibleLaunchers'].includes(this.noteId);
|
||||
}
|
||||
|
||||
isOptions() {
|
||||
return this.noteId.startsWith("_options");
|
||||
}
|
||||
|
||||
get isDeleted() {
|
||||
return !(this.noteId in this.becca.notes);
|
||||
return !(this.noteId in this.becca.notes) || this.isBeingDeleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {NoteRevision|null}
|
||||
* @returns {BNoteRevision|null}
|
||||
*/
|
||||
saveNoteRevision() {
|
||||
const content = this.getContent();
|
||||
@@ -1362,7 +1469,7 @@ class Note extends AbstractEntity {
|
||||
|
||||
const contentMetadata = this.getContentMetadata();
|
||||
|
||||
const noteRevision = new NoteRevision({
|
||||
const noteRevision = new BNoteRevision({
|
||||
noteId: this.noteId,
|
||||
// title and text should be decrypted now
|
||||
title: this.title,
|
||||
@@ -1426,7 +1533,7 @@ class Note extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Note;
|
||||
module.exports = BNote;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -1437,13 +1544,13 @@ module.exports = Note;
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<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 becca = require('../becca');
|
||||
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.
|
||||
* 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 primaryKeyName() { return "noteRevisionId"; }
|
||||
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
||||
@@ -109,7 +109,7 @@ class NoteRevision extends AbstractEntity {
|
||||
return undefined;
|
||||
}
|
||||
else {
|
||||
throw new Error("Cannot find note revision content for noteRevisionId=" + this.noteRevisionId);
|
||||
throw new Error(`Cannot find note revision content for noteRevisionId=${this.noteRevisionId}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ class NoteRevision extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
setContent(content, ignoreMissingProtectedSession = false) {
|
||||
setContent(content) {
|
||||
const pojo = {
|
||||
noteRevisionId: this.noteRevisionId,
|
||||
content: content,
|
||||
@@ -145,14 +145,14 @@ class NoteRevision extends AbstractEntity {
|
||||
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||
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.`);
|
||||
}
|
||||
}
|
||||
|
||||
sql.upsert("note_revision_contents", "noteRevisionId", pojo);
|
||||
|
||||
const hash = utils.hash(this.noteRevisionId + "|" + pojo.content.toString());
|
||||
const hash = utils.hash(`${this.noteRevisionId}|${pojo.content.toString()}`);
|
||||
|
||||
entityChangesService.addEntityChange({
|
||||
entityName: 'note_revision_contents',
|
||||
@@ -194,14 +194,12 @@ class NoteRevision extends AbstractEntity {
|
||||
utcDateLastEdited: this.utcDateLastEdited,
|
||||
utcDateCreated: this.utcDateCreated,
|
||||
utcDateModified: this.utcDateModified,
|
||||
content: this.content,
|
||||
contentLength: this.contentLength
|
||||
};
|
||||
}
|
||||
|
||||
getPojoToSave() {
|
||||
const pojo = this.getPojo();
|
||||
delete pojo.content; // not getting persisted
|
||||
delete pojo.contentLength; // not getting persisted
|
||||
|
||||
if (pojo.isProtected) {
|
||||
@@ -218,7 +216,7 @@ class NoteRevision extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = NoteRevision;
|
||||
module.exports = BNoteRevision;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -229,13 +227,13 @@ module.exports = NoteRevision;
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<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";
|
||||
|
||||
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.
|
||||
*
|
||||
* @extends AbstractEntity
|
||||
* @extends AbstractBeccaEntity
|
||||
*/
|
||||
class Option extends AbstractEntity {
|
||||
class BOption extends AbstractBeccaEntity {
|
||||
static get entityName() { return "options"; }
|
||||
static get primaryKeyName() { return "name"; }
|
||||
static get hashedProperties() { return ["name", "value"]; }
|
||||
@@ -72,7 +72,7 @@ class Option extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Option;
|
||||
module.exports = BOption;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -83,13 +83,13 @@ module.exports = Option;
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<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";
|
||||
|
||||
const dateUtils = require('../../services/date_utils');
|
||||
const AbstractEntity = require("./abstract_entity");
|
||||
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
||||
|
||||
/**
|
||||
* 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 primaryKeyName() { return "noteId"; }
|
||||
|
||||
@@ -60,7 +60,7 @@ class RecentNote extends AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RecentNote;
|
||||
module.exports = BRecentNote;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -71,13 +71,13 @@ module.exports = RecentNote;
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -50,13 +50,13 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line355">line 355</a>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line364">line 364</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -430,7 +430,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line346">line 346</a>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line355">line 355</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -632,7 +632,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line336">line 336</a>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line345">line 345</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -834,7 +834,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line312">line 312</a>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line321">line 321</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1036,7 +1036,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line323">line 323</a>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line332">line 332</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1238,7 +1238,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line302">line 302</a>
|
||||
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line311">line 311</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1294,13 +1294,13 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -44,37 +44,38 @@ const SearchContext = require("./search/search_context");
|
||||
const becca = require("../becca/becca");
|
||||
const ws = require("./ws");
|
||||
const SpacedUpdate = require("./spaced_update");
|
||||
const specialNotesService = require("./special_notes");
|
||||
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
|
||||
* @hideconstructor
|
||||
*/
|
||||
function BackendScriptApi(currentNote, apiParams) {
|
||||
/** @property {Note} note where script started executing */
|
||||
/** @property {BNote} note where script started executing */
|
||||
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;
|
||||
/** @property {Entity} entity whose event triggered this executions */
|
||||
/** @property {AbstractBeccaEntity} entity whose event triggered this executions */
|
||||
this.originEntity = apiParams.originEntity;
|
||||
|
||||
for (const key in apiParams) {
|
||||
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;
|
||||
/** @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;
|
||||
/** @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;
|
||||
|
||||
// DEPRECATED - use direct api.unescapeHtml
|
||||
this.utils = {
|
||||
unescapeHtml: utils.unescapeHtml
|
||||
};
|
||||
|
||||
/**
|
||||
* Instance name identifies particular Trilium instance. It can be useful for scripts
|
||||
* if some action needs to happen on only one specific instance.
|
||||
@@ -86,32 +87,32 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
/**
|
||||
* @method
|
||||
* @param {string} noteId
|
||||
* @returns {Note|null}
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
this.getNote = noteId => becca.getNote(noteId);
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @param {string} branchId
|
||||
* @returns {Branch|null}
|
||||
* @returns {BBranch|null}
|
||||
*/
|
||||
this.getBranch = branchId => becca.getBranch(branchId);
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @param {string} attributeId
|
||||
* @returns {Attribute|null}
|
||||
* @returns {BAttribute|null}
|
||||
*/
|
||||
this.getAttribute = attributeId => becca.getAttribute(attributeId);
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @param {string} query
|
||||
* @param {Object} [searchParams]
|
||||
* @returns {Note[]}
|
||||
* @returns {BNote[]}
|
||||
*/
|
||||
this.searchForNotes = (query, searchParams = {}) => {
|
||||
if (searchParams.includeArchivedNotes === undefined) {
|
||||
@@ -130,12 +131,12 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @param {string} query
|
||||
* @param {Object} [searchParams]
|
||||
* @returns {Note|null}
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
this.searchForNote = (query, searchParams = {}) => {
|
||||
const notes = this.searchForNotes(query, searchParams);
|
||||
@@ -149,7 +150,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @method
|
||||
* @param {string} name - attribute name
|
||||
* @param {string} [value] - attribute value
|
||||
* @returns {Note[]}
|
||||
* @returns {BNote[]}
|
||||
*/
|
||||
this.getNotesWithLabel = attributeService.getNotesWithLabel;
|
||||
|
||||
@@ -159,7 +160,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @method
|
||||
* @param {string} name - attribute name
|
||||
* @param {string} [value] - attribute value
|
||||
* @returns {Note|null}
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
this.getNoteWithLabel = attributeService.getNoteWithLabel;
|
||||
|
||||
@@ -196,20 +197,14 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
*/
|
||||
this.toggleNoteInParent = cloningService.toggleNoteInParent;
|
||||
|
||||
/**
|
||||
* @typedef {object} CreateNoteAttribute
|
||||
* @property {string} type - attribute type - label, relation etc.
|
||||
* @property {string} name - attribute name
|
||||
* @property {string} [value] - attribute value
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create text note. See also createNewNote() for more options.
|
||||
*
|
||||
* @method
|
||||
* @param {string} parentNoteId
|
||||
* @param {string} title
|
||||
* @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({
|
||||
parentNoteId,
|
||||
@@ -222,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
|
||||
* JSON MIME type. See also createNewNote() for more options.
|
||||
*
|
||||
* @method
|
||||
* @param {string} parentNoteId
|
||||
* @param {string} title
|
||||
* @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({
|
||||
parentNoteId,
|
||||
@@ -235,43 +231,23 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
mime: 'application/json'
|
||||
});
|
||||
|
||||
/**
|
||||
* @typedef {object} CreateNewNoteParams
|
||||
* @property {string} parentNoteId - MANDATORY
|
||||
* @property {string} title - MANDATORY
|
||||
* @property {string|buffer} content - MANDATORY
|
||||
* @property {string} type - text, code, file, image, search, book, relation-map, 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
|
||||
*
|
||||
* @param {CreateNewNoteParams} [params]
|
||||
* @returns {{note: Note, branch: Branch}} object contains newly created entities note and branch
|
||||
* @property {object} params
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* @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
|
||||
* @deprecated please use createTextNote() with similar API for simpler use cases or createNewNote() for more complex needs
|
||||
@@ -279,8 +255,16 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @param {string} parentNoteId - create new note under this parent
|
||||
* @param {string} title
|
||||
* @param {string} [content=""]
|
||||
* @param {CreateNoteExtraOptions} [extraOptions={}]
|
||||
* @returns {{note: Note, branch: Branch}} object contains newly created entities note and branch
|
||||
* @param {object} [extraOptions={}]
|
||||
* @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= {}) => {
|
||||
extraOptions.parentNoteId = parentNoteId;
|
||||
@@ -324,7 +308,9 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
/**
|
||||
* Log given message to trilium logs and log pane in UI
|
||||
*
|
||||
* @method
|
||||
* @param message
|
||||
* @returns {void}
|
||||
*/
|
||||
this.log = message => {
|
||||
log.info(message);
|
||||
@@ -351,7 +337,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* Returns root note of the calendar.
|
||||
*
|
||||
* @method
|
||||
* @returns {Note|null}
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
this.getRootCalendarNote = dateNoteService.getRootCalendarNote;
|
||||
|
||||
@@ -360,19 +346,8 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
*
|
||||
* @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}
|
||||
* @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}
|
||||
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
this.getDayNote = dateNoteService.getDayNote;
|
||||
|
||||
@@ -380,8 +355,8 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* Returns today's day note. If such note doesn't exist, it is created.
|
||||
*
|
||||
* @method
|
||||
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
|
||||
* @returns {Note|null}
|
||||
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
this.getTodayNote = dateNoteService.getTodayNote;
|
||||
|
||||
@@ -390,9 +365,10 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
*
|
||||
* @method
|
||||
* @param {string} date in YYYY-MM-DD format
|
||||
* @param {object} [options] - "startOfTheWeek" - either "monday" (default) or "sunday"
|
||||
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
|
||||
* @returns {Note|null}
|
||||
* @param {object} [options]
|
||||
* @param {string} [options.startOfTheWeek=monday] - either "monday" (default) or "sunday"
|
||||
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
this.getWeekNote = dateNoteService.getWeekNote;
|
||||
|
||||
@@ -401,8 +377,8 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
*
|
||||
* @method
|
||||
* @param {string} date in YYYY-MM format
|
||||
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
|
||||
* @returns {Note|null}
|
||||
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
this.getMonthNote = dateNoteService.getMonthNote;
|
||||
|
||||
@@ -411,16 +387,29 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
*
|
||||
* @method
|
||||
* @param {string} year in YYYY format
|
||||
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
|
||||
* @returns {Note|null}
|
||||
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
|
||||
* @returns {BNote|null}
|
||||
*/
|
||||
this.getYearNote = dateNoteService.getYearNote;
|
||||
|
||||
/**
|
||||
* Sort child notes of a given note.
|
||||
*
|
||||
* @method
|
||||
* @param {string} parentNoteId - this note's child notes will be sorted
|
||||
* @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.sortNotesByTitle = parentNoteId => treeService.sortNotes(parentNoteId);
|
||||
this.sortNotes = (parentNoteId, sortConfig = {}) => treeService.sortNotes(
|
||||
parentNoteId,
|
||||
sortConfig.sortBy || "title",
|
||||
!!sortConfig.reverse,
|
||||
!!sortConfig.foldersFirst
|
||||
);
|
||||
|
||||
/**
|
||||
* This method finds note by its noteId and prefix and either sets it to the given parentNoteId
|
||||
@@ -429,10 +418,11 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* This method looks similar to toggleNoteInParent() but differs because we're looking up branch by prefix.
|
||||
*
|
||||
* @method
|
||||
* @deprecated - this method is pretty confusing and serves specialized purpose only
|
||||
* @deprecated this method is pretty confusing and serves specialized purpose only
|
||||
* @param {string} noteId
|
||||
* @param {string} prefix
|
||||
* @param {string|null} parentNoteId
|
||||
* @returns {void}
|
||||
*/
|
||||
this.setNoteToParent = treeService.setNoteToParent;
|
||||
|
||||
@@ -476,19 +466,101 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @deprecated - this is now no-op since all the changes should be gracefully handled per widget
|
||||
*/
|
||||
this.refreshTree = () => {};
|
||||
|
||||
/**
|
||||
* @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
|
||||
* @returns {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
|
||||
*/
|
||||
this.getAppInfo = () => appInfo
|
||||
|
||||
/**
|
||||
* Creates a new launcher to the launchbar. If the launcher (id) already exists, it will be updated.
|
||||
*
|
||||
* @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)
|
||||
* * "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)
|
||||
* @property {string} opts.title
|
||||
* @property {boolean} [opts.isVisible=false] - if true, will be created in the "Visible launchers", otherwise in "Available launchers"
|
||||
* @property {string} [opts.icon] - name of the boxicon to be used (e.g. "bx-time")
|
||||
* @property {string} [opts.keyboardShortcut] - will activate the target note/script upon pressing, e.g. "ctrl+e"
|
||||
* @property {string} [opts.targetNoteId] - for type "note"
|
||||
* @property {string} [opts.scriptNoteId] - for type "script"
|
||||
* @property {string} [opts.widgetNoteId] - for type "customWidget"
|
||||
* @returns {{note: BNote}}
|
||||
*/
|
||||
this.createOrUpdateLauncher = opts => {
|
||||
if (!opts.id) { throw new Error("ID is a mandatory parameter for api.createOrUpdateLauncher(opts)"); }
|
||||
if (!opts.id.match(/[a-z0-9]{6,1000}/i)) { throw new Error(`ID must be an alphanumeric string at least 6 characters long.`); }
|
||||
if (!opts.type) { throw new Error("Launcher Type is a mandatory parameter for api.createOrUpdateLauncher(opts)"); }
|
||||
if (!["note", "script", "customWidget"].includes(opts.type)) { throw new Error(`Given launcher type '${opts.type}'`); }
|
||||
if (!opts.title?.trim()) { throw new Error("Title is a mandatory parameter for api.createOrUpdateLauncher(opts)"); }
|
||||
if (opts.type === 'note' && !opts.targetNoteId) { throw new Error("targetNoteId is mandatory for launchers of type 'note'"); }
|
||||
if (opts.type === 'script' && !opts.scriptNoteId) { throw new Error("scriptNoteId is mandatory for launchers of type 'script'"); }
|
||||
if (opts.type === 'customWidget' && !opts.widgetNoteId) { throw new Error("widgetNoteId is mandatory for launchers of type 'customWidget'"); }
|
||||
|
||||
const parentNoteId = !!opts.isVisible ? '_lbVisibleLaunchers' : '_lbAvailableLaunchers';
|
||||
const noteId = 'al_' + opts.id;
|
||||
|
||||
const launcherNote =
|
||||
becca.getNote(opts.id) ||
|
||||
specialNotesService.createLauncher({
|
||||
noteId: noteId,
|
||||
parentNoteId: parentNoteId,
|
||||
launcherType: opts.type,
|
||||
}).note;
|
||||
|
||||
if (launcherNote.title !== opts.title) {
|
||||
launcherNote.title = opts.title;
|
||||
launcherNote.save();
|
||||
}
|
||||
|
||||
if (launcherNote.getParentBranches().length === 1) {
|
||||
const branch = launcherNote.getParentBranches()[0];
|
||||
|
||||
if (branch.parentNoteId !== parentNoteId) {
|
||||
branchService.moveBranchToNote(branch, parentNoteId);
|
||||
}
|
||||
}
|
||||
|
||||
if (opts.type === 'note') {
|
||||
launcherNote.setRelation('target', opts.targetNoteId);
|
||||
} else if (opts.type === 'script') {
|
||||
launcherNote.setRelation('script', opts.scriptNoteId);
|
||||
} else if (opts.type === 'customWidget') {
|
||||
launcherNote.setRelation('widget', opts.widgetNoteId);
|
||||
} else {
|
||||
throw new Error(`Unrecognized launcher type '${opts.type}'`);
|
||||
}
|
||||
|
||||
if (opts.keyboardShortcut) {
|
||||
launcherNote.setLabel('keyboardShortcut', opts.keyboardShortcut);
|
||||
} else {
|
||||
launcherNote.removeLabel('keyboardShortcut');
|
||||
}
|
||||
|
||||
if (opts.icon) {
|
||||
launcherNote.setLabel('iconClass', `bx ${opts.icon}`);
|
||||
} else {
|
||||
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.
|
||||
*
|
||||
* @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 = {
|
||||
becca
|
||||
@@ -506,13 +578,13 @@ module.exports = BackendScriptApi;
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -56,14 +56,20 @@ const LOG_ALL_QUERIES = false;
|
||||
function insert(tableName, rec, replace = false) {
|
||||
const keys = Object.keys(rec);
|
||||
if (keys.length === 0) {
|
||||
log.error("Can't insert empty object into table " + tableName);
|
||||
log.error(`Can't insert empty object into table ${tableName}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const columns = keys.join(", ");
|
||||
const questionMarks = keys.map(p => "?").join(", ");
|
||||
|
||||
const query = "INSERT " + (replace ? "OR REPLACE" : "") + " INTO " + tableName + "(" + columns + ") VALUES (" + questionMarks + ")";
|
||||
const query = `INSERT
|
||||
${replace ? "OR REPLACE" : ""} INTO
|
||||
${tableName}
|
||||
(
|
||||
${columns}
|
||||
)
|
||||
VALUES (${questionMarks})`;
|
||||
|
||||
const res = execute(query, Object.values(rec));
|
||||
|
||||
@@ -77,13 +83,13 @@ function replace(tableName, rec) {
|
||||
function upsert(tableName, primaryKey, rec) {
|
||||
const keys = Object.keys(rec);
|
||||
if (keys.length === 0) {
|
||||
log.error("Can't upsert empty object into table " + tableName);
|
||||
log.error(`Can't upsert empty object into table ${tableName}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const columns = keys.join(", ");
|
||||
|
||||
const questionMarks = keys.map(colName => "@" + colName).join(", ");
|
||||
const questionMarks = keys.map(colName => `@${colName}`).join(", ");
|
||||
|
||||
const updateMarks = keys.map(colName => `${colName} = @${colName}`).join(", ");
|
||||
|
||||
@@ -278,6 +284,9 @@ function transactional(func) {
|
||||
require('../becca/becca_loader').load();
|
||||
}
|
||||
|
||||
// the maxEntityChangeId has been incremented during failed transaction, need to recalculate
|
||||
require('./entity_changes').recalculateMaxEntityChangeId();
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -300,7 +309,7 @@ function fillParamList(paramIds, truncate = true) {
|
||||
}
|
||||
|
||||
// doing it manually to avoid this showing up on the sloq query list
|
||||
const s = stmt(`INSERT INTO param_list VALUES ` + paramIds.map(paramId => `(?)`).join(','), paramIds);
|
||||
const s = stmt(`INSERT INTO param_list VALUES ${paramIds.map(paramId => `(?)`).join(',')}`, paramIds);
|
||||
|
||||
s.run(paramIds);
|
||||
}
|
||||
@@ -325,7 +334,7 @@ module.exports = {
|
||||
* @method
|
||||
* @param {string} query - SQL query with ? used as parameter placeholder
|
||||
* @param {object[]} [params] - array of params if needed
|
||||
* @return [object] - single value
|
||||
* @returns [object] - single value
|
||||
*/
|
||||
getValue,
|
||||
|
||||
@@ -335,7 +344,7 @@ module.exports = {
|
||||
* @method
|
||||
* @param {string} query - SQL query with ? used as parameter placeholder
|
||||
* @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,
|
||||
getRowOrNull,
|
||||
@@ -346,7 +355,7 @@ module.exports = {
|
||||
* @method
|
||||
* @param {string} query - SQL query with ? used as parameter placeholder
|
||||
* @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,
|
||||
getRawRows,
|
||||
@@ -359,7 +368,7 @@ module.exports = {
|
||||
* @method
|
||||
* @param {string} query - SQL query with ? used as parameter placeholder
|
||||
* @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,
|
||||
|
||||
@@ -369,7 +378,7 @@ module.exports = {
|
||||
* @method
|
||||
* @param {string} query - SQL query with ? used as parameter placeholder
|
||||
* @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,
|
||||
|
||||
@@ -398,13 +407,13 @@ module.exports = {
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: Attribute</h1>
|
||||
<h1 class="page-title">Class: FAttribute</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<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)
|
||||
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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#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>
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#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>
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#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>
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#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>
|
||||
|
||||
|
||||
@@ -466,7 +466,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#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>
|
||||
|
||||
|
||||
@@ -534,7 +534,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#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>
|
||||
|
||||
|
||||
@@ -602,7 +602,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line24">line 24</a>
|
||||
<a href="entities_fattribute.js.html">entities/fattribute.js</a>, <a href="entities_fattribute.js.html#line24">line 24</a>
|
||||
</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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -714,7 +714,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
||||
<span class="param-type"><a href="FNote.html">FNote</a></span>
|
||||
|
||||
|
||||
</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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -816,7 +816,7 @@ and relation (representing named relationship between source and target note)</d
|
||||
</dt>
|
||||
<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>
|
||||
@@ -844,13 +844,13 @@ and relation (representing named relationship between source and target note)</d
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: Branch</h1>
|
||||
<h1 class="page-title">Class: FBranch</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<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
|
||||
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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line17">line 17</a>
|
||||
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line17">line 17</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#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>
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#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>
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#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>
|
||||
|
||||
|
||||
@@ -470,7 +470,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line23">line 23</a>
|
||||
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line23">line 23</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -538,7 +538,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line21">line 21</a>
|
||||
<a href="entities_fbranch.js.html">entities/fbranch.js</a>, <a href="entities_fbranch.js.html#line21">line 21</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -606,7 +606,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -718,7 +718,7 @@ parents.</div>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
||||
<span class="param-type"><a href="FNote.html">FNote</a></span>
|
||||
|
||||
|
||||
</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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -820,7 +820,7 @@ parents.</div>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
||||
<span class="param-type"><a href="FNote.html">FNote</a></span>
|
||||
|
||||
|
||||
</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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -922,7 +922,7 @@ parents.</div>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
||||
<span class="param-type"><a href="FNote.html">FNote</a></span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -988,7 +988,7 @@ parents.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#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>
|
||||
|
||||
|
||||
@@ -1056,13 +1056,13 @@ parents.</div>
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: NoteComplement</h1>
|
||||
<h1 class="page-title">Class: FNoteComplement</h1>
|
||||
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
|
||||
<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>
|
||||
@@ -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>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#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>
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#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>
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line13">line 13</a>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -401,7 +401,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line16">line 16</a>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -469,7 +469,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line19">line 19</a>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -537,7 +537,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line22">line 22</a>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -605,7 +605,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line7">line 7</a>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -673,7 +673,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#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>
|
||||
|
||||
|
||||
@@ -741,7 +741,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#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>
|
||||
|
||||
|
||||
@@ -775,13 +775,13 @@
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<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)
|
||||
* and relation (representing named relationship between source and target note)
|
||||
*/
|
||||
class Attribute {
|
||||
class FAttribute {
|
||||
constructor(froca, row) {
|
||||
this.froca = froca;
|
||||
|
||||
@@ -56,12 +56,12 @@ class Attribute {
|
||||
this.isInheritable = !!row.isInheritable;
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
/** @returns {FNote} */
|
||||
getNote() {
|
||||
return this.froca.notes[this.noteId];
|
||||
}
|
||||
|
||||
/** @returns {Promise<NoteShort>} */
|
||||
/** @returns {Promise<FNote>} */
|
||||
async getTargetNote() {
|
||||
const targetNoteId = this.targetNoteId;
|
||||
|
||||
@@ -81,7 +81,7 @@ class Attribute {
|
||||
}
|
||||
|
||||
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() {
|
||||
@@ -104,7 +104,7 @@ class Attribute {
|
||||
}
|
||||
}
|
||||
|
||||
export default Attribute;
|
||||
export default FAttribute;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -115,13 +115,13 @@ export default Attribute;
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<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
|
||||
* parents.
|
||||
*/
|
||||
class Branch {
|
||||
class FBranch {
|
||||
constructor(froca, row) {
|
||||
this.froca = froca;
|
||||
|
||||
@@ -57,17 +57,17 @@ class Branch {
|
||||
this.fromSearchNote = !!row.fromSearchNote;
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
/** @returns {FNote} */
|
||||
async getNote() {
|
||||
return this.froca.getNote(this.noteId);
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
/** @returns {FNote} */
|
||||
getNoteFromCache() {
|
||||
return this.froca.getNoteFromCache(this.noteId);
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
/** @returns {FNote} */
|
||||
async getParentNote() {
|
||||
return this.froca.getNote(this.parentNoteId);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ class Branch {
|
||||
}
|
||||
|
||||
get toString() {
|
||||
return `Branch(branchId=${this.branchId})`;
|
||||
return `FBranch(branchId=${this.branchId})`;
|
||||
}
|
||||
|
||||
get pojo() {
|
||||
@@ -88,7 +88,7 @@ class Branch {
|
||||
}
|
||||
}
|
||||
|
||||
export default Branch;
|
||||
export default FBranch;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -99,13 +99,13 @@ export default Branch;
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Source: entities/note_short.js</h1>
|
||||
<h1 class="page-title">Source: entities/fnote.js</h1>
|
||||
|
||||
|
||||
|
||||
@@ -43,20 +43,18 @@ const NOTE_TYPE_ICONS = {
|
||||
"code": "bx bx-code",
|
||||
"render": "bx bx-extension",
|
||||
"search": "bx bx-file-find",
|
||||
"relation-map": "bx bx-map-alt",
|
||||
"relationMap": "bx bx-map-alt",
|
||||
"book": "bx bx-book",
|
||||
"note-map": "bx bx-map-alt",
|
||||
"noteMap": "bx bx-map-alt",
|
||||
"mermaid": "bx bx-selection",
|
||||
"canvas": "bx bx-pen",
|
||||
"web-view": "bx bx-globe-alt"
|
||||
"webView": "bx bx-globe-alt",
|
||||
"launcher": "bx bx-link",
|
||||
"doc": "bx bxs-file-doc",
|
||||
"contentWidget": "bx bxs-widget"
|
||||
};
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
class FNote {
|
||||
/**
|
||||
* @param {Froca} froca
|
||||
* @param {Object.<string, Object>} row
|
||||
@@ -143,8 +141,8 @@ class NoteShort {
|
||||
}
|
||||
|
||||
async getContent() {
|
||||
// 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);
|
||||
// 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}`);
|
||||
|
||||
return note.content;
|
||||
}
|
||||
@@ -178,7 +176,7 @@ class NoteShort {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Branch[]}
|
||||
* @returns {FBranch[]}
|
||||
*/
|
||||
getParentBranches() {
|
||||
const branchIds = Object.values(this.parentToBranch);
|
||||
@@ -187,7 +185,7 @@ class NoteShort {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Branch[]}
|
||||
* @returns {FBranch[]}
|
||||
* @deprecated use getParentBranches() instead
|
||||
*/
|
||||
getBranches() {
|
||||
@@ -199,7 +197,7 @@ class NoteShort {
|
||||
return this.children.length > 0;
|
||||
}
|
||||
|
||||
/** @returns {Branch[]} */
|
||||
/** @returns {FBranch[]} */
|
||||
getChildBranches() {
|
||||
// don't use Object.values() to guarantee order
|
||||
const branchIds = this.children.map(childNoteId => this.childToBranch[childNoteId]);
|
||||
@@ -212,7 +210,7 @@ class NoteShort {
|
||||
return this.parents;
|
||||
}
|
||||
|
||||
/** @returns {NoteShort[]} */
|
||||
/** @returns {FNote[]} */
|
||||
getParentNotes() {
|
||||
return this.froca.getNotesFromCache(this.parents);
|
||||
}
|
||||
@@ -229,7 +227,7 @@ class NoteShort {
|
||||
|
||||
const aNote = this.froca.getNoteFromCache([aNoteId]);
|
||||
|
||||
if (aNote.hasLabel('archived')) {
|
||||
if (aNote.isArchived || aNote.isHiddenCompletely()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -237,12 +235,16 @@ class NoteShort {
|
||||
});
|
||||
}
|
||||
|
||||
get isArchived() {
|
||||
return this.hasAttribute('label', 'archived');
|
||||
}
|
||||
|
||||
/** @returns {string[]} */
|
||||
getChildNoteIds() {
|
||||
return this.children;
|
||||
}
|
||||
|
||||
/** @returns {Promise<NoteShort[]>} */
|
||||
/** @returns {Promise<FNote[]>} */
|
||||
async getChildNotes() {
|
||||
return await this.froca.getNotes(this.children);
|
||||
}
|
||||
@@ -250,7 +252,7 @@ class NoteShort {
|
||||
/**
|
||||
* @param {string} [type] - (optional) attribute type to filter
|
||||
* @param {string} [name] - (optional) attribute name to filter
|
||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
||||
* @returns {FAttribute[]} all note's attributes, including inherited ones
|
||||
*/
|
||||
getOwnedAttributes(type, name) {
|
||||
const attrs = this.attributes
|
||||
@@ -263,7 +265,7 @@ class NoteShort {
|
||||
/**
|
||||
* @param {string} [type] - (optional) attribute type to filter
|
||||
* @param {string} [name] - (optional) attribute name to filter
|
||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
||||
* @returns {FAttribute[]} all note's attributes, including inherited ones
|
||||
*/
|
||||
getAttributes(type, name) {
|
||||
return this.__filterAttrs(this.__getCachedAttributes([]), type, name);
|
||||
@@ -280,7 +282,8 @@ class NoteShort {
|
||||
const newPath = [...path, this.noteId];
|
||||
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()) {
|
||||
// these virtual parent-child relationships are also loaded into froca
|
||||
if (parentNote.type !== 'search') {
|
||||
@@ -289,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];
|
||||
|
||||
if (templateNote && templateNote.noteId !== this.noteId) {
|
||||
@@ -317,7 +320,7 @@ class NoteShort {
|
||||
}
|
||||
|
||||
isRoot() {
|
||||
return this.noted
|
||||
return this.noteId === 'root';
|
||||
}
|
||||
|
||||
getAllNotePaths(encounteredNoteIds = null) {
|
||||
@@ -367,9 +370,9 @@ class NoteShort {
|
||||
const notePaths = this.getAllNotePaths().map(path => ({
|
||||
notePath: path,
|
||||
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'),
|
||||
isHidden: path.includes("hidden")
|
||||
isHidden: path.includes('_hidden')
|
||||
}));
|
||||
|
||||
notePaths.sort((a, b) => {
|
||||
@@ -379,6 +382,8 @@ class NoteShort {
|
||||
return a.isSearch ? 1 : -1;
|
||||
} else if (a.isArchived !== b.isArchived) {
|
||||
return a.isArchived ? 1 : -1;
|
||||
} else if (a.isHidden !== b.isHidden) {
|
||||
return a.isHidden ? 1 : -1;
|
||||
} else {
|
||||
return a.notePath.length - b.notePath.length;
|
||||
}
|
||||
@@ -387,11 +392,36 @@ class NoteShort {
|
||||
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) {
|
||||
this.__validateTypeName(type, name);
|
||||
|
||||
if (!type && !name) {
|
||||
return attributes;
|
||||
} 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) {
|
||||
return attributes.filter(attr => attr.type === type);
|
||||
} else if (name) {
|
||||
@@ -405,9 +435,22 @@ class NoteShort {
|
||||
return attrs.filter(attr => attr.isInheritable);
|
||||
}
|
||||
|
||||
__validateTypeName(type, name) {
|
||||
if (type && type !== 'label' && type !== 'relation') {
|
||||
throw new Error(`Unrecognized attribute type '${type}'. Only 'label' and 'relation' are possible values.`);
|
||||
}
|
||||
|
||||
if (name) {
|
||||
const firstLetter = name.charAt(0);
|
||||
if (firstLetter === '#' || firstLetter === '~') {
|
||||
throw new Error(`Detect '#' or '~' in the attribute's name. In the API, attribute names should be set without these characters.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
return this.getOwnedAttributes(LABEL, name);
|
||||
@@ -415,7 +458,7 @@ class NoteShort {
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
return this.getAttributes(LABEL, name);
|
||||
@@ -434,7 +477,7 @@ class NoteShort {
|
||||
else if (this.noteId === 'root') {
|
||||
return "bx bx-chevrons-right";
|
||||
}
|
||||
if (this.noteId === 'share') {
|
||||
if (this.noteId === '_share') {
|
||||
return "bx bx-share-alt";
|
||||
}
|
||||
else if (this.type === 'text') {
|
||||
@@ -467,7 +510,7 @@ class NoteShort {
|
||||
let childBranches = this.getChildBranches();
|
||||
|
||||
if (!childBranches) {
|
||||
ws.logError(`No children for ${parentNote}. This shouldn't happen.`);
|
||||
ws.logError(`No children for '${this.noteId}'. This shouldn't happen.`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -488,7 +531,7 @@ class NoteShort {
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
return this.getOwnedAttributes(RELATION, name);
|
||||
@@ -496,7 +539,7 @@ class NoteShort {
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
return this.getAttributes(RELATION, name);
|
||||
@@ -523,23 +566,23 @@ class NoteShort {
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||
* @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) {
|
||||
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} 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) {
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -590,25 +633,25 @@ class NoteShort {
|
||||
|
||||
/**
|
||||
* @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); }
|
||||
|
||||
/**
|
||||
* @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); }
|
||||
|
||||
/**
|
||||
* @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); }
|
||||
|
||||
/**
|
||||
* @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); }
|
||||
|
||||
@@ -638,7 +681,7 @@ class NoteShort {
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
const targets = await this.getRelationTargets(name);
|
||||
@@ -648,7 +691,7 @@ class NoteShort {
|
||||
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Promise<NoteShort[]>}
|
||||
* @returns {Promise<FNote[]>}
|
||||
*/
|
||||
async getRelationTargets(name) {
|
||||
const relations = this.getRelations(name);
|
||||
@@ -662,10 +705,13 @@ class NoteShort {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {NoteShort[]}
|
||||
* @returns {FNote[]}
|
||||
*/
|
||||
getTemplateNotes() {
|
||||
const relations = this.getRelations('template');
|
||||
getNotesToInheritAttributesFrom() {
|
||||
const relations = [
|
||||
...this.getRelations('template'),
|
||||
...this.getRelations('inherit')
|
||||
];
|
||||
|
||||
return relations.map(rel => this.froca.notes[rel.value]);
|
||||
}
|
||||
@@ -689,7 +735,7 @@ class NoteShort {
|
||||
return promotedAttrs;
|
||||
}
|
||||
|
||||
hasAncestor(ancestorNoteId, visitedNoteIds = null) {
|
||||
hasAncestor(ancestorNoteId, followTemplates = false, visitedNoteIds = null) {
|
||||
if (this.noteId === ancestorNoteId) {
|
||||
return true;
|
||||
}
|
||||
@@ -703,14 +749,16 @@ class NoteShort {
|
||||
|
||||
visitedNoteIds.add(this.noteId);
|
||||
|
||||
for (const templateNote of this.getTemplateNotes()) {
|
||||
if (templateNote.hasAncestor(ancestorNoteId, visitedNoteIds)) {
|
||||
return true;
|
||||
if (followTemplates) {
|
||||
for (const templateNote of this.getNotesToInheritAttributesFrom()) {
|
||||
if (templateNote.hasAncestor(ancestorNoteId, followTemplates, visitedNoteIds)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const parentNote of this.getParentNotes()) {
|
||||
if (parentNote.hasAncestor(ancestorNoteId, visitedNoteIds)) {
|
||||
if (parentNote.hasAncestor(ancestorNoteId, followTemplates, visitedNoteIds)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -718,6 +766,10 @@ class NoteShort {
|
||||
return false;
|
||||
}
|
||||
|
||||
isInHiddenSubtree() {
|
||||
return this.noteId === '_hidden' || this.hasAncestor('_hidden');
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated NOOP
|
||||
*/
|
||||
@@ -726,7 +778,7 @@ class NoteShort {
|
||||
/**
|
||||
* Get relations which target this note
|
||||
*
|
||||
* @returns {Attribute[]}
|
||||
* @returns {FAttribute[]}
|
||||
*/
|
||||
getTargetRelations() {
|
||||
return this.targetRelations
|
||||
@@ -736,7 +788,7 @@ class NoteShort {
|
||||
/**
|
||||
* Get relations which target this note
|
||||
*
|
||||
* @returns {NoteShort[]}
|
||||
* @returns {FNote[]}
|
||||
*/
|
||||
async getTargetRelationSourceNotes() {
|
||||
const targetRelations = this.getTargetRelations();
|
||||
@@ -747,7 +799,7 @@ class NoteShort {
|
||||
/**
|
||||
* Return note complement which is most importantly note's content
|
||||
*
|
||||
* @return {Promise<NoteComplement>}
|
||||
* @returns {Promise<FNoteComplement>}
|
||||
*/
|
||||
async getNoteComplement() {
|
||||
return await this.froca.getNoteComplement(this.noteId);
|
||||
@@ -779,9 +831,9 @@ class NoteShort {
|
||||
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() {
|
||||
return (this.type === "code" || this.type === "file")
|
||||
return (this.type === "code" || this.type === "file" || this.type === 'launcher')
|
||||
&& (this.mime.startsWith("application/javascript")
|
||||
|| this.mime === "application/x-javascript"
|
||||
|| this.mime === "text/javascript");
|
||||
@@ -818,10 +870,10 @@ class NoteShort {
|
||||
|
||||
if (env === "frontend") {
|
||||
const bundleService = (await import("../services/bundle.js")).default;
|
||||
await bundleService.getAndExecuteBundle(this.noteId);
|
||||
return await bundleService.getAndExecuteBundle(this.noteId);
|
||||
}
|
||||
else if (env === "backend") {
|
||||
await server.post('script/run/' + this.noteId);
|
||||
const resp = await server.post(`script/run/${this.noteId}`);
|
||||
}
|
||||
else {
|
||||
throw new Error(`Unrecognized env type ${env} for note ${this.noteId}`);
|
||||
@@ -840,7 +892,7 @@ class NoteShort {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (parentNote.noteId === 'share' || parentNote.isShared()) {
|
||||
if (parentNote.noteId === '_share' || parentNote.isShared()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -851,9 +903,17 @@ class NoteShort {
|
||||
isContentAvailable() {
|
||||
return !this.isProtected || protectedSessionHolder.isProtectedSessionAvailable()
|
||||
}
|
||||
|
||||
isLaunchBarConfig() {
|
||||
return this.type === 'launcher' || ['_lbRoot', '_lbAvailableLaunchers', '_lbVisibleLaunchers'].includes(this.noteId);
|
||||
}
|
||||
|
||||
isOptions() {
|
||||
return this.noteId.startsWith("_options");
|
||||
}
|
||||
}
|
||||
|
||||
export default NoteShort;
|
||||
export default FNote;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -864,13 +924,13 @@ export default NoteShort;
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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/lang-css.js"> </script>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<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>
|
||||
<article>
|
||||
<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) {
|
||||
/** @type {string} */
|
||||
this.noteId = row.noteId;
|
||||
@@ -65,7 +65,7 @@ class NoteComplement {
|
||||
}
|
||||
}
|
||||
|
||||
export default NoteComplement;
|
||||
export default FNoteComplement;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
@@ -76,13 +76,13 @@ export default NoteComplement;
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
@@ -1,440 +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="ToolbarButtonOptions">ToolbarButtonOptions</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>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#line125">line 125</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>
|
||||
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<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,23 +35,21 @@ import noteTooltipService from './note_tooltip.js';
|
||||
import protectedSessionService from './protected_session.js';
|
||||
import dateNotesService from './date_notes.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 appContext from "./app_context.js";
|
||||
import appContext from "../components/app_context.js";
|
||||
import NoteContextAwareWidget from "../widgets/note_context_aware_widget.js";
|
||||
import NoteContextCachingWidget from "../widgets/note_context_caching_widget.js";
|
||||
import BasicWidget from "../widgets/basic_widget.js";
|
||||
import SpacedUpdate from "./spaced_update.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
|
||||
* @hideconstructor
|
||||
*/
|
||||
function FrontendScriptApi(startNote, currentNote, originEntity = null, $container = null) {
|
||||
const $pluginButtons = $("#plugin-buttons");
|
||||
|
||||
/** @property {jQuery} container of all the rendered script content */
|
||||
this.$container = $container;
|
||||
|
||||
@@ -62,11 +60,20 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
/** @property {object|null} entity whose event triggered this execution */
|
||||
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;
|
||||
|
||||
/** @property {CollapsibleWidget} */
|
||||
this.CollapsibleWidget = CollapsibleWidget;
|
||||
/**
|
||||
* @property {RightPanelWidget}
|
||||
* @deprecated use api.RightPanelWidget instead
|
||||
*/
|
||||
this.CollapsibleWidget = RightPanelWidget;
|
||||
|
||||
/** @property {RightPanelWidget} */
|
||||
this.RightPanelWidget = RightPanelWidget;
|
||||
|
||||
/** @property {NoteContextAwareWidget} */
|
||||
this.NoteContextAwareWidget = NoteContextAwareWidget;
|
||||
|
||||
/**
|
||||
* @property {NoteContextAwareWidget}
|
||||
@@ -74,17 +81,17 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*/
|
||||
this.TabAwareWidget = NoteContextAwareWidget;
|
||||
|
||||
/** @property {NoteContextAwareWidget} */
|
||||
this.NoteContextAwareWidget = NoteContextAwareWidget;
|
||||
/**
|
||||
* @property {NoteContextAwareWidget}
|
||||
* @deprecated use NoteContextAwareWidget instead
|
||||
*/
|
||||
this.TabCachingWidget = NoteContextAwareWidget;
|
||||
|
||||
/**
|
||||
* @property {NoteContextCachingWidget}
|
||||
* @deprecated use NoteContextCachingWidget instead
|
||||
* @property {NoteContextAwareWidget}
|
||||
* @deprecated use NoteContextAwareWidget instead
|
||||
*/
|
||||
this.TabCachingWidget = NoteContextCachingWidget;
|
||||
|
||||
/** @property {NoteContextAwareWidget} */
|
||||
this.NoteContextCachingWidget = NoteContextCachingWidget;
|
||||
this.NoteContextCachingWidget = NoteContextAwareWidget;
|
||||
|
||||
/** @property {BasicWidget} */
|
||||
this.BasicWidget = BasicWidget;
|
||||
@@ -104,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.
|
||||
*
|
||||
* @param {string} notePath (or noteId)
|
||||
* @return {Promise<void>}
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.activateNewNote = async notePath => {
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
@@ -116,14 +123,15 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
/**
|
||||
* Open a note in a new tab.
|
||||
*
|
||||
* @method
|
||||
* @param {string} notePath (or noteId)
|
||||
* @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) => {
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
|
||||
await appContext.tabManager.openContextWithNote(notePath, activate);
|
||||
await appContext.tabManager.openContextWithNote(notePath, { activate });
|
||||
|
||||
if (activate) {
|
||||
appContext.triggerEvent('focusAndSelectTitle');
|
||||
@@ -133,9 +141,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
/**
|
||||
* Open a note in a new split.
|
||||
*
|
||||
* @method
|
||||
* @param {string} notePath (or noteId)
|
||||
* @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) => {
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
@@ -151,56 +160,26 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {Object} ToolbarButtonOptions
|
||||
* @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 new button to the plugin area.
|
||||
* Adds a new launcher to the launchbar. If the launcher (id) already exists, it will be updated.
|
||||
*
|
||||
* @param {ToolbarButtonOptions} opts
|
||||
* @method
|
||||
* @deprecated you can now create/modify launchers in the top-left Menu -> Configure Launchbar
|
||||
* for special needs there's also backend API's createOrUpdateLauncher()
|
||||
* @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 = opts => {
|
||||
const buttonId = "toolbar-button-" + opts.title.replace(/\s/g, "-");
|
||||
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.");
|
||||
|
||||
let button;
|
||||
if (utils.isMobile()) {
|
||||
$('#plugin-buttons-placeholder').remove();
|
||||
button = $('<a class="dropdown-item" href="#">')
|
||||
.on('click', () => {
|
||||
setTimeout(() => $pluginButtons.dropdown('hide'), 0);
|
||||
});
|
||||
const {action, ...reqBody} = opts;
|
||||
reqBody.action = action.toString();
|
||||
|
||||
if (opts.icon) {
|
||||
button.append($("<span>").addClass("bx bx-" + opts.icon))
|
||||
.append("&nbsp;");
|
||||
}
|
||||
|
||||
button.append($("<span>").text(opts.title));
|
||||
} else {
|
||||
button = $('<span class="button-widget icon-action bx" data-toggle="tooltip" title="" data-placement="right"></span>')
|
||||
.addClass("bx bx-" + (opts.icon || "question-mark"));
|
||||
|
||||
button.attr("title", opts.title);
|
||||
button.tooltip({html: true});
|
||||
}
|
||||
|
||||
button = button.on('click', opts.action);
|
||||
|
||||
button.attr('id', buttonId);
|
||||
|
||||
if ($("#" + buttonId).replaceWith(button).length === 0) {
|
||||
$pluginButtons.append(button);
|
||||
}
|
||||
|
||||
if (opts.shortcut) {
|
||||
utils.bindGlobalShortcut(opts.shortcut, opts.action);
|
||||
|
||||
button.attr("title", "Shortcut " + opts.shortcut);
|
||||
}
|
||||
await server.put('special-notes/api-script-launcher', reqBody);
|
||||
};
|
||||
|
||||
function prepareParams(params) {
|
||||
@@ -210,7 +189,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
|
||||
return params.map(p => {
|
||||
if (typeof p === "function") {
|
||||
return "!@#Function: " + p.toString();
|
||||
return `!@#Function: ${p.toString()}`;
|
||||
}
|
||||
else {
|
||||
return p;
|
||||
@@ -222,9 +201,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
* Executes given anonymous function on the backend.
|
||||
* 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 {Array.<?>} params - list of parameters to the anonymous function to be send to backend
|
||||
* @return {Promise<*>} return value of the executed function on the backend
|
||||
* @param {Array.<?>} params - list of parameters to the anonymous function to be sent to backend
|
||||
* @returns {Promise<*>} return value of the executed function on the backend
|
||||
*/
|
||||
this.runOnBackend = async (script, params = []) => {
|
||||
if (typeof script === "function") {
|
||||
@@ -246,23 +226,17 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
return ret.executionResult;
|
||||
}
|
||||
else {
|
||||
throw new Error("server error: " + ret.error);
|
||||
throw new Error(`server error: ${ret.error}`);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated new name of this API call is runOnBackend so use that
|
||||
* @method
|
||||
*/
|
||||
this.runOnServer = this.runOnBackend;
|
||||
|
||||
/**
|
||||
* This is a powerful search method - you can search by attributes and their values, e.g.:
|
||||
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
||||
*
|
||||
* @method
|
||||
* @param {string} searchString
|
||||
* @returns {Promise<NoteShort[]>}
|
||||
* @returns {Promise<FNote[]>}
|
||||
*/
|
||||
this.searchForNotes = async searchString => {
|
||||
return await searchService.searchForNotes(searchString);
|
||||
@@ -274,7 +248,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*
|
||||
* @method
|
||||
* @param {string} searchString
|
||||
* @returns {Promise<NoteShort|null>}
|
||||
* @returns {Promise<FNote|null>}
|
||||
*/
|
||||
this.searchForNote = async searchString => {
|
||||
const notes = await this.searchForNotes(searchString);
|
||||
@@ -285,8 +259,9 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
/**
|
||||
* Returns note by given noteId. If note is missing from cache, it's loaded.
|
||||
**
|
||||
* @method
|
||||
* @param {string} noteId
|
||||
* @return {Promise<NoteShort>}
|
||||
* @returns {Promise<FNote>}
|
||||
*/
|
||||
this.getNote = async noteId => await froca.getNote(noteId);
|
||||
|
||||
@@ -296,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
|
||||
* otherwise (by e.g. createNoteLink())
|
||||
*
|
||||
* @method
|
||||
* @param {string[]} noteIds
|
||||
* @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);
|
||||
|
||||
/**
|
||||
* Update frontend tree (note) cache from the backend.
|
||||
*
|
||||
* @param {string[]} noteIds
|
||||
* @method
|
||||
* @param {string[]} noteIds
|
||||
*/
|
||||
this.reloadNotes = async noteIds => await froca.reloadNotes(noteIds);
|
||||
|
||||
@@ -314,7 +290,8 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
* Instance name identifies particular Trilium instance. It can be useful for scripts
|
||||
* if some action needs to happen on only one specific instance.
|
||||
*
|
||||
* @return {string}
|
||||
* @method
|
||||
* @returns {string}
|
||||
*/
|
||||
this.getInstanceName = () => window.glob.instanceName;
|
||||
|
||||
@@ -366,12 +343,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*/
|
||||
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.
|
||||
*
|
||||
@@ -388,54 +359,17 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
/**
|
||||
* Adds given text to the editor cursor
|
||||
*
|
||||
* @deprecated use addTextToActiveContextEditor() instead
|
||||
* @param {string} text - this must be clear text, HTML is not supported.
|
||||
* @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.
|
||||
* @method
|
||||
*/
|
||||
this.addTextToActiveContextEditor = text => appContext.triggerCommand('addTextToActiveEditor', {text});
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @deprecated use getActiveContextNote() instead
|
||||
* @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)
|
||||
* @returns {FNote} active note (loaded into right pane)
|
||||
*/
|
||||
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.
|
||||
*
|
||||
@@ -461,17 +395,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*/
|
||||
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
|
||||
* @returns {Promise<string|null>} returns note path of active note or null if there isn't active note
|
||||
@@ -489,24 +412,16 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
|
||||
/**
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* @deprecated use protectNote and protectSubtree instead
|
||||
* @method
|
||||
*/
|
||||
this.protectActiveNote = async () => {
|
||||
const activeNote = appContext.tabManager.getActiveContextNote();
|
||||
|
||||
await protectedSessionService.protectNote(activeNote.noteId, true, false);
|
||||
};
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @param {string} noteId
|
||||
* @param {boolean} protect - true to protect note, false to unprotect
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.protectNote = async (noteId, protect) => {
|
||||
await protectedSessionService.protectNote(noteId, protect, false);
|
||||
@@ -516,6 +431,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
* @method
|
||||
* @param {string} noteId
|
||||
* @param {boolean} protect - true to protect subtree, false to unprotect
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.protectSubTree = async (noteId, protect) => {
|
||||
await protectedSessionService.protectNote(noteId, protect, true);
|
||||
@@ -525,7 +441,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
* Returns date-note for today. If it doesn't exist, it is automatically created.
|
||||
*
|
||||
* @method
|
||||
* @return {Promise<NoteShort>}
|
||||
* @returns {Promise<FNote>}
|
||||
*/
|
||||
this.getTodayNote = dateNotesService.getTodayNote;
|
||||
|
||||
@@ -534,17 +450,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*
|
||||
* @method
|
||||
* @param {string} date - e.g. "2019-04-29"
|
||||
* @return {Promise<NoteShort>}
|
||||
* @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>}
|
||||
* @returns {Promise<FNote>}
|
||||
*/
|
||||
this.getDayNote = dateNotesService.getDayNote;
|
||||
|
||||
@@ -553,7 +459,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*
|
||||
* @method
|
||||
* @param {string} date - e.g. "2019-04-29"
|
||||
* @return {Promise<NoteShort>}
|
||||
* @returns {Promise<FNote>}
|
||||
*/
|
||||
this.getWeekNote = dateNotesService.getWeekNote;
|
||||
|
||||
@@ -562,7 +468,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*
|
||||
* @method
|
||||
* @param {string} month - e.g. "2019-04"
|
||||
* @return {Promise<NoteShort>}
|
||||
* @returns {Promise<FNote>}
|
||||
*/
|
||||
this.getMonthNote = dateNotesService.getMonthNote;
|
||||
|
||||
@@ -571,7 +477,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*
|
||||
* @method
|
||||
* @param {string} year - e.g. "2019"
|
||||
* @return {Promise<NoteShort>}
|
||||
* @returns {Promise<FNote>}
|
||||
*/
|
||||
this.getYearNote = dateNotesService.getYearNote;
|
||||
|
||||
@@ -580,7 +486,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*
|
||||
* @method
|
||||
* @param {string} noteId - set hoisted note. 'root' will effectively unhoist
|
||||
* @return {Promise}
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.setHoistedNoteId = (noteId) => {
|
||||
const activeNoteContext = appContext.tabManager.getActiveContext();
|
||||
@@ -594,8 +500,11 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
* @method
|
||||
* @param {string} keyboardShortcut - e.g. "ctrl+shift+a"
|
||||
* @param {function} handler
|
||||
* @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.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.bindGlobalShortcut = utils.bindGlobalShortcut;
|
||||
this.bindGlobalShortcut = shortcutService.bindGlobalShortcut;
|
||||
|
||||
/**
|
||||
* Trilium runs in backend and frontend process, when something is changed on the backend from script,
|
||||
@@ -605,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.
|
||||
*
|
||||
* @method
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.waitUntilSynced = ws.waitForMaxKnownEntityChangeId;
|
||||
|
||||
@@ -612,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
|
||||
*
|
||||
* @param includedNoteId - noteId of the included note
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.refreshIncludedNote = includedNoteId => appContext.triggerEvent('refreshIncludedNote', {noteId: includedNoteId});
|
||||
|
||||
@@ -631,11 +542,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
* Log given message to the log pane in UI
|
||||
*
|
||||
* @param message
|
||||
* @returns {void}
|
||||
*/
|
||||
this.log = message => {
|
||||
const {noteId} = this.startNote;
|
||||
|
||||
message = utils.now() + ": " + message;
|
||||
message = `${utils.now()}: ${message}`;
|
||||
|
||||
console.log(`Script ${noteId}: ${message}`);
|
||||
|
||||
@@ -663,13 +575,13 @@ export default FrontendScriptApi;
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
const yargs = require('yargs/yargs')
|
||||
const { hideBin } = require('yargs/helpers')
|
||||
const dumpService = require("./inc/dump.js");
|
||||
const dumpService = require("./inc/dump");
|
||||
|
||||
yargs(hideBin(process.argv))
|
||||
.command('$0 <path_to_document> <target_directory>', 'dump the contents of document.db into the target directory', (yargs) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const crypto = require("crypto");
|
||||
const sql = require("./sql.js");
|
||||
const decryptService = require("./decrypt.js");
|
||||
const sql = require("./sql");
|
||||
const decryptService = require("./decrypt");
|
||||
|
||||
function getDataKey(password) {
|
||||
if (!password) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const fs = require("fs");
|
||||
const sanitize = require("sanitize-filename");
|
||||
const sql = require("./sql.js");
|
||||
const decryptService = require("./decrypt.js");
|
||||
const dataKeyService = require("./data_key.js");
|
||||
const extensionService = require("./extension.js");
|
||||
const sql = require("./sql");
|
||||
const decryptService = require("./decrypt");
|
||||
const dataKeyService = require("./data_key");
|
||||
const extensionService = require("./extension");
|
||||
|
||||
function dumpDocument(documentPath, targetPath, options) {
|
||||
const stats = {
|
||||
|
||||
15
dump-db/package-lock.json
generated
15
dump-db/package-lock.json
generated
@@ -387,9 +387,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimist": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
|
||||
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/mkdirp-classic": {
|
||||
"version": "0.5.3",
|
||||
@@ -1163,9 +1166,9 @@
|
||||
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
|
||||
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g=="
|
||||
},
|
||||
"mkdirp-classic": {
|
||||
"version": "0.5.3",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
}
|
||||
|
||||
/*
|
||||
* CKEditor 5 (v35.2.1) content styles.
|
||||
* Generated on Fri, 14 Oct 2022 09:47:42 GMT.
|
||||
* CKEditor 5 (v35.4.0) content styles.
|
||||
* Generated on Wed, 14 Dec 2022 12:53:04 GMT.
|
||||
* For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html
|
||||
*/
|
||||
|
||||
@@ -34,21 +34,6 @@
|
||||
padding: .15em;
|
||||
border-radius: 2px;
|
||||
}
|
||||
/* ckeditor5-block-quote/theme/blockquote.css */
|
||||
.ck-content blockquote {
|
||||
overflow: hidden;
|
||||
padding-right: 1.5em;
|
||||
padding-left: 1.5em;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
font-style: italic;
|
||||
border-left: solid 5px hsl(0, 0%, 80%);
|
||||
}
|
||||
/* ckeditor5-block-quote/theme/blockquote.css */
|
||||
.ck-content[dir="rtl"] blockquote {
|
||||
border-left: 0;
|
||||
border-right: solid 5px hsl(0, 0%, 80%);
|
||||
}
|
||||
/* ckeditor5-font/theme/fontsize.css */
|
||||
.ck-content .text-tiny {
|
||||
font-size: .7em;
|
||||
@@ -65,6 +50,21 @@
|
||||
.ck-content .text-huge {
|
||||
font-size: 1.8em;
|
||||
}
|
||||
/* ckeditor5-block-quote/theme/blockquote.css */
|
||||
.ck-content blockquote {
|
||||
overflow: hidden;
|
||||
padding-right: 1.5em;
|
||||
padding-left: 1.5em;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
font-style: italic;
|
||||
border-left: solid 5px hsl(0, 0%, 80%);
|
||||
}
|
||||
/* ckeditor5-block-quote/theme/blockquote.css */
|
||||
.ck-content[dir="rtl"] blockquote {
|
||||
border-left: 0;
|
||||
border-right: solid 5px hsl(0, 0%, 80%);
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .marker-yellow {
|
||||
background-color: var(--ck-highlight-marker-yellow);
|
||||
@@ -328,18 +328,6 @@
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
/* ckeditor5-table/theme/tablecaption.css */
|
||||
.ck-content .table > figcaption {
|
||||
display: table-caption;
|
||||
caption-side: top;
|
||||
word-break: break-word;
|
||||
text-align: center;
|
||||
color: var(--ck-color-table-caption-text);
|
||||
background-color: var(--ck-color-table-caption-background);
|
||||
padding: .6em;
|
||||
font-size: .75em;
|
||||
outline-offset: -1px;
|
||||
}
|
||||
/* ckeditor5-table/theme/table.css */
|
||||
.ck-content .table {
|
||||
margin: 0.9em auto;
|
||||
@@ -386,6 +374,18 @@
|
||||
.ck-content .table th {
|
||||
position: relative;
|
||||
}
|
||||
/* ckeditor5-table/theme/tablecaption.css */
|
||||
.ck-content .table > figcaption {
|
||||
display: table-caption;
|
||||
caption-side: top;
|
||||
word-break: break-word;
|
||||
text-align: center;
|
||||
color: var(--ck-color-table-caption-text);
|
||||
background-color: var(--ck-color-table-caption-background);
|
||||
padding: .6em;
|
||||
font-size: .75em;
|
||||
outline-offset: -1px;
|
||||
}
|
||||
/* ckeditor5-code-block/theme/codeblock.css */
|
||||
.ck-content pre {
|
||||
padding: 1em;
|
||||
|
||||
6
libraries/ckeditor/ckeditor.js
vendored
6
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
File diff suppressed because one or more lines are too long
214
libraries/jquery.js
vendored
214
libraries/jquery.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v3.6.0
|
||||
* jQuery JavaScript Library v3.6.1
|
||||
* https://jquery.com/
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
@@ -9,7 +9,7 @@
|
||||
* Released under the MIT license
|
||||
* https://jquery.org/license
|
||||
*
|
||||
* Date: 2021-03-02T17:08Z
|
||||
* Date: 2022-08-26T17:52Z
|
||||
*/
|
||||
( function( global, factory ) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// (such as Node.js), expose a factory as module.exports.
|
||||
// This accentuates the need for the creation of a real `window`.
|
||||
// e.g. var jQuery = require("jquery")(window);
|
||||
// See ticket #14549 for more info.
|
||||
// See ticket trac-14549 for more info.
|
||||
module.exports = global.document ?
|
||||
factory( global, true ) :
|
||||
function( w ) {
|
||||
@@ -151,7 +151,7 @@ function toType( obj ) {
|
||||
|
||||
|
||||
var
|
||||
version = "3.6.0",
|
||||
version = "3.6.1",
|
||||
|
||||
// Define a local copy of jQuery
|
||||
jQuery = function( selector, context ) {
|
||||
@@ -3129,8 +3129,8 @@ jQuery.fn.extend( {
|
||||
var rootjQuery,
|
||||
|
||||
// A simple way to check for HTML strings
|
||||
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
||||
// Strict HTML recognition (#11290: must start with <)
|
||||
// Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
|
||||
// Strict HTML recognition (trac-11290: must start with <)
|
||||
// Shortcut simple #id case for speed
|
||||
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
|
||||
|
||||
@@ -4087,7 +4087,7 @@ jQuery.extend( {
|
||||
isReady: false,
|
||||
|
||||
// A counter to track how many items to wait for before
|
||||
// the ready event fires. See #6781
|
||||
// the ready event fires. See trac-6781
|
||||
readyWait: 1,
|
||||
|
||||
// Handle when the DOM is ready
|
||||
@@ -4215,7 +4215,7 @@ function fcamelCase( _all, letter ) {
|
||||
|
||||
// Convert dashed to camelCase; used by the css and data modules
|
||||
// Support: IE <=9 - 11, Edge 12 - 15
|
||||
// Microsoft forgot to hump their vendor prefix (#9572)
|
||||
// Microsoft forgot to hump their vendor prefix (trac-9572)
|
||||
function camelCase( string ) {
|
||||
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
||||
}
|
||||
@@ -4251,7 +4251,7 @@ Data.prototype = {
|
||||
value = {};
|
||||
|
||||
// We can accept data for non-element nodes in modern browsers,
|
||||
// but we should not, see #8335.
|
||||
// but we should not, see trac-8335.
|
||||
// Always return an empty object.
|
||||
if ( acceptData( owner ) ) {
|
||||
|
||||
@@ -4490,7 +4490,7 @@ jQuery.fn.extend( {
|
||||
while ( i-- ) {
|
||||
|
||||
// Support: IE 11 only
|
||||
// The attrs elements can be null (#14894)
|
||||
// The attrs elements can be null (trac-14894)
|
||||
if ( attrs[ i ] ) {
|
||||
name = attrs[ i ].name;
|
||||
if ( name.indexOf( "data-" ) === 0 ) {
|
||||
@@ -4913,9 +4913,9 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
|
||||
input = document.createElement( "input" );
|
||||
|
||||
// Support: Android 4.0 - 4.3 only
|
||||
// Check state lost if the name is set (#11217)
|
||||
// Check state lost if the name is set (trac-11217)
|
||||
// Support: Windows Web Apps (WWA)
|
||||
// `name` and `type` must use .setAttribute for WWA (#14901)
|
||||
// `name` and `type` must use .setAttribute for WWA (trac-14901)
|
||||
input.setAttribute( "type", "radio" );
|
||||
input.setAttribute( "checked", "checked" );
|
||||
input.setAttribute( "name", "t" );
|
||||
@@ -4939,7 +4939,7 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
|
||||
} )();
|
||||
|
||||
|
||||
// We have to close these tags to support XHTML (#13200)
|
||||
// We have to close these tags to support XHTML (trac-13200)
|
||||
var wrapMap = {
|
||||
|
||||
// XHTML parsers do not magically insert elements in the
|
||||
@@ -4965,7 +4965,7 @@ if ( !support.option ) {
|
||||
function getAll( context, tag ) {
|
||||
|
||||
// Support: IE <=9 - 11 only
|
||||
// Use typeof to avoid zero-argument method invocation on host objects (#15151)
|
||||
// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
|
||||
var ret;
|
||||
|
||||
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
||||
@@ -5048,7 +5048,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
|
||||
// Remember the top-level container
|
||||
tmp = fragment.firstChild;
|
||||
|
||||
// Ensure the created nodes are orphaned (#12392)
|
||||
// Ensure the created nodes are orphaned (trac-12392)
|
||||
tmp.textContent = "";
|
||||
}
|
||||
}
|
||||
@@ -5469,15 +5469,15 @@ jQuery.event = {
|
||||
|
||||
for ( ; cur !== this; cur = cur.parentNode || this ) {
|
||||
|
||||
// Don't check non-elements (#13208)
|
||||
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
|
||||
// Don't check non-elements (trac-13208)
|
||||
// Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
|
||||
if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
|
||||
matchedHandlers = [];
|
||||
matchedSelectors = {};
|
||||
for ( i = 0; i < delegateCount; i++ ) {
|
||||
handleObj = handlers[ i ];
|
||||
|
||||
// Don't conflict with Object.prototype properties (#13203)
|
||||
// Don't conflict with Object.prototype properties (trac-13203)
|
||||
sel = handleObj.selector + " ";
|
||||
|
||||
if ( matchedSelectors[ sel ] === undefined ) {
|
||||
@@ -5731,7 +5731,7 @@ jQuery.Event = function( src, props ) {
|
||||
|
||||
// Create target properties
|
||||
// Support: Safari <=6 - 7 only
|
||||
// Target should not be a text node (#504, #13143)
|
||||
// Target should not be a text node (trac-504, trac-13143)
|
||||
this.target = ( src.target && src.target.nodeType === 3 ) ?
|
||||
src.target.parentNode :
|
||||
src.target;
|
||||
@@ -5854,10 +5854,10 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
|
||||
return true;
|
||||
},
|
||||
|
||||
// Suppress native focus or blur as it's already being fired
|
||||
// in leverageNative.
|
||||
_default: function() {
|
||||
return true;
|
||||
// Suppress native focus or blur if we're currently inside
|
||||
// a leveraged native-event stack
|
||||
_default: function( event ) {
|
||||
return dataPriv.get( event.target, type );
|
||||
},
|
||||
|
||||
delegateType: delegateType
|
||||
@@ -5956,7 +5956,8 @@ var
|
||||
|
||||
// checked="checked" or checked
|
||||
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
||||
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
|
||||
|
||||
rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
|
||||
|
||||
// Prefer a tbody over its parent table for containing new rows
|
||||
function manipulationTarget( elem, content ) {
|
||||
@@ -6070,7 +6071,7 @@ function domManip( collection, args, callback, ignored ) {
|
||||
|
||||
// Use the original fragment for the last item
|
||||
// instead of the first because it can end up
|
||||
// being emptied incorrectly in certain situations (#8070).
|
||||
// being emptied incorrectly in certain situations (trac-8070).
|
||||
for ( ; i < l; i++ ) {
|
||||
node = fragment;
|
||||
|
||||
@@ -6111,6 +6112,12 @@ function domManip( collection, args, callback, ignored ) {
|
||||
}, doc );
|
||||
}
|
||||
} else {
|
||||
|
||||
// Unwrap a CDATA section containing script contents. This shouldn't be
|
||||
// needed as in XML documents they're already not visible when
|
||||
// inspecting element contents and in HTML documents they have no
|
||||
// meaning but we're preserving that logic for backwards compatibility.
|
||||
// This will be removed completely in 4.0. See gh-4904.
|
||||
DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
|
||||
}
|
||||
}
|
||||
@@ -6393,9 +6400,12 @@ jQuery.each( {
|
||||
} );
|
||||
var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
|
||||
|
||||
var rcustomProp = /^--/;
|
||||
|
||||
|
||||
var getStyles = function( elem ) {
|
||||
|
||||
// Support: IE <=11 only, Firefox <=30 (#15098, #14150)
|
||||
// Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
|
||||
// IE throws on elements created in popups
|
||||
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
|
||||
var view = elem.ownerDocument.defaultView;
|
||||
@@ -6430,6 +6440,15 @@ var swap = function( elem, options, callback ) {
|
||||
|
||||
var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
|
||||
|
||||
var whitespace = "[\\x20\\t\\r\\n\\f]";
|
||||
|
||||
|
||||
var rtrimCSS = new RegExp(
|
||||
"^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
|
||||
"g"
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
( function() {
|
||||
@@ -6495,7 +6514,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
|
||||
}
|
||||
|
||||
// Support: IE <=9 - 11 only
|
||||
// Style of cloned element affects source element cloned (#8908)
|
||||
// Style of cloned element affects source element cloned (trac-8908)
|
||||
div.style.backgroundClip = "content-box";
|
||||
div.cloneNode( true ).style.backgroundClip = "";
|
||||
support.clearCloneStyle = div.style.backgroundClip === "content-box";
|
||||
@@ -6575,6 +6594,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
|
||||
|
||||
function curCSS( elem, name, computed ) {
|
||||
var width, minWidth, maxWidth, ret,
|
||||
isCustomProp = rcustomProp.test( name ),
|
||||
|
||||
// Support: Firefox 51+
|
||||
// Retrieving style before computed somehow
|
||||
@@ -6585,11 +6605,22 @@ function curCSS( elem, name, computed ) {
|
||||
computed = computed || getStyles( elem );
|
||||
|
||||
// getPropertyValue is needed for:
|
||||
// .css('filter') (IE 9 only, #12537)
|
||||
// .css('--customProperty) (#3144)
|
||||
// .css('filter') (IE 9 only, trac-12537)
|
||||
// .css('--customProperty) (gh-3144)
|
||||
if ( computed ) {
|
||||
ret = computed.getPropertyValue( name ) || computed[ name ];
|
||||
|
||||
// trim whitespace for custom property (issue gh-4926)
|
||||
if ( isCustomProp ) {
|
||||
|
||||
// rtrim treats U+000D CARRIAGE RETURN and U+000C FORM FEED
|
||||
// as whitespace while CSS does not, but this is not a problem
|
||||
// because CSS preprocessing replaces them with U+000A LINE FEED
|
||||
// (which *is* CSS whitespace)
|
||||
// https://www.w3.org/TR/css-syntax-3/#input-preprocessing
|
||||
ret = ret.replace( rtrimCSS, "$1" );
|
||||
}
|
||||
|
||||
if ( ret === "" && !isAttached( elem ) ) {
|
||||
ret = jQuery.style( elem, name );
|
||||
}
|
||||
@@ -6685,7 +6716,6 @@ var
|
||||
// except "table", "table-cell", or "table-caption"
|
||||
// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
|
||||
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
|
||||
rcustomProp = /^--/,
|
||||
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
||||
cssNormalTransform = {
|
||||
letterSpacing: "0",
|
||||
@@ -6921,15 +6951,15 @@ jQuery.extend( {
|
||||
if ( value !== undefined ) {
|
||||
type = typeof value;
|
||||
|
||||
// Convert "+=" or "-=" to relative numbers (#7345)
|
||||
// Convert "+=" or "-=" to relative numbers (trac-7345)
|
||||
if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
|
||||
value = adjustCSS( elem, name, ret );
|
||||
|
||||
// Fixes bug #9237
|
||||
// Fixes bug trac-9237
|
||||
type = "number";
|
||||
}
|
||||
|
||||
// Make sure that null and NaN values aren't set (#7116)
|
||||
// Make sure that null and NaN values aren't set (trac-7116)
|
||||
if ( value == null || value !== value ) {
|
||||
return;
|
||||
}
|
||||
@@ -7553,7 +7583,7 @@ function Animation( elem, properties, options ) {
|
||||
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
|
||||
|
||||
// Support: Android 2.3 only
|
||||
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
|
||||
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)
|
||||
temp = remaining / animation.duration || 0,
|
||||
percent = 1 - temp,
|
||||
index = 0,
|
||||
@@ -7943,7 +7973,6 @@ jQuery.fx.speeds = {
|
||||
|
||||
|
||||
// Based off of the plugin by Clint Helfers, with permission.
|
||||
// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
|
||||
jQuery.fn.delay = function( time, type ) {
|
||||
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
|
||||
type = type || "fx";
|
||||
@@ -8168,8 +8197,7 @@ jQuery.extend( {
|
||||
// Support: IE <=9 - 11 only
|
||||
// elem.tabIndex doesn't always return the
|
||||
// correct value when it hasn't been explicitly set
|
||||
// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
||||
// Use proper attribute retrieval(#12072)
|
||||
// Use proper attribute retrieval (trac-12072)
|
||||
var tabindex = jQuery.find.attr( elem, "tabindex" );
|
||||
|
||||
if ( tabindex ) {
|
||||
@@ -8273,8 +8301,7 @@ function classesToArray( value ) {
|
||||
|
||||
jQuery.fn.extend( {
|
||||
addClass: function( value ) {
|
||||
var classes, elem, cur, curValue, clazz, j, finalValue,
|
||||
i = 0;
|
||||
var classNames, cur, curValue, className, i, finalValue;
|
||||
|
||||
if ( isFunction( value ) ) {
|
||||
return this.each( function( j ) {
|
||||
@@ -8282,36 +8309,35 @@ jQuery.fn.extend( {
|
||||
} );
|
||||
}
|
||||
|
||||
classes = classesToArray( value );
|
||||
classNames = classesToArray( value );
|
||||
|
||||
if ( classes.length ) {
|
||||
while ( ( elem = this[ i++ ] ) ) {
|
||||
curValue = getClass( elem );
|
||||
cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
||||
if ( classNames.length ) {
|
||||
return this.each( function() {
|
||||
curValue = getClass( this );
|
||||
cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
||||
|
||||
if ( cur ) {
|
||||
j = 0;
|
||||
while ( ( clazz = classes[ j++ ] ) ) {
|
||||
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
|
||||
cur += clazz + " ";
|
||||
for ( i = 0; i < classNames.length; i++ ) {
|
||||
className = classNames[ i ];
|
||||
if ( cur.indexOf( " " + className + " " ) < 0 ) {
|
||||
cur += className + " ";
|
||||
}
|
||||
}
|
||||
|
||||
// Only assign if different to avoid unneeded rendering.
|
||||
finalValue = stripAndCollapse( cur );
|
||||
if ( curValue !== finalValue ) {
|
||||
elem.setAttribute( "class", finalValue );
|
||||
this.setAttribute( "class", finalValue );
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
removeClass: function( value ) {
|
||||
var classes, elem, cur, curValue, clazz, j, finalValue,
|
||||
i = 0;
|
||||
var classNames, cur, curValue, className, i, finalValue;
|
||||
|
||||
if ( isFunction( value ) ) {
|
||||
return this.each( function( j ) {
|
||||
@@ -8323,45 +8349,42 @@ jQuery.fn.extend( {
|
||||
return this.attr( "class", "" );
|
||||
}
|
||||
|
||||
classes = classesToArray( value );
|
||||
classNames = classesToArray( value );
|
||||
|
||||
if ( classes.length ) {
|
||||
while ( ( elem = this[ i++ ] ) ) {
|
||||
curValue = getClass( elem );
|
||||
if ( classNames.length ) {
|
||||
return this.each( function() {
|
||||
curValue = getClass( this );
|
||||
|
||||
// This expression is here for better compressibility (see addClass)
|
||||
cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
||||
cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
||||
|
||||
if ( cur ) {
|
||||
j = 0;
|
||||
while ( ( clazz = classes[ j++ ] ) ) {
|
||||
for ( i = 0; i < classNames.length; i++ ) {
|
||||
className = classNames[ i ];
|
||||
|
||||
// Remove *all* instances
|
||||
while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
|
||||
cur = cur.replace( " " + clazz + " ", " " );
|
||||
while ( cur.indexOf( " " + className + " " ) > -1 ) {
|
||||
cur = cur.replace( " " + className + " ", " " );
|
||||
}
|
||||
}
|
||||
|
||||
// Only assign if different to avoid unneeded rendering.
|
||||
finalValue = stripAndCollapse( cur );
|
||||
if ( curValue !== finalValue ) {
|
||||
elem.setAttribute( "class", finalValue );
|
||||
this.setAttribute( "class", finalValue );
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
toggleClass: function( value, stateVal ) {
|
||||
var type = typeof value,
|
||||
var classNames, className, i, self,
|
||||
type = typeof value,
|
||||
isValidValue = type === "string" || Array.isArray( value );
|
||||
|
||||
if ( typeof stateVal === "boolean" && isValidValue ) {
|
||||
return stateVal ? this.addClass( value ) : this.removeClass( value );
|
||||
}
|
||||
|
||||
if ( isFunction( value ) ) {
|
||||
return this.each( function( i ) {
|
||||
jQuery( this ).toggleClass(
|
||||
@@ -8371,17 +8394,20 @@ jQuery.fn.extend( {
|
||||
} );
|
||||
}
|
||||
|
||||
return this.each( function() {
|
||||
var className, i, self, classNames;
|
||||
if ( typeof stateVal === "boolean" && isValidValue ) {
|
||||
return stateVal ? this.addClass( value ) : this.removeClass( value );
|
||||
}
|
||||
|
||||
classNames = classesToArray( value );
|
||||
|
||||
return this.each( function() {
|
||||
if ( isValidValue ) {
|
||||
|
||||
// Toggle individual class names
|
||||
i = 0;
|
||||
self = jQuery( this );
|
||||
classNames = classesToArray( value );
|
||||
|
||||
while ( ( className = classNames[ i++ ] ) ) {
|
||||
for ( i = 0; i < classNames.length; i++ ) {
|
||||
className = classNames[ i ];
|
||||
|
||||
// Check each className given, space separated list
|
||||
if ( self.hasClass( className ) ) {
|
||||
@@ -8515,7 +8541,7 @@ jQuery.extend( {
|
||||
val :
|
||||
|
||||
// Support: IE <=10 - 11 only
|
||||
// option.text throws exceptions (#14686, #14858)
|
||||
// option.text throws exceptions (trac-14686, trac-14858)
|
||||
// Strip and collapse whitespace
|
||||
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
|
||||
stripAndCollapse( jQuery.text( elem ) );
|
||||
@@ -8542,7 +8568,7 @@ jQuery.extend( {
|
||||
option = options[ i ];
|
||||
|
||||
// Support: IE <=9 only
|
||||
// IE8-9 doesn't update selected after form reset (#2551)
|
||||
// IE8-9 doesn't update selected after form reset (trac-2551)
|
||||
if ( ( option.selected || i === index ) &&
|
||||
|
||||
// Don't return options that are disabled or in a disabled optgroup
|
||||
@@ -8685,8 +8711,8 @@ jQuery.extend( jQuery.event, {
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine event propagation path in advance, per W3C events spec (#9951)
|
||||
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
|
||||
// Determine event propagation path in advance, per W3C events spec (trac-9951)
|
||||
// Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
|
||||
if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
|
||||
|
||||
bubbleType = special.delegateType || type;
|
||||
@@ -8738,7 +8764,7 @@ jQuery.extend( jQuery.event, {
|
||||
acceptData( elem ) ) {
|
||||
|
||||
// Call a native DOM method on the target with the same name as the event.
|
||||
// Don't do default actions on window, that's where global variables be (#6170)
|
||||
// Don't do default actions on window, that's where global variables be (trac-6170)
|
||||
if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
|
||||
|
||||
// Don't re-trigger an onFOO event when we call its FOO() method
|
||||
@@ -9012,7 +9038,7 @@ var
|
||||
rantiCache = /([?&])_=[^&]*/,
|
||||
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
|
||||
|
||||
// #7653, #8125, #8152: local protocol detection
|
||||
// trac-7653, trac-8125, trac-8152: local protocol detection
|
||||
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
|
||||
rnoContent = /^(?:GET|HEAD)$/,
|
||||
rprotocol = /^\/\//,
|
||||
@@ -9035,7 +9061,7 @@ var
|
||||
*/
|
||||
transports = {},
|
||||
|
||||
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
|
||||
// Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
|
||||
allTypes = "*/".concat( "*" ),
|
||||
|
||||
// Anchor tag for parsing the document origin
|
||||
@@ -9106,7 +9132,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
|
||||
|
||||
// A special extend for ajax options
|
||||
// that takes "flat" options (not to be deep extended)
|
||||
// Fixes #9887
|
||||
// Fixes trac-9887
|
||||
function ajaxExtend( target, src ) {
|
||||
var key, deep,
|
||||
flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
||||
@@ -9517,12 +9543,12 @@ jQuery.extend( {
|
||||
deferred.promise( jqXHR );
|
||||
|
||||
// Add protocol if not provided (prefilters might expect it)
|
||||
// Handle falsy url in the settings object (#10093: consistency with old signature)
|
||||
// Handle falsy url in the settings object (trac-10093: consistency with old signature)
|
||||
// We also use the url parameter if available
|
||||
s.url = ( ( url || s.url || location.href ) + "" )
|
||||
.replace( rprotocol, location.protocol + "//" );
|
||||
|
||||
// Alias method option to type as per ticket #12004
|
||||
// Alias method option to type as per ticket trac-12004
|
||||
s.type = options.method || options.type || s.method || s.type;
|
||||
|
||||
// Extract dataTypes list
|
||||
@@ -9565,7 +9591,7 @@ jQuery.extend( {
|
||||
}
|
||||
|
||||
// We can fire global events as of now if asked to
|
||||
// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
|
||||
// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
|
||||
fireGlobals = jQuery.event && s.global;
|
||||
|
||||
// Watch for a new set of requests
|
||||
@@ -9594,7 +9620,7 @@ jQuery.extend( {
|
||||
if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
|
||||
cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
|
||||
|
||||
// #9682: remove data so that it's not used in an eventual retry
|
||||
// trac-9682: remove data so that it's not used in an eventual retry
|
||||
delete s.data;
|
||||
}
|
||||
|
||||
@@ -9867,7 +9893,7 @@ jQuery._evalUrl = function( url, options, doc ) {
|
||||
return jQuery.ajax( {
|
||||
url: url,
|
||||
|
||||
// Make this explicit, since user can override this through ajaxSetup (#11264)
|
||||
// Make this explicit, since user can override this through ajaxSetup (trac-11264)
|
||||
type: "GET",
|
||||
dataType: "script",
|
||||
cache: true,
|
||||
@@ -9976,7 +10002,7 @@ var xhrSuccessStatus = {
|
||||
0: 200,
|
||||
|
||||
// Support: IE <=9 only
|
||||
// #1450: sometimes IE returns 1223 when it should be 204
|
||||
// trac-1450: sometimes IE returns 1223 when it should be 204
|
||||
1223: 204
|
||||
},
|
||||
xhrSupported = jQuery.ajaxSettings.xhr();
|
||||
@@ -10048,7 +10074,7 @@ jQuery.ajaxTransport( function( options ) {
|
||||
} else {
|
||||
complete(
|
||||
|
||||
// File: protocol always yields status 0; see #8605, #14207
|
||||
// File: protocol always yields status 0; see trac-8605, trac-14207
|
||||
xhr.status,
|
||||
xhr.statusText
|
||||
);
|
||||
@@ -10109,7 +10135,7 @@ jQuery.ajaxTransport( function( options ) {
|
||||
xhr.send( options.hasContent && options.data || null );
|
||||
} catch ( e ) {
|
||||
|
||||
// #14683: Only rethrow if this hasn't been notified as an error yet
|
||||
// trac-14683: Only rethrow if this hasn't been notified as an error yet
|
||||
if ( callback ) {
|
||||
throw e;
|
||||
}
|
||||
@@ -10753,7 +10779,9 @@ jQuery.each(
|
||||
|
||||
// Support: Android <=4.0 only
|
||||
// Make sure we trim BOM and NBSP
|
||||
var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
|
||||
// Require that the "whitespace run" starts from a non-whitespace
|
||||
// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
|
||||
var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
|
||||
|
||||
// Bind a function to a context, optionally partially applying any
|
||||
// arguments.
|
||||
@@ -10820,7 +10848,7 @@ jQuery.isNumeric = function( obj ) {
|
||||
jQuery.trim = function( text ) {
|
||||
return text == null ?
|
||||
"" :
|
||||
( text + "" ).replace( rtrim, "" );
|
||||
( text + "" ).replace( rtrim, "$1" );
|
||||
};
|
||||
|
||||
|
||||
@@ -10868,8 +10896,8 @@ jQuery.noConflict = function( deep ) {
|
||||
};
|
||||
|
||||
// Expose jQuery and $ identifiers, even in AMD
|
||||
// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
|
||||
// and CommonJS for browser emulators (#13566)
|
||||
// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
|
||||
// and CommonJS for browser emulators (trac-13566)
|
||||
if ( typeof noGlobal === "undefined" ) {
|
||||
window.jQuery = window.$ = jQuery;
|
||||
}
|
||||
|
||||
4
libraries/jquery.min.js
vendored
4
libraries/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1287
libraries/mermaid.min.js
vendored
1287
libraries/mermaid.min.js
vendored
File diff suppressed because one or more lines are too long
4085
package-lock.json
generated
4085
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
54
package.json
54
package.json
@@ -2,7 +2,7 @@
|
||||
"name": "trilium",
|
||||
"productName": "Trilium Notes",
|
||||
"description": "Trilium Notes",
|
||||
"version": "0.57.4",
|
||||
"version": "0.59.2",
|
||||
"license": "AGPL-3.0-only",
|
||||
"main": "electron.js",
|
||||
"bin": {
|
||||
@@ -13,12 +13,14 @@
|
||||
"url": "https://github.com/zadam/trilium.git"
|
||||
},
|
||||
"scripts": {
|
||||
"start-server": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev node ./src/www",
|
||||
"start-electron": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev electron --inspect=5858 .",
|
||||
"switch-server": "rm -r ./node_modules/better-sqlite3 && npm install",
|
||||
"switch-electron": "rm -r ./node_modules/better-sqlite3 && npm install && ./node_modules/.bin/electron-rebuild",
|
||||
"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",
|
||||
"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",
|
||||
"start-server": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 node ./src/www",
|
||||
"start-server-no-dir": "cross-env TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 node ./src/www",
|
||||
"start-electron": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron --inspect=5858 .",
|
||||
"start-electron-no-dir": "cross-env TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 electron --inspect=5858 .",
|
||||
"switch-server": "rm -rf ./node_modules/better-sqlite3 && npm install",
|
||||
"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",
|
||||
"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",
|
||||
@@ -27,11 +29,12 @@
|
||||
"postinstall": "rimraf ./node_modules/canvas"
|
||||
},
|
||||
"dependencies": {
|
||||
"@electron/remote": "2.0.8",
|
||||
"@excalidraw/excalidraw": "0.12.0",
|
||||
"@braintree/sanitize-url": "6.0.2",
|
||||
"@electron/remote": "2.0.9",
|
||||
"@excalidraw/excalidraw": "0.14.2",
|
||||
"archiver": "5.3.1",
|
||||
"async-mutex": "0.4.0",
|
||||
"axios": "1.1.3",
|
||||
"axios": "1.3.3",
|
||||
"better-sqlite3": "7.4.5",
|
||||
"chokidar": "3.5.3",
|
||||
"cls-hooked": "4.2.2",
|
||||
@@ -39,18 +42,20 @@
|
||||
"compression": "1.7.4",
|
||||
"cookie-parser": "1.4.6",
|
||||
"csurf": "1.11.0",
|
||||
"dayjs": "1.11.6",
|
||||
"dayjs": "1.11.7",
|
||||
"dayjs-plugin-utc": "^0.1.2",
|
||||
"debounce": "^1.2.1",
|
||||
"ejs": "3.1.8",
|
||||
"electron-debug": "3.2.0",
|
||||
"electron-dl": "3.4.1",
|
||||
"electron-dl": "3.5.0",
|
||||
"electron-window-state": "5.0.3",
|
||||
"escape-html": "^1.0.3",
|
||||
"express": "4.18.2",
|
||||
"express-partial-content": "1.0.2",
|
||||
"express-rate-limit": "6.6.0",
|
||||
"express-rate-limit": "6.7.0",
|
||||
"express-session": "1.17.3",
|
||||
"fs-extra": "10.1.0",
|
||||
"helmet": "6.0.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"helmet": "6.0.1",
|
||||
"html": "1.0.0",
|
||||
"html2plaintext": "2.1.4",
|
||||
"http-proxy-agent": "5.0.0",
|
||||
@@ -59,14 +64,14 @@
|
||||
"ini": "3.0.1",
|
||||
"is-animated": "2.0.2",
|
||||
"is-svg": "4.3.2",
|
||||
"jimp": "0.16.2",
|
||||
"jimp": "0.22.4",
|
||||
"joplin-turndown-plugin-gfm": "1.0.12",
|
||||
"jsdom": "20.0.2",
|
||||
"jsdom": "21.1.0",
|
||||
"mime-types": "2.1.35",
|
||||
"multer": "1.4.5-lts.1",
|
||||
"node-abi": "3.28.0",
|
||||
"node-abi": "3.33.0",
|
||||
"normalize-strings": "1.1.1",
|
||||
"open": "8.4.0",
|
||||
"open": "8.4.1",
|
||||
"rand-token": "1.0.1",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
@@ -74,7 +79,7 @@
|
||||
"rimraf": "3.0.2",
|
||||
"safe-compare": "1.1.4",
|
||||
"sanitize-filename": "1.6.3",
|
||||
"sanitize-html": "2.7.3",
|
||||
"sanitize-html": "2.9.0",
|
||||
"sax": "1.2.4",
|
||||
"semver": "7.3.8",
|
||||
"serve-favicon": "2.5.0",
|
||||
@@ -84,7 +89,8 @@
|
||||
"tmp": "0.2.1",
|
||||
"turndown": "7.1.1",
|
||||
"unescape": "1.0.1",
|
||||
"ws": "8.11.0",
|
||||
"ws": "8.12.1",
|
||||
"xml2js": "0.4.23",
|
||||
"yauzl": "2.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -95,11 +101,11 @@
|
||||
"electron-rebuild": "3.2.9",
|
||||
"esm": "3.2.25",
|
||||
"jasmine": "4.5.0",
|
||||
"jsdoc": "4.0.0",
|
||||
"jsdoc": "4.0.1",
|
||||
"lorem-ipsum": "2.0.8",
|
||||
"rcedit": "3.0.1",
|
||||
"webpack": "5.74.0",
|
||||
"webpack-cli": "4.10.0"
|
||||
"webpack": "5.75.0",
|
||||
"webpack-cli": "5.0.1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"electron-installer-debian": "3.1.0"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
const Note = require('../../src/becca/entities/note');
|
||||
const Branch = require('../../src/becca/entities/branch');
|
||||
const Attribute = require('../../src/becca/entities/attribute');
|
||||
const BNote = require('../../src/becca/entities/bnote');
|
||||
const BBranch = require('../../src/becca/entities/bbranch');
|
||||
const BAttribute = require('../../src/becca/entities/battribute');
|
||||
const becca = require('../../src/becca/becca');
|
||||
const randtoken = require('rand-token').generator({source: 'crypto'});
|
||||
|
||||
/** @returns {Note} */
|
||||
/** @returns {BNote} */
|
||||
function findNoteByTitle(searchResults, title) {
|
||||
return searchResults
|
||||
.map(sr => becca.notes[sr.noteId])
|
||||
@@ -17,7 +17,7 @@ class NoteBuilder {
|
||||
}
|
||||
|
||||
label(name, value = '', isInheritable = false) {
|
||||
new Attribute({
|
||||
new BAttribute({
|
||||
attributeId: id(),
|
||||
noteId: this.note.noteId,
|
||||
type: 'label',
|
||||
@@ -30,7 +30,7 @@ class NoteBuilder {
|
||||
}
|
||||
|
||||
relation(name, targetNote) {
|
||||
new Attribute({
|
||||
new BAttribute({
|
||||
attributeId: id(),
|
||||
noteId: this.note.noteId,
|
||||
type: 'relation',
|
||||
@@ -42,7 +42,7 @@ class NoteBuilder {
|
||||
}
|
||||
|
||||
child(childNoteBuilder, prefix = "") {
|
||||
new Branch({
|
||||
new BBranch({
|
||||
branchId: id(),
|
||||
noteId: childNoteBuilder.note.noteId,
|
||||
parentNoteId: this.note.noteId,
|
||||
@@ -66,7 +66,7 @@ function note(title, extraParams = {}) {
|
||||
mime: 'text/html'
|
||||
}, extraParams);
|
||||
|
||||
const note = new Note(row);
|
||||
const note = new BNote(row);
|
||||
|
||||
return new NoteBuilder(note);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
const searchService = require('../../src/services/search/services/search');
|
||||
const Note = require('../../src/becca/entities/note');
|
||||
const Branch = require('../../src/becca/entities/branch');
|
||||
const BNote = require('../../src/becca/entities/bnote');
|
||||
const BBranch = require('../../src/becca/entities/bbranch');
|
||||
const SearchContext = require('../../src/services/search/search_context');
|
||||
const dateUtils = require('../../src/services/date_utils');
|
||||
const becca = require('../../src/becca/becca');
|
||||
const {NoteBuilder, findNoteByTitle, note} = require('./becca_mocking.js');
|
||||
const {NoteBuilder, findNoteByTitle, note} = require('./becca_mocking');
|
||||
|
||||
describe("Search", () => {
|
||||
let rootNote;
|
||||
@@ -12,8 +12,8 @@ describe("Search", () => {
|
||||
beforeEach(() => {
|
||||
becca.reset();
|
||||
|
||||
rootNote = new NoteBuilder(new Note({noteId: 'root', title: 'root', type: 'text'}));
|
||||
new Branch({branchId: 'root', noteId: 'root', parentNoteId: 'none', notePosition: 10});
|
||||
rootNote = new NoteBuilder(new BNote({noteId: 'root', title: 'root', type: 'text'}));
|
||||
new BBranch({branchId: 'none_root', noteId: 'root', parentNoteId: 'none', notePosition: 10});
|
||||
});
|
||||
|
||||
it("simple path match", () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const {note} = require('./becca_mocking.js');
|
||||
const {note} = require('./becca_mocking');
|
||||
const ValueExtractor = require('../../src/services/search/value_extractor');
|
||||
const becca = require('../../src/becca/becca');
|
||||
const SearchContext = require("../../src/services/search/search_context");
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
const backupService = require('./services/backup');
|
||||
const anonymizationService = require('./services/anonymization');
|
||||
const sqlInit = require('./services/sql_init');
|
||||
require('./entities/entity_constructor');
|
||||
require('./becca/entity_constructor');
|
||||
|
||||
sqlInit.dbReady.then(async () => {
|
||||
try {
|
||||
console.log("Starting anonymization...");
|
||||
|
||||
const resp = await backupService.anonymize();
|
||||
const resp = await anonymizationService.createAnonymizedCopy('full');
|
||||
|
||||
if (resp.success) {
|
||||
console.log("Anonymized file has been saved to: " + resp.anonymizedFilePath);
|
||||
console.log(`Anonymized file has been saved to: ${resp.anonymizedFilePath}`);
|
||||
|
||||
process.exit(0);
|
||||
} else {
|
||||
|
||||
@@ -66,12 +66,12 @@ const sessionParser = session({
|
||||
name: 'trilium.sid',
|
||||
store: new FileStore({
|
||||
ttl: 30 * 24 * 3600,
|
||||
path: dataDir.TRILIUM_DATA_DIR + '/sessions'
|
||||
path: `${dataDir.TRILIUM_DATA_DIR}/sessions`
|
||||
})
|
||||
});
|
||||
app.use(sessionParser);
|
||||
|
||||
app.use(favicon(__dirname + '/../images/app-icons/win/icon.ico'));
|
||||
app.use(favicon(`${__dirname}/../images/app-icons/win/icon.ico`));
|
||||
|
||||
require('./routes/routes').register(app);
|
||||
|
||||
@@ -91,7 +91,7 @@ app.use((err, req, res, next) => {
|
||||
|
||||
// catch 404 and forward to error handler
|
||||
app.use((req, res, next) => {
|
||||
const err = new Error('Router not found for request ' + req.url);
|
||||
const err = new Error(`Router not found for request ${req.url}`);
|
||||
err.status = 404;
|
||||
next(err);
|
||||
});
|
||||
|
||||
@@ -12,19 +12,19 @@ class Becca {
|
||||
}
|
||||
|
||||
reset() {
|
||||
/** @type {Object.<String, Note>} */
|
||||
/** @type {Object.<String, BNote>} */
|
||||
this.notes = {};
|
||||
/** @type {Object.<String, Branch>} */
|
||||
/** @type {Object.<String, BBranch>} */
|
||||
this.branches = {};
|
||||
/** @type {Object.<String, Branch>} */
|
||||
/** @type {Object.<String, BBranch>} */
|
||||
this.childParentToBranch = {};
|
||||
/** @type {Object.<String, Attribute>} */
|
||||
/** @type {Object.<String, BAttribute>} */
|
||||
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 = {};
|
||||
/** @type {Object.<String, Option>} */
|
||||
/** @type {Object.<String, BOption>} */
|
||||
this.options = {};
|
||||
/** @type {Object.<String, EtapiToken>} */
|
||||
/** @type {Object.<String, BEtapiToken>} */
|
||||
this.etapiTokens = {};
|
||||
|
||||
this.dirtyNoteSetCache();
|
||||
@@ -32,7 +32,11 @@ class Becca {
|
||||
this.loaded = false;
|
||||
}
|
||||
|
||||
/** @returns {Attribute[]} */
|
||||
getRoot() {
|
||||
return this.getNote('root');
|
||||
}
|
||||
|
||||
/** @returns {BAttribute[]} */
|
||||
findAttributes(type, name) {
|
||||
name = name.trim().toLowerCase();
|
||||
|
||||
@@ -43,7 +47,7 @@ class Becca {
|
||||
return this.attributeIndex[`${type}-${name}`] || [];
|
||||
}
|
||||
|
||||
/** @returns {Attribute[]} */
|
||||
/** @returns {BAttribute[]} */
|
||||
findAttributesWithPrefix(type, name) {
|
||||
const resArr = [];
|
||||
const key = `${type}-${name}`;
|
||||
@@ -68,12 +72,12 @@ class Becca {
|
||||
this.dirtyNoteSetCache();
|
||||
}
|
||||
|
||||
/** @returns {Note|null} */
|
||||
/** @returns {BNote|null} */
|
||||
getNote(noteId) {
|
||||
return this.notes[noteId];
|
||||
}
|
||||
|
||||
/** @returns {Note[]} */
|
||||
/** @returns {BNote[]} */
|
||||
getNotes(noteIds, ignoreMissing = false) {
|
||||
const filteredNotes = [];
|
||||
|
||||
@@ -94,40 +98,40 @@ class Becca {
|
||||
return filteredNotes;
|
||||
}
|
||||
|
||||
/** @returns {Branch|null} */
|
||||
/** @returns {BBranch|null} */
|
||||
getBranch(branchId) {
|
||||
return this.branches[branchId];
|
||||
}
|
||||
|
||||
/** @returns {Attribute|null} */
|
||||
/** @returns {BAttribute|null} */
|
||||
getAttribute(attributeId) {
|
||||
return this.attributes[attributeId];
|
||||
}
|
||||
|
||||
/** @returns {Branch|null} */
|
||||
/** @returns {BBranch|null} */
|
||||
getBranchFromChildAndParent(childNoteId, parentNoteId) {
|
||||
return this.childParentToBranch[`${childNoteId}-${parentNoteId}`];
|
||||
}
|
||||
|
||||
/** @returns {NoteRevision|null} */
|
||||
/** @returns {BNoteRevision|null} */
|
||||
getNoteRevision(noteRevisionId) {
|
||||
const row = sql.getRow("SELECT * FROM note_revisions WHERE noteRevisionId = ?", [noteRevisionId]);
|
||||
|
||||
const NoteRevision = require("./entities/note_revision"); // avoiding circular dependency problems
|
||||
return row ? new NoteRevision(row) : null;
|
||||
const BNoteRevision = require("./entities/bnote_revision"); // avoiding circular dependency problems
|
||||
return row ? new BNoteRevision(row) : null;
|
||||
}
|
||||
|
||||
/** @returns {Option|null} */
|
||||
/** @returns {BOption|null} */
|
||||
getOption(name) {
|
||||
return this.options[name];
|
||||
}
|
||||
|
||||
/** @returns {EtapiToken[]} */
|
||||
/** @returns {BEtapiToken[]} */
|
||||
getEtapiTokens() {
|
||||
return Object.values(this.etapiTokens);
|
||||
}
|
||||
|
||||
/** @returns {EtapiToken|null} */
|
||||
/** @returns {BEtapiToken|null} */
|
||||
getEtapiToken(etapiTokenId) {
|
||||
return this.etapiTokens[etapiTokenId];
|
||||
}
|
||||
@@ -148,23 +152,27 @@ class Becca {
|
||||
.replace('_', '')
|
||||
);
|
||||
|
||||
if (!(camelCaseEntityName in this)) {
|
||||
throw new Error(`Unknown entity name '${camelCaseEntityName}' (original argument '${entityName}')`);
|
||||
}
|
||||
|
||||
return this[camelCaseEntityName][entityId];
|
||||
}
|
||||
|
||||
/** @returns {RecentNote[]} */
|
||||
/** @returns {BRecentNote[]} */
|
||||
getRecentNotesFromQuery(query, params = []) {
|
||||
const rows = sql.getRows(query, params);
|
||||
|
||||
const RecentNote = require("./entities/recent_note"); // avoiding circular dependency problems
|
||||
return rows.map(row => new RecentNote(row));
|
||||
const BRecentNote = require("./entities/brecent_note"); // avoiding circular dependency problems
|
||||
return rows.map(row => new BRecentNote(row));
|
||||
}
|
||||
|
||||
/** @returns {NoteRevision[]} */
|
||||
/** @returns {BNoteRevision[]} */
|
||||
getNoteRevisionsFromQuery(query, params = []) {
|
||||
const rows = sql.getRows(query, params);
|
||||
|
||||
const NoteRevision = require("./entities/note_revision"); // avoiding circular dependency problems
|
||||
return rows.map(row => new NoteRevision(row));
|
||||
const BNoteRevision = require("./entities/bnote_revision"); // avoiding circular dependency problems
|
||||
return rows.map(row => new BNoteRevision(row));
|
||||
}
|
||||
|
||||
/** 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 sqlInit = require('../services/sql_init');
|
||||
const log = require('../services/log');
|
||||
const Note = require('./entities/note');
|
||||
const Branch = require('./entities/branch');
|
||||
const Attribute = require('./entities/attribute');
|
||||
const Option = require('./entities/option');
|
||||
const EtapiToken = require("./entities/etapi_token");
|
||||
const BNote = require('./entities/bnote');
|
||||
const BBranch = require('./entities/bbranch');
|
||||
const BAttribute = require('./entities/battribute');
|
||||
const BOption = require('./entities/boption');
|
||||
const BEtapiToken = require("./entities/betapi_token");
|
||||
const cls = require("../services/cls");
|
||||
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
|
||||
|
||||
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`)) {
|
||||
new Branch().update(row).init();
|
||||
const branchRows = sql.getRawRows(`SELECT branchId, noteId, parentNoteId, prefix, notePosition, isExpanded, utcDateModified FROM branches WHERE isDeleted = 0`);
|
||||
// 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`)) {
|
||||
new Attribute().update(row).init();
|
||||
new BAttribute().update(row).init();
|
||||
}
|
||||
|
||||
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`)) {
|
||||
new EtapiToken(row);
|
||||
new BEtapiToken(row);
|
||||
}
|
||||
|
||||
for (const noteId in becca.notes) {
|
||||
@@ -80,7 +84,7 @@ eventService.subscribeBeccaLoader([eventService.ENTITY_CHANGE_SYNCED], ({entity
|
||||
return;
|
||||
}
|
||||
|
||||
if (["notes", "branches", "attributes", "etapi_tokens"].includes(entityName)) {
|
||||
if (["notes", "branches", "attributes", "etapi_tokens", "options"].includes(entityName)) {
|
||||
const EntityClass = entityConstructor.getEntityFromEntityName(entityName);
|
||||
const primaryKeyName = EntityClass.primaryKeyName;
|
||||
|
||||
@@ -164,6 +168,12 @@ function branchUpdated(branch) {
|
||||
childNote.flatTextCache = null;
|
||||
childNote.sortParents();
|
||||
}
|
||||
|
||||
const parentNote = becca.notes[branch.parentNoteId];
|
||||
|
||||
if (parentNote) {
|
||||
parentNote.sortChildren();
|
||||
}
|
||||
}
|
||||
|
||||
function attributeDeleted(attributeId) {
|
||||
@@ -177,7 +187,7 @@ function attributeDeleted(attributeId) {
|
||||
|
||||
if (note) {
|
||||
// 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();
|
||||
} else {
|
||||
note.invalidateThisCache();
|
||||
@@ -205,7 +215,7 @@ function attributeUpdated(attribute) {
|
||||
const note = becca.notes[attribute.noteId];
|
||||
|
||||
if (note) {
|
||||
if (attribute.isAffectingSubtree || note.isTemplate()) {
|
||||
if (attribute.isAffectingSubtree || note.isInherited()) {
|
||||
note.invalidateSubTree();
|
||||
} else {
|
||||
note.invalidateThisCache();
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
const becca = require('./becca.js');
|
||||
const becca = require('./becca');
|
||||
const cls = require('../services/cls');
|
||||
const protectedSessionService = require('../services/protected_session');
|
||||
const log = require('../services/log');
|
||||
|
||||
function isNotePathArchived(notePath) {
|
||||
@@ -17,7 +16,7 @@ function isNotePathArchived(notePath) {
|
||||
const note = becca.notes[notePath[i]];
|
||||
|
||||
// this is going through parents so archived must be inheritable
|
||||
if (note.hasInheritableOwnedArchivedLabel()) {
|
||||
if (note.hasInheritableArchivedLabel()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -40,7 +39,7 @@ function isArchived(noteId) {
|
||||
/**
|
||||
* @param {string} noteId
|
||||
* @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) {
|
||||
if (ancestorNoteId === 'root' || ancestorNoteId === noteId) {
|
||||
@@ -75,7 +74,7 @@ function getNoteTitle(childNoteId, parentNoteId) {
|
||||
|
||||
const branch = parentNote ? becca.getBranchFromChildAndParent(childNote.noteId, parentNote.noteId) : null;
|
||||
|
||||
return ((branch && branch.prefix) ? `${branch.prefix} - ` : '') + title;
|
||||
return `${(branch && branch.prefix) ? `${branch.prefix} - ` : ''}${title}`;
|
||||
}
|
||||
|
||||
function getNoteTitleArrayForPath(notePathArray) {
|
||||
@@ -83,8 +82,8 @@ function getNoteTitleArrayForPath(notePathArray) {
|
||||
throw new Error(`${notePathArray} is not an array.`);
|
||||
}
|
||||
|
||||
if (notePathArray.length === 1 && notePathArray[0] === cls.getHoistedNoteId()) {
|
||||
return [getNoteTitle(cls.getHoistedNoteId())];
|
||||
if (notePathArray.length === 1) {
|
||||
return [getNoteTitle(notePathArray[0])];
|
||||
}
|
||||
|
||||
const titles = [];
|
||||
@@ -92,6 +91,10 @@ function getNoteTitleArrayForPath(notePathArray) {
|
||||
let parentNoteId = 'root';
|
||||
let hoistedNotePassed = false;
|
||||
|
||||
// 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);
|
||||
|
||||
for (const noteId of notePathArray) {
|
||||
// start collecting path segment titles only after hoisted note
|
||||
if (hoistedNotePassed) {
|
||||
@@ -100,7 +103,7 @@ function getNoteTitleArrayForPath(notePathArray) {
|
||||
titles.push(title);
|
||||
}
|
||||
|
||||
if (noteId === cls.getHoistedNoteId()) {
|
||||
if (!hoistedNotePassed && (noteId === hoistedNoteId || outsideOfHoistedSubtree)) {
|
||||
hoistedNotePassed = true;
|
||||
}
|
||||
|
||||
@@ -121,6 +124,9 @@ function getNoteTitleForPath(notePathArray) {
|
||||
* 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
|
||||
* - you can check whether returned path is archived using isArchived
|
||||
*
|
||||
* @param {BNote} note
|
||||
* @param {string[]} path
|
||||
*/
|
||||
function getSomePath(note, path = []) {
|
||||
// first try to find note within hoisted note, otherwise take any existing note path
|
||||
@@ -128,27 +134,33 @@ function getSomePath(note, path = []) {
|
||||
|| getSomePathInner(note, path, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {BNote} note
|
||||
* @param {string[]} path
|
||||
* @param {boolean}respectHoisting
|
||||
* @returns {string[]|false}
|
||||
*/
|
||||
function getSomePathInner(note, path, respectHoisting) {
|
||||
if (note.isRoot()) {
|
||||
path.push(note.noteId);
|
||||
path.reverse();
|
||||
const foundPath = [...path, note.noteId];
|
||||
foundPath.reverse();
|
||||
|
||||
if (respectHoisting && !path.includes(cls.getHoistedNoteId())) {
|
||||
if (respectHoisting && !foundPath.includes(cls.getHoistedNoteId())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return path;
|
||||
return foundPath;
|
||||
}
|
||||
|
||||
const parents = note.parents;
|
||||
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;
|
||||
}
|
||||
|
||||
for (const parentNote of parents) {
|
||||
const retPath = getSomePathInner(parentNote, path.concat([note.noteId]), respectHoisting);
|
||||
const retPath = getSomePathInner(parentNote, [...path, note.noteId], respectHoisting);
|
||||
|
||||
if (retPath) {
|
||||
return retPath;
|
||||
@@ -174,7 +186,7 @@ function getNotePath(noteId) {
|
||||
let branchId;
|
||||
|
||||
if (note.isRoot()) {
|
||||
branchId = 'root';
|
||||
branchId = 'none_root';
|
||||
}
|
||||
else {
|
||||
const parentNote = note.parents[0];
|
||||
|
||||
@@ -13,7 +13,7 @@ let becca = null;
|
||||
/**
|
||||
* Base class for all backend entities.
|
||||
*/
|
||||
class AbstractEntity {
|
||||
class AbstractBeccaEntity {
|
||||
/** @protected */
|
||||
beforeSaving() {
|
||||
this.generateIdIfNecessary();
|
||||
@@ -31,7 +31,7 @@ class AbstractEntity {
|
||||
let contentToHash = "";
|
||||
|
||||
for (const propertyName of this.constructor.hashedProperties) {
|
||||
contentToHash += "|" + this[propertyName];
|
||||
contentToHash += `|${this[propertyName]}`;
|
||||
}
|
||||
|
||||
if (isDeleted) {
|
||||
@@ -46,7 +46,10 @@ class AbstractEntity {
|
||||
return this.utcDateModified || this.utcDateCreated;
|
||||
}
|
||||
|
||||
/** @protected */
|
||||
/**
|
||||
* @protected
|
||||
* @returns {Becca}
|
||||
*/
|
||||
get becca() {
|
||||
if (!becca) {
|
||||
becca = require('../becca');
|
||||
@@ -75,16 +78,16 @@ class AbstractEntity {
|
||||
/**
|
||||
* 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 primaryKeyName = this.constructor.primaryKeyName;
|
||||
|
||||
const isNewEntity = !this[primaryKeyName];
|
||||
|
||||
if (this.beforeSaving) {
|
||||
this.beforeSaving();
|
||||
this.beforeSaving(opts);
|
||||
}
|
||||
|
||||
const pojo = this.getPojoToSave();
|
||||
@@ -164,4 +167,4 @@ class AbstractEntity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AbstractEntity;
|
||||
module.exports = AbstractBeccaEntity;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user