Compare commits

...

217 Commits

Author SHA1 Message Date
zadam
f541bf186c release 0.59.1 2023-02-28 23:39:34 +01:00
zadam
9eb3075f65 Merge remote-tracking branch 'origin/master' into next59
# Conflicts:
#	bin/tpl/anonymize-database.sql
2023-02-28 23:25:51 +01:00
zadam
e2b8dfe96a fix autocomplete showing hidden paths, closes #3654 2023-02-28 23:23:48 +01:00
zadam
f883fde74a small search refactorings 2023-02-28 23:23:17 +01:00
zadam
ae6f2624a0 Merge pull request #3650 from eliandoran/fix/vertical_align_table_cells
Centered vertical align does not seem to work on merged table cells
2023-02-28 00:02:29 +01:00
zadam
ee2953a5e1 fix display of note revision content, #3637 2023-02-27 22:58:02 +01:00
zadam
ec8ed65feb submenu choice of template should override child: settings, fixes #3628 2023-02-27 21:07:32 +01:00
zadam
b70699ce1c make the active fancytree selector more specific than the normal color setting 2023-02-27 21:01:25 +01:00
Elian Doran
44c0ecdbfa Fix middle vertical align on table cells
For merged cells, middle vertical alignment would not work properly (it
was either aligned to the top or bottom).
2023-02-26 22:45:58 +02:00
zadam
7be9db8b84 fix ctrl+click opening note twice, closes #3630 2023-02-22 22:59:31 +01:00
zadam
69d7684b0d fix refreshing option cache on sync, closes #3623 2023-02-22 22:10:41 +01:00
zadam
a88582c610 Update README-ZH_CN.md 2023-02-21 10:38:37 +01:00
zadam
3fd0c01c05 Update README.ru.md 2023-02-21 10:38:12 +01:00
zadam
c16537aecf Update README.md 2023-02-21 10:37:53 +01:00
zadam
79f1eb6e5e improvements in the anonymization script 2023-02-20 21:21:32 +01:00
zadam
fc67dd4d0a release 0.59.0-beta 2023-02-19 21:36:05 +01:00
zadam
232dad66d1 trim imported text 2023-02-19 21:34:37 +01:00
zadam
ed30ec27e7 update demo API examples 2023-02-17 23:34:29 +01:00
zadam
eaab82551f API migration to remove deprecated calls 2023-02-17 23:23:53 +01:00
zadam
d343ff0d23 removed deprecated widgets from frontend API 2023-02-17 23:04:49 +01:00
zadam
400b14e021 removed remnants of dev branch 2023-02-17 16:44:04 +01:00
zadam
760c7b73ad api docs 2023-02-17 16:30:14 +01:00
zadam
97cadc3acf cleaned up unused backend log widget 2023-02-17 16:27:37 +01:00
zadam
7d0117bd28 unneeded changes from dev 2023-02-17 16:24:47 +01:00
zadam
956682f2c7 update docs 2023-02-17 16:15:58 +01:00
zadam
4558e349b5 node update 2023-02-17 15:05:27 +01:00
zadam
6f7b554cdc preparing 0.59 without ocr/pdf, userguide, note ancillaries 2023-02-17 14:49:45 +01:00
zadam
42e08284b0 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	package-lock.json
#	src/public/app/widgets/mermaid.js
2023-02-15 23:47:41 +01:00
zadam
127486fdf5 removed deprecated API methods 2023-02-15 23:45:25 +01:00
zadam
4ffe36e4d0 added options for OCR and extract text from PDF 2023-02-15 16:08:00 +01:00
zadam
85403321cf tweaks 2023-02-15 15:57:33 +01:00
zadam
22cea63863 unneeded await 2023-02-15 15:09:34 +01:00
zadam
c95c5bb471 fix lost content data after CKEditor crash, closes #3584 2023-02-15 15:08:59 +01:00
zadam
cbabaa6b0c move advanced menu slightly below to not overlay the text 2023-02-15 14:49:58 +01:00
zadam
520ffecd36 ancillary type widget 2023-02-15 14:32:12 +01:00
zadam
b1e2b5ba8e reimplement note source to open in a new tab 2023-02-14 16:06:49 +01:00
zadam
896a4fe981 show mermaid errors, fixes #3610 2023-02-13 23:46:04 +01:00
zadam
e9a2cacb5b release 0.58.8 2023-02-13 21:50:54 +01:00
zadam
c190296bf9 refactoring 2023-02-13 16:22:34 +01:00
zadam
e411ad0eb1 Merge branch 'master' into dev 2023-02-13 15:58:02 +01:00
zadam
17085e5578 fix hidden subtree appearing after collapse, #2922 2023-02-13 15:09:57 +01:00
zadam
33d6bb69c0 refresh note list on pageSize update 2023-02-10 13:21:00 +01:00
zadam
44629e6a0a upgrades 2023-02-10 12:29:07 +01:00
zadam
78d61f157e fix docker healthcheck 2023-02-10 12:20:27 +01:00
zadam
3c0ba09a62 fix docker build 2023-02-10 11:40:56 +01:00
zadam
e57d325bd6 fix docker build 2023-02-10 11:24:31 +01:00
zadam
260bc93a66 reimplement docker healtcheck into node.js to take into account configuration, #3582 2023-02-10 11:09:56 +01:00
zadam
a9296e2a39 update node.js to 18 2023-02-10 10:44:38 +01:00
zadam
8371703090 Merge branch 'master' into dev 2023-02-10 10:41:12 +01:00
zadam
fc7da015fe fix image display with slash in title, closes #3591 2023-02-10 10:23:02 +01:00
zadam
adf222b5e8 fix consistency check to re-parent note from search parent to root 2023-02-10 10:12:58 +01:00
zadam
ade22ea825 recover notes into root only if no other valid branch exists, #3590 2023-02-10 10:09:06 +01:00
zadam
2c8fb90ecb Merge pull request #3590 from eliandoran/feature/fix_broken_reference_check
Fix broken reference consistency check
2023-02-10 09:58:24 +01:00
zadam
c67644a2e3 fix filing entity changes for deleted notes 2023-02-10 09:16:32 +01:00
zadam
346f6edd7e fix filing entity changes for deleted notes 2023-02-10 08:55:26 +01:00
Elian Doran
92f586486f Fix broken reference consistency check
If a branch was identified with a missing parent, the branch would be
moved to root. However, the ID of the branch would be changed as a
result of that, and this resulted in the creation of a new branch
instead of updating the old one. Deleting the old one first solves the
issue.
2023-02-05 01:12:13 +02:00
zadam
15607becc6 Merge branch 'master' into dev
# Conflicts:
#	package-lock.json
#	src/public/app/entities/fnote.js
#	src/services/notes.js
2023-02-02 23:35:41 +01:00
zadam
e7c6d912a4 fix undeleting notes with a relation, closes #3583 2023-02-01 23:06:55 +01:00
zadam
290f7e2101 fix sharing of templates, #3562 2023-02-01 22:58:40 +01:00
zadam
460b5fb3a4 fix sharing of templates, #3562 2023-02-01 22:55:31 +01:00
zadam
88e09eb279 ocr wip 2023-02-01 21:07:23 +01:00
zadam
5e0fbea3b3 fix disabled: on attribtue changed script in demo document, fixes #3564 2023-02-01 07:29:37 +01:00
zadam
7b2c3afe4c always open the note in URL, closes #3571 2023-01-31 23:20:11 +01:00
zadam
2e181d0fb1 toggling the left pane will toggle the focus between tree and detail, #3563 2023-01-31 22:35:01 +01:00
zadam
68a03211ce fix padding on launcher when collapsed 2023-01-31 22:25:46 +01:00
zadam
37ba76fdd8 refactored note attachment into note ancillary 2023-01-28 13:13:46 +01:00
zadam
78954268ab small attribute optimizations 2023-01-27 16:59:59 +01:00
zadam
b0528b62d8 small attribute optimizations 2023-01-27 16:57:23 +01:00
zadam
2b4dfaef7f small attribute optimizations 2023-01-27 08:46:04 +01:00
zadam
ad887c4b12 added image OCR and parsing text from PDF (and OCR of PDF images) 2023-01-26 20:32:27 +01:00
zadam
63c62df787 ocr 2023-01-26 09:42:11 +01:00
zadam
c68a67d148 ocr test 2023-01-25 15:20:53 +01:00
zadam
bd8568809f export/import attachments 2023-01-25 09:55:29 +01:00
zadam
0bfb2631df fix saving mermaid attachment 2023-01-24 23:09:00 +01:00
zadam
3c57f08ef7 added checksum to note_attachment 2023-01-24 16:55:48 +01:00
zadam
a7b103e07a add a button to temporarily hide TOC, closes #3555 2023-01-24 16:24:51 +01:00
zadam
64e7150765 fix undeleting note when its relation points to yet-undeleted note 2023-01-24 09:43:10 +01:00
zadam
a888f9aa04 recalculate maxEntityChangeId after rollbacked transaction 2023-01-24 09:35:00 +01:00
zadam
2e9dbda077 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	package.json
2023-01-24 09:20:15 +01:00
zadam
c474e65cae saving attachments when editing 2023-01-24 09:19:49 +01:00
zadam
f59e19d93b fixes to note attachment handling 2023-01-23 23:37:58 +01:00
zadam
8a33645360 migrating canvas etc. 2023-01-23 16:57:28 +01:00
zadam
339d8a7378 initial implementation of note attachments 2023-01-22 23:36:05 +01:00
zadam
f2a19c56b1 add excludeFromNoteMap to a day template instead of journal root, #3547 2023-01-21 11:13:40 +01:00
zadam
a98fd509c6 release 0.58.7 2023-01-17 23:14:58 +01:00
zadam
a3149aecf4 fix migration for DBs which did not have _hidden tree created, closes #3536 2023-01-17 23:13:21 +01:00
zadam
6a6ae359b6 Merge branch 'master' into dev
# Conflicts:
#	package-lock.json
#	package.json
#	src/public/app/widgets/dialogs/note_revisions.js
#	src/services/handlers.js
#	src/services/hidden_subtree.js
#	src/services/search/services/parse.js
2023-01-17 22:20:10 +01:00
zadam
2fa1d812f6 _hidden note does not inherit attributes from root, fixes #3537 2023-01-17 22:14:53 +01:00
zadam
ef825371cf fix "root" note in autocomplete when hoisted into another subtree 2023-01-17 21:15:05 +01:00
zadam
b567775129 small fixes of steel blue theme 2023-01-17 21:06:30 +01:00
zadam
58d71bf8e3 release 0.58.6 2023-01-16 22:39:28 +01:00
zadam
9fd0b85ff2 doc note for the back/forward launchers 2023-01-16 22:37:21 +01:00
zadam
a5e21ea5f3 simplified/fixed close tab button 2023-01-16 22:28:55 +01:00
zadam
98620887d4 fix demo steel blue main menu icon 2023-01-16 22:19:36 +01:00
zadam
9eff08144c extra check that hidden tree is not created until migration is completed 2023-01-16 08:06:19 +01:00
zadam
4ba72bc8d3 fixed standalone anonymize script 2023-01-15 21:05:03 +01:00
zadam
f50a9c250a many small issues found by intellij analysis 2023-01-15 21:04:17 +01:00
zadam
743979266a fix history navigation buttons in server, #3527 2023-01-15 19:46:32 +01:00
zadam
4f98c960ec fix note revision for images 2023-01-15 19:23:28 +01:00
zadam
424b624ea9 small mermaid fixes 2023-01-15 13:48:01 +01:00
zadam
a004a8b092 fix loading custom themes in Options, closes #3528 2023-01-15 12:54:38 +01:00
zadam
df0f52aff9 clarified comment 2023-01-14 23:16:57 +01:00
zadam
f7bd72ba2f release 0.58.5 2023-01-14 23:02:39 +01:00
zadam
038c0e78a6 fix options check in froca 2023-01-14 23:01:02 +01:00
zadam
2a2cbcd68b fix duplicate unique key in migration, #3526 2023-01-14 22:57:39 +01:00
zadam
be654e7a31 fix duplicate unique key in migration, #3526 2023-01-14 22:55:22 +01:00
zadam
32bd74fe27 build website improvements 2023-01-14 22:50:04 +01:00
zadam
14da697a4e put firing of the runOnNoteContentChange on entity level instead of service level, #3436 2023-01-14 12:57:50 +01:00
zadam
2525857c20 fix null content when protecting notes, closes #3523 2023-01-14 00:01:24 +01:00
zadam
c97ada3434 docs improvements 2023-01-13 23:54:47 +01:00
zadam
c924790f3e Merge remote-tracking branch 'origin/dev' into dev 2023-01-13 21:11:36 +01:00
zadam
a110f24b05 Merge branch 'master' into dev 2023-01-13 21:11:23 +01:00
zadam
8eaef3e1d8 add runOnNoteContentChange into the autocomplete 2023-01-13 14:28:41 +01:00
zadam
082caf98e8 restore all "named" notes quickly after their deletion, #3517 2023-01-13 11:53:25 +01:00
zadam
60602a2264 fix creating notes into options, #3517 2023-01-13 11:34:35 +01:00
zadam
9479f1c1a1 toggling archived notes caused appearance of hidden subtree, fixes #3519 2023-01-13 11:25:58 +01:00
zadam
88bc7402a2 hidden notes should not appear in the global search unless hoisted into it, #3516 2023-01-13 10:09:41 +01:00
zadam
e7b3c3239b fix migration of bookmarks to also migrate bookmarkFolder #3514 2023-01-13 08:43:18 +01:00
zadam
4f4c3ef3f3 fix enex checkboxes for mac, closes #3511 2023-01-12 16:45:11 +01:00
zadam
d7b0719788 script to build the docs website 2023-01-12 16:37:30 +01:00
zadam
7a457e4509 Merge remote-tracking branch 'origin/master' into dev 2023-01-12 15:25:59 +01:00
zadam
decfeb366c zoom factor should be rounded to 1 floating point digit 2023-01-12 08:27:08 +01:00
zadam
420175f5ef release 0.58.4 2023-01-11 23:44:33 +01:00
zadam
bdfdc0402d update content should parse out links #3509 2023-01-11 23:22:51 +01:00
zadam
bb8496cb3f ETAPI method to create note revision, #3509 2023-01-11 23:18:51 +01:00
zadam
4bdb94fbaa ancestorDepth should be treated as string in ETAPI, fixes #3510 2023-01-11 23:08:57 +01:00
zadam
05c04a35a7 API docs integrate into user docs 2023-01-10 22:48:56 +01:00
zadam
4385a02f6b transform 2023-01-10 16:51:50 +01:00
zadam
397dd68666 Merge remote-tracking branch 'origin/dev' into dev 2023-01-10 16:33:35 +01:00
zadam
edbb60f2b5 Merge branch 'master' into dev
# Conflicts:
#	src/routes/api/sender.js
#	src/services/import/enex.js
2023-01-10 16:33:31 +01:00
zadam
5bf9c253f2 toc fix 2023-01-10 16:16:13 +01:00
zadam
b0cc177d84 make heading regex in TOC case insensitive 2023-01-10 15:06:21 +01:00
zadam
c60f25fb7c more flexible heading regex 2023-01-10 00:00:46 +01:00
zadam
4ab90b694f fix 2023-01-09 23:15:02 +01:00
zadam
87636f27ba Merge branch 'master' into dev
# Conflicts:
#	src/routes/api/sender.js
#	src/services/import/enex.js
2023-01-09 23:02:19 +01:00
zadam
571cb6d0eb fix dynamic module import 2023-01-09 22:32:49 +01:00
zadam
f738787202 expand regex to account for more attributes in en-media tag in ENEX import, fixes #3503 2023-01-08 20:50:08 +01:00
zadam
4ae1b6e07b sender route should respect inbox, #3502 2023-01-08 20:40:38 +01:00
zadam
41b8f6882c note content renderer should load reference link titles, fixes #3499 2023-01-08 20:31:55 +01:00
zadam
43c5163f66 renamed closing commands 2023-01-08 13:58:51 +01:00
zadam
8a2a9b2ea6 Merge branch 'stable'
# Conflicts:
#	src/services/import/enex.js
2023-01-08 13:24:10 +01:00
zadam
c70272e756 fix creation date in ENEX import for mac files, closes #3496 2023-01-08 13:23:07 +01:00
zadam
843f5d0da1 gitignore 2023-01-08 12:54:55 +01:00
zadam
2242397280 fix 2023-01-08 12:46:26 +01:00
zadam
8a641e1b4f added "inherit" relation, #3493 2023-01-06 20:31:55 +01:00
zadam
f86fb0d0a2 added TRILIUM_SYNC_SERVER_HOST env. variable to prevent prod sync issues 2023-01-06 15:14:04 +01:00
zadam
a863da1dce becca should also keep correct branch order, e.g. for export, #2346 2023-01-06 15:07:18 +01:00
zadam
d7cae7d5bb improvements in API docs generation 2023-01-05 23:38:41 +01:00
zadam
19f4870280 transform api docs script WIP 2023-01-05 16:52:39 +01:00
zadam
ac51d0d569 Merge branch 'master' into dev
# Conflicts:
#	package-lock.json
#	package.json
2023-01-05 16:17:33 +01:00
zadam
218f526a92 fix order by note content size, closes #3488 2023-01-05 15:52:07 +01:00
zadam
161b45aa12 Merge pull request #3489 from Nriver/master
use api.showMessage instead of alert
2023-01-05 15:24:42 +01:00
zadam
397629587c Merge remote-tracking branch 'origin/master' 2023-01-05 15:23:31 +01:00
zadam
034098fd06 don't use alert, #3483 2023-01-05 15:23:22 +01:00
Nriver
e03cc01e15 use api.showMessage instead of alert 2023-01-05 09:02:40 +08:00
zadam
0995c56506 release 0.58.3-beta 2023-01-04 22:36:31 +01:00
zadam
3a5fa2954d Merge remote-tracking branch 'origin/master' 2023-01-03 22:36:56 +01:00
zadam
398480415e package-lock.json 2023-01-03 22:36:41 +01:00
zadam
81013ed21a Merge branch 'stable'
# Conflicts:
#	package-lock.json
#	package.json
2023-01-03 22:35:45 +01:00
zadam
53360c147a npm script improvements 2023-01-03 22:34:31 +01:00
zadam
9e47da3f03 Merge pull request #3150 from zadam/dependabot/npm_and_yarn/json-schema-and-jsprim-0.4.0
Bump json-schema and jsprim
2023-01-03 22:32:36 +01:00
zadam
faefe10c15 Merge pull request #3423 from zadam/dependabot/npm_and_yarn/terser-5.16.1
Bump terser from 5.10.0 to 5.16.1
2023-01-03 22:32:15 +01:00
zadam
a4d3150a24 Merge pull request #2739 from zadam/dependabot/npm_and_yarn/nanoid-3.3.1
Bump nanoid from 3.1.30 to 3.3.1
2023-01-03 22:31:57 +01:00
zadam
e1f0676891 Merge pull request #3197 from zadam/dependabot/npm_and_yarn/dump-db/minimist-1.2.7
Bump minimist from 1.2.5 to 1.2.7 in /dump-db
2023-01-03 22:31:08 +01:00
zadam
792ac9b77d Merge pull request #3408 from zadam/dependabot/npm_and_yarn/qs-6.5.3
Bump qs from 6.5.2 to 6.5.3
2023-01-03 22:30:42 +01:00
zadam
bbbd2f7e82 Merge pull request #3481 from contributor/feature/safeVsCodeLaunch
Safe Vs Code debug launch
2023-01-03 22:29:36 +01:00
zadam
d910191e83 Merge pull request #3480 from contributor/feature/pageUrlSanitizeUrl
Fix pageUrl and clipping selection can create multiple notes for the same Url
2023-01-03 22:28:37 +01:00
zadam
e8a9389e6d remove console.log 2023-01-03 21:44:47 +01:00
zadam
6dce13bc34 export root note fix, #2346 2023-01-03 21:30:49 +01:00
contributor
71cdea3902 fix vscode launch can break release app data 2023-01-03 21:39:35 +02:00
contributor
85a6e8b47e fix clipping selection can create multiple notes for the same Url
sanitize was replacing '&' char to '&'and changing actual Url
2023-01-03 21:18:23 +02:00
contributor
f02ad63e97 npm i @braintree/sanitize-url 2023-01-03 21:18:23 +02:00
contributor
977399a73e refac: better naming 2023-01-03 21:18:23 +02:00
zadam
5d4a2f2064 jsdoc 2023-01-03 15:02:01 +01:00
zadam
c5ab6fa2fa jsdoc fixes to make export simpler 2023-01-03 14:31:46 +01:00
zadam
b80bf0ffb6 docs updated 2023-01-03 13:54:27 +01:00
zadam
bff7434921 rename becca entities to have B-prefix, #3476 2023-01-03 13:52:37 +01:00
zadam
da161c7ce0 rename shaca entities to have F-prefix, #3476 2023-01-03 13:40:21 +01:00
zadam
977a47bc27 rename froca entities to have F-prefix, #3476 2023-01-03 13:35:10 +01:00
zadam
957640f163 Merge branch 'master' into dev 2023-01-02 22:53:03 +01:00
zadam
291ef87c9b fix edit button 2023-01-02 22:32:05 +01:00
zadam
115bf0af4d fix button paddings 2023-01-02 21:08:20 +01:00
zadam
e40f1fd11a fix inclusion of the image into the correct position in ENEX import, closes #3468 2023-01-01 21:02:54 +01:00
zadam
797ddf6205 search hit with exact note title match gets a strong score boost, closes #3470 2022-12-30 23:14:48 +01:00
zadam
ca4e1c19a7 make utils.normalize null-safe, #3469 2022-12-30 21:00:42 +01:00
zadam
d2b906bc1b global menu can open the user guide 2022-12-30 17:41:45 +01:00
zadam
94dcaae12d renamed Help to User Guide 2022-12-30 17:28:19 +01:00
zadam
df47679c7f added option for help sha256 2022-12-30 17:10:07 +01:00
zadam
d6f3b79f20 improvs 2022-12-29 23:12:38 +01:00
zadam
c7556d9163 backend api for ZIP export 2022-12-29 21:15:34 +01:00
zadam
16c3833a36 fix 2022-12-29 14:25:25 +01:00
zadam
007e45ad8c fix import and replace tree 2022-12-29 14:21:35 +01:00
zadam
b9b8b35342 Merge branch 'master' into dev
# Conflicts:
#	src/services/import/zip.js
2022-12-29 10:27:23 +01:00
zadam
dd82b0f958 Merge remote-tracking branch 'origin/master' 2022-12-29 10:25:54 +01:00
zadam
f150c223bc improved ZIP import validation and error handling 2022-12-29 10:25:49 +01:00
zadam
e76290e598 Merge branch 'master' into dev 2022-12-29 10:07:04 +01:00
zadam
4f771cfa7a Merge pull request #3467 from contributor/feature/enex-pageUrl
Evernote import - use pageUrl attribute for enex source-url
2022-12-29 09:57:43 +01:00
contributor
aa3b26c965 Evernote import - use pageUrl attribute for enex source-url 2022-12-29 01:27:17 +02:00
zadam
f4cf04232f release 0.58.2-beta 2022-12-29 00:12:54 +01:00
zadam
d36cf47974 no-dir npm scripts 2022-12-28 23:17:59 +01:00
zadam
f809da58ec fix occurrences of 'root' branch 2022-12-28 13:09:49 +01:00
zadam
ff1f01be8c erase deleted notes in the migration 2022-12-28 12:58:53 +01:00
zadam
0ddaa8f5c2 migration fixes 2022-12-27 21:17:40 +01:00
zadam
620bed73bb put back the removed widgets, the BC break is not worth it 2022-12-27 15:05:12 +01:00
zadam
c177d2b97b fix migration 2022-12-27 14:52:32 +01:00
zadam
0758c82983 hidden subtree is now built as "predictable" to avoid duplicating it in sync 2022-12-27 14:44:28 +01:00
zadam
ecc2ed7d73 formatting 2022-12-27 10:22:50 +01:00
zadam
4b779d7512 small refactors in sync 2022-12-27 09:53:25 +01:00
zadam
5fea90491c zip import WIP 2022-12-26 23:46:39 +01:00
zadam
d665b7e584 import refactoring 2022-12-26 22:51:16 +01:00
zadam
45b94ecaeb zip import refactoring 2022-12-26 10:38:31 +01:00
zadam
acda37e334 wip import zip as help 2022-12-25 23:36:56 +01:00
dependabot[bot]
c409d7ff2a Bump qs from 6.5.2 to 6.5.3
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-15 15:39:13 +00:00
dependabot[bot]
f8dd175837 Bump terser from 5.10.0 to 5.16.1
Bumps [terser](https://github.com/terser/terser) from 5.10.0 to 5.16.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.10.0...v5.16.1)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-15 15:39:04 +00:00
dependabot[bot]
df3212c304 Bump minimist from 1.2.5 to 1.2.7 in /dump-db
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.7.
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.7)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-14 22:50:02 +00:00
dependabot[bot]
6ec734df13 Bump json-schema and jsprim
Bumps [json-schema](https://github.com/kriszyp/json-schema) and [jsprim](https://github.com/joyent/node-jsprim). These dependencies needed to be updated together.

Updates `json-schema` from 0.2.3 to 0.4.0
- [Release notes](https://github.com/kriszyp/json-schema/releases)
- [Commits](https://github.com/kriszyp/json-schema/compare/v0.2.3...v0.4.0)

Updates `jsprim` from 1.4.1 to 1.4.2
- [Release notes](https://github.com/joyent/node-jsprim/releases)
- [Changelog](https://github.com/TritonDataCenter/node-jsprim/blob/v1.4.2/CHANGES.md)
- [Commits](https://github.com/joyent/node-jsprim/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: json-schema
  dependency-type: indirect
- dependency-name: jsprim
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-22 14:03:30 +00:00
dependabot[bot]
102bfcebd0 Bump nanoid from 3.1.30 to 3.3.1
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.3.1.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.30...3.3.1)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-22 20:26:50 +00:00
255 changed files with 8900 additions and 8646 deletions

1
.gitignore vendored
View File

@@ -11,3 +11,4 @@ cert.crt
server-package.json
.idea/httpRequests/
data/
tmp/

View File

@@ -2,7 +2,7 @@ image:
file: .gitpod.dockerfile
tasks:
- before: nvm install 16.19.0 && nvm use 16.19.0
- before: nvm install 16.19.1 && nvm use 16.19.1
init: npm install
command: npm run start-server

15
.idea/git_toolbox_prj.xml generated Normal file
View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxProjectSettings">
<option name="commitMessageIssueKeyValidationOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
<option name="commitMessageValidationEnabledOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
</component>
</project>

3
.vscode/launch.json vendored
View File

@@ -9,7 +9,8 @@
"<node_internals>/**"
],
"env": {
"TRILIUM_ENV": "dev"
"TRILIUM_ENV": "dev",
"TRILIUM_DATA_DIR": "./data"
},
"outputCapture": "std",
"program": "${workspaceFolder}/src/www"

View File

@@ -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

View File

@@ -1,5 +1,5 @@
# !!! Don't try to build this Dockerfile directly, run it through bin/build-docker.sh script !!!
FROM node:16.19.0-alpine
FROM node:16.19.1-alpine
# Create app directory
WORKDIR /usr/src/app
@@ -39,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 node docker_healthcheck.js

View File

@@ -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"/>
## 特性

View File

@@ -11,6 +11,8 @@ Ukraine is currently defending itself from Russian aggression, please consider [
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
<img src="https://signmyrocket.com//uploads/2b2a523cd0c0e76cdbba95a89a9636b2_1676971281.jpg" alt="Trilium Notes supports Ukraine!" width="600"/>
## 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))

View File

@@ -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"/>
## Возможности

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
PKG_DIR=dist/trilium-linux-x64-server
NODE_VERSION=16.19.0
NODE_VERSION=16.19.1
if [ "$1" != "DONTCOPY" ]
then

View File

@@ -5,7 +5,7 @@ if [[ $# -eq 0 ]] ; then
exit 1
fi
n exec 16.19.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.19.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

View File

@@ -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"

View File

@@ -1,12 +1,161 @@
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', 'cssClass', 'iconClass', 'keyboardShortcut', 'run', 'runOnInstance', 'runAtHour', 'customRequestHandler', 'customResourceProvider', 'widget', 'noteInfoWidgetDisabled', 'linkMapWidgetDisabled', 'noteRevisionsWidgetDisabled', 'whatLinksHereWidgetDisabled', 'similarNotesWidgetDisabled', 'workspace', 'workspaceIconClass', 'workspaceTabBackgroundColor', 'searchHome', 'workspaceInbox', 'workspaceSearchHome', 'sqlConsoleHome', 'datePattern', 'pageSize', 'viewType', 'mapRootNoteId', 'bookmarkFolder', 'sorted', 'top', 'fullContentWidth', 'shareHiddenFromTree', 'shareAlias', 'shareOmitDefaultCss', 'shareRoot', 'shareDescription', 'internalLink', 'imageLink', 'relationMapLink', 'includeMapLink', 'runOnNoteCreation', 'runOnNoteTitleChange', 'runOnNoteContentChange', 'runOnNoteChange', 'runOnChildNoteCreation', 'runOnAttributeCreation', 'runOnAttributeChange', 'template', 'widget', 'renderNote', 'shareCss', 'shareJs', 'shareFavicon');
UPDATE attributes SET name = 'name' WHERE type = 'relation' AND name NOT IN ('inbox', 'disableVersioning', 'calendarRoot', 'archived', 'excludeFromExport', 'disableInclusion', 'appCss', 'appTheme', 'hidePromotedAttributes', 'readOnly', 'autoReadOnlyDisabled', 'cssClass', 'iconClass', 'keyboardShortcut', 'run', 'runOnInstance', 'runAtHour', 'customRequestHandler', 'customResourceProvider', 'widget', 'noteInfoWidgetDisabled', 'linkMapWidgetDisabled', 'noteRevisionsWidgetDisabled', 'whatLinksHereWidgetDisabled', 'similarNotesWidgetDisabled', 'workspace', 'workspaceIconClass', 'workspaceTabBackgroundColor', 'searchHome', 'workspaceInbox', 'workspaceSearchHome', 'sqlConsoleHome', 'datePattern', 'pageSize', 'viewType', 'mapRootNoteId', 'bookmarkFolder', 'sorted', 'top', 'fullContentWidth', 'shareHiddenFromTree', 'shareAlias', 'shareOmitDefaultCss', 'shareRoot', 'shareDescription', 'internalLink', 'imageLink', 'relationMapLink', 'includeMapLink', 'runOnNoteCreation', 'runOnNoteTitleChange', 'runOnNoteContentChange', 'runOnNoteChange', 'runOnChildNoteCreation', 'runOnAttributeCreation', 'runOnAttributeChange', 'template', 'widget', 'renderNote', 'shareCss', 'shareJs', 'shareFavicon');
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',

Binary file not shown.

View File

@@ -1,7 +0,0 @@
-- "randomize" branchIds so it's clear user should not rely on them
UPDATE branches SET branchId = '7LSsI2FnZPW2' WHERE parentNoteId = 'hidden' AND noteId = 'search';
UPDATE branches SET branchId = 'wEcmxk4CNC7G' WHERE parentNoteId = 'singles' AND noteId = 'globalnotemap';
UPDATE branches SET branchId = '191uVR6Cu6fA' WHERE parentNoteId = 'hidden' AND noteId = 'sqlconsole';
UPDATE branches SET branchId = 'OjX5Phxp6A4N' WHERE parentNoteId = 'root' AND noteId = 'hidden';
UPDATE branches SET branchId = 'glNBYFYZRH8P' WHERE parentNoteId = 'hidden' AND noteId = 'bulkaction';
UPDATE branches SET branchId = 'cAT25wvGMg3K' WHERE parentNoteId = 'root' AND noteId = 'share';

View 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;

View File

@@ -7,6 +7,6 @@ module.exports = () => {
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();
hiddenSubtreeService.checkHiddenSubtree(true);
});
};

View File

@@ -1,2 +1,2 @@
DELETE FROM branches WHERE noteId = '_globalNoteMap' AND parentNoteId != 'singles'; -- make sure there are no clones which would fail at the next line
DELETE FROM branches WHERE noteId = '_globalNoteMap' AND parentNoteId != 'singles' AND parentNoteId != '_hidden'; -- make sure there are no clones which would fail at the next line
UPDATE branches SET parentNoteId = '_hidden' WHERE noteId = '_globalNoteMap';

View File

@@ -12,5 +12,10 @@ module.exports = () => {
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');
}
});
};

View 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}`);
}
});
};

View 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;

View 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");
}
}
}
});
};

View File

@@ -0,0 +1,48 @@
module.exports = () => {
const beccaLoader = require("../../src/becca/becca_loader");
const becca = require("../../src/becca/becca");
const cls = require("../../src/services/cls");
const log = require("../../src/services/log");
cls.init(() => {
beccaLoader.load();
for (const note of Object.values(becca.notes)) {
try {
if (!note.isJavaScript()) {
continue;
}
if (!note.mime?.endsWith('env=frontend') && !note.mime?.endsWith('env=backend')) {
continue;
}
const origContent = note.getContent().toString();
const fixedContent = origContent
.replaceAll("runOnServer", "runOnBackend")
.replaceAll("api.refreshTree()", "")
.replaceAll("addTextToActiveTabEditor", "addTextToActiveContextEditor")
.replaceAll("getActiveTabNote", "getActiveContextNote")
.replaceAll("getActiveTabTextEditor", "getActiveContextTextEditor")
.replaceAll("getActiveTabNotePath", "getActiveContextNotePath")
.replaceAll("getDateNote", "getDayNote")
.replaceAll("utils.unescapeHtml", "unescapeHtml")
.replaceAll("sortNotesByTitle", "sortNotes")
.replaceAll("CollapsibleWidget", "RightPanelWidget")
.replaceAll("TabAwareWidget", "NoteContextAwareWidget")
.replaceAll("TabCachingWidget", "NoteContextAwareWidget")
.replaceAll("NoteContextCachingWidget", "NoteContextAwareWidget");
if (origContent !== fixedContent) {
log.info(`Replacing legacy API calls for note '${note.noteId}'`);
note.saveNoteRevision();
note.setContent(fixedContent);
}
}
catch (e) {
log.error(`Error during migration to 213 for note '${note.noteId}': ${e.message} ${e.stack}`);
}
}
});
};

27
docker_healthcheck.js Executable file
View File

@@ -0,0 +1,27 @@
const http = require("http");
const config = require("./src/services/config");
if (config.https) {
// built-in TLS (terminated by trilium) is not supported yet, PRs are welcome
// for reverse proxy terminated TLS this will works since config.https will be false
process.exit(0);
return;
}
const port = require('./src/services/port');
const host = require('./src/services/host');
const url = `http://${host}:${port}/api/health-check`;
const options = { timeout: 2000 };
const request = http.request(url, options, res => {
console.log(`STATUS: ${res.statusCode}`);
if (res.statusCode === 200) {
process.exit(0);
} else {
process.exit(1);
}
});
request.on("error", err => {
console.log("ERROR");
process.exit(1);
});
request.end();

View File

@@ -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"> &rarr; {<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"> &rarr; {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>

View File

@@ -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#line16">line 16</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line16">line 16</a>
</li></ul></dd>
@@ -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#line47">line 47</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line47">line 47</a>
</li></ul></dd>
@@ -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#line59">line 59</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line59">line 59</a>
</li></ul></dd>
@@ -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#line53">line 53</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line53">line 53</a>
</li></ul></dd>
@@ -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#line49">line 49</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line49">line 49</a>
</li></ul></dd>
@@ -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#line55">line 55</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line55">line 55</a>
</li></ul></dd>
@@ -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#line51">line 51</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line51">line 51</a>
</li></ul></dd>
@@ -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#line61">line 61</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line61">line 61</a>
</li></ul></dd>
@@ -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#line57">line 57</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line57">line 57</a>
</li></ul></dd>
@@ -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"> &rarr; {<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"> &rarr; {<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#line129">line 129</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line129">line 129</a>
</li></ul></dd>
@@ -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"> &rarr; {<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"> &rarr; {<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#line142">line 142</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line142">line 142</a>
</li></ul></dd>
@@ -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#line157">line 157</a>
<a href="becca_entities_battribute.js.html">becca/entities/battribute.js</a>, <a href="becca_entities_battribute.js.html#line157">line 157</a>
</li></ul></dd>
@@ -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"> &rarr; {<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"> &rarr; {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>

View File

@@ -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,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>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.
@@ -49,7 +49,7 @@ Always check noteId instead.</div>
<h4 class="name" id="Branch"><span class="type-signature"></span>new Branch<span class="signature">()</span><span class="type-signature"></span></h4>
<h4 class="name" id="BBranch"><span class="type-signature"></span>new BBranch<span class="signature">()</span><span class="type-signature"></span></h4>
@@ -97,7 +97,7 @@ Always check noteId instead.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_branch.js.html">becca/entities/branch.js</a>, <a href="becca_entities_branch.js.html#line20">line 20</a>
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line20">line 20</a>
</li></ul></dd>
@@ -137,7 +137,7 @@ Always check noteId instead.</div>
<ul>
<li><a href="AbstractEntity.html">AbstractEntity</a></li>
<li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
</ul>
@@ -180,7 +180,7 @@ Always check noteId instead.</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>
@@ -203,7 +203,7 @@ Always check noteId instead.</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>
@@ -271,7 +271,7 @@ Always check noteId instead.</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#line51">line 51</a>
</li></ul></dd>
@@ -329,7 +329,7 @@ Always check noteId instead.</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#line97">line 97</a>
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line97">line 97</a>
</li></ul></dd>
@@ -397,7 +397,7 @@ Always check noteId instead.</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#line61">line 61</a>
</li></ul></dd>
@@ -463,7 +463,7 @@ of deletion should not act as a clone.
<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#line133">line 133</a>
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line133">line 133</a>
</li></ul></dd>
@@ -531,7 +531,7 @@ of deletion should not act as a clone.
<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#line53">line 53</a>
</li></ul></dd>
@@ -599,7 +599,7 @@ of deletion should not act as a clone.
<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#line59">line 59</a>
</li></ul></dd>
@@ -657,7 +657,7 @@ of deletion should not act as a clone.
<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#line111">line 111</a>
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line111">line 111</a>
</li></ul></dd>
@@ -725,7 +725,7 @@ of deletion should not act as a clone.
<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#line55">line 55</a>
</li></ul></dd>
@@ -743,7 +743,7 @@ of deletion should not act as a clone.
<h4 class="name" id="prefix"><span class="type-signature"></span>prefix<span class="type-signature"> :string</span></h4>
<h4 class="name" id="prefix"><span class="type-signature"></span>prefix<span class="type-signature"> :string|null</span></h4>
@@ -755,6 +755,9 @@ of deletion should not act as a clone.
<li>
<span class="param-type">string</span>
|
<span class="param-type">null</span>
</li>
@@ -793,7 +796,7 @@ of deletion should not act as a clone.
<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#line57">line 57</a>
</li></ul></dd>
@@ -861,7 +864,7 @@ of deletion should not act as a clone.
<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#line63">line 63</a>
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line63">line 63</a>
</li></ul></dd>
@@ -919,7 +922,7 @@ of deletion should not act as a clone.
<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>
@@ -942,7 +945,7 @@ of deletion should not act as a clone.
<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>
@@ -1008,7 +1011,7 @@ of deletion should not act as a clone.
<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>
@@ -1031,7 +1034,7 @@ of deletion should not act as a clone.
<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>
@@ -1213,7 +1216,7 @@ of deletion should not act as a clone.
<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#line145">line 145</a>
<a href="becca_entities_bbranch.js.html">becca/entities/bbranch.js</a>, <a href="becca_entities_bbranch.js.html#line145">line 145</a>
</li></ul></dd>
@@ -1301,7 +1304,7 @@ of deletion should not act as a clone.
<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>
@@ -1324,7 +1327,7 @@ of deletion should not act as a clone.
<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>
@@ -1390,7 +1393,7 @@ of deletion should not act as a clone.
<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>
@@ -1413,7 +1416,7 @@ of deletion should not act as a clone.
<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>
@@ -1479,7 +1482,7 @@ of deletion should not act as a clone.
<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>
@@ -1502,7 +1505,7 @@ of deletion should not act as a clone.
<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>
@@ -1568,7 +1571,7 @@ of deletion should not act as a clone.
<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>
@@ -1591,7 +1594,7 @@ of deletion should not act as a clone.
<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>
@@ -1727,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>
@@ -1750,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>
@@ -1786,7 +1789,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> &rarr; {<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"> &rarr; {this}</span></h4>
@@ -1820,7 +1823,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
<dt class="tag-overrides">Overrides:</dt>
<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>
@@ -1843,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>
@@ -1879,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>
@@ -1907,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>

View File

@@ -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"> &rarr; {<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"> &rarr; {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

View File

@@ -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"> &rarr; {<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"> &rarr; {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>

View File

@@ -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"> &rarr; {<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"> &rarr; {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>

View File

@@ -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"> &rarr; {<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"> &rarr; {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

View File

@@ -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();
@@ -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>

View File

@@ -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,8 +28,8 @@
<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");
@@ -39,9 +39,9 @@ const {sanitizeAttributeName} = require("../../services/sanitize_attribute_name"
* Attribute is an abstract concept which has two real uses - label (key - value pair)
* 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"]; }
@@ -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);
@@ -130,7 +130,7 @@ class Attribute extends AbstractEntity {
get isAffectingSubtree() {
return this.isInheritable
|| (this.type === 'relation' &amp;&amp; this.name === 'template');
|| (this.type === 'relation' &amp;&amp; ['template', 'inherit'].includes(this.name));
}
get targetNoteId() { // alias
@@ -152,7 +152,7 @@ class Attribute extends AbstractEntity {
}
/**
* @returns {Note|null}
* @returns {BNote|null}
*/
getNote() {
const note = this.becca.getNote(this.noteId);
@@ -165,7 +165,7 @@ class Attribute extends AbstractEntity {
}
/**
* @returns {Note|null}
* @returns {BNote|null}
*/
getTargetNote() {
if (this.type !== 'relation') {
@@ -180,7 +180,7 @@ class Attribute extends AbstractEntity {
}
/**
* @return {boolean}
* @returns {boolean}
*/
isDefinition() {
return this.type === 'label' &amp;&amp; (this.name.startsWith('label:') || this.name.startsWith('relation:'));
@@ -204,8 +204,10 @@ class Attribute extends AbstractEntity {
return !(this.attributeId in this.becca.attributes);
}
beforeSaving() {
this.validate();
beforeSaving(opts = {}) {
if (!opts.skipValidation) {
this.validate();
}
this.name = sanitizeAttributeName(this.name);
@@ -245,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,
@@ -257,7 +259,7 @@ class Attribute extends AbstractEntity {
}
}
module.exports = Attribute;
module.exports = BAttribute;
</code></pre>
</article>
</section>
@@ -268,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>

View File

@@ -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,8 +28,8 @@
<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 dateUtils = require("../../services/date_utils");
const utils = require("../../services/utils");
const TaskContext = require("../../services/task_context");
@@ -43,9 +43,9 @@ const log = require("../../services/log");
* Note that you should not rely on the branch's identity, since it can change easily with a note's move.
* Always check noteId instead.
*
* @extends AbstractEntity
* @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
@@ -81,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;
@@ -106,7 +106,7 @@ class Branch extends AbstractEntity {
childNote.parentBranches.push(this);
}
if (this.branchId === 'root') {
if (this.noteId === 'root') {
return;
}
@@ -121,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];
@@ -135,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) &amp;&amp; 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];
@@ -168,7 +168,7 @@ class Branch extends AbstractEntity {
* @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) {
@@ -193,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");
@@ -237,11 +236,19 @@ 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) {
let maxNotePos = 0;
for (const childBranch of this.parentNote.getChildBranches()) {
if (maxNotePos &lt; childBranch.notePosition &amp;&amp; childBranch.noteId !== '_hidden') {
if (maxNotePos &lt; childBranch.notePosition
&amp;&amp; childBranch.noteId !== '_hidden' // hidden has very large notePosition to always stay last
) {
maxNotePos = childBranch.notePosition;
}
}
@@ -253,6 +260,10 @@ class Branch extends AbstractEntity {
this.isExpanded = false;
}
if (!this.prefix?.trim()) {
this.prefix = null;
}
this.utcDateModified = dateUtils.utcNowDateTime();
super.beforeSaving();
@@ -274,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>
@@ -295,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>

View File

@@ -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 "&lt;etapiTokenId>_&lt;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>

View File

@@ -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,12 +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');
dayjs.extend(utc)
const eventService = require("../../services/events");
dayjs.extend(utc);
const LABEL = 'label';
const RELATION = 'relation';
@@ -47,9 +48,9 @@ const RELATION = 'relation';
/**
* Trilium's main entity which can represent text note, image, code note, file attachment etc.
*
* @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"]; }
@@ -117,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;
@@ -179,7 +180,7 @@ class Note extends AbstractEntity {
return this.isContentAvailable() ? this.title : '[protected]';
}
/** @returns {Branch[]} */
/** @returns {BBranch[]} */
getParentBranches() {
return this.parentBranches;
}
@@ -187,26 +188,26 @@ class Note extends AbstractEntity {
/**
* Returns &lt;i>strong&lt;/i> (as opposed to &lt;i>weak&lt;/i>) parent branches. See isWeak for details.
*
* @returns {Branch[]}
* @returns {BBranch[]}
*/
getStrongParentBranches() {
return this.getParentBranches().filter(branch => !branch.isWeak);
}
/**
* @returns {Branch[]}
* @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;
}
@@ -216,16 +217,16 @@ class Note extends AbstractEntity {
return this.children &amp;&amp; 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)
*/
@@ -342,6 +343,11 @@ class Note extends AbstractEntity {
utcDateChanged: pojo.utcDateModified,
isSynced: true
});
eventService.emit(eventService.ENTITY_CHANGED, {
entityName: 'note_contents',
entity: this
});
}
setJsonContent(content) {
@@ -372,6 +378,12 @@ class Note extends AbstractEntity {
&amp;&amp; this.mime === "text/html";
}
/** @returns {boolean} true if this note is an image */
isImage() {
return this.type === 'image'
|| (this.type === 'file' &amp;&amp; this.mime?.startsWith('image/'));
}
/** @returns {boolean} true if the note has string content (not binary) */
isStringNote() {
return utils.isStringNote(this.type, this.mime);
@@ -397,15 +409,14 @@ class Note extends AbstractEntity {
/**
* @param {string} [type] - (optional) attribute type to filter
* @param {string} [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.__validateTypeName(type, name);
this.__getAttributes([]);
this.__ensureAttributeCacheIsAvailable();
if (type &amp;&amp; name) {
return this.__attributeCache.filter(attr => attr.type === type &amp;&amp; attr.name === name);
return this.__attributeCache.filter(attr => attr.name === name &amp;&amp; attr.type === type);
}
else if (type) {
return this.__attributeCache.filter(attr => attr.type === type);
@@ -419,6 +430,13 @@ class Note extends AbstractEntity {
}
}
/** @private */
__ensureAttributeCacheIsAvailable() {
if (!this.__attributeCache) {
this.__getAttributes([]);
}
}
/** @private */
__getAttributes(path) {
if (path.includes(this.noteId)) {
@@ -429,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' &amp;&amp; this.noteId !== '_hidden') {
for (const parentNote of this.parents) {
parentAttributes.push(...parentNote.__getInheritableAttributes(newPath));
}
@@ -438,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' &amp;&amp; ownedAttr.name === 'template') {
if (ownedAttr.type === 'relation' &amp;&amp; ['template', 'inherit'].includes(ownedAttr.name)) {
const templateNote = this.becca.notes[ownedAttr.value];
if (templateNote) {
@@ -477,7 +496,7 @@ class Note extends AbstractEntity {
/**
* @private
* @returns {Attribute[]}
* @returns {BAttribute[]}
*/
__getInheritableAttributes(path) {
if (path.includes(this.noteId)) {
@@ -512,9 +531,9 @@ class Note extends AbstractEntity {
*/
hasAttribute(type, name, value = null) {
return !!this.getAttributes().find(attr =>
attr.type === type
&amp;&amp; attr.name === name
attr.name === name
&amp;&amp; (value === undefined || value === null || attr.value === value)
&amp;&amp; attr.type === type
);
}
@@ -523,13 +542,13 @@ class Note extends AbstractEntity {
value = value ? value.toLowerCase() : null;
return this.getAttributes().find(
attr => attr.type === type
&amp;&amp; attr.name.toLowerCase() === name
&amp;&amp; (!value || attr.value.toLowerCase() === value));
attr => attr.name.toLowerCase() === name
&amp;&amp; (!value || attr.value.toLowerCase() === value)
&amp;&amp; attr.type === type);
}
getRelationTarget(name) {
const relation = this.getAttributes().find(attr => attr.type === 'relation' &amp;&amp; attr.name === name);
const relation = this.getAttributes().find(attr => attr.name === name &amp;&amp; attr.type === 'relation');
return relation ? relation.targetNote : null;
}
@@ -564,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); }
@@ -623,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 &amp;&amp; attr.name === name);
return attributes.find(attr => attr.name === name &amp;&amp; attr.type === type);
}
/**
@@ -655,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);
@@ -671,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);
@@ -687,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);
@@ -695,7 +714,7 @@ 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);
@@ -705,16 +724,16 @@ class Note extends AbstractEntity {
* @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 {Attribute[]} note's "owned" attributes - excluding inherited ones
* @returns {BAttribute[]} note's "owned" attributes - excluding inherited ones
*/
getOwnedAttributes(type = null, name = null, value = null) {
this.__validateTypeName(type, name);
if (type &amp;&amp; name &amp;&amp; value !== undefined &amp;&amp; value !== null) {
return this.ownedAttributes.filter(attr => attr.type === type &amp;&amp; attr.name === name &amp;&amp; attr.value === value);
return this.ownedAttributes.filter(attr => attr.name === name &amp;&amp; attr.value === value &amp;&amp; attr.type === type);
}
else if (type &amp;&amp; name) {
return this.ownedAttributes.filter(attr => attr.type === type &amp;&amp; attr.name === name);
return this.ownedAttributes.filter(attr => attr.name === name &amp;&amp; attr.type === type);
}
else if (type) {
return this.ownedAttributes.filter(attr => attr.type === type);
@@ -728,7 +747,7 @@ class Note extends AbstractEntity {
}
/**
* @returns {Attribute} attribute belonging to this specific note (excludes inherited attributes)
* @returns {BAttribute} attribute belonging to this specific note (excludes inherited attributes)
*
* This method can be significantly faster than the getAttribute()
*/
@@ -742,28 +761,55 @@ class Note extends AbstractEntity {
return this.hasAttribute('label', 'archived');
}
hasInheritableOwnedArchivedLabel() {
return !!this.ownedAttributes.find(attr => attr.type === 'label' &amp;&amp; attr.name === 'archived' &amp;&amp; attr.isInheritable);
hasInheritableArchivedLabel() {
for (const attr of this.getAttributes()) {
if (attr.name === 'archived' &amp;&amp; attr.type === LABEL &amp;&amp; attr.isInheritable) {
return true;
}
}
return false;
}
// will sort the parents so that non-search &amp; non-archived are first and archived at the end
// this is done so that non-search &amp; 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 &lt; 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) {
@@ -818,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) {
@@ -836,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) {
@@ -856,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;
}
@@ -876,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) {
@@ -891,7 +938,7 @@ class Note extends AbstractEntity {
return Array.from(set);
}
/** @return {Note[]} */
/** @returns {BNote[]} */
getSearchResultNotes() {
if (this.type !== 'search') {
return [];
@@ -913,7 +960,7 @@ class Note extends AbstractEntity {
}
/**
* @returns {{notes: Note[], relationships: Array.&lt;{parentNoteId: string, childNoteId: string}>}}
* @returns {{notes: BNote[], relationships: Array.&lt;{parentNoteId: string, childNoteId: string}>}}
*/
getSubtree({includeArchived = true, includeHidden = false, resolveSearch = false} = {}) {
const noteSet = new Set();
@@ -973,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();
}
@@ -1029,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();
@@ -1077,13 +1125,13 @@ class Note extends AbstractEntity {
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) {
@@ -1109,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') {
@@ -1134,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();
@@ -1164,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,
@@ -1199,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,
@@ -1220,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);
@@ -1232,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);
@@ -1377,7 +1450,7 @@ class Note extends AbstractEntity {
}
isOptions() {
return this.noteId.startsWith("options");
return this.noteId.startsWith("_options");
}
get isDeleted() {
@@ -1385,7 +1458,7 @@ class Note extends AbstractEntity {
}
/**
* @return {NoteRevision|null}
* @returns {BNoteRevision|null}
*/
saveNoteRevision() {
const content = this.getContent();
@@ -1396,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,
@@ -1460,7 +1533,7 @@ class Note extends AbstractEntity {
}
}
module.exports = Note;
module.exports = BNote;
</code></pre>
</article>
</section>
@@ -1471,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>

View File

@@ -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"]; }
@@ -134,7 +134,7 @@ class NoteRevision extends AbstractEntity {
}
}
setContent(content, ignoreMissingProtectedSession = false) {
setContent(content) {
const pojo = {
noteRevisionId: this.noteRevisionId,
content: content,
@@ -145,7 +145,7 @@ 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.`);
}
}
@@ -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>

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

View File

@@ -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#line361">line 361</a>
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line364">line 364</a>
</li></ul></dd>
@@ -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#line352">line 352</a>
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line355">line 355</a>
</li></ul></dd>
@@ -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#line342">line 342</a>
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line345">line 345</a>
</li></ul></dd>
@@ -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#line318">line 318</a>
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line321">line 321</a>
</li></ul></dd>
@@ -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#line329">line 329</a>
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line332">line 332</a>
</li></ul></dd>
@@ -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#line308">line 308</a>
<a href="services_sql.js.html">services/sql.js</a>, <a href="services_sql.js.html#line311">line 311</a>
</li></ul></dd>
@@ -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>

View File

@@ -45,38 +45,37 @@ const becca = require("../becca/becca");
const ws = require("./ws");
const SpacedUpdate = require("./spaced_update");
const specialNotesService = require("./special_notes");
const branchService = require("./branches.js");
const branchService = require("./branches");
const exportService = require("./export/zip");
/**
* This is the main backend API interface for scripts. It's published in the local "api" object.
* &lt;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. &lt;code>api.log(api.startNote.title);&lt;/code>&lt;/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.
@@ -88,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) {
@@ -132,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);
@@ -151,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;
@@ -161,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;
@@ -198,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,
@@ -224,10 +217,11 @@ function BackendScriptApi(currentNote, apiParams) {
* Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
* 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,
@@ -237,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, relationMap, canvas - MANDATORY
* @property {string} mime - value is derived from default mimes for type
* @property {boolean} isProtected - default is false
* @property {boolean} isExpanded - default is false
* @property {string} prefix - default is empty string
* @property {int} notePosition - default is last existing notePosition in a parent + 10
*/
/**
* @method
*
* @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
@@ -281,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;
@@ -326,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);
@@ -353,7 +337,7 @@ function BackendScriptApi(currentNote, apiParams) {
* Returns root note of the calendar.
*
* @method
* @returns {Note|null}
* @returns {BNote|null}
*/
this.getRootCalendarNote = dateNoteService.getRootCalendarNote;
@@ -362,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;
@@ -382,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;
@@ -392,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;
@@ -403,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;
@@ -413,32 +387,22 @@ 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;
/**
* @method
* @deprecated - use sortNotes instead
* @param {string} parentNoteId - this note's child notes will be sorted
*/
this.sortNotesByTitle = parentNoteId => treeService.sortNotes(parentNoteId);
/**
* @typedef {Object} SortConfig
* @property {string} [sortBy=title] - 'title', 'dateCreated', 'dateModified' or a label name
* see https://github.com/zadam/trilium/wiki/Sorting for details.
* @property {boolean} [reverse=false]
* @property {boolean} [foldersFirst=false]
*/
/**
* Sort child notes of a given note.
*
* @method
* @param {string} parentNoteId - this note's child notes will be sorted
* @param {SortConfig} [sortConfig]
* @param {object} [sortConfig]
* @property {string} [sortConfig.sortBy=title] - 'title', 'dateCreated', 'dateModified' or a label name
* See {@link https://github.com/zadam/trilium/wiki/Sorting} for details.
* @property {boolean} [sortConfig.reverse=false]
* @property {boolean} [sortConfig.foldersFirst=false]
* @returns {void}
*/
this.sortNotes = (parentNoteId, sortConfig = {}) => treeService.sortNotes(
parentNoteId,
@@ -454,10 +418,11 @@ function BackendScriptApi(currentNote, apiParams) {
* This method looks similar to toggleNoteInParent() but differs because we're looking up branch by prefix.
*
* @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;
@@ -501,37 +466,28 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
* @deprecated - this is now no-op since all the changes should be gracefully handled per widget
*/
this.refreshTree = () => {
console.warn("api.refreshTree() is a NO-OP and can be removed from your script.")
};
/**
* @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
* @returns {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
*/
this.getAppInfo = () => appInfo
/**
* @typedef {Object} CreateOrUpdateLauncher
* @property {string} id - id of the launcher, only alphanumeric at least 6 characters long
* @property {string} type - one of
* 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} title
* @property {boolean} [isVisible=false] - if true, will be created in the "Visible launchers", otherwise in "Available launchers"
* @property {string} [icon] - name of the boxicon to be used (e.g. "bx-time")
* @property {string} [keyboardShortcut] - will activate the target note/script upon pressing, e.g. "ctrl+e"
* @property {string} [targetNoteId] - for type "note"
* @property {string} [scriptNoteId] - for type "script"
* @property {string} [widgetNoteId] - for type "customWidget"
*/
/**
* Creates a new launcher to the launchbar. If the launcher (id) already exists, it will be updated.
*
* @param {CreateOrUpdateLauncher} opts
* @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)"); }
@@ -588,12 +544,23 @@ function BackendScriptApi(currentNote, apiParams) {
} else {
launcherNote.removeLabel('keyboardShortcut');
}
return {note: launcherNote};
};
/**
* @method
* @param {string} noteId
* @param {string} format - either 'html' or 'markdown'
* @param {string} zipFilePath
* @returns {Promise&lt;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
@@ -611,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>

View File

@@ -284,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;
}
}
@@ -331,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,
@@ -341,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,
@@ -352,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,
@@ -365,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,
@@ -375,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,
@@ -404,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>

View File

@@ -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"> &rarr; {<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"> &rarr; {<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"> &rarr; {Promise.&lt;<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"> &rarr; {Promise.&lt;<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.&lt;<a href="NoteShort.html">NoteShort</a>></span>
<span class="param-type">Promise.&lt;<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>

View File

@@ -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"> &rarr; {<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"> &rarr; {<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"> &rarr; {<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"> &rarr; {<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"> &rarr; {<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"> &rarr; {<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>

View File

@@ -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

View File

@@ -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&lt;NoteShort>} */
/** @returns {Promise&lt;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>

View File

@@ -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>

View File

@@ -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>
@@ -54,12 +54,7 @@ const NOTE_TYPE_ICONS = {
"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.&lt;string, Object>} row
@@ -146,7 +141,7 @@ class NoteShort {
}
async getContent() {
// we're not caching content since these objects are in froca and as such pretty long lived
// we're not caching content since these objects are in froca and as such pretty long-lived
const note = await server.get(`notes/${this.noteId}`);
return note.content;
@@ -181,7 +176,7 @@ class NoteShort {
}
/**
* @returns {Branch[]}
* @returns {FBranch[]}
*/
getParentBranches() {
const branchIds = Object.values(this.parentToBranch);
@@ -190,7 +185,7 @@ class NoteShort {
}
/**
* @returns {Branch[]}
* @returns {FBranch[]}
* @deprecated use getParentBranches() instead
*/
getBranches() {
@@ -202,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]);
@@ -215,7 +210,7 @@ class NoteShort {
return this.parents;
}
/** @returns {NoteShort[]} */
/** @returns {FNote[]} */
getParentNotes() {
return this.froca.getNotesFromCache(this.parents);
}
@@ -232,7 +227,7 @@ class NoteShort {
const aNote = this.froca.getNoteFromCache([aNoteId]);
if (aNote.hasLabel('archived')) {
if (aNote.isArchived || aNote.isHiddenCompletely()) {
return 1;
}
@@ -240,12 +235,16 @@ class NoteShort {
});
}
get isArchived() {
return this.hasAttribute('label', 'archived');
}
/** @returns {string[]} */
getChildNoteIds() {
return this.children;
}
/** @returns {Promise&lt;NoteShort[]>} */
/** @returns {Promise&lt;FNote[]>} */
async getChildNotes() {
return await this.froca.getNotes(this.children);
}
@@ -253,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
@@ -266,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);
@@ -283,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' &amp;&amp; this.noteId !== '_hidden') {
for (const parentNote of this.getParentNotes()) {
// these virtual parent-child relationships are also loaded into froca
if (parentNote.type !== 'search') {
@@ -292,7 +292,7 @@ class NoteShort {
}
}
for (const templateAttr of attrArrs.flat().filter(attr => attr.type === 'relation' &amp;&amp; attr.name === 'template')) {
for (const templateAttr of attrArrs.flat().filter(attr => attr.type === 'relation' &amp;&amp; ['template', 'inherit'].includes(attr.name))) {
const templateNote = this.froca.notes[templateAttr.value];
if (templateNote &amp;&amp; templateNote.noteId !== this.noteId) {
@@ -370,7 +370,7 @@ 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')
}));
@@ -392,13 +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 &amp;&amp; !name) {
return attributes;
} else if (type &amp;&amp; name) {
return attributes.filter(attr => attr.type === type &amp;&amp; attr.name === name);
return attributes.filter(attr => attr.name === name &amp;&amp; attr.type === type);
} else if (type) {
return attributes.filter(attr => attr.type === type);
} else if (name) {
@@ -427,7 +450,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
*/
getOwnedLabels(name) {
return this.getOwnedAttributes(LABEL, name);
@@ -435,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);
@@ -487,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;
}
@@ -508,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);
@@ -516,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);
@@ -543,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 &amp;&amp; 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 &amp;&amp; attr.type === type);
}
/**
@@ -610,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); }
@@ -658,7 +681,7 @@ class NoteShort {
/**
* @param {string} name
* @returns {Promise&lt;NoteShort>|null} target note of the relation or null (if target is empty or note was not found)
* @returns {Promise&lt;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);
@@ -668,7 +691,7 @@ class NoteShort {
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;NoteShort[]>}
* @returns {Promise&lt;FNote[]>}
*/
async getRelationTargets(name) {
const relations = this.getRelations(name);
@@ -682,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]);
}
@@ -709,7 +735,7 @@ class NoteShort {
return promotedAttrs;
}
hasAncestor(ancestorNoteId, visitedNoteIds = null) {
hasAncestor(ancestorNoteId, followTemplates = false, visitedNoteIds = null) {
if (this.noteId === ancestorNoteId) {
return true;
}
@@ -723,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;
}
}
@@ -750,7 +778,7 @@ class NoteShort {
/**
* Get relations which target this note
*
* @returns {Attribute[]}
* @returns {FAttribute[]}
*/
getTargetRelations() {
return this.targetRelations
@@ -760,7 +788,7 @@ class NoteShort {
/**
* Get relations which target this note
*
* @returns {NoteShort[]}
* @returns {FNote[]}
*/
async getTargetRelationSourceNotes() {
const targetRelations = this.getTargetRelations();
@@ -771,7 +799,7 @@ class NoteShort {
/**
* Return note complement which is most importantly note's content
*
* @return {Promise&lt;NoteComplement>}
* @returns {Promise&lt;FNoteComplement>}
*/
async getNoteComplement() {
return await this.froca.getNoteComplement(this.noteId);
@@ -803,7 +831,7 @@ 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" || this.type === 'launcher')
&amp;&amp; (this.mime.startsWith("application/javascript")
@@ -881,11 +909,11 @@ class NoteShort {
}
isOptions() {
return this.noteId.startsWith("options");
return this.noteId.startsWith("_options");
}
}
export default NoteShort;
export default FNote;
</code></pre>
</article>
</section>
@@ -896,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>

View File

@@ -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>

View File

@@ -1,472 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Global</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2></h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="doRenderBody"><span class="type-signature">(async) </span>doRenderBody<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
for overriding
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line37">line 37</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id="AddButtonToToolbarOptions">AddButtonToToolbarOptions</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">id of the button, used to identify the old instances of this button to be replaced
ID is optional because of BC, but not specifying it is deprecated. ID can be alphanumeric only.</td>
</tr>
<tr>
<td class="name"><code>title</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>icon</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;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">
&lt;optional><br>
</td>
<td class="description last">keyboard shortcut for the button, e.g. "alt+t"</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line108">line 108</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Attribute.html">Attribute</a></li><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#doRenderBody">doRenderBody</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@@ -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>

View File

@@ -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>

View File

@@ -35,7 +35,7 @@ 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 "../components/app_context.js";
import NoteContextAwareWidget from "../widgets/note_context_aware_widget.js";
@@ -44,10 +44,10 @@ import SpacedUpdate from "./spaced_update.js";
import shortcutService from "./shortcuts.js";
/**
* This is the main frontend API interface for scripts. It's published in the local "api" object.
* &lt;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. &lt;code>api.showMessage(api.startNote.title);&lt;/code>&lt;/p>
*
* @constructor
* @hideconstructor
*/
function FrontendScriptApi(startNote, currentNote, originEntity = null, $container = null) {
/** @property {jQuery} container of all the rendered script content */
@@ -60,15 +60,39 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
/** @property {object|null} entity whose event triggered this execution */
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}
* @deprecated use NoteContextAwareWidget instead
*/
this.TabAwareWidget = NoteContextAwareWidget;
/**
* @property {NoteContextAwareWidget}
* @deprecated use NoteContextAwareWidget instead
*/
this.TabCachingWidget = NoteContextAwareWidget;
/**
* @property {NoteContextAwareWidget}
* @deprecated use NoteContextAwareWidget instead
*/
this.NoteContextCachingWidget = NoteContextAwareWidget;
/** @property {BasicWidget} */
this.BasicWidget = BasicWidget;
@@ -87,7 +111,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* Activates newly created note. Compared to this.activateNote() also makes sure that frontend has been fully synced.
*
* @param {string} notePath (or noteId)
* @return {Promise&lt;void>}
* @returns {Promise&lt;void>}
*/
this.activateNewNote = async notePath => {
await ws.waitForMaxKnownEntityChangeId();
@@ -99,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&lt;void>}
* @returns {Promise&lt;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');
@@ -116,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&lt;void>}
* @returns {Promise&lt;void>}
*/
this.openSplitWithNote = async (notePath, activate) => {
await ws.waitForMaxKnownEntityChangeId();
@@ -133,22 +159,19 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
}
};
/**
* @typedef {Object} AddButtonToToolbarOptions
* @property {string} [id] - id of the button, used to identify the old instances of this button to be replaced
* ID is optional because of BC, but not specifying it is deprecated. ID can be alphanumeric only.
* @property {string} title
* @property {string} [icon] - name of the boxicon to be used (e.g. "time" for "bx-time" icon)
* @property {function} action - callback handling the click on the button
* @property {string} [shortcut] - keyboard shortcut for the button, e.g. "alt+t"
*/
/**
* Adds a new launcher to the launchbar. If the launcher (id) already exists, it will be updated.
*
* @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 {AddButtonToToolbarOptions} opts
* @param {object} opts
* @property {string} [opts.id] - id of the button, used to identify the old instances of this button to be replaced
* ID is optional because of BC, but not specifying it is deprecated. ID can be alphanumeric only.
* @property {string} opts.title
* @property {string} [opts.icon] - name of the boxicon to be used (e.g. "time" for "bx-time" icon)
* @property {function} opts.action - callback handling the click on the button
* @property {string} [opts.shortcut] - keyboard shortcut for the button, e.g. "alt+t"
*/
this.addButtonToToolbar = async opts => {
console.warn("api.addButtonToToolbar() has been deprecated since v0.58 and may be removed in the future. Use Menu -> Configure Launchbar to create/update launchers instead.");
@@ -178,9 +201,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* Executes given anonymous function on the backend.
* 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.&lt;?>} params - list of parameters to the anonymous function to be send to backend
* @return {Promise&lt;*>} return value of the executed function on the backend
* @param {Array.&lt;?>} params - list of parameters to the anonymous function to be sent to backend
* @returns {Promise&lt;*>} return value of the executed function on the backend
*/
this.runOnBackend = async (script, params = []) => {
if (typeof script === "function") {
@@ -206,19 +230,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
}
};
/**
* @deprecated new name of this API call is runOnBackend so use that
* @method
*/
this.runOnServer = this.runOnBackend;
/**
* This is a powerful search method - you can search by attributes and their values, e.g.:
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
*
* @method
* @param {string} searchString
* @returns {Promise&lt;NoteShort[]>}
* @returns {Promise&lt;FNote[]>}
*/
this.searchForNotes = async searchString => {
return await searchService.searchForNotes(searchString);
@@ -230,7 +248,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*
* @method
* @param {string} searchString
* @returns {Promise&lt;NoteShort|null>}
* @returns {Promise&lt;FNote|null>}
*/
this.searchForNote = async searchString => {
const notes = await this.searchForNotes(searchString);
@@ -241,8 +259,9 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
/**
* Returns note by given noteId. If note is missing from cache, it's loaded.
**
* @method
* @param {string} noteId
* @return {Promise&lt;NoteShort>}
* @returns {Promise&lt;FNote>}
*/
this.getNote = async noteId => await froca.getNote(noteId);
@@ -252,17 +271,18 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* This is often used to bulk-fill the cache with notes which would have to be picked one by one
* otherwise (by e.g. createNoteLink())
*
* @method
* @param {string[]} noteIds
* @param {boolean} [silentNotFoundError] - don't report error if the note is not found
* @return {Promise&lt;NoteShort[]>}
* @returns {Promise&lt;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);
@@ -270,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;
@@ -322,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.
*
@@ -344,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.
*
@@ -417,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&lt;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&lt;string|null>} returns note path of active note or null if there isn't active note
@@ -445,24 +412,16 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
/**
* @method
* @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&lt;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&lt;void>}
*/
this.protectNote = async (noteId, protect) => {
await protectedSessionService.protectNote(noteId, protect, false);
@@ -472,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&lt;void>}
*/
this.protectSubTree = async (noteId, protect) => {
await protectedSessionService.protectNote(noteId, protect, true);
@@ -481,7 +441,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* Returns date-note for today. If it doesn't exist, it is automatically created.
*
* @method
* @return {Promise&lt;NoteShort>}
* @returns {Promise&lt;FNote>}
*/
this.getTodayNote = dateNotesService.getTodayNote;
@@ -490,17 +450,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*
* @method
* @param {string} date - e.g. "2019-04-29"
* @return {Promise&lt;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&lt;NoteShort>}
* @returns {Promise&lt;FNote>}
*/
this.getDayNote = dateNotesService.getDayNote;
@@ -509,7 +459,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*
* @method
* @param {string} date - e.g. "2019-04-29"
* @return {Promise&lt;NoteShort>}
* @returns {Promise&lt;FNote>}
*/
this.getWeekNote = dateNotesService.getWeekNote;
@@ -518,7 +468,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*
* @method
* @param {string} month - e.g. "2019-04"
* @return {Promise&lt;NoteShort>}
* @returns {Promise&lt;FNote>}
*/
this.getMonthNote = dateNotesService.getMonthNote;
@@ -527,7 +477,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*
* @method
* @param {string} year - e.g. "2019"
* @return {Promise&lt;NoteShort>}
* @returns {Promise&lt;FNote>}
*/
this.getYearNote = dateNotesService.getYearNote;
@@ -536,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&lt;void>}
*/
this.setHoistedNoteId = (noteId) => {
const activeNoteContext = appContext.tabManager.getActiveContext();
@@ -552,6 +502,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* @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&lt;void>}
*/
this.bindGlobalShortcut = shortcutService.bindGlobalShortcut;
@@ -563,6 +514,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* Typical use case is when new note has been created, we should wait until it is synced into frontend and only then activate it.
*
* @method
* @returns {Promise&lt;void>}
*/
this.waitUntilSynced = ws.waitForMaxKnownEntityChangeId;
@@ -570,6 +522,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* This will refresh all currently opened notes which have included note specified in the parameter
*
* @param includedNoteId - noteId of the included note
* @returns {Promise&lt;void>}
*/
this.refreshIncludedNote = includedNoteId => appContext.triggerEvent('refreshIncludedNote', {noteId: includedNoteId});
@@ -589,6 +542,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* Log given message to the log pane in UI
*
* @param message
* @returns {void}
*/
this.log = message => {
const {noteId} = this.startNote;
@@ -621,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>

View File

@@ -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 = `
&lt;div class="card widget">
&lt;div class="card-header">&lt;/div>
&lt;div id="[to be set]" class="body-wrapper">
&lt;div class="card-body">&lt;/div>
&lt;/div>
&lt;/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>

View File

@@ -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",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3128
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.58.1-beta",
"version": "0.59.1",
"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": {
"@braintree/sanitize-url": "6.0.2",
"@electron/remote": "2.0.9",
"@excalidraw/excalidraw": "0.13.0",
"@excalidraw/excalidraw": "0.14.2",
"archiver": "5.3.1",
"async-mutex": "0.4.0",
"axios": "1.2.1",
"axios": "1.3.3",
"better-sqlite3": "7.4.5",
"chokidar": "3.5.3",
"cls-hooked": "4.2.2",
@@ -46,6 +49,7 @@
"electron-debug": "3.2.0",
"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.7.0",
@@ -60,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.3",
"jsdom": "21.1.0",
"mime-types": "2.1.35",
"multer": "1.4.5-lts.1",
"node-abi": "3.30.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",
@@ -75,7 +79,7 @@
"rimraf": "3.0.2",
"safe-compare": "1.1.4",
"sanitize-filename": "1.6.3",
"sanitize-html": "2.8.1",
"sanitize-html": "2.9.0",
"sax": "1.2.4",
"semver": "7.3.8",
"serve-favicon": "2.5.0",
@@ -85,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": {
@@ -96,7 +101,7 @@
"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.75.0",

View File

@@ -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);
}

View File

@@ -1,6 +1,6 @@
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');
@@ -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", () => {

View File

@@ -1,12 +1,12 @@
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}`);

View File

@@ -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();
@@ -36,7 +36,7 @@ class Becca {
return this.getNote('root');
}
/** @returns {Attribute[]} */
/** @returns {BAttribute[]} */
findAttributes(type, name) {
name = name.trim().toLowerCase();
@@ -47,7 +47,7 @@ class Becca {
return this.attributeIndex[`${type}-${name}`] || [];
}
/** @returns {Attribute[]} */
/** @returns {BAttribute[]} */
findAttributesWithPrefix(type, name) {
const resArr = [];
const key = `${type}-${name}`;
@@ -72,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 = [];
@@ -98,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];
}
@@ -152,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) */

View File

@@ -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();

View File

@@ -2,7 +2,6 @@
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) {
@@ -83,10 +82,8 @@ function getNoteTitleArrayForPath(notePathArray) {
throw new Error(`${notePathArray} is not an array.`);
}
const hoistedNoteId = cls.getHoistedNoteId();
if (notePathArray.length === 1 && notePathArray[0] === hoistedNoteId) {
return [getNoteTitle(hoistedNoteId)];
if (notePathArray.length === 1) {
return [getNoteTitle(notePathArray[0])];
}
const titles = [];
@@ -95,6 +92,7 @@ function getNoteTitleArrayForPath(notePathArray) {
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) {
@@ -126,35 +124,43 @@ 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
// each branch needs a separate copy since it's mutable
return getSomePathInner(note, [...path], true)
|| getSomePathInner(note, [...path], false);
return getSomePathInner(note, path, true)
|| 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;
@@ -180,7 +186,7 @@ function getNotePath(noteId) {
let branchId;
if (note.isRoot()) {
branchId = 'root';
branchId = 'none_root';
}
else {
const parentNote = note.parents[0];

View File

@@ -13,7 +13,7 @@ let becca = null;
/**
* Base class for all backend entities.
*/
class AbstractEntity {
class AbstractBeccaEntity {
/** @protected */
beforeSaving() {
this.generateIdIfNecessary();
@@ -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;

View File

@@ -1,7 +1,7 @@
"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");
@@ -11,9 +11,9 @@ const {sanitizeAttributeName} = require("../../services/sanitize_attribute_name"
* Attribute is an abstract concept which has two real uses - label (key - value pair)
* 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"]; }
@@ -70,7 +70,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);
@@ -102,7 +102,7 @@ class Attribute extends AbstractEntity {
get isAffectingSubtree() {
return this.isInheritable
|| (this.type === 'relation' && this.name === 'template');
|| (this.type === 'relation' && ['template', 'inherit'].includes(this.name));
}
get targetNoteId() { // alias
@@ -124,7 +124,7 @@ class Attribute extends AbstractEntity {
}
/**
* @returns {Note|null}
* @returns {BNote|null}
*/
getNote() {
const note = this.becca.getNote(this.noteId);
@@ -137,7 +137,7 @@ class Attribute extends AbstractEntity {
}
/**
* @returns {Note|null}
* @returns {BNote|null}
*/
getTargetNote() {
if (this.type !== 'relation') {
@@ -152,7 +152,7 @@ class Attribute extends AbstractEntity {
}
/**
* @return {boolean}
* @returns {boolean}
*/
isDefinition() {
return this.type === 'label' && (this.name.startsWith('label:') || this.name.startsWith('relation:'));
@@ -176,8 +176,10 @@ class Attribute extends AbstractEntity {
return !(this.attributeId in this.becca.attributes);
}
beforeSaving() {
this.validate();
beforeSaving(opts = {}) {
if (!opts.skipValidation) {
this.validate();
}
this.name = sanitizeAttributeName(this.name);
@@ -217,7 +219,7 @@ class Attribute extends AbstractEntity {
}
createClone(type, name, value, isInheritable) {
return new Attribute({
return new BAttribute({
noteId: this.noteId,
type: type,
name: name,
@@ -229,4 +231,4 @@ class Attribute extends AbstractEntity {
}
}
module.exports = Attribute;
module.exports = BAttribute;

View File

@@ -1,7 +1,7 @@
"use strict";
const Note = require('./note');
const AbstractEntity = require("./abstract_entity");
const BNote = require('./bnote');
const AbstractBeccaEntity = require("./abstract_becca_entity");
const dateUtils = require("../../services/date_utils");
const utils = require("../../services/utils");
const TaskContext = require("../../services/task_context");
@@ -15,9 +15,9 @@ const log = require("../../services/log");
* Note that you should not rely on the branch's identity, since it can change easily with a note's move.
* Always check noteId instead.
*
* @extends AbstractEntity
* @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
@@ -53,7 +53,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;
@@ -78,7 +78,7 @@ class Branch extends AbstractEntity {
childNote.parentBranches.push(this);
}
if (this.branchId === 'root') {
if (this.noteId === 'root') {
return;
}
@@ -93,11 +93,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];
@@ -107,11 +107,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];
@@ -140,7 +140,7 @@ class Branch extends AbstractEntity {
* @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) {
@@ -165,8 +165,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");
@@ -209,11 +208,19 @@ 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) {
let maxNotePos = 0;
for (const childBranch of this.parentNote.getChildBranches()) {
if (maxNotePos < childBranch.notePosition && childBranch.noteId !== '_hidden') {
if (maxNotePos < childBranch.notePosition
&& childBranch.noteId !== '_hidden' // hidden has very large notePosition to always stay last
) {
maxNotePos = childBranch.notePosition;
}
}
@@ -225,6 +232,10 @@ class Branch extends AbstractEntity {
this.isExpanded = false;
}
if (!this.prefix?.trim()) {
this.prefix = null;
}
this.utcDateModified = dateUtils.utcNowDateTime();
super.beforeSaving();
@@ -246,14 +257,21 @@ 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;

View File

@@ -1,7 +1,7 @@
"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.
@@ -12,9 +12,9 @@ const AbstractEntity = require("./abstract_entity");
* The format user is presented with is "<etapiTokenId>_<tokenHash>". This is also called "authToken" to distinguish it
* 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"]; }
@@ -75,4 +75,4 @@ class EtapiToken extends AbstractEntity {
}
}
module.exports = EtapiToken;
module.exports = BEtapiToken;

View File

@@ -6,12 +6,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');
dayjs.extend(utc)
const eventService = require("../../services/events");
dayjs.extend(utc);
const LABEL = 'label';
const RELATION = 'relation';
@@ -19,9 +20,9 @@ const RELATION = 'relation';
/**
* Trilium's main entity which can represent text note, image, code note, file attachment etc.
*
* @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"]; }
@@ -89,33 +90,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;
@@ -151,7 +152,7 @@ class Note extends AbstractEntity {
return this.isContentAvailable() ? this.title : '[protected]';
}
/** @returns {Branch[]} */
/** @returns {BBranch[]} */
getParentBranches() {
return this.parentBranches;
}
@@ -159,26 +160,26 @@ class Note extends AbstractEntity {
/**
* Returns <i>strong</i> (as opposed to <i>weak</i>) parent branches. See isWeak for details.
*
* @returns {Branch[]}
* @returns {BBranch[]}
*/
getStrongParentBranches() {
return this.getParentBranches().filter(branch => !branch.isWeak);
}
/**
* @returns {Branch[]}
* @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;
}
@@ -188,16 +189,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)
*/
@@ -314,6 +315,11 @@ class Note extends AbstractEntity {
utcDateChanged: pojo.utcDateModified,
isSynced: true
});
eventService.emit(eventService.ENTITY_CHANGED, {
entityName: 'note_contents',
entity: this
});
}
setJsonContent(content) {
@@ -344,6 +350,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);
@@ -369,15 +381,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.__validateTypeName(type, name);
this.__getAttributes([]);
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);
@@ -391,6 +402,13 @@ class Note extends AbstractEntity {
}
}
/** @private */
__ensureAttributeCacheIsAvailable() {
if (!this.__attributeCache) {
this.__getAttributes([]);
}
}
/** @private */
__getAttributes(path) {
if (path.includes(this.noteId)) {
@@ -401,7 +419,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));
}
@@ -410,7 +429,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) {
@@ -449,7 +468,7 @@ class Note extends AbstractEntity {
/**
* @private
* @returns {Attribute[]}
* @returns {BAttribute[]}
*/
__getInheritableAttributes(path) {
if (path.includes(this.noteId)) {
@@ -484,9 +503,9 @@ class Note extends AbstractEntity {
*/
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
);
}
@@ -495,13 +514,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;
}
@@ -536,25 +555,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); }
@@ -595,12 +614,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);
}
/**
@@ -627,7 +646,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);
@@ -643,7 +662,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);
@@ -659,7 +678,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);
@@ -667,7 +686,7 @@ 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);
@@ -677,16 +696,16 @@ class Note extends AbstractEntity {
* @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 {Attribute[]} note's "owned" attributes - excluding inherited ones
* @returns {BAttribute[]} note's "owned" attributes - excluding inherited ones
*/
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);
@@ -700,7 +719,7 @@ class Note extends AbstractEntity {
}
/**
* @returns {Attribute} attribute belonging to this specific note (excludes inherited attributes)
* @returns {BAttribute} attribute belonging to this specific note (excludes inherited attributes)
*
* This method can be significantly faster than the getAttribute()
*/
@@ -714,28 +733,55 @@ 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) {
@@ -790,7 +836,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) {
@@ -808,7 +854,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) {
@@ -828,16 +874,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;
}
@@ -848,7 +895,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) {
@@ -863,7 +910,7 @@ class Note extends AbstractEntity {
return Array.from(set);
}
/** @return {Note[]} */
/** @returns {BNote[]} */
getSearchResultNotes() {
if (this.type !== 'search') {
return [];
@@ -885,7 +932,7 @@ class Note extends AbstractEntity {
}
/**
* @returns {{notes: Note[], relationships: Array.<{parentNoteId: string, childNoteId: string}>}}
* @returns {{notes: BNote[], relationships: Array.<{parentNoteId: string, childNoteId: string}>}}
*/
getSubtree({includeArchived = true, includeHidden = false, resolveSearch = false} = {}) {
const noteSet = new Set();
@@ -945,13 +992,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();
}
@@ -1001,10 +1049,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();
@@ -1049,13 +1097,13 @@ class Note extends AbstractEntity {
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) {
@@ -1081,13 +1129,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') {
@@ -1106,9 +1155,30 @@ 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;
} else 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();
@@ -1136,9 +1206,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,
@@ -1171,13 +1241,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,
@@ -1192,8 +1263,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);
@@ -1204,9 +1275,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);
@@ -1349,7 +1420,7 @@ class Note extends AbstractEntity {
}
isOptions() {
return this.noteId.startsWith("options");
return this.noteId.startsWith("_options");
}
get isDeleted() {
@@ -1357,7 +1428,7 @@ class Note extends AbstractEntity {
}
/**
* @return {NoteRevision|null}
* @returns {BNoteRevision|null}
*/
saveNoteRevision() {
const content = this.getContent();
@@ -1368,7 +1439,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,
@@ -1432,4 +1503,4 @@ class Note extends AbstractEntity {
}
}
module.exports = Note;
module.exports = BNote;

View File

@@ -6,15 +6,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"]; }
@@ -106,7 +106,7 @@ class NoteRevision extends AbstractEntity {
}
}
setContent(content, ignoreMissingProtectedSession = false) {
setContent(content) {
const pojo = {
noteRevisionId: this.noteRevisionId,
content: content,
@@ -117,7 +117,7 @@ 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.`);
}
}
@@ -166,7 +166,7 @@ class NoteRevision extends AbstractEntity {
utcDateLastEdited: this.utcDateLastEdited,
utcDateCreated: this.utcDateCreated,
utcDateModified: this.utcDateModified,
content: this.content,
content: this.content, // used when retrieving full note revision to frontend
contentLength: this.contentLength
};
}
@@ -190,4 +190,4 @@ class NoteRevision extends AbstractEntity {
}
}
module.exports = NoteRevision;
module.exports = BNoteRevision;

View File

@@ -1,14 +1,14 @@
"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"]; }
@@ -16,6 +16,11 @@ class Option extends AbstractEntity {
constructor(row) {
super();
this.updateFromRow(row);
this.becca.options[this.name] = this;
}
updateFromRow(row) {
/** @type {string} */
this.name = row.name;
/** @type {string} */
@@ -24,8 +29,6 @@ class Option extends AbstractEntity {
this.isSynced = !!row.isSynced;
/** @type {string} */
this.utcDateModified = row.utcDateModified;
this.becca.options[this.name] = this;
}
beforeSaving() {
@@ -44,4 +47,4 @@ class Option extends AbstractEntity {
}
}
module.exports = Option;
module.exports = BOption;

View File

@@ -1,14 +1,14 @@
"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"; }
@@ -32,4 +32,4 @@ class RecentNote extends AbstractEntity {
}
}
module.exports = RecentNote;
module.exports = BRecentNote;

View File

@@ -1,21 +1,21 @@
const Note = require('./entities/note');
const NoteRevision = require('./entities/note_revision');
const Branch = require('./entities/branch');
const Attribute = require('./entities/attribute');
const RecentNote = require('./entities/recent_note');
const EtapiToken = require('./entities/etapi_token');
const Option = require('./entities/option');
const BNote = require('./entities/bnote');
const BNoteRevision = require('./entities/bnote_revision');
const BBranch = require('./entities/bbranch');
const BAttribute = require('./entities/battribute');
const BRecentNote = require('./entities/brecent_note');
const BEtapiToken = require('./entities/betapi_token');
const BOption = require('./entities/boption');
const ENTITY_NAME_TO_ENTITY = {
"attributes": Attribute,
"branches": Branch,
"notes": Note,
"note_contents": Note,
"note_revisions": NoteRevision,
"note_revision_contents": NoteRevision,
"recent_notes": RecentNote,
"etapi_tokens": EtapiToken,
"options": Option
"attributes": BAttribute,
"branches": BBranch,
"notes": BNote,
"note_contents": BNote,
"note_revisions": BNoteRevision,
"note_revision_contents": BNoteRevision,
"recent_notes": BRecentNote,
"etapi_tokens": BEtapiToken,
"options": BOption
};
function getEntityFromEntityName(entityName) {

View File

@@ -40,7 +40,7 @@ function filterUrlValue(value) {
}
/**
* @param {Note} note
* @param {BNote} note
*/
function buildRewardMap(note) {
// Need to use Map instead of object: https://github.com/zadam/trilium/issues/1895
@@ -261,7 +261,7 @@ async function findSimilarNotes(noteId) {
let counter = 0;
// when the title is very long then weight of each individual word should be lower
// when the title is very long then weight of each individual word should be lowered
// also pretty important in e.g. long URLs in label values
const lengthPenalization = 1 / Math.pow(text.length, 0.3);
@@ -448,7 +448,7 @@ async function findSimilarNotes(noteId) {
}
/**
* Point of this is to break up long running sync process to avoid blocking
* Point of this is to break up long-running sync process to avoid blocking
* see https://snyk.io/blog/nodejs-how-even-quick-async-functions-can-block-the-event-loop-starve-io/
*/
function setImmediatePromise() {

View File

@@ -1,7 +1,7 @@
const becca = require("../becca/becca");
const eu = require("./etapi_utils");
const mappers = require("./mappers");
const Branch = require("../becca/entities/branch");
const BBranch = require("../becca/entities/bbranch");
const entityChangesService = require("../services/entity_changes");
const v = require("./validators");
@@ -35,15 +35,14 @@ function register(router) {
existing.save();
return res.status(200).json(mappers.mapBranchToPojo(existing));
}
} else {
try {
const branch = new BBranch(params).save();
try {
const branch = new Branch(params).save();
res.status(201).json(mappers.mapBranchToPojo(branch));
}
catch (e) {
throw new eu.EtapiError(400, eu.GENERIC_CODE, e.message);
res.status(201).json(mappers.mapBranchToPojo(branch));
} catch (e) {
throw new eu.EtapiError(400, eu.GENERIC_CODE, e.message);
}
}
});

View File

@@ -291,6 +291,33 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/notes/{noteId}/note-revision:
parameters:
- name: noteId
in: path
required: true
schema:
$ref: '#/components/schemas/EntityId'
- name: format
in: query
required: false
schema:
enum:
- html
- markdown
default: html
post:
description: Create a note revision for the given note
operationId: createNoteRevision
responses:
'204':
description: revision has been created
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/branches/{branchId}:
parameters:
- name: branchId

View File

@@ -122,6 +122,8 @@ function register(router) {
note.setContent(req.body);
noteService.asyncPostProcessContent(note, req.body);
return res.sendStatus(204);
});
@@ -143,18 +145,26 @@ function register(router) {
zipExportService.exportToZip(taskContext, branch, format, res);
});
eu.route(router, 'post' ,'/etapi/notes/:noteId/note-revision', (req, res, next) => {
const note = eu.getAndCheckNote(req.params.noteId);
note.saveNoteRevision();
return res.sendStatus(204);
});
}
function parseSearchParams(req) {
const rawSearchParams = {
'fastSearch': parseBoolean(req.query, 'fastSearch'),
'includeArchivedNotes': parseBoolean(req.query, 'includeArchivedNotes'),
'ancestorNoteId': req.query['ancestorNoteId'],
'ancestorDepth': parseInteger(req.query, 'ancestorDepth'),
'orderBy': req.query['orderBy'],
'orderDirection': parseOrderDirection(req.query, 'orderDirection'),
'limit': parseInteger(req.query, 'limit'),
'debug': parseBoolean(req.query, 'debug')
fastSearch: parseBoolean(req.query, 'fastSearch'),
includeArchivedNotes: parseBoolean(req.query, 'includeArchivedNotes'),
ancestorNoteId: req.query['ancestorNoteId'],
ancestorDepth: req.query['ancestorDepth'], // e.g. "eq5"
orderBy: req.query['orderBy'],
orderDirection: parseOrderDirection(req.query, 'orderDirection'),
limit: parseInteger(req.query, 'limit'),
debug: parseBoolean(req.query, 'debug')
};
const searchParams = {};

View File

@@ -16,7 +16,7 @@ function isString(obj) {
if (obj === undefined || obj === null) {
return;
}
if (typeof obj !== 'string') {
return `'${obj}' is not a string`;
}
@@ -26,7 +26,7 @@ function isBoolean(obj) {
if (obj === undefined || obj === null) {
return;
}
if (typeof obj !== 'boolean') {
return `'${obj}' is not a boolean`;
}
@@ -36,7 +36,7 @@ function isInteger(obj) {
if (obj === undefined || obj === null) {
return;
}
if (!Number.isInteger(obj)) {
return `'${obj}' is not an integer`;
}
@@ -46,13 +46,13 @@ function isNoteId(obj) {
if (obj === undefined || obj === null) {
return;
}
const becca = require('../becca/becca');
if (typeof obj !== 'string') {
return `'${obj}' is not a valid noteId`;
}
if (!(obj in becca.notes)) {
return `Note '${obj}' does not exist`;
}
@@ -84,8 +84,8 @@ function isValidEntityId(obj) {
if (obj === undefined || obj === null) {
return;
}
if (typeof obj !== 'string' || !/^[A-Za-z0-9]{4,32}$/.test(obj)) {
if (typeof obj !== 'string' || !/^[A-Za-z0-9_]{4,128}$/.test(obj)) {
return `'${obj}' is not a valid entityId. Only alphanumeric characters are allowed of length 4 to 32.`;
}
}
@@ -100,4 +100,4 @@ module.exports = {
isNoteType,
isAttributeType,
isValidEntityId
};
};

View File

@@ -88,12 +88,12 @@ class AppContext extends Component {
this.triggerEvent('initialRenderComplete');
}
/** @returns {Promise} */
triggerEvent(name, data) {
/** @returns {Promise<void>} */
triggerEvent(name, data = {}) {
return this.handleEvent(name, data);
}
/** @returns {Promise} */
/** @returns {Promise<*>} */
triggerCommand(name, data = {}) {
for (const executor of this.components) {
const fun = executor[`${name}Command`];

View File

@@ -4,11 +4,11 @@ import utils from '../services/utils.js';
* Abstract class for all components in the Trilium's frontend.
*
* Contains also event implementation with following properties:
* - event / command distribution is synchronous which among others mean that events are well ordered - event
* - event / command distribution is synchronous which among others mean that events are well-ordered - event
* which was sent out first will also be processed first by the component
* - execution of the event / command is asynchronous - each component executes the event on its own without regard for
* other components.
* - although the execution is async, we are collecting all the promises and therefore it is possible to wait until the
* - although the execution is async, we are collecting all the promises, and therefore it is possible to wait until the
* event / command is executed in all components - by simply awaiting the `triggerEvent()`.
*/
export default class Component {
@@ -40,7 +40,7 @@ export default class Component {
return this;
}
/** @returns {Promise} */
/** @returns {Promise<void>} */
handleEvent(name, data) {
try {
const callMethodPromise = this.initialized
@@ -61,13 +61,13 @@ export default class Component {
}
}
/** @returns {Promise} */
triggerEvent(name, data) {
/** @returns {Promise<void>} */
triggerEvent(name, data = {}) {
return this.parent.triggerEvent(name, data);
}
/** @returns {Promise} */
handleEventInChildren(name, data) {
/** @returns {Promise<void>} */
handleEventInChildren(name, data = {}) {
const promises = [];
for (const child of this.children) {
@@ -82,7 +82,7 @@ export default class Component {
return promises.length > 0 ? Promise.all(promises) : null;
}
/** @returns {Promise} */
/** @returns {Promise<*>} */
triggerCommand(name, data = {}) {
const fun = this[`${name}Command`];

View File

@@ -9,15 +9,14 @@ import hoistedNoteService from "../services/hoisted_note.js";
import options from "../services/options.js";
class NoteContext extends Component {
/**
* @param {string|null} ntxId
*/
constructor(ntxId = null, hoistedNoteId = 'root', mainNtxId = null) {
super();
this.ntxId = ntxId || utils.randomString(4);
this.hoistedNoteId = hoistedNoteId;
this.mainNtxId = mainNtxId;
this.resetViewScope();
}
setEmpty() {
@@ -30,13 +29,17 @@ class NoteContext extends Component {
noteContext: this,
notePath: this.notePath
});
this.resetViewScope();
}
isEmpty() {
return !this.noteId;
}
async setNote(inputNotePath, triggerSwitchEvent = true) {
async setNote(inputNotePath, opts = {}) {
opts.triggerSwitchEvent = opts.triggerSwitchEvent !== undefined ? opts.triggerSwitchEvent : true;
const resolvedNotePath = await this.getResolvedNotePath(inputNotePath);
if (!resolvedNotePath) {
@@ -50,19 +53,28 @@ class NoteContext extends Component {
this.notePath = resolvedNotePath;
({noteId: this.noteId, parentNoteId: this.parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(resolvedNotePath));
this.readOnlyTemporarilyDisabled = false;
this.resetViewScope();
this.viewScope.viewMode = opts.viewMode || "default";
this.saveToRecentNotes(resolvedNotePath);
protectedSessionHolder.touchProtectedSessionIfNecessary(this.note);
if (triggerSwitchEvent) {
if (opts.triggerSwitchEvent) {
await this.triggerEvent('noteSwitched', {
noteContext: this,
notePath: this.notePath
});
}
await this.setHoistedNoteIfNeeded();
if (utils.isMobile()) {
this.triggerCommand('setActiveScreen', {screen: 'detail'});
}
}
async setHoistedNoteIfNeeded() {
if (this.hoistedNoteId === 'root'
&& this.notePath.startsWith("root/_hidden")
&& !this.note.hasLabel("keepCurrentHoisting")
@@ -79,10 +91,6 @@ class NoteContext extends Component {
await this.setHoistedNoteId(hoistedNoteId);
}
if (utils.isMobile()) {
this.triggerCommand('setActiveScreen', {screen: 'detail'});
}
}
getSubContexts() {
@@ -140,7 +148,7 @@ class NoteContext extends Component {
return resolvedNotePath;
}
/** @property {NoteShort} */
/** @property {FNote} */
get note() {
if (!this.noteId || !(this.noteId in froca.notes)) {
return null;
@@ -154,7 +162,7 @@ class NoteContext extends Component {
return this.notePath ? this.notePath.split('/') : [];
}
/** @returns {NoteComplement} */
/** @returns {FNoteComplement} */
async getNoteComplement() {
if (!this.noteId) {
return null;
@@ -178,7 +186,8 @@ class NoteContext extends Component {
mainNtxId: this.mainNtxId,
notePath: this.notePath,
hoistedNoteId: this.hoistedNoteId,
active: this.isActive()
active: this.isActive(),
viewMode: this.viewScope.viewMode
}
}
@@ -204,7 +213,7 @@ class NoteContext extends Component {
}
async isReadOnly() {
if (this.readOnlyTemporarilyDisabled) {
if (this.viewScope.readOnlyTemporarilyDisabled) {
return false;
}
@@ -219,9 +228,9 @@ class NoteContext extends Component {
const noteComplement = await this.getNoteComplement();
const sizeLimit = this.note.type === 'text' ?
options.getInt('autoReadonlySizeText')
: options.getInt('autoReadonlySizeCode');
const sizeLimit = this.note.type === 'text'
? options.getInt('autoReadonlySizeText')
: options.getInt('autoReadonlySizeCode');
return noteComplement.content
&& noteComplement.content.length > sizeLimit
@@ -246,6 +255,7 @@ class NoteContext extends Component {
hasNoteList() {
return this.note
&& this.viewScope.viewMode === 'default'
&& this.note.hasChildren()
&& ['book', 'text', 'code'].includes(this.note.type)
&& this.note.mime !== 'text/x-sqlite;schema=trilium'
@@ -280,6 +290,13 @@ class NoteContext extends Component {
ntxId: this.ntxId
}));
}
resetViewScope() {
// view scope contains data specific to one note context and one "view".
// it is used to e.g. make read-only note temporarily editable or to hide TOC
// this is reset after navigating to a different note
this.viewScope = {};
}
}
export default NoteContext;

View File

@@ -10,7 +10,7 @@ import froca from "../services/froca.js";
export default class RootCommandExecutor extends Component {
editReadOnlyNoteCommand() {
const noteContext = appContext.tabManager.getActiveContext();
noteContext.readOnlyTemporarilyDisabled = true;
noteContext.viewScope.readOnlyTemporarilyDisabled = true;
appContext.triggerEvent("readOnlyTemporarilyDisabled", { noteContext });
}
@@ -18,7 +18,7 @@ export default class RootCommandExecutor extends Component {
async showSQLConsoleCommand() {
const sqlConsoleNote = await dateNoteService.createSqlConsole();
const noteContext = await appContext.tabManager.openContextWithNote(sqlConsoleNote.noteId, true);
const noteContext = await appContext.tabManager.openContextWithNote(sqlConsoleNote.noteId, { activate: true });
appContext.triggerEvent('focusOnDetail', {ntxId: noteContext.ntxId});
}
@@ -32,7 +32,10 @@ export default class RootCommandExecutor extends Component {
const activeNoteContext = appContext.tabManager.getActiveContext();
const hoistedNoteId = activeNoteContext?.hoistedNoteId || 'root';
const noteContext = await appContext.tabManager.openContextWithNote(searchNote.noteId, true, null, hoistedNoteId);
const noteContext = await appContext.tabManager.openContextWithNote(searchNote.noteId, {
activate: true,
hoistedNoteId
});
appContext.triggerCommand('focusOnSearchDefinition', {ntxId: noteContext.ntxId});
}
@@ -73,7 +76,7 @@ export default class RootCommandExecutor extends Component {
}
async showBackendLogCommand() {
await appContext.tabManager.openContextWithNote('_backendLog', true);
await appContext.tabManager.openContextWithNote('_backendLog', { activate: true });
}
async showLaunchBarSubtreeCommand() {
@@ -88,8 +91,11 @@ export default class RootCommandExecutor extends Component {
await this.showAndHoistSubtree('_hidden');
}
async showOptionsCommand() {
await this.showAndHoistSubtree('_options');
async showOptionsCommand({section}) {
await appContext.tabManager.openContextWithNote(section || '_options', {
activate: true,
hoistedNoteId: '_options'
});
}
async showSQLConsoleHistoryCommand() {
@@ -101,6 +107,17 @@ export default class RootCommandExecutor extends Component {
}
async showAndHoistSubtree(subtreeNoteId) {
await appContext.tabManager.openContextWithNote(subtreeNoteId, true, null, subtreeNoteId);
await appContext.tabManager.openContextWithNote(subtreeNoteId, {
activate: true,
hoistedNoteId: subtreeNoteId
});
}
async showNoteSourceCommand() {
const notePath = appContext.tabManager.getActiveContextNotePath();
if (notePath) {
await appContext.tabManager.openContextWithNote(notePath, { activate: true, viewMode: 'source' });
}
}
}

View File

@@ -79,11 +79,12 @@ export default class TabManager extends Component {
filteredTabs = filteredTabs.filter(tab => tab.active);
}
if (filteredTabs.length === 0) {
const [notePath] = treeService.getHashValueFromAddress();
// resolve before opened tabs can change this
const [notePathInUrl, ntxIdInUrl] = treeService.getHashValueFromAddress();
if (filteredTabs.length === 0) {
filteredTabs.push({
notePath: notePath || 'root',
notePath: notePathInUrl || 'root',
active: true,
hoistedNoteId: glob.extraHoistedNoteId || 'root'
});
@@ -95,17 +96,20 @@ export default class TabManager extends Component {
await this.tabsUpdate.allowUpdateWithoutChange(async () => {
for (const tab of filteredTabs) {
await this.openContextWithNote(tab.notePath, tab.active, tab.ntxId, tab.hoistedNoteId, tab.mainNtxId);
await this.openContextWithNote(tab.notePath, {
activate: tab.active,
ntxId: tab.ntxId,
mainNtxId: tab.mainNtxId,
hoistedNoteId: tab.hoistedNoteId,
viewMode: tab.viewMode
});
}
});
// if there's notePath in the URL, make sure it's open and active
// (useful, for e.g. opening clipped notes from clipper or opening link in an extra window)
if (treeService.isNotePathInAddress()) {
const [notePath, ntxId] = treeService.getHashValueFromAddress();
await appContext.tabManager.switchToNoteContext(ntxId, notePath);
if (notePathInUrl) {
await appContext.tabManager.switchToNoteContext(ntxIdInUrl, notePathInUrl);
}
}
catch (e) {
@@ -181,7 +185,7 @@ export default class TabManager extends Component {
return activeContext ? activeContext.notePath : null;
}
/** @returns {NoteShort} */
/** @returns {FNote} */
getActiveContextNote() {
const activeContext = this.getActiveContext();
return activeContext ? activeContext.note : null;
@@ -279,14 +283,24 @@ export default class TabManager extends Component {
}
}
return this.openContextWithNote(notePath, activate, null, hoistedNoteId);
return this.openContextWithNote(notePath, { activate, hoistedNoteId });
}
async openContextWithNote(notePath, activate, ntxId = null, hoistedNoteId = 'root', mainNtxId = null) {
async openContextWithNote(notePath, opts = {}) {
const activate = !!opts.activate;
const ntxId = opts.ntxId || null;
const mainNtxId = opts.mainNtxId || null;
const hoistedNoteId = opts.hoistedNoteId || 'root';
const viewMode = opts.viewMode || "default";
const noteContext = await this.openEmptyTab(ntxId, hoistedNoteId, mainNtxId);
if (notePath) {
await noteContext.setNote(notePath, !activate); // if activate is false then send normal noteSwitched event
await noteContext.setNote(notePath, {
// if activate is false then send normal noteSwitched event
triggerSwitchEvent: !activate,
viewMode: viewMode
});
}
if (activate) {
@@ -312,7 +326,7 @@ export default class TabManager extends Component {
// if no tab with this note has been found we'll create new tab
await this.openContextWithNote(noteId, true);
await this.openContextWithNote(noteId, { activate: true });
}
async activateNoteContext(ntxId, triggerEvent = true) {
@@ -477,13 +491,13 @@ export default class TabManager extends Component {
this.openAndActivateEmptyTab();
}
async removeAllTabsCommand() {
async closeAllTabsCommand() {
for (const ntxIdToRemove of this.mainNoteContexts.map(nc => nc.ntxId)) {
await this.removeNoteContext(ntxIdToRemove);
}
}
async removeAllTabsExceptForThisCommand({ntxId}) {
async closeOtherTabsCommand({ntxId}) {
for (const ntxIdToRemove of this.mainNoteContexts.map(nc => nc.ntxId)) {
if (ntxIdToRemove !== ntxId) {
await this.removeNoteContext(ntxIdToRemove);
@@ -491,6 +505,10 @@ export default class TabManager extends Component {
}
}
async closeTabCommand({ntxId}) {
await this.removeNoteContext(ntxId);
}
async moveTabToNewWindowCommand({ntxId}) {
const {notePath, hoistedNoteId} = this.getNoteContextById(ntxId);

View File

@@ -31,7 +31,7 @@ class ZoomComponent extends Component {
async setZoomFactorAndSave(zoomFactor) {
if (zoomFactor >= MIN_ZOOM && zoomFactor <= MAX_ZOOM) {
zoomFactor = Math.round(zoomFactor * 1000) / 1000;
zoomFactor = Math.round(zoomFactor * 10) / 10;
this.setZoomFactor(zoomFactor);

View File

@@ -0,0 +1,3 @@
<p>Back and Forward buttons allow you to move in the navigation history.</p>
<p>These launchers are active only in the desktop build and will be ignored in the server edition where you can use the native browser navigation buttons instead.</p>

View File

@@ -8,5 +8,5 @@
<h4>Example script</h4>
<pre>
alert("Current note is " + api.getActiveContextNote().title);
api.showMessage("Current note is " + api.getActiveContextNote().title);
</pre>

View File

@@ -4,7 +4,7 @@ import promotedAttributeDefinitionParser from '../services/promoted_attribute_de
* Attribute is an abstract concept which has two real uses - label (key - value pair)
* and relation (representing named relationship between source and target note)
*/
class Attribute {
class FAttribute {
constructor(froca, row) {
this.froca = froca;
@@ -28,12 +28,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;
@@ -53,7 +53,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() {
@@ -76,4 +76,4 @@ class Attribute {
}
}
export default Attribute;
export default FAttribute;

View File

@@ -2,7 +2,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;
@@ -29,17 +29,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);
}
@@ -50,7 +50,7 @@ class Branch {
}
get toString() {
return `Branch(branchId=${this.branchId})`;
return `FBranch(branchId=${this.branchId})`;
}
get pojo() {
@@ -60,4 +60,4 @@ class Branch {
}
}
export default Branch;
export default FBranch;

View File

@@ -26,12 +26,7 @@ const NOTE_TYPE_ICONS = {
"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
@@ -78,7 +73,7 @@ class NoteShort {
this.mime = row.mime;
}
addParent(parentNoteId, branchId) {
addParent(parentNoteId, branchId, sort = true) {
if (parentNoteId === 'none') {
return;
}
@@ -88,6 +83,10 @@ class NoteShort {
}
this.parentToBranch[parentNoteId] = branchId;
if (sort) {
this.sortParents();
}
}
addChild(childNoteId, branchId, sort = true) {
@@ -118,7 +117,7 @@ class NoteShort {
}
async getContent() {
// we're not caching content since these objects are in froca and as such pretty long lived
// we're not caching content since these objects are in froca and as such pretty long-lived
const note = await server.get(`notes/${this.noteId}`);
return note.content;
@@ -153,7 +152,7 @@ class NoteShort {
}
/**
* @returns {Branch[]}
* @returns {FBranch[]}
*/
getParentBranches() {
const branchIds = Object.values(this.parentToBranch);
@@ -162,7 +161,7 @@ class NoteShort {
}
/**
* @returns {Branch[]}
* @returns {FBranch[]}
* @deprecated use getParentBranches() instead
*/
getBranches() {
@@ -174,7 +173,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]);
@@ -187,14 +186,14 @@ class NoteShort {
return this.parents;
}
/** @returns {NoteShort[]} */
/** @returns {FNote[]} */
getParentNotes() {
return this.froca.getNotesFromCache(this.parents);
}
// 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
resortParents() {
sortParents() {
this.parents.sort((aNoteId, bNoteId) => {
const aBranchId = this.parentToBranch[aNoteId];
@@ -202,9 +201,9 @@ class NoteShort {
return 1;
}
const aNote = this.froca.getNoteFromCache([aNoteId]);
const aNote = this.froca.getNoteFromCache(aNoteId);
if (aNote.hasLabel('archived')) {
if (aNote.isArchived || aNote.isHiddenCompletely()) {
return 1;
}
@@ -212,12 +211,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);
}
@@ -225,7 +228,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
@@ -238,7 +241,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);
@@ -255,7 +258,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') {
@@ -264,7 +268,7 @@ class NoteShort {
}
}
for (const templateAttr of attrArrs.flat().filter(attr => attr.type === 'relation' && attr.name === 'template')) {
for (const templateAttr of attrArrs.flat().filter(attr => attr.type === 'relation' && ['template', 'inherit'].includes(attr.name))) {
const templateNote = this.froca.notes[templateAttr.value];
if (templateNote && templateNote.noteId !== this.noteId) {
@@ -342,7 +346,7 @@ 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')
}));
@@ -364,13 +368,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) {
@@ -399,7 +426,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
*/
getOwnedLabels(name) {
return this.getOwnedAttributes(LABEL, name);
@@ -407,7 +434,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);
@@ -459,7 +486,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;
}
@@ -480,7 +507,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);
@@ -488,7 +515,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);
@@ -515,23 +542,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);
}
/**
@@ -582,25 +609,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); }
@@ -630,7 +657,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);
@@ -640,7 +667,7 @@ class NoteShort {
/**
* @param {string} [name] - relation name to filter
* @returns {Promise<NoteShort[]>}
* @returns {Promise<FNote[]>}
*/
async getRelationTargets(name) {
const relations = this.getRelations(name);
@@ -654,10 +681,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]);
}
@@ -681,7 +711,7 @@ class NoteShort {
return promotedAttrs;
}
hasAncestor(ancestorNoteId, visitedNoteIds = null) {
hasAncestor(ancestorNoteId, followTemplates = false, visitedNoteIds = null) {
if (this.noteId === ancestorNoteId) {
return true;
}
@@ -695,14 +725,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;
}
}
@@ -722,7 +754,7 @@ class NoteShort {
/**
* Get relations which target this note
*
* @returns {Attribute[]}
* @returns {FAttribute[]}
*/
getTargetRelations() {
return this.targetRelations
@@ -732,7 +764,7 @@ class NoteShort {
/**
* Get relations which target this note
*
* @returns {NoteShort[]}
* @returns {FNote[]}
*/
async getTargetRelationSourceNotes() {
const targetRelations = this.getTargetRelations();
@@ -743,7 +775,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);
@@ -775,7 +807,7 @@ 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" || this.type === 'launcher')
&& (this.mime.startsWith("application/javascript")
@@ -853,8 +885,8 @@ class NoteShort {
}
isOptions() {
return this.noteId.startsWith("options");
return this.noteId.startsWith("_options");
}
}
export default NoteShort;
export default FNote;

View File

@@ -1,7 +1,7 @@
/**
* Complements the NoteShort with the main note content and other extra attributes
* Complements the FNote with the main note content and other extra attributes
*/
class NoteComplement {
class FNoteComplement {
constructor(row) {
/** @type {string} */
this.noteId = row.noteId;
@@ -37,4 +37,4 @@ class NoteComplement {
}
}
export default NoteComplement;
export default FNoteComplement;

View File

@@ -46,10 +46,8 @@ import FindWidget from "../widgets/find.js";
import TocWidget from "../widgets/toc.js";
import BulkActionsDialog from "../widgets/dialogs/bulk_actions.js";
import AboutDialog from "../widgets/dialogs/about.js";
import NoteSourceDialog from "../widgets/dialogs/note_source.js";
import HelpDialog from "../widgets/dialogs/help.js";
import RecentChangesDialog from "../widgets/dialogs/recent_changes.js";
import BackendLogDialog from "../widgets/dialogs/backend_log.js";
import BranchPrefixDialog from "../widgets/dialogs/branch_prefix.js";
import SortChildNotesDialog from "../widgets/dialogs/sort_child_notes.js";
import PasswordNoteSetDialog from "../widgets/dialogs/password_not_set.js";
@@ -186,10 +184,8 @@ export default class DesktopLayout {
)
.child(new BulkActionsDialog())
.child(new AboutDialog())
.child(new NoteSourceDialog())
.child(new HelpDialog())
.child(new RecentChangesDialog())
.child(new BackendLogDialog())
.child(new BranchPrefixDialog())
.child(new SortChildNotesDialog())
.child(new PasswordNoteSetDialog())

View File

@@ -24,7 +24,7 @@ class ContextMenu {
positionMenu() {
// code below tries to detect when dropdown would overflow from page
// in such case we'll position it above click coordinates so it will fit into client
// in such case we'll position it above click coordinates, so it will fit into client
const CONTEXT_MENU_PADDING = 5; // How many pixels to pad context menu from edge of screen
const CONTEXT_MENU_OFFSET = 0; // How many pixels to offset context menu by relative to cursor, see #3157

View File

@@ -19,7 +19,7 @@ export default class LauncherContextMenu {
x: e.pageX,
y: e.pageY,
items: await this.getMenuItems(),
selectMenuItemHandler: (item, e) => this.selectMenuItemHandler(item, e)
selectMenuItemHandler: (item, e) => this.selectMenuItemHandler(item)
})
}

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