Compare commits
318 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d5714c411 | |||
| 56506d33a7 | |||
| c94fb7a62d | |||
| 4160da70be | |||
| 2cfd093cae | |||
| 859465841d | |||
| 0c9a11db6f | |||
| 4cbf9c2e86 | |||
| 1f7997eeed | |||
| 8e730c6ecf | |||
| 600a312b2a | |||
| ec2e973165 | |||
| faeb55bc90 | |||
| 23ebe360a6 | |||
| d905335935 | |||
| f49f510459 | |||
| e78b495bd3 | |||
| 5542c9dc57 | |||
| 2388da7cfb | |||
| 3b4fa0c5fc | |||
| 1af98056bb | |||
| c0edcc1bfe | |||
| 597e595c32 | |||
| e212a37c84 | |||
| c41448f5da | |||
| aab49946f8 | |||
| cc4d04416b | |||
| 66c5606d46 | |||
| 50bcf45113 | |||
| 08cba1e1ce | |||
| f528799fed | |||
| a78c8ddad7 | |||
| 3cc93157bf | |||
| 3dbd80d5a6 | |||
| 076b4a6651 | |||
| 378987e61c | |||
| 5eb850bf59 | |||
| 4914160590 | |||
| 00c106aba6 | |||
| 5e6d2c8336 | |||
| d45a59aa4e | |||
| 9f19cf8046 | |||
| c0dfd23191 | |||
| b9539117d8 | |||
| d616a77d6b | |||
| 5b679930de | |||
| 3d7beefad0 | |||
| 8850de51f5 | |||
| 18b13657fd | |||
| 43ac712fca | |||
| bf231d31a2 | |||
| 7dd19c0366 | |||
| 0040334e89 | |||
| 96a5cb23f3 | |||
| 067ca9ab16 | |||
| be65e2e62f | |||
| bed7bdfd00 | |||
| cd5be59413 | |||
| 2a67d9eae2 | |||
| 0f05d6258e | |||
| 45516fa7b4 | |||
| 70708b36ef | |||
| fb3d5f25ac | |||
| 397f0d1326 | |||
| 6469937393 | |||
| 48cb4d2ab9 | |||
| 3a94b04ef4 | |||
| d406df48a8 | |||
| 9447d3f9b5 | |||
| 2ac78c2e03 | |||
| 17073096cf | |||
| 6068bd7c44 | |||
| 56a35b85a6 | |||
| 9d7d79ef94 | |||
| eb1a6b78ff | |||
| 60d000b9cb | |||
| 61ddd8afc6 | |||
| 69bdcdd74a | |||
| 17c6f53397 | |||
| 1c51419db5 | |||
| 1ba1f28006 | |||
| 6b306ac426 | |||
| ae26f22114 | |||
| 552d213817 | |||
| 8fb7dd451e | |||
| 01a82bed09 | |||
| 77bc5f9944 | |||
| 6081c3540e | |||
| 0a10764ed4 | |||
| ba33a0d330 | |||
| aea81c9872 | |||
| 8019e23ee4 | |||
| 5eb9b8fe42 | |||
| d19a929237 | |||
| 67e0e0888e | |||
| 810fd9e819 | |||
| 2dc742f5b8 | |||
| 48b7108da0 | |||
| 806ab22fa8 | |||
| fbabdef272 | |||
| a1f67e830d | |||
| ee78413ecb | |||
| b936a63db3 | |||
| 80354d09fb | |||
| 87925f72a3 | |||
| 898c941333 | |||
| 8b0a1e546d | |||
| ec351137d4 | |||
| cf5127dcec | |||
| 345de752d1 | |||
| 9c2b98915e | |||
| 7b0fd639f6 | |||
| 6408a47a8a | |||
| f2ca9276d6 | |||
| 872e81fe1f | |||
| 480aec1667 | |||
| 35ea877c7d | |||
| 41ca4b8d2e | |||
| 8375a1b5ab | |||
| 48b697f408 | |||
| c33d496cf3 | |||
| 200982655f | |||
| d67e1552ee | |||
| ce09e4a1eb | |||
| 7bf6ec3ff2 | |||
| 1f923403de | |||
| cb2361e9c4 | |||
| d7e46263be | |||
| 138903cf28 | |||
| 3fa2535862 | |||
| 5bb490e1ff | |||
| f2e44e5617 | |||
| 58a93f748b | |||
| e1e185e5db | |||
| 199b49c1f7 | |||
| cbc1f63732 | |||
| 3f2e8717b3 | |||
| e06c5703ee | |||
| cd858a73c1 | |||
| 69353f12b5 | |||
| fe3bb2c5f6 | |||
| 6afc299efb | |||
| 369274ead7 | |||
| 7f8b19aee4 | |||
| cd653b9f0c | |||
| 9fcd659df4 | |||
| c08c4531db | |||
| f8bec35893 | |||
| 04e6431c09 | |||
| 7aadd57d2f | |||
| 02d9752abf | |||
| 1d64129572 | |||
| e89057a771 | |||
| 95760f1d28 | |||
| 75c3bd8ae3 | |||
| 4f27254e64 | |||
| 479d6ba964 | |||
| 577dc95ab8 | |||
| a266d6a3d5 | |||
| 749b6cb57e | |||
| 9f472b353a | |||
| 4c614aee90 | |||
| f17be0ef9b | |||
| b0b2951ff6 | |||
| 1f3d73b9fd | |||
| 7dde78e98a | |||
| bdfd760b9d | |||
| 8c0662ab82 | |||
| cc3addebd4 | |||
| 7133e60267 | |||
| fc4edf4aa7 | |||
| eaf93a70cd | |||
| a1b2e22ba5 | |||
| f8936f3bc8 | |||
| 015c9d2ccd | |||
| 95ccfd2521 | |||
| 6c15d299e0 | |||
| b093569ec5 | |||
| f8089ba370 | |||
| 053162fef2 | |||
| 71bbf2eb16 | |||
| f723433970 | |||
| 1cc7917b6e | |||
| cdc2721ac1 | |||
| 4a15127e58 | |||
| c5ec57e08e | |||
| d0578971f7 | |||
| 1b0bb22273 | |||
| bf653a9a5c | |||
| 5467dc62cd | |||
| 96eff4c410 | |||
| 3a12181a57 | |||
| fccce2ff1e | |||
| c949dcb449 | |||
| 8b99f065d5 | |||
| 6d7b9e0db3 | |||
| 248fa780e8 | |||
| 20c7c657da | |||
| 0a896cc19c | |||
| 0bb548d0d1 | |||
| de1584eab8 | |||
| 60e2026850 | |||
| 5098dda376 | |||
| 35e47f866a | |||
| 199d89c1a6 | |||
| be543737a9 | |||
| 0b6fa4ab06 | |||
| 8f1b2fa226 | |||
| 5010175b84 | |||
| 0ac42608f7 | |||
| 4633c68a0c | |||
| 33571e0ef3 | |||
| 31876d2cf9 | |||
| 81c6043cb6 | |||
| 7f3ef2cb8b | |||
| 1982d054ef | |||
| 16c4b8aa43 | |||
| e56979c482 | |||
| 4078b32e9d | |||
| 90d33f56c3 | |||
| b0e5ab7533 | |||
| 526bd81b50 | |||
| 58555b3660 | |||
| b7b1324dd0 | |||
| a1fb84f14d | |||
| bc520edd19 | |||
| 5f4f0d3086 | |||
| a68c61b2f0 | |||
| 2a6978c349 | |||
| 1c5425c9eb | |||
| 2338a13749 | |||
| 6df6fe03fa | |||
| e318acc977 | |||
| b0217ee04c | |||
| 2a54ce803e | |||
| 642bf9d113 | |||
| 31746e7baf | |||
| 48b1703725 | |||
| 72d6440de7 | |||
| eaed7ec86f | |||
| 02043d9109 | |||
| b9c0823abf | |||
| 61f30373d4 | |||
| 9889166afc | |||
| 8ae82f5b69 | |||
| 26442f418a | |||
| 35d5036aaa | |||
| 14f5b46ece | |||
| 23a432e7d8 | |||
| ac636b6649 | |||
| 52b8162d01 | |||
| 167b6974fe | |||
| 984ecaf99c | |||
| 21b73a86b2 | |||
| 7d8277699c | |||
| 4bd86a6dfa | |||
| 5bbec118e4 | |||
| 928ed7a034 | |||
| 473229f03a | |||
| 882b6be580 | |||
| e5fa1e0ed5 | |||
| af1fd5bd06 | |||
| c737a3adc9 | |||
| 1047aecfbd | |||
| 314e0a453f | |||
| 8ec476ba96 | |||
| 8e2bf7795c | |||
| a346ba7038 | |||
| fd6b2f1e7f | |||
| 6662b9dbf9 | |||
| c0a29ede05 | |||
| 845907b8d2 | |||
| b12008e313 | |||
| a108ef91a0 | |||
| 4fd9e7f14f | |||
| b5480b4137 | |||
| 47d61c416d | |||
| 6c57b2220f | |||
| 99f01b9ccf | |||
| d5a9abd911 | |||
| a3a2bc0a74 | |||
| 7859aca006 | |||
| 1403acd808 | |||
| e258de329c | |||
| 044bcf6f05 | |||
| 2c028f7c45 | |||
| 435200ec5a | |||
| 3d808d638a | |||
| bb0ee0b36c | |||
| b70ee742e8 | |||
| 4281111344 | |||
| 37e111d8a9 | |||
| 4202af96c8 | |||
| d0efd67d5e | |||
| aeb6c34d27 | |||
| a3f4fc7762 | |||
| 6517188b39 | |||
| c4acecd510 | |||
| c7d8bddf24 | |||
| 29c1d05540 | |||
| 55f04436c0 | |||
| 4ce2eaa919 | |||
| 489e064932 | |||
| 1369603ed9 | |||
| 79431d8b4b | |||
| 4591899df0 | |||
| dfa7d3f186 | |||
| a7c13ceacc | |||
| b2b3c80192 | |||
| badb678b69 | |||
| 5933b17b47 | |||
| 761912c3bd | |||
| 99f35b2588 | |||
| 51eb9f18f7 | |||
| 4b8ca31091 | |||
| 2706f1b02f | |||
| 6710476768 | |||
| de30095737 |
@@ -23,5 +23,7 @@ RUN set -x \
|
||||
# Bundle app source
|
||||
COPY . .
|
||||
|
||||
USER node
|
||||
|
||||
EXPOSE 8080
|
||||
CMD [ "node", "./src/www" ]
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# Trilium注意事项
|
||||
|
||||
[](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
Trilium Notes是一个分层的笔记应用程序,专注于建立大型个人知识库。请参阅[屏幕截图](https://github.com/zadam/trilium/wiki/Screenshot-tour)以快速了解:
|
||||
|
||||

|
||||
|
||||
## 特性
|
||||
|
||||
* 笔记可以排列成任意深的树。单个笔记可以放在树中的多个位置(请参阅[克隆](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
||||
* 丰富的所见即所得笔记编辑功能,包括带有markdown[自动格式化功能的](https://github.com/zadam/trilium/wiki/Text-notes#autoformat)表格,图像和[数学](https://github.com/zadam/trilium/wiki/Text-notes#math-support)
|
||||
* 支持编辑[使用源代码的笔记](https://github.com/zadam/trilium/wiki/Code-notes),包括语法高亮显示
|
||||
* 笔记之间快速[导航](https://github.com/zadam/trilium/wiki/Note-navigation),全文搜索和[笔记挂起](https://github.com/zadam/trilium/wiki/Note-hoisting)
|
||||
* 无缝[笔记版本控制](https://github.com/zadam/trilium/wiki/Note-revisions)
|
||||
* 笔记[属性](https://github.com/zadam/trilium/wiki/Attributes)可用于笔记组织,查询和高级[脚本编写](https://github.com/zadam/trilium/wiki/Scripts)
|
||||
* [同步](https://github.com/zadam/trilium/wiki/Synchronization)与自托管同步服务器
|
||||
* 具有按笔记粒度的强大的[笔记加密](https://github.com/zadam/trilium/wiki/Protected-notes)
|
||||
* [关系图](https://github.com/zadam/trilium/wiki/Relation-map)和[链接图](https://github.com/zadam/trilium/wiki/Link-map),用于可视化笔记及其关系
|
||||
* [脚本](https://github.com/zadam/trilium/wiki/Scripts)-请参阅[高级展示](https://github.com/zadam/trilium/wiki/Advanced-showcases)
|
||||
* 可用性和性能均能很好地扩展至超过10万个笔记
|
||||
* 针对智能手机和平板电脑进行触摸优化的[移动前端](https://github.com/zadam/trilium/wiki/Mobile-frontend)
|
||||
* [夜间主题](https://github.com/zadam/trilium/wiki/Themes)
|
||||
* [Evernote](https://github.com/zadam/trilium/wiki/Evernote-import)和[Markdown导入导出](https://github.com/zadam/trilium/wiki/Markdown)
|
||||
* [Web Clipper](https://github.com/zadam/trilium/wiki/Web-clipper)可轻松保存Web内容
|
||||
|
||||
## 构建
|
||||
|
||||
Trilium是作为桌面应用程序(Linux和Windows)或服务器上托管的Web应用程序(Linux)提供的。Mac OS桌面版本可用,但[不受支持](https://github.com/zadam/trilium/wiki/FAQ#mac-os-support)。
|
||||
|
||||
* 如果要在桌面上使用Trilium,请从[最新版本](https://github.com/zadam/trilium/releases/latest)下载适用于您平台的二进制[版本](https://github.com/zadam/trilium/releases/latest),解压缩该软件包并运行`trilium`可执行文件。
|
||||
* 如果要在服务器上安装Trilium,请遵循[此页面](https://github.com/zadam/trilium/wiki/Server-installation)。
|
||||
* 当前仅支持(经过测试)最新的Chrome和Firefox浏览器。
|
||||
|
||||
## 文档
|
||||
|
||||
[有关文档页面的完整列表,请参见Wiki。](https://github.com/zadam/trilium/wiki/)
|
||||
|
||||
您还可以阅读[个人知识库模式](https://github.com/zadam/trilium/wiki/Patterns-of-personal-knowledge-base),以获取有关如何使用Trilium的灵感。
|
||||
|
||||
## 贡献
|
||||
|
||||
使用基于浏览器的开发环境
|
||||
|
||||
[](https://gitpod.io/#https://github.com/zadam/trilium)
|
||||
|
||||
或在本地克隆并运行
|
||||
|
||||
```
|
||||
npm install
|
||||
npm run start-server
|
||||
```
|
||||
|
||||
## 致谢
|
||||
|
||||
* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - 市场上最好的所见即所得编辑器,互动性强且聆听能力强的团队
|
||||
* [FancyTree](https://github.com/mar10/fancytree) - 一个非常丰富的关于树的库,强大的没有对手。没有它,Trilium Notes将不会如此。
|
||||
* [CodeMirror](https://github.com/codemirror/CodeMirror) - 支持大量语言的代码编辑器
|
||||
* [jsPlumb](https://github.com/jsplumb/jsplumb)强大的可视化连接库。- 用于[关系图](https://github.com/zadam/trilium/wiki/Relation-map)和[链接图](https://github.com/zadam/trilium/wiki/Link-map)
|
||||
@@ -8,7 +8,7 @@ Trilium Notes is a hierarchical note taking application with focus on building l
|
||||
## Features
|
||||
|
||||
* Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
||||
* Rich WYSIWYG note editing including e.g. tables and images with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-notes#autoformat)
|
||||
* Rich WYSIWYG note editing including e.g. tables, images and [math](https://github.com/zadam/trilium/wiki/Text-notes#math-support) with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-notes#autoformat)
|
||||
* Support for editing [notes with source code](https://github.com/zadam/trilium/wiki/Code-notes), including syntax highlighting
|
||||
* Fast and easy [navigation between notes](https://github.com/zadam/trilium/wiki/Note-navigation), full text search and [note hoisting](https://github.com/zadam/trilium/wiki/Note-hoisting)
|
||||
* Seamless [note versioning](https://github.com/zadam/trilium/wiki/Note-revisions)
|
||||
@@ -54,4 +54,4 @@ npm run start-server
|
||||
* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - best WYSIWYG editor on the market, very interactive and listening team
|
||||
* [FancyTree](https://github.com/mar10/fancytree) - very feature rich tree library without real competition. Trilium Notes would not be the same without it.
|
||||
* [CodeMirror](https://github.com/codemirror/CodeMirror) - code editor with support for huge amount of languages
|
||||
* [jsPlumb](https://github.com/jsplumb/jsplumb) - visual connectivity library without competition. Used in [relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map)
|
||||
* [jsPlumb](https://github.com/jsplumb/jsplumb) - visual connectivity library without competition. Used in [relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map)
|
||||
|
||||
+4
-1
@@ -1,10 +1,13 @@
|
||||
[General]
|
||||
# Instance name can be used to distinguish between different instances
|
||||
# Instance name can be used to distinguish between different instances using backend api.getInstanceName()
|
||||
instanceName=
|
||||
|
||||
# set to true to allow using Trilium without authentication (makes sense for server build only, desktop build doesn't need password)
|
||||
noAuthentication=false
|
||||
|
||||
# set to true to disable backups (e.g. because of limited space on server)
|
||||
noBackup=false
|
||||
|
||||
# Disable automatically generating desktop icon
|
||||
# noDesktopIcon=true
|
||||
|
||||
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
DELETE FROM options WHERE name IN (
|
||||
'noteInfoWidget',
|
||||
'attributesWidget',
|
||||
'linkMapWidget',
|
||||
'noteRevisionsWidget',
|
||||
'whatLinksHereWidget',
|
||||
'codeNotesMimeTypes',
|
||||
'similarNotesWidget',
|
||||
'editedNotesWidget',
|
||||
'calendarWidget',
|
||||
'sidebarMinWidth',
|
||||
'sidebarWidthPercent',
|
||||
'showSidebarInNewTab',
|
||||
'hoistedNoteId'
|
||||
);
|
||||
@@ -0,0 +1,69 @@
|
||||
CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`hash` TEXT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isErased` INT NOT NULL,
|
||||
`utcDateChanged` TEXT NOT NULL,
|
||||
`isSynced` INTEGER NOT NULL);
|
||||
|
||||
INSERT INTO mig_entity_changes (id, entityName, entityId, hash, sourceId, isSynced, utcDateChanged, isErased)
|
||||
SELECT id, entityName, entityId, '', sourceId, isSynced, utcChangedDate, 0 FROM entity_changes;
|
||||
|
||||
UPDATE mig_entity_changes SET isErased = (SELECT isErased FROM notes WHERE noteId = entityId) WHERE entityName = 'notes';
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM notes WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'notes';
|
||||
|
||||
UPDATE mig_entity_changes SET isErased = (SELECT isErased FROM notes WHERE noteId = entityId) WHERE entityName = 'note_contents';
|
||||
|
||||
UPDATE mig_entity_changes SET isErased = (
|
||||
SELECT isErased
|
||||
FROM attributes
|
||||
JOIN notes USING(noteId)
|
||||
WHERE attributeId = entityId
|
||||
) WHERE entityName = 'attributes';
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM attributes WHERE attributeId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'attributes';
|
||||
|
||||
UPDATE mig_entity_changes SET isErased = (
|
||||
SELECT isErased
|
||||
FROM branches
|
||||
JOIN notes USING(noteId)
|
||||
WHERE branchId = entityId
|
||||
) WHERE entityName = 'branches';
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM branches WHERE branchId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'branches';
|
||||
|
||||
UPDATE mig_entity_changes SET isErased = (
|
||||
SELECT isErased
|
||||
FROM note_revisions
|
||||
WHERE noteRevisionId = entityId
|
||||
) WHERE entityName = 'note_revisions';
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM note_revisions WHERE noteRevisionId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'note_revisions';
|
||||
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateCreated FROM api_tokens WHERE apiTokenId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'api_tokens';
|
||||
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM note_contents WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'note_contents';
|
||||
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM note_revision_contents WHERE noteRevisionId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'note_revision_contents';
|
||||
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM options WHERE name = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'options';
|
||||
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateCreated FROM recent_notes WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'options';
|
||||
|
||||
DROP TABLE entity_changes;
|
||||
ALTER TABLE mig_entity_changes RENAME TO entity_changes;
|
||||
|
||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
|
||||
DELETE FROM attributes WHERE noteId IN (SELECT noteId FROM notes WHERE isErased = 1);
|
||||
DELETE FROM branches WHERE noteId IN (SELECT noteId FROM notes WHERE isErased = 1);
|
||||
DELETE FROM note_contents WHERE noteId IN (SELECT noteId FROM notes WHERE isErased = 1);
|
||||
DELETE FROM note_revision_contents WHERE noteRevisionId IN (
|
||||
SELECT noteRevisionId FROM note_revisions WHERE isErased = 1
|
||||
);
|
||||
DELETE FROM note_revisions WHERE isErased = 1;
|
||||
DELETE FROM notes WHERE isErased = 1;
|
||||
|
||||
UPDATE entity_changes SET isErased = COALESCE((SELECT isErased FROM entity_changes AS sub WHERE sub.entityId = entity_changes.entityId AND sub.entityName = 'note_revisions'), 0) WHERE entityName = 'note_revision_contents';
|
||||
@@ -0,0 +1,198 @@
|
||||
CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`hash` TEXT NOT NULL,
|
||||
`isErased` INT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isSynced` INTEGER NOT NULL,
|
||||
`utcDateChanged` TEXT NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO mig_entity_changes (id, entityName, entityId, hash, sourceId, isSynced, isErased, utcDateChanged)
|
||||
SELECT id, entityName, entityId, '', sourceId, isSynced, isErased, utcDateChanged FROM entity_changes;
|
||||
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM api_tokens WHERE apiTokenId = entityId), '') WHERE entityName = 'api_tokens';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM attributes WHERE attributeId = entityId), '') WHERE entityName = 'attributes';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM branches WHERE branchId = entityId), '') WHERE entityName = 'branches';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM notes WHERE noteId = entityId), '') WHERE entityName = 'notes';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM note_contents WHERE noteId = entityId), '') WHERE entityName = 'note_contents';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM note_revisions WHERE noteRevisionId = entityId), '') WHERE entityName = 'note_revisions';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM note_revision_contents WHERE noteRevisionId = entityId), '') WHERE entityName = 'note_revision_contents';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM options WHERE name = entityId), '') WHERE entityName = 'options';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM recent_notes WHERE noteId = entityId), '') WHERE entityName = 'recent_notes';
|
||||
|
||||
DROP TABLE entity_changes;
|
||||
ALTER TABLE mig_entity_changes RENAME TO entity_changes;
|
||||
|
||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_api_tokens"
|
||||
(
|
||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
||||
token TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
isDeleted INT NOT NULL DEFAULT 0);
|
||||
|
||||
INSERT INTO mig_api_tokens (apiTokenId, token, utcDateCreated, isDeleted)
|
||||
SELECT apiTokenId, token, utcDateCreated, isDeleted FROM api_tokens;
|
||||
|
||||
DROP TABLE api_tokens;
|
||||
ALTER TABLE mig_api_tokens RENAME TO api_tokens;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_attributes"
|
||||
(
|
||||
attributeId TEXT not null primary key,
|
||||
noteId TEXT not null,
|
||||
type TEXT not null,
|
||||
name TEXT not null,
|
||||
value TEXT default '' not null,
|
||||
position INT default 0 not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT not null,
|
||||
isDeleted INT not null,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
isInheritable int DEFAULT 0 NULL);
|
||||
|
||||
INSERT INTO mig_attributes (attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, deleteId, isInheritable)
|
||||
SELECT attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, deleteId, isInheritable FROM attributes;
|
||||
|
||||
DROP TABLE attributes;
|
||||
ALTER TABLE mig_attributes RENAME TO attributes;
|
||||
|
||||
CREATE INDEX IDX_attributes_name_value
|
||||
on attributes (name, value);
|
||||
CREATE INDEX IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
CREATE INDEX IDX_attributes_value_index
|
||||
on attributes (value);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_branches" (
|
||||
`branchId` TEXT NOT NULL,
|
||||
`noteId` TEXT NOT NULL,
|
||||
`parentNoteId` TEXT NOT NULL,
|
||||
`notePosition` INTEGER NOT NULL,
|
||||
`prefix` TEXT,
|
||||
`isExpanded` INTEGER NOT NULL DEFAULT 0,
|
||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
PRIMARY KEY(`branchId`));
|
||||
|
||||
INSERT INTO mig_branches (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, deleteId, utcDateModified, utcDateCreated)
|
||||
SELECT branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, deleteId, utcDateModified, utcDateCreated FROM branches;
|
||||
|
||||
DROP TABLE branches;
|
||||
ALTER TABLE mig_branches RENAME TO branches;
|
||||
|
||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_notes" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT NOT NULL DEFAULT "note",
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`type` TEXT NOT NULL DEFAULT 'text',
|
||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`));
|
||||
|
||||
INSERT INTO mig_notes (noteId, title, isProtected, type, mime, isDeleted, deleteId, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
||||
SELECT noteId, title, isProtected, type, mime, isDeleted, deleteId, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
|
||||
|
||||
DROP TABLE notes;
|
||||
ALTER TABLE mig_notes RENAME TO notes;
|
||||
|
||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_note_contents" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`content` TEXT NULL DEFAULT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`)
|
||||
);
|
||||
|
||||
INSERT INTO mig_note_contents (noteId, content, dateModified, utcDateModified)
|
||||
SELECT noteId, content, dateModified, utcDateModified FROM note_contents;
|
||||
|
||||
DROP TABLE note_contents;
|
||||
ALTER TABLE mig_note_contents RENAME TO note_contents;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_note_revisions" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`noteId` TEXT NOT NULL,
|
||||
type TEXT DEFAULT '' NOT NULL,
|
||||
mime TEXT DEFAULT '' NOT NULL,
|
||||
`title` TEXT,
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`utcDateLastEdited` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
`dateLastEdited` TEXT NOT NULL,
|
||||
`dateCreated` TEXT NOT NULL);
|
||||
|
||||
INSERT INTO mig_note_revisions (noteRevisionId, noteId, type, mime, title, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated)
|
||||
SELECT noteRevisionId, noteId, type, mime, title, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated FROM note_revisions;
|
||||
|
||||
DROP TABLE note_revisions;
|
||||
ALTER TABLE mig_note_revisions RENAME TO note_revisions;
|
||||
|
||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
||||
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`content` TEXT,
|
||||
`utcDateModified` TEXT NOT NULL);
|
||||
|
||||
INSERT INTO mig_note_revision_contents (noteRevisionId, content, utcDateModified)
|
||||
SELECT noteRevisionId, content, utcDateModified FROM note_revision_contents;
|
||||
|
||||
DROP TABLE note_revision_contents;
|
||||
ALTER TABLE mig_note_revision_contents RENAME TO note_revision_contents;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_options"
|
||||
(
|
||||
name TEXT not null PRIMARY KEY,
|
||||
value TEXT,
|
||||
isSynced INTEGER default 0 not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO mig_options (name, value, isSynced, utcDateCreated, utcDateModified)
|
||||
SELECT name, value, isSynced, utcDateCreated, utcDateModified FROM options;
|
||||
|
||||
DROP TABLE options;
|
||||
ALTER TABLE mig_options RENAME TO options;
|
||||
|
||||
CREATE TABLE mig_recent_notes
|
||||
(
|
||||
noteId TEXT not null primary key,
|
||||
notePath TEXT not null,
|
||||
utcDateCreated TEXT not null,
|
||||
isDeleted INT NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
INSERT INTO mig_recent_notes (noteId, notePath, utcDateCreated, isDeleted)
|
||||
SELECT noteId, notePath, utcDateCreated, isDeleted FROM recent_notes;
|
||||
|
||||
DROP TABLE recent_notes;
|
||||
ALTER TABLE mig_recent_notes RENAME TO recent_notes;
|
||||
@@ -0,0 +1,2 @@
|
||||
UPDATE options SET name = 'eraseEntitiesAfterTimeInSeconds' WHERE name = 'eraseNotesAfterTimeInSeconds';
|
||||
UPDATE entity_changes SET entityId = 'eraseEntitiesAfterTimeInSeconds' WHERE entityName = 'options' AND entityId = 'eraseNotesAfterTimeInSeconds';
|
||||
@@ -0,0 +1,25 @@
|
||||
CREATE TABLE IF NOT EXISTS "mig_attributes"
|
||||
(
|
||||
attributeId TEXT not null primary key,
|
||||
noteId TEXT not null,
|
||||
type TEXT not null,
|
||||
name TEXT not null,
|
||||
value TEXT default '' not null,
|
||||
position INT default 0 not null,
|
||||
utcDateModified TEXT not null,
|
||||
isDeleted INT not null,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
isInheritable int DEFAULT 0 NULL);
|
||||
|
||||
INSERT INTO mig_attributes (attributeId, noteId, type, name, value, position, utcDateModified, isDeleted, deleteId, isInheritable)
|
||||
SELECT attributeId, noteId, type, name, value, position, utcDateModified, isDeleted, deleteId, isInheritable FROM attributes;
|
||||
|
||||
DROP TABLE attributes;
|
||||
ALTER TABLE mig_attributes RENAME TO attributes;
|
||||
|
||||
CREATE INDEX IDX_attributes_name_value
|
||||
on attributes (name, value);
|
||||
CREATE INDEX IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
CREATE INDEX IDX_attributes_value_index
|
||||
on attributes (value);
|
||||
@@ -0,0 +1,5 @@
|
||||
DELETE FROM options WHERE name = 'keyboardShortcutsCreateNoteIntoInbox'; -- in case there is already one which shouldn't (except for in-dev documents)
|
||||
UPDATE options SET name = 'keyboardShortcutsCreateNoteIntoInbox' WHERE name = 'keyboardShortcutsCreateNoteIntoDayNote';
|
||||
|
||||
DELETE FROM options WHERE name = 'keyboardShortcutsShowAttributes';
|
||||
DELETE FROM entity_changes WHERE entityName = 'options' AND entityId = 'keyboardShortcutsShowAttributes';
|
||||
@@ -0,0 +1 @@
|
||||
DROP INDEX IDX_notes_isDeleted;
|
||||
@@ -0,0 +1 @@
|
||||
VACUUM
|
||||
@@ -0,0 +1,2 @@
|
||||
UPDATE options SET name = 'keyboardShortcutsQuickSearch' WHERE name = 'keyboardShortcutsSearchNotes';
|
||||
UPDATE entity_changes SET entityId = 'keyboardShortcutsQuickSearch' WHERE entityId = 'keyboardShortcutsSearchNotes' AND entityName = 'options';
|
||||
@@ -0,0 +1,5 @@
|
||||
UPDATE entity_changes SET isSynced = COALESCE((
|
||||
SELECT options.isSynced
|
||||
FROM options
|
||||
WHERE options.name = entity_changes.entityId
|
||||
), 0) WHERE entityName = 'options';
|
||||
@@ -0,0 +1,14 @@
|
||||
DELETE FROM entity_changes WHERE entityName = 'recent_notes';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_recent_notes"
|
||||
(
|
||||
noteId TEXT not null primary key,
|
||||
notePath TEXT not null,
|
||||
utcDateCreated TEXT not null
|
||||
);
|
||||
|
||||
INSERT INTO mig_recent_notes (noteId, notePath, utcDateCreated)
|
||||
SELECT noteId, notePath, utcDateCreated FROM recent_notes;
|
||||
|
||||
DROP TABLE recent_notes;
|
||||
ALTER TABLE mig_recent_notes RENAME TO recent_notes;
|
||||
@@ -0,0 +1,25 @@
|
||||
const repository = require('../../src/services/repository');
|
||||
|
||||
module.exports = () => {
|
||||
for (const note of repository.getEntities("SELECT * FROM notes WHERE type = 'search' AND isProtected = 0 AND isDeleted = 0")) {
|
||||
try {
|
||||
let origContent = note.getJsonContent();
|
||||
|
||||
if (!origContent) {
|
||||
continue;
|
||||
}
|
||||
|
||||
note.addLabel('searchString', origContent.searchString);
|
||||
|
||||
note.setContent('');
|
||||
|
||||
note.mime = 'text/plain';
|
||||
note.save();
|
||||
|
||||
console.log(`Migrated search note ${note.noteId}`);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Changing note content for note ${note.noteId} failed with: ${e.message} ${e.stack}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
+69
-83
@@ -1,31 +1,19 @@
|
||||
CREATE TABLE IF NOT EXISTS "entity_changes" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`hash` TEXT NOT NULL,
|
||||
`isErased` INT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isSynced` INTEGER NOT NULL,
|
||||
`utcDateChanged` TEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "api_tokens"
|
||||
(
|
||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
||||
token TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
isDeleted INT NOT NULL DEFAULT 0,
|
||||
hash TEXT DEFAULT "" NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS "options"
|
||||
(
|
||||
name TEXT not null PRIMARY KEY,
|
||||
value TEXT,
|
||||
isSynced INTEGER default 0 not null,
|
||||
hash TEXT default "" not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE recent_notes
|
||||
(
|
||||
noteId TEXT not null primary key,
|
||||
notePath TEXT not null,
|
||||
hash TEXT default "" not null,
|
||||
utcDateCreated TEXT not null,
|
||||
isDeleted INT
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`content` TEXT,
|
||||
hash TEXT DEFAULT '' NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL);
|
||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
||||
token TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
isDeleted INT NOT NULL DEFAULT 0);
|
||||
CREATE TABLE IF NOT EXISTS "branches" (
|
||||
`branchId` TEXT NOT NULL,
|
||||
`noteId` TEXT NOT NULL,
|
||||
@@ -37,10 +25,49 @@ CREATE TABLE IF NOT EXISTS "branches" (
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
hash TEXT DEFAULT "" NOT NULL,
|
||||
PRIMARY KEY(`branchId`));
|
||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
||||
CREATE TABLE IF NOT EXISTS "notes" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT NOT NULL DEFAULT "note",
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`type` TEXT NOT NULL DEFAULT 'text',
|
||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`));
|
||||
CREATE TABLE IF NOT EXISTS "note_contents" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`content` TEXT NULL DEFAULT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "note_revisions" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`noteId` TEXT NOT NULL,
|
||||
type TEXT DEFAULT '' NOT NULL,
|
||||
mime TEXT DEFAULT '' NOT NULL,
|
||||
`title` TEXT,
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`utcDateLastEdited` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
`dateLastEdited` TEXT NOT NULL,
|
||||
`dateCreated` TEXT NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS "note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`content` TEXT,
|
||||
`utcDateModified` TEXT NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS "options"
|
||||
(
|
||||
name TEXT not null PRIMARY KEY,
|
||||
value TEXT,
|
||||
isSynced INTEGER default 0 not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "attributes"
|
||||
(
|
||||
attributeId TEXT not null primary key,
|
||||
@@ -49,77 +76,36 @@ CREATE TABLE IF NOT EXISTS "attributes"
|
||||
name TEXT not null,
|
||||
value TEXT default '' not null,
|
||||
position INT default 0 not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT not null,
|
||||
isDeleted INT not null,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
hash TEXT default "" not null,
|
||||
isInheritable int DEFAULT 0 NULL);
|
||||
CREATE INDEX IDX_attributes_name_value
|
||||
on attributes (name, value);
|
||||
CREATE INDEX IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
CREATE INDEX IDX_attributes_value_index
|
||||
on attributes (value);
|
||||
CREATE TABLE IF NOT EXISTS "entity_changes" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isSynced` INTEGER default 0 not null,
|
||||
`utcChangedDate` TEXT NOT NULL);
|
||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
CREATE INDEX `IDX_entityChanges_utcChangedDate` ON "entity_changes" (
|
||||
`utcChangedDate`
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "notes" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT NOT NULL DEFAULT "note",
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`type` TEXT NOT NULL DEFAULT 'text',
|
||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
||||
`hash` TEXT DEFAULT "" NOT NULL,
|
||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`isErased` INT NOT NULL DEFAULT 0,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`));
|
||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
||||
CREATE TABLE IF NOT EXISTS "note_revisions" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT,
|
||||
`isErased` INT NOT NULL DEFAULT 0,
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`utcDateLastEdited` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
`dateLastEdited` TEXT NOT NULL,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
type TEXT DEFAULT '' NOT NULL,
|
||||
mime TEXT DEFAULT '' NOT NULL,
|
||||
hash TEXT DEFAULT '' NOT NULL);
|
||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
||||
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
||||
CREATE TABLE IF NOT EXISTS "note_contents" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`content` TEXT NULL DEFAULT NULL,
|
||||
`hash` TEXT DEFAULT "" NOT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`)
|
||||
CREATE INDEX IDX_attributes_name_value
|
||||
on attributes (name, value);
|
||||
CREATE INDEX IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
CREATE INDEX IDX_attributes_value_index
|
||||
on attributes (value);
|
||||
CREATE TABLE IF NOT EXISTS "recent_notes"
|
||||
(
|
||||
noteId TEXT not null primary key,
|
||||
notePath TEXT not null,
|
||||
utcDateCreated TEXT not null
|
||||
);
|
||||
|
||||
@@ -298,29 +298,6 @@
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>utcDateCreated</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>utcDateModified</code></td>
|
||||
@@ -378,7 +355,7 @@
|
||||
|
||||
<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_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line25">line 25</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -493,7 +470,7 @@
|
||||
|
||||
<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#line40">line 40</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line43">line 43</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -598,7 +575,7 @@
|
||||
|
||||
<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#line47">line 47</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line50">line 50</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -703,7 +680,7 @@
|
||||
|
||||
<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#line62">line 62</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line65">line 65</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -619,7 +619,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line205">line 205</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line207">line 207</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -782,7 +782,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line232">line 232</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line234">line 234</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1068,7 +1068,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line260">line 260</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line262">line 262</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1273,7 +1273,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line189">line 189</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line191">line 191</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1451,7 +1451,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line160">line 160</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line162">line 162</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1652,7 +1652,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line150">line 150</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line152">line 152</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1754,7 +1754,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line397">line 397</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line399">line 399</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2224,7 +2224,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line318">line 318</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line320">line 320</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2847,7 +2847,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line345">line 345</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line347">line 347</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3202,7 +3202,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line129">line 129</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line131">line 131</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3400,7 +3400,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line139">line 139</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line141">line 141</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3509,7 +3509,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line309">line 309</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line311">line 311</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3618,7 +3618,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line326">line 326</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line328">line 328</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3799,7 +3799,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line336">line 336</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line338">line 338</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3957,7 +3957,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line354">line 354</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line356">line 356</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4110,7 +4110,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line301">line 301</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line303">line 303</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4196,7 +4196,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line392">line 392</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line394">line 394</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4334,7 +4334,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line115">line 115</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line117">line 117</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4391,7 +4391,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="searchForNotes"><span class="type-signature"></span>searchForNotes<span class="signature">(query, searchContext<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array.<<a href="Note.html">Note</a>>}</span></h4>
|
||||
<h4 class="name" id="searchForNotes"><span class="type-signature"></span>searchForNotes<span class="signature">(query, searchParams<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array.<<a href="Note.html">Note</a>>}</span></h4>
|
||||
|
||||
|
||||
|
||||
@@ -4469,13 +4469,13 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>searchContext</code></td>
|
||||
<td class="name"><code>searchParams</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">SearchContext</span>
|
||||
<span class="param-type">Object</span>
|
||||
|
||||
|
||||
|
||||
@@ -4745,7 +4745,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line374">line 374</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line376">line 376</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4878,7 +4878,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line360">line 360</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line362">line 362</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5084,7 +5084,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line172">line 172</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line174">line 174</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5240,7 +5240,7 @@ exists, then we'll use that transaction.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line384">line 384</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line386">line 386</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
+62
-85
@@ -296,29 +296,6 @@
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>isErased</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">boolean</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">true if note's content is erased after it has been deleted</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>dateCreated</code></td>
|
||||
@@ -445,7 +422,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line32">line 32</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line31">line 31</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -560,7 +537,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line531">line 531</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line537">line 537</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -662,7 +639,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line855">line 855</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line861">line 861</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -840,7 +817,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line430">line 430</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line436">line 436</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1040,7 +1017,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line268">line 268</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line274">line 274</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1218,7 +1195,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line441">line 441</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line447">line 447</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1327,7 +1304,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line801">line 801</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line807">line 807</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1429,7 +1406,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line829">line 829</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line835">line 835</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1535,7 +1512,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line815">line 815</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line821">line 821</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1641,7 +1618,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line71">line 71</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line70">line 70</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1743,7 +1720,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line107">line 107</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line106">line 106</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1845,7 +1822,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line701">line 701</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line707">line 707</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2078,7 +2055,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line724">line 724</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line730">line 730</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2276,7 +2253,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line762">line 762</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line768">line 768</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2474,7 +2451,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line771">line 771</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line777">line 777</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2576,7 +2553,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line118">line 118</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line117">line 117</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2727,7 +2704,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line584">line 584</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line590">line 590</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2897,7 +2874,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line291">line 291</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line297">line 297</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3052,7 +3029,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line608">line 608</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line614">line 614</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3167,7 +3144,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line788">line 788</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line794">line 794</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3269,7 +3246,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line250">line 250</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line256">line 256</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3476,7 +3453,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line226">line 226</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line232">line 232</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3654,7 +3631,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line452">line 452</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line458">line 458</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3812,7 +3789,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line590">line 590</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line596">line 596</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3982,7 +3959,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line299">line 299</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line305">line 305</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4137,7 +4114,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line614">line 614</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line620">line 620</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4295,7 +4272,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line602">line 602</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line608">line 608</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4465,7 +4442,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line315">line 315</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line321">line 321</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4620,7 +4597,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line642">line 642</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line648">line 648</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4778,7 +4755,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line626">line 626</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line632">line 632</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4887,7 +4864,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line841">line 841</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line847">line 847</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5042,7 +5019,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line596">line 596</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line602">line 602</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5212,7 +5189,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line307">line 307</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line313">line 313</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5367,7 +5344,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line632">line 632</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line638">line 638</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5537,7 +5514,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line323">line 323</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line329">line 329</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5688,7 +5665,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line620">line 620</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line626">line 626</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5801,7 +5778,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line778">line 778</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line784">line 784</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5903,7 +5880,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line197">line 197</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line203">line 203</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6009,7 +5986,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line259">line 259</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line265">line 265</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6187,7 +6164,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line412">line 412</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line418">line 418</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6293,7 +6270,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line808">line 808</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line814">line 814</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6448,7 +6425,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line560">line 560</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line566">line 566</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6626,7 +6603,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line421">line 421</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line427">line 427</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6781,7 +6758,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line566">line 566</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line572">line 572</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6936,7 +6913,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line578">line 578</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line584">line 584</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7091,7 +7068,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line572">line 572</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line578">line 578</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7202,7 +7179,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line338">line 338</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line344">line 344</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7330,7 +7307,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line886">line 886</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line892">line 892</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7436,7 +7413,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line187">line 187</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line193">line 193</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7542,7 +7519,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line179">line 179</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line185">line 185</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7648,7 +7625,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line174">line 174</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line180">line 180</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7754,7 +7731,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line169">line 169</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line175">line 175</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7860,7 +7837,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line192">line 192</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line198">line 198</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -8093,7 +8070,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line515">line 515</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line521">line 521</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -8273,7 +8250,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line688">line 688</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line694">line 694</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -8453,7 +8430,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line696">line 696</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line702">line 702</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -8664,7 +8641,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line482">line 482</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line488">line 488</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -8844,7 +8821,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line672">line 672</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line678">line 678</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -9024,7 +9001,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line680">line 680</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line686">line 686</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -9266,7 +9243,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line466">line 466</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line472">line 472</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -9477,7 +9454,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line655">line 655</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line661">line 661</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -9688,7 +9665,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line664">line 664</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line670">line 670</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -198,29 +198,6 @@
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>isErased</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">boolean</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
@@ -398,7 +375,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line28">line 28</a>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line27">line 27</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -513,7 +490,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line68">line 68</a>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line66">line 66</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -615,7 +592,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line54">line 54</a>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line52">line 52</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -136,30 +136,7 @@
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>isDeleted</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">boolean</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>utcDateModified</code></td>
|
||||
<td class="name"><code>utcDateCreated</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
@@ -214,7 +191,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_recent_note.js.html">entities/recent_note.js</a>, <a href="entities_recent_note.js.html#line16">line 16</a>
|
||||
<a href="entities_recent_note.js.html">entities/recent_note.js</a>, <a href="entities_recent_note.js.html#line15">line 15</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ const promotedAttributeDefinitionParser = require("../services/promoted_attribut
|
||||
* @property {boolean} isInheritable - immutable
|
||||
* @property {boolean} isDeleted
|
||||
* @property {string|null} deleteId - ID identifying delete transaction
|
||||
* @property {string} utcDateCreated
|
||||
* @property {string} utcDateModified
|
||||
*
|
||||
* @extends Entity
|
||||
@@ -54,7 +53,7 @@ const promotedAttributeDefinitionParser = require("../services/promoted_attribut
|
||||
class Attribute extends Entity {
|
||||
static get entityName() { return "attributes"; }
|
||||
static get primaryKeyName() { return "attributeId"; }
|
||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "utcDateCreated"]; }
|
||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted"]; }
|
||||
|
||||
constructor(row) {
|
||||
super(row);
|
||||
@@ -62,6 +61,10 @@ class Attribute extends Entity {
|
||||
this.isInheritable = !!this.isInheritable;
|
||||
}
|
||||
|
||||
isAutoLink() {
|
||||
return this.type === 'relation' && ['internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink'].includes(this.name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
@@ -127,15 +130,9 @@ class Attribute extends Entity {
|
||||
this.isDeleted = false;
|
||||
}
|
||||
|
||||
if (!this.utcDateCreated) {
|
||||
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
createClone(type, name, value, isInheritable) {
|
||||
@@ -147,7 +144,6 @@ class Attribute extends Entity {
|
||||
position: this.position,
|
||||
isInheritable: isInheritable,
|
||||
isDeleted: false,
|
||||
utcDateCreated: this.utcDateCreated,
|
||||
utcDateModified: this.utcDateModified
|
||||
});
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class Branch extends Entity {
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
if (this.notePosition === undefined) {
|
||||
if (this.notePosition === undefined || this.notePosition === null) {
|
||||
const maxNotePos = sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
|
||||
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 10;
|
||||
}
|
||||
@@ -85,9 +85,7 @@ class Branch extends Entity {
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
createClone(parentNoteId, notePosition) {
|
||||
|
||||
@@ -43,18 +43,13 @@ class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
if ('isDeleted' in this) {
|
||||
if ('isDeleted' in this && this.constructor.entityName !== 'recent_notes') {
|
||||
this.isDeleted = !!this.isDeleted;
|
||||
}
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
this.generateIdIfNecessary();
|
||||
|
||||
const origHash = this.hash;
|
||||
|
||||
this.hash = this.generateHash();
|
||||
this.isChanged = origHash !== this.hash;
|
||||
}
|
||||
|
||||
generateIdIfNecessary() {
|
||||
@@ -73,6 +68,10 @@ class Entity {
|
||||
return utils.hash(contentToHash).substr(0, 10);
|
||||
}
|
||||
|
||||
getUtcDateChanged() {
|
||||
return this.utcDateModified;
|
||||
}
|
||||
|
||||
get repository() {
|
||||
if (!repo) {
|
||||
repo = require('../services/repository');
|
||||
|
||||
@@ -49,7 +49,6 @@ const RELATION = 'relation';
|
||||
* @property {boolean} isProtected - true if note is protected
|
||||
* @property {boolean} isDeleted - true if note is deleted
|
||||
* @property {string|null} deleteId - ID identifying delete transaction
|
||||
* @property {boolean} isErased - true if note's content is erased after it has been deleted
|
||||
* @property {string} dateCreated - local date time (with offset)
|
||||
* @property {string} dateModified - local date time (with offset)
|
||||
* @property {string} utcDateCreated
|
||||
@@ -98,9 +97,9 @@ class Note extends Entity {
|
||||
/** @returns {*} */
|
||||
getContent(silentNotFoundError = false) {
|
||||
if (this.content === undefined) {
|
||||
const res = sql.getRow(`SELECT content, hash FROM note_contents WHERE noteId = ?`, [this.noteId]);
|
||||
const row = sql.getRow(`SELECT content FROM note_contents WHERE noteId = ?`, [this.noteId]);
|
||||
|
||||
if (!res) {
|
||||
if (!row) {
|
||||
if (silentNotFoundError) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -109,7 +108,7 @@ class Note extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
this.content = res.content;
|
||||
this.content = row.content;
|
||||
|
||||
if (this.isProtected) {
|
||||
if (this.isContentAvailable) {
|
||||
@@ -171,8 +170,7 @@ class Note extends Entity {
|
||||
noteId: this.noteId,
|
||||
content: content,
|
||||
dateModified: dateUtils.localNowDateTime(),
|
||||
utcDateModified: dateUtils.utcNowDateTime(),
|
||||
hash: utils.hash(this.noteId + "|" + content.toString())
|
||||
utcDateModified: dateUtils.utcNowDateTime()
|
||||
};
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -186,7 +184,15 @@ class Note extends Entity {
|
||||
|
||||
sql.upsert("note_contents", "noteId", pojo);
|
||||
|
||||
entityChangesService.addNoteContentEntityChange(this.noteId);
|
||||
const hash = utils.hash(this.noteId + "|" + content.toString());
|
||||
|
||||
entityChangesService.addEntityChange({
|
||||
entityName: 'note_contents',
|
||||
entityId: this.noteId,
|
||||
hash: hash,
|
||||
isErased: false,
|
||||
utcDateChanged: this.getUtcDateChanged()
|
||||
}, null);
|
||||
}
|
||||
|
||||
setJsonContent(content) {
|
||||
@@ -834,7 +840,7 @@ class Note extends Entity {
|
||||
* @returns {boolean} - true if note has children
|
||||
*/
|
||||
hasChildren() {
|
||||
return (this.getChildNotes()).length > 0;
|
||||
return this.getChildNotes().length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -932,10 +938,8 @@ class Note extends Entity {
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.dateModified = dateUtils.localNowDateTime();
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.dateModified = dateUtils.localNowDateTime();
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
|
||||
@@ -43,7 +43,6 @@ const entityChangesService = require('../services/entity_changes.js');
|
||||
* @property {string} type
|
||||
* @property {string} mime
|
||||
* @property {string} title
|
||||
* @property {boolean} isErased
|
||||
* @property {boolean} isProtected
|
||||
* @property {string} dateLastEdited
|
||||
* @property {string} dateCreated
|
||||
@@ -56,12 +55,11 @@ const entityChangesService = require('../services/entity_changes.js');
|
||||
class NoteRevision extends Entity {
|
||||
static get entityName() { return "note_revisions"; }
|
||||
static get primaryKeyName() { return "noteRevisionId"; }
|
||||
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isErased", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
||||
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
||||
|
||||
constructor(row) {
|
||||
super(row);
|
||||
|
||||
this.isErased = !!this.isErased;
|
||||
this.isProtected = !!this.isProtected;
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -95,7 +93,7 @@ class NoteRevision extends Entity {
|
||||
/** @returns {*} */
|
||||
getContent(silentNotFoundError = false) {
|
||||
if (this.content === undefined) {
|
||||
const res = sql.getRow(`SELECT content, hash FROM note_revision_contents WHERE noteRevisionId = ?`, [this.noteRevisionId]);
|
||||
const res = sql.getRow(`SELECT content FROM note_revision_contents WHERE noteRevisionId = ?`, [this.noteRevisionId]);
|
||||
|
||||
if (!res) {
|
||||
if (silentNotFoundError) {
|
||||
@@ -107,7 +105,6 @@ class NoteRevision extends Entity {
|
||||
}
|
||||
|
||||
this.content = res.content;
|
||||
|
||||
if (this.isProtected) {
|
||||
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||
this.content = protectedSessionService.decrypt(this.content);
|
||||
@@ -134,8 +131,7 @@ class NoteRevision extends Entity {
|
||||
const pojo = {
|
||||
noteRevisionId: this.noteRevisionId,
|
||||
content: content,
|
||||
utcDateModified: dateUtils.utcNowDateTime(),
|
||||
hash: utils.hash(this.noteRevisionId + "|" + content)
|
||||
utcDateModified: dateUtils.utcNowDateTime()
|
||||
};
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -149,15 +145,21 @@ class NoteRevision extends Entity {
|
||||
|
||||
sql.upsert("note_revision_contents", "noteRevisionId", pojo);
|
||||
|
||||
entityChangesService.addNoteRevisionContentEntityChange(this.noteRevisionId);
|
||||
const hash = utils.hash(this.noteRevisionId + "|" + content);
|
||||
|
||||
entityChangesService.addEntityChange({
|
||||
entityName: 'note_revision_contents',
|
||||
entityId: this.noteRevisionId,
|
||||
hash: hash,
|
||||
isErased: false,
|
||||
utcDateChanged: this.getUtcDateChanged()
|
||||
}, null);
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
|
||||
@@ -60,13 +60,12 @@ class Option extends Entity {
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Option;</code></pre>
|
||||
module.exports = Option;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -36,21 +36,15 @@ const dateUtils = require('../services/date_utils');
|
||||
*
|
||||
* @property {string} noteId
|
||||
* @property {string} notePath
|
||||
* @property {boolean} isDeleted
|
||||
* @property {string} utcDateModified
|
||||
* @property {string} utcDateCreated
|
||||
*
|
||||
* @extends Entity
|
||||
*/
|
||||
class RecentNote extends Entity {
|
||||
static get entityName() { return "recent_notes"; }
|
||||
static get primaryKeyName() { return "noteId"; }
|
||||
static get hashedProperties() { return ["noteId", "notePath", "utcDateCreated", "isDeleted"]; }
|
||||
|
||||
beforeSaving() {
|
||||
if (!this.isDeleted) {
|
||||
this.isDeleted = false;
|
||||
}
|
||||
|
||||
if (!this.utcDateCreated) {
|
||||
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||
}
|
||||
@@ -59,7 +53,8 @@ class RecentNote extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RecentNote;</code></pre>
|
||||
module.exports = RecentNote;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -391,7 +391,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line213">line 213</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line215">line 215</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -579,7 +579,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line174">line 174</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line176">line 176</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line234">line 234</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line236">line 236</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1053,7 +1053,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line241">line 241</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line243">line 243</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -120,13 +120,15 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
*
|
||||
* @method
|
||||
* @param {string} query
|
||||
* @param {SearchContext} [searchContext]
|
||||
* @param {Object} [searchParams]
|
||||
* @returns {Note[]}
|
||||
*/
|
||||
this.searchForNotes = (query, searchContext) => {
|
||||
searchContext = searchContext || new SearchContext();
|
||||
this.searchForNotes = (query, searchParams = {}) => {
|
||||
if (searchParams.includeArchivedNotes === undefined) {
|
||||
searchParams.includeArchivedNotes = true;
|
||||
}
|
||||
|
||||
const noteIds = searchService.findNotesWithQuery(query, searchContext)
|
||||
const noteIds = searchService.findNotesWithQuery(query, new SearchContext(searchParams))
|
||||
.map(sr => sr.noteId);
|
||||
|
||||
return repository.getNotes(noteIds);
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="isDeleted"><span class="type-signature"></span>isDeleted<span class="type-signature"></span></h4>
|
||||
<h4 class="name" id="fromSearchNote"><span class="type-signature"></span>fromSearchNote<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
@@ -259,6 +259,64 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="isDeleted"><span class="type-signature"></span>isDeleted<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line25">line 25</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="isExpanded"><span class="type-signature"></span>isExpanded<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
@@ -607,7 +665,7 @@
|
||||
|
||||
<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_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line29">line 29</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -709,7 +767,7 @@
|
||||
|
||||
<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#line32">line 32</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line34">line 34</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -811,7 +869,7 @@
|
||||
|
||||
<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#line37">line 37</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line39">line 39</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -913,7 +971,7 @@
|
||||
|
||||
<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#line42">line 42</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line44">line 44</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line24">line 24</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line22">line 22</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line28">line 28</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line26">line 26</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -329,7 +329,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line50">line 50</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line48">line 48</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -435,7 +435,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line41">line 41</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line39">line 39</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -545,7 +545,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line33">line 33</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line31">line 31</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -658,7 +658,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line35">line 35</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line33">line 33</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -768,7 +768,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line31">line 31</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line29">line 29</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -874,7 +874,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line44">line 44</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line42">line 42</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -980,7 +980,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line47">line 47</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line45">line 45</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1109,7 +1109,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line69">line 69</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line67">line 67</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1264,7 +1264,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line59">line 59</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line57">line 57</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1419,7 +1419,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line89">line 89</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line101">line 101</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1556,7 +1556,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line287">line 287</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line302">line 302</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1712,7 +1712,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line392">line 392</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line413">line 413</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1748,7 +1748,7 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="createNoteLink"><span class="type-signature"></span>createNoteLink<span class="signature">(notePath, noteTitle<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
|
||||
<h4 class="name" id="createNoteLink"><span class="type-signature"></span>createNoteLink<span class="signature">(notePath, params<span class="signature-attributes">opt</span>, title=<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
@@ -1825,7 +1825,148 @@
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>noteTitle</code></td>
|
||||
<td class="name"><code>params</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">object</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td class="attributes">
|
||||
|
||||
<optional><br>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">
|
||||
<h6>Properties</h6>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
<th>Attributes</th>
|
||||
|
||||
|
||||
|
||||
<th>Default</th>
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>showTooltip</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">boolean</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td class="attributes">
|
||||
|
||||
<optional><br>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td class="default">
|
||||
|
||||
true
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td class="description last">enable/disable tooltip on the link</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>showNotePath</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">boolean</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td class="attributes">
|
||||
|
||||
<optional><br>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td class="default">
|
||||
|
||||
false
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td class="description last">show also whole note's path as part of the link</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>title=</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
@@ -1851,7 +1992,7 @@
|
||||
|
||||
|
||||
|
||||
<td class="description last">if not present we'll use note title</td>
|
||||
<td class="description last">custom link tile with note's title as default</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -1892,7 +2033,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line279">line 279</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line294">line 294</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2025,7 +2166,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line241">line 241</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line253">line 253</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2131,7 +2272,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line293">line 293</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line308">line 308</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2237,7 +2378,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line307">line 307</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line322">line 322</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2391,7 +2532,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line301">line 301</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line316">line 316</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2528,7 +2669,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line358">line 358</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line373">line 373</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2635,7 +2776,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line234">line 234</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line246">line 246</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2790,7 +2931,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line367">line 367</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line382">line 382</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2946,7 +3087,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line206">line 206</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line218">line 218</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3147,7 +3288,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line218">line 218</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line230">line 230</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3253,7 +3394,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line349">line 349</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line364">line 364</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3408,7 +3549,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line376">line 376</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line391">line 391</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3462,6 +3603,184 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="openTabWithNote"><span class="type-signature"></span>openTabWithNote<span class="signature">(notePath, activate)</span><span class="type-signature"> → {Promise.<void>}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Open a note in a new tab.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>notePath</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">(or noteId)</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>activate</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">boolean</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">set to true to activate the new tab, false to stay on the current tab</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#line81">line 81</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Promise.<void></span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="parseDate"><span class="type-signature"></span>parseDate<span class="signature">(str)</span><span class="type-signature"> → {Date}</span></h4>
|
||||
|
||||
|
||||
@@ -3559,7 +3878,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line248">line 248</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line260">line 260</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3667,7 +3986,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line319">line 319</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line334">line 334</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3823,7 +4142,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line330">line 330</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line345">line 345</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3979,7 +4298,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line339">line 339</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line354">line 354</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4111,7 +4430,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line410">line 410</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line431">line 431</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4197,7 +4516,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line270">line 270</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line282">line 282</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4334,7 +4653,7 @@ otherwise (by e.g. createNoteLink())
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line226">line 226</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line238">line 238</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4495,7 +4814,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line139">line 139</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line151">line 151</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4603,7 +4922,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line168">line 168</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line180">line 180</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4741,7 +5060,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line194">line 194</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line206">line 206</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4897,7 +5216,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line178">line 178</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line190">line 190</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4959,7 +5278,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
|
||||
<div class="description">
|
||||
Hoist note. See https://github.com/zadam/trilium/wiki/Note-hoisting
|
||||
Hoist note in the current tab. See https://github.com/zadam/trilium/wiki/Note-hoisting
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5052,7 +5371,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line385">line 385</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line400">line 400</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5203,7 +5522,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line313">line 313</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line328">line 328</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5340,7 +5659,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line264">line 264</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line276">line 276</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5477,7 +5796,7 @@ Internally this serializes the anonymous function into string and sends it to ba
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line256">line 256</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line268">line 268</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5569,7 +5888,7 @@ Typical use case is when new note has been created, we should wait until it is s
|
||||
|
||||
<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#line403">line 403</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line424">line 424</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line13">line 13</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line24">line 24</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line22">line 22</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line33">line 33</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line30">line 30</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line41">line 41</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line36">line 36</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line47">line 47</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line53">line 53</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line64">line 64</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -519,7 +519,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line47">line 47</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line58">line 58</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -577,7 +577,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line51">line 51</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line62">line 62</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -635,7 +635,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line43">line 43</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line54">line 54</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -703,7 +703,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line28">line 28</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line39">line 39</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -771,7 +771,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line33">line 33</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line44">line 44</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -839,7 +839,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line25">line 25</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line36">line 36</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -897,7 +897,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line45">line 45</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line56">line 56</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -955,7 +955,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line49">line 49</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line60">line 60</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1103,7 +1103,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line307">line 307</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line377">line 377</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1303,7 +1303,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line176">line 176</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line189">line 189</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1481,7 +1481,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line329">line 329</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line399">line 399</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1587,7 +1587,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line119">line 119</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line132">line 132</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1689,7 +1689,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line114">line 114</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line127">line 127</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1791,7 +1791,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line131">line 131</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line144">line 144</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1893,7 +1893,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line149">line 149</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line162">line 162</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1995,7 +1995,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line154">line 154</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line167">line 167</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2146,7 +2146,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line369">line 369</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line439">line 439</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2313,7 +2313,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line253">line 253</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line266">line 266</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2468,7 +2468,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line393">line 393</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line463">line 463</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2578,7 +2578,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line495">line 495</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line588">line 588</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2752,7 +2752,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line296">line 296</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line366">line 366</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2952,7 +2952,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line163">line 163</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line176">line 176</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3130,7 +3130,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line318">line 318</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line388">line 388</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3285,7 +3285,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line363">line 363</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line433">line 433</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3452,7 +3452,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line245">line 245</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line258">line 258</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3607,7 +3607,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line387">line 387</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line457">line 457</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3762,7 +3762,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line375">line 375</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line445">line 445</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3929,7 +3929,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line261">line 261</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line331">line 331</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4084,7 +4084,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line399">line 399</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line469">line 469</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4190,7 +4190,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line139">line 139</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line152">line 152</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4292,7 +4292,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line144">line 144</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line157">line 157</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4443,7 +4443,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line381">line 381</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line451">line 451</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4610,7 +4610,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line269">line 269</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line339">line 339</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4765,7 +4765,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line411">line 411</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line481">line 481</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4935,7 +4935,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line421">line 421</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line491">line 491</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5086,7 +5086,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line405">line 405</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line475">line 475</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5196,7 +5196,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line474">line 474</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line567">line 567</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5302,7 +5302,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line484">line 484</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line577">line 577</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5404,7 +5404,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line435">line 435</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line505">line 505</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5578,7 +5578,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line278">line 278</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line348">line 348</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5684,7 +5684,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line126">line 126</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line139">line 139</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5835,7 +5835,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line345">line 345</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line415">line 415</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6013,7 +6013,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line287">line 287</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line357">line 357</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6168,7 +6168,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line339">line 339</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line409">line 409</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6323,7 +6323,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line351">line 351</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line421">line 421</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6478,7 +6478,7 @@ This note's representation is used in note tree and is kept in TreeCache.</div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line357">line 357</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line427">line 427</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6589,7 +6589,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line465">line 465</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line558">line 558</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6673,7 +6673,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line89">line 89</a>
|
||||
<a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line102">line 102</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ class Attribute {
|
||||
this.position = row.position;
|
||||
/** @param {boolean} isInheritable */
|
||||
this.isInheritable = !!row.isInheritable;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = !!row.isDeleted;
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
@@ -114,6 +116,17 @@ class Attribute {
|
||||
getDefinition() {
|
||||
return promotedAttributeDefinitionParser.parse(this.value);
|
||||
}
|
||||
|
||||
isDefinitionFor(attr) {
|
||||
return this.type === 'label' && this.name === `${attr.type}:${attr.name}`;
|
||||
}
|
||||
|
||||
get dto() {
|
||||
const dto = Object.assign({}, this);
|
||||
delete dto.treeCache;
|
||||
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
|
||||
export default Attribute;
|
||||
|
||||
@@ -48,6 +48,8 @@ class Branch {
|
||||
/** @param {boolean} */
|
||||
this.isExpanded = !!row.isExpanded;
|
||||
/** @param {boolean} */
|
||||
this.fromSearchNote = !!row.fromSearchNote;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = !!row.isDeleted;
|
||||
}
|
||||
|
||||
@@ -76,7 +78,8 @@ class Branch {
|
||||
}
|
||||
}
|
||||
|
||||
export default Branch;</code></pre>
|
||||
export default Branch;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -27,12 +27,23 @@
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source linenums"><code>import server from '../services/server.js';
|
||||
import Attribute from './attribute.js';
|
||||
import noteAttributeCache from "../services/note_attribute_cache.js";
|
||||
import ws from "../services/ws.js";
|
||||
import options from "../services/options.js";
|
||||
|
||||
const LABEL = 'label';
|
||||
const RELATION = 'relation';
|
||||
|
||||
const NOTE_TYPE_ICONS = {
|
||||
"file": "bx bx-file",
|
||||
"image": "bx bx-image",
|
||||
"code": "bx bx-code",
|
||||
"render": "bx bx-extension",
|
||||
"search": "bx bx-file-find",
|
||||
"relation-map": "bx bx-map-alt",
|
||||
"book": "bx bx-book"
|
||||
};
|
||||
|
||||
/**
|
||||
* FIXME: since there's no "full note" anymore we can rename this to Note
|
||||
*
|
||||
@@ -78,7 +89,7 @@ class NoteShort {
|
||||
/** @param {string} content-type, e.g. "application/json" */
|
||||
this.mime = row.mime;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = row.isDeleted;
|
||||
this.isDeleted = !!row.isDeleted;
|
||||
}
|
||||
|
||||
addParent(parentNoteId, branchId) {
|
||||
@@ -93,14 +104,16 @@ class NoteShort {
|
||||
this.parentToBranch[parentNoteId] = branchId;
|
||||
}
|
||||
|
||||
addChild(childNoteId, branchId) {
|
||||
if (!this.children.includes(childNoteId)) {
|
||||
addChild(childNoteId, branchId, sort = true) {
|
||||
if (!(childNoteId in this.childToBranch)) {
|
||||
this.children.push(childNoteId);
|
||||
}
|
||||
|
||||
this.childToBranch[childNoteId] = branchId;
|
||||
|
||||
this.sortChildren();
|
||||
if (sort) {
|
||||
this.sortChildren();
|
||||
}
|
||||
}
|
||||
|
||||
sortChildren() {
|
||||
@@ -282,6 +295,63 @@ class NoteShort {
|
||||
return this.getAttributes(LABEL, name);
|
||||
}
|
||||
|
||||
getIcon() {
|
||||
const iconClassLabels = this.getLabels('iconClass');
|
||||
const workspaceIconClass = this.getWorkspaceIconClass();
|
||||
|
||||
if (iconClassLabels.length > 0) {
|
||||
return iconClassLabels.map(l => l.value).join(' ');
|
||||
}
|
||||
else if (workspaceIconClass) {
|
||||
return workspaceIconClass;
|
||||
}
|
||||
else if (this.noteId === 'root') {
|
||||
return "bx bx-chevrons-right";
|
||||
}
|
||||
else if (this.type === 'text') {
|
||||
if (this.isFolder()) {
|
||||
return "bx bx-folder";
|
||||
}
|
||||
else {
|
||||
return "bx bx-note";
|
||||
}
|
||||
}
|
||||
else if (this.type === 'code' && this.mime.startsWith('text/x-sql')) {
|
||||
return "bx bx-data";
|
||||
}
|
||||
else {
|
||||
return NOTE_TYPE_ICONS[this.type];
|
||||
}
|
||||
}
|
||||
|
||||
isFolder() {
|
||||
return this.type === 'search'
|
||||
|| this.getFilteredChildBranches().length > 0;
|
||||
}
|
||||
|
||||
getFilteredChildBranches() {
|
||||
let childBranches = this.getChildBranches();
|
||||
|
||||
if (!childBranches) {
|
||||
ws.logError(`No children for ${parentNote}. This shouldn't happen.`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (options.is("hideIncludedImages_main")) {
|
||||
const imageLinks = this.getRelations('imageLink');
|
||||
|
||||
// image is already visible in the parent note so no need to display it separately in the book
|
||||
childBranches = childBranches.filter(branch => !imageLinks.find(rel => rel.value === branch.noteId));
|
||||
}
|
||||
|
||||
// we're not checking hideArchivedNotes since that would mean we need to lazy load the child notes
|
||||
// which would seriously slow down everything.
|
||||
// we check this flag only once user chooses to expand the parent. This has the negative consequence that
|
||||
// note may appear as folder but not contain any children when all of them are archived
|
||||
|
||||
return childBranches;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||
@@ -466,19 +536,42 @@ class NoteShort {
|
||||
return relations.map(rel => this.treeCache.notes[rel.value]);
|
||||
}
|
||||
|
||||
hasAncestor(ancestorNote) {
|
||||
getPromotedDefinitionAttributes() {
|
||||
if (this.hasLabel('hidePromotedAttributes')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return this.getAttributes()
|
||||
.filter(attr => attr.isDefinition())
|
||||
.filter(attr => {
|
||||
const def = attr.getDefinition();
|
||||
|
||||
return def && def.isPromoted;
|
||||
});
|
||||
}
|
||||
|
||||
hasAncestor(ancestorNote, visitedNoteIds) {
|
||||
if (this.noteId === ancestorNote.noteId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!visitedNoteIds) {
|
||||
visitedNoteIds = new Set();
|
||||
} else if (visitedNoteIds.has(this.noteId)) {
|
||||
// to avoid infinite cycle when template is descendent of the instance
|
||||
return false;
|
||||
}
|
||||
|
||||
visitedNoteIds.add(this.noteId);
|
||||
|
||||
for (const templateNote of this.getTemplateNotes()) {
|
||||
if (templateNote.hasAncestor(ancestorNote)) {
|
||||
if (templateNote.hasAncestor(ancestorNote, visitedNoteIds)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (const parentNote of this.getParentNotes()) {
|
||||
if (parentNote.hasAncestor(ancestorNote)) {
|
||||
if (parentNote.hasAncestor(ancestorNote, visitedNoteIds)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -539,6 +632,16 @@ class NoteShort {
|
||||
const labels = this.getLabels('cssClass');
|
||||
return labels.map(l => l.value).join(' ');
|
||||
}
|
||||
|
||||
getWorkspaceIconClass() {
|
||||
const labels = this.getLabels('workspaceIconClass');
|
||||
return labels.length > 0 ? labels[0].value : "";
|
||||
}
|
||||
|
||||
getWorkspaceTabBackgroundColor() {
|
||||
const labels = this.getLabels('workspaceTabBackgroundColor');
|
||||
return labels.length > 0 ? labels[0].value : "";
|
||||
}
|
||||
}
|
||||
|
||||
export default NoteShort;
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
<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#line93">line 93</a>
|
||||
<a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line124">line 124</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
|
||||
<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#line96">line 96</a>
|
||||
<a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line127">line 127</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@ separately but should behave uniformly for the user.
|
||||
|
||||
<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#line86">line 86</a>
|
||||
<a href="widgets_collapsible_widget.js.html">widgets/collapsible_widget.js</a>, <a href="widgets_collapsible_widget.js.html#line117">line 117</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -572,7 +572,7 @@ separately but should behave uniformly for the user.
|
||||
|
||||
<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#line76">line 76</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line88">line 88</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source linenums"><code>import treeService from './tree.js';
|
||||
import server from './server.js';
|
||||
<pre class="prettyprint source linenums"><code>import server from './server.js';
|
||||
import utils from './utils.js';
|
||||
import toastService from './toast.js';
|
||||
import linkService from './link.js';
|
||||
@@ -37,7 +36,6 @@ import protectedSessionService from './protected_session.js';
|
||||
import dateNotesService from './date_notes.js';
|
||||
import CollapsibleWidget from '../widgets/collapsible_widget.js';
|
||||
import ws from "./ws.js";
|
||||
import hoistedNoteService from "./hoisted_note.js";
|
||||
import appContext from "./app_context.js";
|
||||
import TabAwareWidget from "../widgets/tab_aware_widget.js";
|
||||
import TabCachingWidget from "../widgets/tab_caching_widget.js";
|
||||
@@ -101,6 +99,20 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
appContext.triggerEvent('focusAndSelectTitle');
|
||||
};
|
||||
|
||||
/**
|
||||
* Open a note in a new tab.
|
||||
*
|
||||
* @param {string} notePath (or noteId)
|
||||
* @param {boolean} activate - set to true to activate the new tab, false to stay on the current tab
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
this.openTabWithNote = async (notePath, activate) => {
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
|
||||
await appContext.tabManager.openTabWithNote(notePath, activate);
|
||||
appContext.triggerEvent('focusAndSelectTitle');
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {Object} ToolbarButtonOptions
|
||||
* @property {string} title
|
||||
@@ -117,7 +129,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
this.addButtonToToolbar = opts => {
|
||||
const buttonId = "toolbar-button-" + opts.title.replace(/\s/g, "-");
|
||||
|
||||
const button = $('<button>')
|
||||
const button = $('<button class="noborder">')
|
||||
.addClass("btn btn-sm")
|
||||
.on('click', opts.action);
|
||||
|
||||
@@ -302,7 +314,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*
|
||||
* @method
|
||||
* @param {string} notePath (or noteId)
|
||||
* @param {string} [noteTitle] - if not present we'll use note title
|
||||
* @param {object} [params]
|
||||
* @param {boolean} [params.showTooltip=true] - enable/disable tooltip on the link
|
||||
* @param {boolean} [params.showNotePath=false] - show also whole note's path as part of the link
|
||||
* @param {string} [title=] - custom link tile with note's title as default
|
||||
*/
|
||||
this.createNoteLink = linkService.createNoteLink;
|
||||
|
||||
@@ -404,13 +419,19 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
this.getYearNote = dateNotesService.getYearNote;
|
||||
|
||||
/**
|
||||
* Hoist note. See https://github.com/zadam/trilium/wiki/Note-hoisting
|
||||
* Hoist note in the current tab. See https://github.com/zadam/trilium/wiki/Note-hoisting
|
||||
*
|
||||
* @method
|
||||
* @param {string} noteId - set hoisted note. 'root' will effectively unhoist
|
||||
* @return {Promise}
|
||||
*/
|
||||
this.setHoistedNoteId = hoistedNoteService.setHoistedNoteId;
|
||||
this.setHoistedNoteId = (noteId) => {
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
|
||||
if (activeTabContext) {
|
||||
activeTabContext.setHoistedNoteId(noteId);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @method
|
||||
|
||||
@@ -31,16 +31,25 @@ import options from "../services/options.js";
|
||||
|
||||
const WIDGET_TPL = `
|
||||
<div class="card widget">
|
||||
<div class="card-header">
|
||||
<div class="card-header">
|
||||
<div>
|
||||
<button class="btn btn-sm widget-title" data-toggle="collapse" data-target="#[to be set]">
|
||||
Collapsible Group Item
|
||||
</button>
|
||||
|
||||
<a class="widget-help external no-arrow bx bx-info-circle"></a>
|
||||
<a class="widget-toggle-button no-arrow"
|
||||
title="Minimize/maximize widget"
|
||||
data-toggle="collapse" data-target="#[to be set]">
|
||||
|
||||
<span class="widget-toggle-icon bx"></span>
|
||||
|
||||
<span class="widget-title">
|
||||
Collapsible Group Item
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<span class="widget-header-actions"></span>
|
||||
</div>
|
||||
|
||||
<div class="widget-header-actions"></div>
|
||||
<div>
|
||||
<a class="widget-help external no-arrow bx bx-info-circle"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="[to be set]" class="collapse body-wrapper" style="transition: none; ">
|
||||
@@ -66,13 +75,19 @@ export default class CollapsibleWidget extends TabAwareWidget {
|
||||
// not using constructor name because of webpack mangling class names ...
|
||||
this.widgetName = this.widgetTitle.replace(/[^[a-zA-Z0-9]/g, "_");
|
||||
|
||||
if (!options.is(this.widgetName + 'Collapsed')) {
|
||||
this.$toggleButton = this.$widget.find('.widget-toggle-button');
|
||||
this.$toggleIcon = this.$widget.find('.widget-toggle-icon');
|
||||
|
||||
const collapsed = options.is(this.widgetName + 'Collapsed');
|
||||
if (!collapsed) {
|
||||
this.$bodyWrapper.collapse("show");
|
||||
}
|
||||
|
||||
this.updateToggleIcon(collapsed);
|
||||
|
||||
// using immediate variants of the event so that the previous collapse is not caught
|
||||
this.$bodyWrapper.on('hide.bs.collapse', () => this.saveCollapsed(true));
|
||||
this.$bodyWrapper.on('show.bs.collapse', () => this.saveCollapsed(false));
|
||||
this.$bodyWrapper.on('hide.bs.collapse', () => this.toggleCollapsed(true));
|
||||
this.$bodyWrapper.on('show.bs.collapse', () => this.toggleCollapsed(false));
|
||||
|
||||
this.$body = this.$bodyWrapper.find('.card-body');
|
||||
|
||||
@@ -94,19 +109,35 @@ export default class CollapsibleWidget extends TabAwareWidget {
|
||||
}
|
||||
|
||||
this.$headerActions = this.$widget.find('.widget-header-actions');
|
||||
this.$headerActions.append(...this.headerActions);
|
||||
this.$headerActions.append(this.headerActions);
|
||||
|
||||
this.initialized = this.doRenderBody();
|
||||
|
||||
this.decorateWidget();
|
||||
}
|
||||
|
||||
saveCollapsed(collapse) {
|
||||
toggleCollapsed(collapse) {
|
||||
this.updateToggleIcon(collapse);
|
||||
|
||||
options.save(this.widgetName + 'Collapsed', collapse.toString());
|
||||
|
||||
this.triggerEvent(`widgetCollapsedStateChanged`, {widgetName: this.widgetName, collapse});
|
||||
}
|
||||
|
||||
updateToggleIcon(collapse) {
|
||||
if (collapse) {
|
||||
this.$toggleIcon
|
||||
.addClass("bx-chevron-right")
|
||||
.removeClass("bx-chevron-down")
|
||||
.attr("title", "Show");
|
||||
} else {
|
||||
this.$toggleIcon
|
||||
.addClass("bx-chevron-down")
|
||||
.removeClass("bx-chevron-right")
|
||||
.attr("title", "Hide");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This event is used to synchronize collapsed state of all the tab-cached widgets since they are all rendered
|
||||
* separately but should behave uniformly for the user.
|
||||
|
||||
+4
-4
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,12 +1,12 @@
|
||||
/* !!!!!! TRILIUM CUSTOM CHANGES !!!!!! */
|
||||
|
||||
.ck-widget__type-around { /* gets rid of triangles: https://github.com/zadam/trilium/issues/1129 */
|
||||
.printed-content .ck-widget__selection-handle, .printed-content .ck-widget__type-around { /* gets rid of triangles: https://github.com/zadam/trilium/issues/1129 */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* CKEditor 5 (v22.0.0) content styles.
|
||||
* Generated on Thu, 27 Aug 2020 12:13:06 GMT.
|
||||
* CKEditor 5 (v24.0.0) content styles.
|
||||
* Generated on Thu, 10 Dec 2020 08:15:26 GMT.
|
||||
* For more information, check out https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/content-styles.html
|
||||
*/
|
||||
|
||||
@@ -23,31 +23,19 @@
|
||||
--ck-todo-list-checkmark-size: 16px;
|
||||
}
|
||||
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .marker-yellow {
|
||||
background-color: var(--ck-highlight-marker-yellow);
|
||||
/* ckeditor5-image/theme/imageresize.css */
|
||||
.ck-content .image.image_resized {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .marker-green {
|
||||
background-color: var(--ck-highlight-marker-green);
|
||||
/* ckeditor5-image/theme/imageresize.css */
|
||||
.ck-content .image.image_resized img {
|
||||
width: 100%;
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .marker-pink {
|
||||
background-color: var(--ck-highlight-marker-pink);
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .marker-blue {
|
||||
background-color: var(--ck-highlight-marker-blue);
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .pen-red {
|
||||
color: var(--ck-highlight-pen-red);
|
||||
background-color: transparent;
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .pen-green {
|
||||
color: var(--ck-highlight-pen-green);
|
||||
background-color: transparent;
|
||||
/* ckeditor5-image/theme/imageresize.css */
|
||||
.ck-content .image.image_resized > figcaption {
|
||||
display: block;
|
||||
}
|
||||
/* ckeditor5-image/theme/imagestyle.css */
|
||||
.ck-content .image-style-side {
|
||||
@@ -84,20 +72,6 @@
|
||||
max-width: 100%;
|
||||
min-width: 50px;
|
||||
}
|
||||
/* ckeditor5-image/theme/imageresize.css */
|
||||
.ck-content .image.image_resized {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
/* ckeditor5-image/theme/imageresize.css */
|
||||
.ck-content .image.image_resized img {
|
||||
width: 100%;
|
||||
}
|
||||
/* ckeditor5-image/theme/imageresize.css */
|
||||
.ck-content .image.image_resized > figcaption {
|
||||
display: block;
|
||||
}
|
||||
/* ckeditor5-image/theme/imagecaption.css */
|
||||
.ck-content .image > figcaption {
|
||||
display: table-caption;
|
||||
@@ -109,11 +83,31 @@
|
||||
font-size: .75em;
|
||||
outline-offset: -1px;
|
||||
}
|
||||
/* ckeditor5-basic-styles/theme/code.css */
|
||||
.ck-content code {
|
||||
background-color: hsla(0, 0%, 78%, 0.3);
|
||||
padding: .15em;
|
||||
border-radius: 2px;
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .marker-yellow {
|
||||
background-color: var(--ck-highlight-marker-yellow);
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .marker-green {
|
||||
background-color: var(--ck-highlight-marker-green);
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .marker-pink {
|
||||
background-color: var(--ck-highlight-marker-pink);
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .marker-blue {
|
||||
background-color: var(--ck-highlight-marker-blue);
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .pen-red {
|
||||
color: var(--ck-highlight-pen-red);
|
||||
background-color: transparent;
|
||||
}
|
||||
/* ckeditor5-highlight/theme/highlight.css */
|
||||
.ck-content .pen-green {
|
||||
color: var(--ck-highlight-pen-green);
|
||||
background-color: transparent;
|
||||
}
|
||||
/* ckeditor5-font/theme/fontsize.css */
|
||||
.ck-content .text-tiny {
|
||||
@@ -146,6 +140,12 @@
|
||||
border-left: 0;
|
||||
border-right: solid 5px hsl(0, 0%, 80%);
|
||||
}
|
||||
/* ckeditor5-basic-styles/theme/code.css */
|
||||
.ck-content code {
|
||||
background-color: hsla(0, 0%, 78%, 0.3);
|
||||
padding: .15em;
|
||||
border-radius: 2px;
|
||||
}
|
||||
/* ckeditor5-table/theme/table.css */
|
||||
.ck-content .table {
|
||||
margin: 1em auto;
|
||||
@@ -289,6 +289,12 @@
|
||||
.ck-content .todo-list .todo-list__label .todo-list__label__description {
|
||||
vertical-align: middle;
|
||||
}
|
||||
/* ckeditor5-html-embed/theme/htmlembed.css */
|
||||
.ck-content .raw-html-embed {
|
||||
margin: 1em auto;
|
||||
min-width: 15em;
|
||||
font-style: normal;
|
||||
}
|
||||
/* ckeditor5-horizontal-line/theme/horizontalline.css */
|
||||
.ck-content hr {
|
||||
margin: 15px 0;
|
||||
@@ -330,4 +336,4 @@
|
||||
.ck-content .page-break::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
/*! jQuery Fancytree Plugin - 2.37.0 - 2020-09-11T18:58:08Z
|
||||
/*! jQuery Fancytree Plugin - 2.38.0 - 2021-02-09T20:03:49Z
|
||||
* https://github.com/mar10/fancytree
|
||||
* Copyright (c) 2020 Martin Wendt; Licensed MIT
|
||||
* Copyright (c) 2021 Martin Wendt; Licensed MIT
|
||||
*/
|
||||
/*! jQuery UI - v1.12.1 - 2018-05-20
|
||||
* http://jqueryui.com
|
||||
@@ -1361,12 +1361,12 @@ var uniqueId = $.fn.extend( {
|
||||
* Tree view control with support for lazy loading and much more.
|
||||
* https://github.com/mar10/fancytree/
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
/** Core Fancytree module.
|
||||
@@ -1530,8 +1530,16 @@ var uniqueId = $.fn.extend( {
|
||||
// TODO: see qunit.js extractStacktrace()
|
||||
if (!cond) {
|
||||
msg = msg ? ": " + msg : "";
|
||||
msg = "Fancytree assertion failed" + msg;
|
||||
|
||||
// consoleApply("assert", [!!cond, msg]);
|
||||
$.error("Fancytree assertion failed" + msg);
|
||||
|
||||
// #1041: Raised exceptions may not be visible in the browser
|
||||
// console if inside promise chains, so we also print directly:
|
||||
$.ui.fancytree.error(msg);
|
||||
|
||||
// Throw exception:
|
||||
$.error(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5259,6 +5267,13 @@ var uniqueId = $.fn.extend( {
|
||||
// visit siblings
|
||||
siblings = parent.children;
|
||||
nextIdx = siblings.indexOf(node) + siblingOfs;
|
||||
_assert(
|
||||
nextIdx >= 0,
|
||||
"Could not find " +
|
||||
node +
|
||||
" in parent's children: " +
|
||||
parent
|
||||
);
|
||||
|
||||
for (i = nextIdx; i < siblings.length; i++) {
|
||||
node = siblings[i];
|
||||
@@ -6660,7 +6675,17 @@ var uniqueId = $.fn.extend( {
|
||||
if (isActive === flag) {
|
||||
// Nothing to do
|
||||
return _getResolvedPromise(node);
|
||||
} else if (
|
||||
}
|
||||
// #1042: don't scroll between mousedown/-up when clicking an embedded link
|
||||
if (
|
||||
scroll &&
|
||||
ctx.originalEvent &&
|
||||
$(ctx.originalEvent.target).is("a,:checkbox")
|
||||
) {
|
||||
node.info("Not scrolling while clicking an embedded link.");
|
||||
scroll = false;
|
||||
}
|
||||
if (
|
||||
flag &&
|
||||
!noEvents &&
|
||||
this._triggerNodeEvent(
|
||||
@@ -8070,7 +8095,7 @@ var uniqueId = $.fn.extend( {
|
||||
{
|
||||
/** Version number `"MAJOR.MINOR.PATCH"`
|
||||
* @type {string} */
|
||||
version: "2.37.0", // Set to semver by 'grunt release'
|
||||
version: "2.38.0", // Set to semver by 'grunt release'
|
||||
/** @type {string}
|
||||
* @description `"production" for release builds` */
|
||||
buildType: "production", // Set to 'production' by 'grunt build'
|
||||
@@ -8700,13 +8725,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Add a child counter bubble to tree nodes.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
// To keep the global namespace clean, we wrap everything in a closure.
|
||||
@@ -8825,7 +8850,7 @@ var uniqueId = $.fn.extend( {
|
||||
// Every extension must be registered by a unique name.
|
||||
name: "childcounter",
|
||||
// Version information should be compliant with [semver](http://semver.org)
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
|
||||
// Extension specific options and their defaults.
|
||||
// This options will be available as `tree.options.childcounter.hideExpanded`
|
||||
@@ -8931,13 +8956,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Support faster lookup of nodes by key and shared ref-ids.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -8958,13 +8983,8 @@ var uniqueId = $.fn.extend( {
|
||||
/*******************************************************************************
|
||||
* Private functions and variables
|
||||
*/
|
||||
function _assert(cond, msg) {
|
||||
// TODO: see qunit.js extractStacktrace()
|
||||
if (!cond) {
|
||||
msg = msg ? ": " + msg : "";
|
||||
$.error("Assertion failed" + msg);
|
||||
}
|
||||
}
|
||||
|
||||
var _assert = $.ui.fancytree.assert;
|
||||
|
||||
/* Return first occurrence of member from array. */
|
||||
function _removeArrayMember(arr, elem) {
|
||||
@@ -9295,7 +9315,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "clones",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
highlightActiveClones: true, // set 'fancytree-active-clone' on active clones and all peers
|
||||
@@ -9452,13 +9472,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Drag-and-drop support (native HTML5).
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -10056,7 +10076,7 @@ var uniqueId = $.fn.extend( {
|
||||
// data store list of items representing dragged data can be
|
||||
// enumerated, but the data itself is unavailable and no new
|
||||
// data can be added.
|
||||
var nodeData = node.toDict();
|
||||
var nodeData = node.toDict(true, dndOpts.sourceCopyHook);
|
||||
nodeData.treeId = node.tree._id;
|
||||
json = JSON.stringify(nodeData);
|
||||
try {
|
||||
@@ -10476,7 +10496,7 @@ var uniqueId = $.fn.extend( {
|
||||
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "dnd5",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
autoExpandMS: 1500, // Expand nodes after n milliseconds of hovering
|
||||
@@ -10498,6 +10518,7 @@ var uniqueId = $.fn.extend( {
|
||||
scrollSensitivity: 20, // Active top/bottom margin in pixel
|
||||
scrollSpeed: 5, // Pixel per event
|
||||
setTextTypeJson: false, // Allow dragging of nodes to different IE windows
|
||||
sourceCopyHook: null, // Optional callback passed to `toDict` on dragStart @since 2.38
|
||||
// Events (drag support)
|
||||
dragStart: null, // Callback(sourceNode, data), return true, to enable dnd drag
|
||||
dragDrag: $.noop, // Callback(sourceNode, data)
|
||||
@@ -10607,13 +10628,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Make node titles editable.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -10905,7 +10926,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "edit",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
adjustWidthOfs: 4, // null: don't adjust input size to content
|
||||
@@ -11011,13 +11032,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Remove or highlight tree nodes, based on a filter.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -11040,8 +11061,9 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
|
||||
var KeyNoData = "__not_found__",
|
||||
escapeHtml = $.ui.fancytree.escapeHtml;
|
||||
|
||||
escapeHtml = $.ui.fancytree.escapeHtml,
|
||||
exoticStartChar = "\uFFF7",
|
||||
exoticEndChar = "\uFFF8";
|
||||
function _escapeRegex(str) {
|
||||
return (str + "").replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
|
||||
}
|
||||
@@ -11055,6 +11077,47 @@ var uniqueId = $.fn.extend( {
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Marks the matching charecters of `text` either by `mark` or
|
||||
* by exotic*Chars (if `escapeTitles` is `true`) based on `regexMatchArray`
|
||||
* which is an array of matching groups.
|
||||
* @param {string} text
|
||||
* @param {RegExpMatchArray} regexMatchArray
|
||||
*/
|
||||
function _markFuzzyMatchedChars(text, regexMatchArray, escapeTitles) {
|
||||
// It is extremely infuriating that we can not use `let` or `const` or arrow functions.
|
||||
// Damn you IE!!!
|
||||
var matchingIndices = [];
|
||||
// get the indices of matched characters (Iterate through `RegExpMatchArray`)
|
||||
for (
|
||||
var _matchingArrIdx = 1;
|
||||
_matchingArrIdx < regexMatchArray.length;
|
||||
_matchingArrIdx++
|
||||
) {
|
||||
var _mIdx =
|
||||
// get matching char index by cumulatively adding
|
||||
// the matched group length
|
||||
regexMatchArray[_matchingArrIdx].length +
|
||||
(_matchingArrIdx === 1 ? 0 : 1) +
|
||||
(matchingIndices[matchingIndices.length - 1] || 0);
|
||||
matchingIndices.push(_mIdx);
|
||||
}
|
||||
// Map each `text` char to its position and store in `textPoses`.
|
||||
var textPoses = text.split("");
|
||||
if (escapeTitles) {
|
||||
// If escaping the title, then wrap the matchng char within exotic chars
|
||||
matchingIndices.forEach(function(v) {
|
||||
textPoses[v] = exoticStartChar + textPoses[v] + exoticEndChar;
|
||||
});
|
||||
} else {
|
||||
// Otherwise, Wrap the matching chars within `mark`.
|
||||
matchingIndices.forEach(function(v) {
|
||||
textPoses[v] = "<mark>" + textPoses[v] + "</mark>";
|
||||
});
|
||||
}
|
||||
// Join back the modified `textPoses` to create final highlight markup.
|
||||
return textPoses.join("");
|
||||
}
|
||||
$.ui.fancytree._FancytreeClass.prototype._applyFilterImpl = function(
|
||||
filter,
|
||||
branchMode,
|
||||
@@ -11064,6 +11127,8 @@ var uniqueId = $.fn.extend( {
|
||||
statusNode,
|
||||
re,
|
||||
reHighlight,
|
||||
reExoticStartChar,
|
||||
reExoticEndChar,
|
||||
temp,
|
||||
prevEnableUpdate,
|
||||
count = 0,
|
||||
@@ -11087,14 +11152,29 @@ var uniqueId = $.fn.extend( {
|
||||
// See https://codereview.stackexchange.com/questions/23899/faster-javascript-fuzzy-string-matching-function/23905#23905
|
||||
// and http://www.quora.com/How-is-the-fuzzy-search-algorithm-in-Sublime-Text-designed
|
||||
// and http://www.dustindiaz.com/autocomplete-fuzzy-matching
|
||||
match = filter.split("").reduce(function(a, b) {
|
||||
return a + "[^" + b + "]*" + b;
|
||||
});
|
||||
match = filter
|
||||
.split("")
|
||||
// Escaping the `filter` will not work because,
|
||||
// it gets further split into individual characters. So,
|
||||
// escape each character after splitting
|
||||
.map(_escapeRegex)
|
||||
.reduce(function(a, b) {
|
||||
// create capture groups for parts that comes before
|
||||
// the character
|
||||
return a + "([^" + b + "]*)" + b;
|
||||
}, "");
|
||||
} else {
|
||||
match = _escapeRegex(filter); // make sure a '.' is treated literally
|
||||
}
|
||||
re = new RegExp(".*" + match + ".*", "i");
|
||||
re = new RegExp(match, "i");
|
||||
reHighlight = new RegExp(_escapeRegex(filter), "gi");
|
||||
if (escapeTitles) {
|
||||
reExoticStartChar = new RegExp(
|
||||
_escapeRegex(exoticStartChar),
|
||||
"g"
|
||||
);
|
||||
reExoticEndChar = new RegExp(_escapeRegex(exoticEndChar), "g");
|
||||
}
|
||||
filter = function(node) {
|
||||
if (!node.title) {
|
||||
return false;
|
||||
@@ -11102,31 +11182,46 @@ var uniqueId = $.fn.extend( {
|
||||
var text = escapeTitles
|
||||
? node.title
|
||||
: extractHtmlText(node.title),
|
||||
res = !!re.test(text);
|
||||
|
||||
// `.match` instead of `.test` to get the capture groups
|
||||
res = text.match(re);
|
||||
if (res && opts.highlight) {
|
||||
if (escapeTitles) {
|
||||
// #740: we must not apply the marks to escaped entity names, e.g. `"`
|
||||
// Use some exotic characters to mark matches:
|
||||
temp = text.replace(reHighlight, function(s) {
|
||||
return "\uFFF7" + s + "\uFFF8";
|
||||
});
|
||||
if (opts.fuzzy) {
|
||||
temp = _markFuzzyMatchedChars(
|
||||
text,
|
||||
res,
|
||||
escapeTitles
|
||||
);
|
||||
} else {
|
||||
// #740: we must not apply the marks to escaped entity names, e.g. `"`
|
||||
// Use some exotic characters to mark matches:
|
||||
temp = text.replace(reHighlight, function(s) {
|
||||
return exoticStartChar + s + exoticEndChar;
|
||||
});
|
||||
}
|
||||
// now we can escape the title...
|
||||
node.titleWithHighlight = escapeHtml(temp)
|
||||
// ... and finally insert the desired `<mark>` tags
|
||||
.replace(/\uFFF7/g, "<mark>")
|
||||
.replace(/\uFFF8/g, "</mark>");
|
||||
.replace(reExoticStartChar, "<mark>")
|
||||
.replace(reExoticEndChar, "</mark>");
|
||||
} else {
|
||||
node.titleWithHighlight = text.replace(
|
||||
reHighlight,
|
||||
function(s) {
|
||||
return "<mark>" + s + "</mark>";
|
||||
}
|
||||
);
|
||||
if (opts.fuzzy) {
|
||||
node.titleWithHighlight = _markFuzzyMatchedChars(
|
||||
text,
|
||||
res
|
||||
);
|
||||
} else {
|
||||
node.titleWithHighlight = text.replace(
|
||||
reHighlight,
|
||||
function(s) {
|
||||
return "<mark>" + s + "</mark>";
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
// node.debug("filter", escapeTitles, text, node.titleWithHighlight);
|
||||
}
|
||||
return res;
|
||||
return !!res;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11264,6 +11359,26 @@ var uniqueId = $.fn.extend( {
|
||||
return this._applyFilterImpl(filter, true, opts);
|
||||
};
|
||||
|
||||
/**
|
||||
* [ext-filter] Re-apply current filter.
|
||||
*
|
||||
* @returns {integer} count
|
||||
* @alias Fancytree#updateFilter
|
||||
* @requires jquery.fancytree.filter.js
|
||||
* @since 2.38
|
||||
*/
|
||||
$.ui.fancytree._FancytreeClass.prototype.updateFilter = function() {
|
||||
if (
|
||||
this.enableFilter &&
|
||||
this.lastFilterArgs &&
|
||||
this.options.filter.autoApply
|
||||
) {
|
||||
this._applyFilterImpl.apply(this, this.lastFilterArgs);
|
||||
} else {
|
||||
this.warn("updateFilter(): no filter active.");
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* [ext-filter] Reset the filter.
|
||||
*
|
||||
@@ -11355,7 +11470,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "filter",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
autoApply: true, // Re-apply last filter if lazy data is loaded
|
||||
@@ -11470,13 +11585,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Use glyph-fonts, ligature-fonts, or SVG icons instead of icon sprites.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -11678,7 +11793,7 @@ var uniqueId = $.fn.extend( {
|
||||
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "glyph",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
preset: null, // 'awesome3', 'awesome4', 'bootstrap3', 'material'
|
||||
@@ -11828,13 +11943,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Support keyboard navigation for trees with embedded input controls.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -11951,7 +12066,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "gridnav",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
autofocusInput: false, // Focus first embedded input if node gets activated
|
||||
@@ -12053,13 +12168,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Allow multiple selection of nodes by mouse or keyboard.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -12088,7 +12203,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "multi",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
allowNoSelect: false, //
|
||||
@@ -12185,13 +12300,13 @@ var uniqueId = $.fn.extend( {
|
||||
*
|
||||
* @depends: js-cookie or jquery-cookie
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -12402,7 +12517,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "persist",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
cookieDelimiter: "~",
|
||||
@@ -12690,13 +12805,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Render tree as table (aka 'tree grid', 'table tree').
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -12717,12 +12832,7 @@ var uniqueId = $.fn.extend( {
|
||||
/******************************************************************************
|
||||
* Private functions and variables
|
||||
*/
|
||||
function _assert(cond, msg) {
|
||||
msg = msg || "";
|
||||
if (!cond) {
|
||||
$.error("Assertion failed " + msg);
|
||||
}
|
||||
}
|
||||
var _assert = $.ui.fancytree.assert;
|
||||
|
||||
function insertFirstChild(referenceNode, newNode) {
|
||||
referenceNode.insertBefore(newNode, referenceNode.firstChild);
|
||||
@@ -12779,7 +12889,7 @@ var uniqueId = $.fn.extend( {
|
||||
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "table",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
checkboxColumnIdx: null, // render the checkboxes into the this column index (default: nodeColumnIdx)
|
||||
@@ -13240,13 +13350,13 @@ var uniqueId = $.fn.extend( {
|
||||
*
|
||||
* @see http://jqueryui.com/themeroller/
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -13269,7 +13379,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "themeroller",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
activeClass: "ui-state-active", // Class added to active node
|
||||
@@ -13360,13 +13470,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Support for 100% wide selection bars.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -13496,7 +13606,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "wide",
|
||||
version: "2.37.0",
|
||||
version: "2.38.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
iconWidth: null, // Adjust this if @fancy-icon-width != "16px"
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -9,12 +9,12 @@
|
||||
*
|
||||
* This section is automatically generated from the `skin-common.less` template.
|
||||
*
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.37.0
|
||||
* @date 2020-09-11T18:58:08Z
|
||||
* @version 2.38.0
|
||||
* @date 2021-02-09T20:03:49Z
|
||||
******************************************************************************/
|
||||
/*------------------------------------------------------------------------------
|
||||
* Helpers
|
||||
|
||||
Generated
+598
-548
File diff suppressed because it is too large
Load Diff
+28
-26
@@ -2,7 +2,7 @@
|
||||
"name": "trilium",
|
||||
"productName": "Trilium Notes",
|
||||
"description": "Trilium Notes",
|
||||
"version": "0.45.3",
|
||||
"version": "0.46.1-beta",
|
||||
"license": "AGPL-3.0-only",
|
||||
"main": "electron.js",
|
||||
"bin": {
|
||||
@@ -24,69 +24,71 @@
|
||||
"test-all": "npm run test && npm run test-es6"
|
||||
},
|
||||
"dependencies": {
|
||||
"async-mutex": "0.2.4",
|
||||
"axios": "0.20.0",
|
||||
"better-sqlite3": "7.1.1",
|
||||
"async-mutex": "0.3.0",
|
||||
"axios": "0.21.1",
|
||||
"better-sqlite3": "7.1.2",
|
||||
"body-parser": "1.19.0",
|
||||
"cls-hooked": "4.2.2",
|
||||
"commonmark": "0.29.2",
|
||||
"commonmark": "0.29.3",
|
||||
"cookie-parser": "1.4.5",
|
||||
"csurf": "1.11.0",
|
||||
"dayjs": "1.9.3",
|
||||
"ejs": "3.1.5",
|
||||
"electron-debug": "3.1.0",
|
||||
"electron-dl": "3.0.2",
|
||||
"dayjs": "1.10.4",
|
||||
"ejs": "3.1.6",
|
||||
"electron-debug": "3.2.0",
|
||||
"electron-dl": "3.1.0",
|
||||
"electron-find": "1.0.6",
|
||||
"electron-window-state": "5.0.3",
|
||||
"express": "4.17.1",
|
||||
"express-session": "1.17.1",
|
||||
"fs-extra": "9.0.1",
|
||||
"helmet": "4.1.1",
|
||||
"fs-extra": "9.1.0",
|
||||
"helmet": "4.4.1",
|
||||
"html": "1.0.0",
|
||||
"html2plaintext": "2.1.2",
|
||||
"http-proxy-agent": "4.0.1",
|
||||
"https-proxy-agent": "5.0.0",
|
||||
"image-type": "4.1.0",
|
||||
"ini": "1.3.5",
|
||||
"ini": "2.0.0",
|
||||
"is-animated": "^2.0.1",
|
||||
"is-svg": "4.2.1",
|
||||
"jimp": "0.16.1",
|
||||
"jsdom": "^16.4.0",
|
||||
"mime-types": "2.1.27",
|
||||
"mime-types": "2.1.29",
|
||||
"multer": "1.4.2",
|
||||
"node-abi": "2.19.1",
|
||||
"open": "7.3.0",
|
||||
"node-abi": "2.19.3",
|
||||
"open": "7.4.2",
|
||||
"portscanner": "2.2.0",
|
||||
"rand-token": "1.0.1",
|
||||
"request": "^2.88.2",
|
||||
"rimraf": "3.0.2",
|
||||
"sanitize-filename": "1.6.3",
|
||||
"sanitize-html": "2.1.1",
|
||||
"sanitize-html": "2.3.2",
|
||||
"sax": "1.2.4",
|
||||
"semver": "7.3.2",
|
||||
"semver": "7.3.4",
|
||||
"serve-favicon": "2.5.0",
|
||||
"session-file-store": "1.5.0",
|
||||
"stream-throttle": "^0.1.3",
|
||||
"striptags": "3.1.1",
|
||||
"tmp": "^0.2.1",
|
||||
"turndown": "7.0.0",
|
||||
"turndown-plugin-gfm": "1.0.2",
|
||||
"unescape": "1.0.1",
|
||||
"ws": "7.3.1",
|
||||
"ws": "7.4.3",
|
||||
"yauzl": "2.10.0",
|
||||
"yazl": "2.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "7.0.2",
|
||||
"electron": "9.3.4",
|
||||
"cross-env": "7.0.3",
|
||||
"electron": "9.4.3",
|
||||
"electron-builder": "22.9.1",
|
||||
"electron-packager": "15.1.0",
|
||||
"electron-rebuild": "2.3.2",
|
||||
"electron-packager": "15.2.0",
|
||||
"electron-rebuild": "2.3.5",
|
||||
"esm": "3.2.25",
|
||||
"jasmine": "3.6.2",
|
||||
"jasmine": "3.6.4",
|
||||
"jsdoc": "3.6.6",
|
||||
"lorem-ipsum": "2.0.3",
|
||||
"rcedit": "2.2.0",
|
||||
"webpack": "5.1.3",
|
||||
"webpack-cli": "4.1.0"
|
||||
"rcedit": "3.0.0",
|
||||
"webpack": "5.23.0",
|
||||
"webpack-cli": "4.5.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"electron-installer-debian": "2.0.1"
|
||||
|
||||
@@ -46,7 +46,8 @@ class NoteBuilder {
|
||||
branchId: id(),
|
||||
noteId: childNoteBuilder.note.noteId,
|
||||
parentNoteId: this.note.noteId,
|
||||
prefix
|
||||
prefix,
|
||||
notePosition: 10
|
||||
});
|
||||
|
||||
return this;
|
||||
|
||||
@@ -12,8 +12,8 @@ describe("Search", () => {
|
||||
beforeEach(() => {
|
||||
noteCache.reset();
|
||||
|
||||
rootNote = new NoteBuilder(new Note(noteCache, {noteId: 'root', title: 'root'}));
|
||||
new Branch(noteCache, {branchId: 'root', noteId: 'root', parentNoteId: 'none'});
|
||||
rootNote = new NoteBuilder(new Note(noteCache, {noteId: 'root', title: 'root', type: 'text'}));
|
||||
new Branch(noteCache, {branchId: 'root', noteId: 'root', parentNoteId: 'none', notePosition: 10});
|
||||
});
|
||||
|
||||
it("simple path match", () => {
|
||||
@@ -113,6 +113,15 @@ describe("Search", () => {
|
||||
let searchResults = searchService.findNotesWithQuery('#capital=Vienna', searchContext);
|
||||
expect(searchResults.length).toEqual(1);
|
||||
expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
|
||||
|
||||
// case sensitivity:
|
||||
searchResults = searchService.findNotesWithQuery('#CAPITAL=VIENNA', searchContext);
|
||||
expect(searchResults.length).toEqual(1);
|
||||
expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
|
||||
|
||||
searchResults = searchService.findNotesWithQuery('#caPItal=vienNa', searchContext);
|
||||
expect(searchResults.length).toEqual(1);
|
||||
expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
|
||||
});
|
||||
|
||||
it("label comparison with full syntax", () => {
|
||||
@@ -472,14 +481,17 @@ describe("Search", () => {
|
||||
expect(searchResults.length).toEqual(expectedResultCount);
|
||||
}
|
||||
|
||||
test("type", "text", 6);
|
||||
test("type", "text", 7);
|
||||
test("TYPE", "TEXT", 7);
|
||||
test("type", "code", 0);
|
||||
|
||||
test("mime", "text/html", 6);
|
||||
test("mime", "application/json", 0);
|
||||
|
||||
test("isProtected", "false", 7);
|
||||
test("isProtected", "FALSE", 7);
|
||||
test("isProtected", "true", 0);
|
||||
test("isProtected", "TRUE", 0);
|
||||
|
||||
test("dateCreated", "'2020-05-14 12:11:42.001+0200'", 1);
|
||||
test("dateCreated", "wrong", 0);
|
||||
|
||||
@@ -24,12 +24,12 @@ describe("Value extractor", () => {
|
||||
let valueExtractor = new ValueExtractor(["note", "labels", "capital"]);
|
||||
|
||||
expect(valueExtractor.validate()).toBeFalsy();
|
||||
expect(valueExtractor.extract(austria)).toEqual("vienna");
|
||||
expect(valueExtractor.extract(austria)).toEqual("Vienna");
|
||||
|
||||
valueExtractor = new ValueExtractor(["#capital"]);
|
||||
|
||||
expect(valueExtractor.validate()).toBeFalsy();
|
||||
expect(valueExtractor.extract(austria)).toEqual("vienna");
|
||||
expect(valueExtractor.extract(austria)).toEqual("Vienna");
|
||||
});
|
||||
|
||||
it("parent/child property extraction", async () => {
|
||||
@@ -59,12 +59,12 @@ describe("Value extractor", () => {
|
||||
let valueExtractor = new ValueExtractor(["note", "relations", "neighbor", "labels", "capital"]);
|
||||
|
||||
expect(valueExtractor.validate()).toBeFalsy();
|
||||
expect(valueExtractor.extract(austria.note)).toEqual("prague");
|
||||
expect(valueExtractor.extract(austria.note)).toEqual("Prague");
|
||||
|
||||
valueExtractor = new ValueExtractor(["~neighbor", "labels", "capital"]);
|
||||
|
||||
expect(valueExtractor.validate()).toBeFalsy();
|
||||
expect(valueExtractor.extract(austria.note)).toEqual("prague");
|
||||
expect(valueExtractor.extract(austria.note)).toEqual("Prague");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+2
-1
@@ -10,7 +10,6 @@ const FileStore = require('session-file-store')(session);
|
||||
const sessionSecret = require('./services/session_secret');
|
||||
const dataDir = require('./services/data_dir');
|
||||
require('./services/handlers');
|
||||
require('./services/hoisted_note_loader');
|
||||
require('./services/note_cache/note_cache_loader');
|
||||
|
||||
const app = express();
|
||||
@@ -24,6 +23,7 @@ app.use(helmet({
|
||||
contentSecurityPolicy: false
|
||||
}));
|
||||
|
||||
app.use(bodyParser.text({limit: '500mb'}));
|
||||
app.use(bodyParser.json({limit: '500mb'}));
|
||||
app.use(bodyParser.urlencoded({extended: false}));
|
||||
app.use(cookieParser());
|
||||
@@ -39,6 +39,7 @@ const sessionParser = session({
|
||||
httpOnly: true,
|
||||
maxAge: 24 * 60 * 60 * 1000 // in milliseconds
|
||||
},
|
||||
name: 'trilium.sid',
|
||||
store: new FileStore({
|
||||
ttl: 30 * 24 * 3600,
|
||||
path: dataDir.TRILIUM_DATA_DIR + '/sessions'
|
||||
|
||||
@@ -18,7 +18,6 @@ const promotedAttributeDefinitionParser = require("../services/promoted_attribut
|
||||
* @property {boolean} isInheritable - immutable
|
||||
* @property {boolean} isDeleted
|
||||
* @property {string|null} deleteId - ID identifying delete transaction
|
||||
* @property {string} utcDateCreated
|
||||
* @property {string} utcDateModified
|
||||
*
|
||||
* @extends Entity
|
||||
@@ -26,7 +25,7 @@ const promotedAttributeDefinitionParser = require("../services/promoted_attribut
|
||||
class Attribute extends Entity {
|
||||
static get entityName() { return "attributes"; }
|
||||
static get primaryKeyName() { return "attributeId"; }
|
||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "utcDateCreated"]; }
|
||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted"]; }
|
||||
|
||||
constructor(row) {
|
||||
super(row);
|
||||
@@ -34,6 +33,10 @@ class Attribute extends Entity {
|
||||
this.isInheritable = !!this.isInheritable;
|
||||
}
|
||||
|
||||
isAutoLink() {
|
||||
return this.type === 'relation' && ['internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink'].includes(this.name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
@@ -99,15 +102,9 @@ class Attribute extends Entity {
|
||||
this.isDeleted = false;
|
||||
}
|
||||
|
||||
if (!this.utcDateCreated) {
|
||||
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
createClone(type, name, value, isInheritable) {
|
||||
@@ -119,7 +116,6 @@ class Attribute extends Entity {
|
||||
position: this.position,
|
||||
isInheritable: isInheritable,
|
||||
isDeleted: false,
|
||||
utcDateCreated: this.utcDateCreated,
|
||||
utcDateModified: this.utcDateModified
|
||||
});
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class Branch extends Entity {
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
if (this.notePosition === undefined) {
|
||||
if (this.notePosition === undefined || this.notePosition === null) {
|
||||
const maxNotePos = sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
|
||||
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 10;
|
||||
}
|
||||
@@ -57,9 +57,7 @@ class Branch extends Entity {
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
createClone(parentNoteId, notePosition) {
|
||||
|
||||
@@ -15,18 +15,13 @@ class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
if ('isDeleted' in this) {
|
||||
if ('isDeleted' in this && this.constructor.entityName !== 'recent_notes') {
|
||||
this.isDeleted = !!this.isDeleted;
|
||||
}
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
this.generateIdIfNecessary();
|
||||
|
||||
const origHash = this.hash;
|
||||
|
||||
this.hash = this.generateHash();
|
||||
this.isChanged = origHash !== this.hash;
|
||||
}
|
||||
|
||||
generateIdIfNecessary() {
|
||||
@@ -45,6 +40,10 @@ class Entity {
|
||||
return utils.hash(contentToHash).substr(0, 10);
|
||||
}
|
||||
|
||||
getUtcDateChanged() {
|
||||
return this.utcDateModified;
|
||||
}
|
||||
|
||||
get repository() {
|
||||
if (!repo) {
|
||||
repo = require('../services/repository');
|
||||
|
||||
+16
-12
@@ -21,7 +21,6 @@ const RELATION = 'relation';
|
||||
* @property {boolean} isProtected - true if note is protected
|
||||
* @property {boolean} isDeleted - true if note is deleted
|
||||
* @property {string|null} deleteId - ID identifying delete transaction
|
||||
* @property {boolean} isErased - true if note's content is erased after it has been deleted
|
||||
* @property {string} dateCreated - local date time (with offset)
|
||||
* @property {string} dateModified - local date time (with offset)
|
||||
* @property {string} utcDateCreated
|
||||
@@ -70,9 +69,9 @@ class Note extends Entity {
|
||||
/** @returns {*} */
|
||||
getContent(silentNotFoundError = false) {
|
||||
if (this.content === undefined) {
|
||||
const res = sql.getRow(`SELECT content, hash FROM note_contents WHERE noteId = ?`, [this.noteId]);
|
||||
const row = sql.getRow(`SELECT content FROM note_contents WHERE noteId = ?`, [this.noteId]);
|
||||
|
||||
if (!res) {
|
||||
if (!row) {
|
||||
if (silentNotFoundError) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -81,7 +80,7 @@ class Note extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
this.content = res.content;
|
||||
this.content = row.content;
|
||||
|
||||
if (this.isProtected) {
|
||||
if (this.isContentAvailable) {
|
||||
@@ -143,8 +142,7 @@ class Note extends Entity {
|
||||
noteId: this.noteId,
|
||||
content: content,
|
||||
dateModified: dateUtils.localNowDateTime(),
|
||||
utcDateModified: dateUtils.utcNowDateTime(),
|
||||
hash: utils.hash(this.noteId + "|" + content.toString())
|
||||
utcDateModified: dateUtils.utcNowDateTime()
|
||||
};
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -158,7 +156,15 @@ class Note extends Entity {
|
||||
|
||||
sql.upsert("note_contents", "noteId", pojo);
|
||||
|
||||
entityChangesService.addNoteContentEntityChange(this.noteId);
|
||||
const hash = utils.hash(this.noteId + "|" + content.toString());
|
||||
|
||||
entityChangesService.addEntityChange({
|
||||
entityName: 'note_contents',
|
||||
entityId: this.noteId,
|
||||
hash: hash,
|
||||
isErased: false,
|
||||
utcDateChanged: this.getUtcDateChanged()
|
||||
}, null);
|
||||
}
|
||||
|
||||
setJsonContent(content) {
|
||||
@@ -806,7 +812,7 @@ class Note extends Entity {
|
||||
* @returns {boolean} - true if note has children
|
||||
*/
|
||||
hasChildren() {
|
||||
return (this.getChildNotes()).length > 0;
|
||||
return this.getChildNotes().length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -904,10 +910,8 @@ class Note extends Entity {
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.dateModified = dateUtils.localNowDateTime();
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.dateModified = dateUtils.localNowDateTime();
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
|
||||
@@ -15,7 +15,6 @@ const entityChangesService = require('../services/entity_changes.js');
|
||||
* @property {string} type
|
||||
* @property {string} mime
|
||||
* @property {string} title
|
||||
* @property {boolean} isErased
|
||||
* @property {boolean} isProtected
|
||||
* @property {string} dateLastEdited
|
||||
* @property {string} dateCreated
|
||||
@@ -28,12 +27,11 @@ const entityChangesService = require('../services/entity_changes.js');
|
||||
class NoteRevision extends Entity {
|
||||
static get entityName() { return "note_revisions"; }
|
||||
static get primaryKeyName() { return "noteRevisionId"; }
|
||||
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isErased", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
||||
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
||||
|
||||
constructor(row) {
|
||||
super(row);
|
||||
|
||||
this.isErased = !!this.isErased;
|
||||
this.isProtected = !!this.isProtected;
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -67,7 +65,7 @@ class NoteRevision extends Entity {
|
||||
/** @returns {*} */
|
||||
getContent(silentNotFoundError = false) {
|
||||
if (this.content === undefined) {
|
||||
const res = sql.getRow(`SELECT content, hash FROM note_revision_contents WHERE noteRevisionId = ?`, [this.noteRevisionId]);
|
||||
const res = sql.getRow(`SELECT content FROM note_revision_contents WHERE noteRevisionId = ?`, [this.noteRevisionId]);
|
||||
|
||||
if (!res) {
|
||||
if (silentNotFoundError) {
|
||||
@@ -79,7 +77,6 @@ class NoteRevision extends Entity {
|
||||
}
|
||||
|
||||
this.content = res.content;
|
||||
|
||||
if (this.isProtected) {
|
||||
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||
this.content = protectedSessionService.decrypt(this.content);
|
||||
@@ -106,8 +103,7 @@ class NoteRevision extends Entity {
|
||||
const pojo = {
|
||||
noteRevisionId: this.noteRevisionId,
|
||||
content: content,
|
||||
utcDateModified: dateUtils.utcNowDateTime(),
|
||||
hash: utils.hash(this.noteRevisionId + "|" + content)
|
||||
utcDateModified: dateUtils.utcNowDateTime()
|
||||
};
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -121,15 +117,21 @@ class NoteRevision extends Entity {
|
||||
|
||||
sql.upsert("note_revision_contents", "noteRevisionId", pojo);
|
||||
|
||||
entityChangesService.addNoteRevisionContentEntityChange(this.noteRevisionId);
|
||||
const hash = utils.hash(this.noteRevisionId + "|" + content);
|
||||
|
||||
entityChangesService.addEntityChange({
|
||||
entityName: 'note_revision_contents',
|
||||
entityId: this.noteRevisionId,
|
||||
hash: hash,
|
||||
isErased: false,
|
||||
utcDateChanged: this.getUtcDateChanged()
|
||||
}, null);
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
|
||||
@@ -32,10 +32,8 @@ class Option extends Entity {
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Option;
|
||||
module.exports = Option;
|
||||
|
||||
@@ -8,21 +8,15 @@ const dateUtils = require('../services/date_utils');
|
||||
*
|
||||
* @property {string} noteId
|
||||
* @property {string} notePath
|
||||
* @property {boolean} isDeleted
|
||||
* @property {string} utcDateModified
|
||||
* @property {string} utcDateCreated
|
||||
*
|
||||
* @extends Entity
|
||||
*/
|
||||
class RecentNote extends Entity {
|
||||
static get entityName() { return "recent_notes"; }
|
||||
static get primaryKeyName() { return "noteId"; }
|
||||
static get hashedProperties() { return ["noteId", "notePath", "utcDateCreated", "isDeleted"]; }
|
||||
|
||||
beforeSaving() {
|
||||
if (!this.isDeleted) {
|
||||
this.isDeleted = false;
|
||||
}
|
||||
|
||||
if (!this.utcDateCreated) {
|
||||
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||
}
|
||||
@@ -31,4 +25,4 @@ class RecentNote extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RecentNote;
|
||||
module.exports = RecentNote;
|
||||
|
||||
@@ -7,17 +7,18 @@ const $form = $("#add-link-form");
|
||||
const $autoComplete = $("#add-link-note-autocomplete");
|
||||
const $linkTitle = $("#link-title");
|
||||
const $addLinkTitleSettings = $("#add-link-title-settings");
|
||||
const $addLinkTitleRadios = $(".add-link-title-radios");
|
||||
const $addLinkTitleFormGroup = $("#add-link-title-form-group");
|
||||
|
||||
/** @var TextTypeWidget */
|
||||
let textTypeWidget;
|
||||
|
||||
export async function showDialog(widget) {
|
||||
export async function showDialog(widget, text = '') {
|
||||
textTypeWidget = widget;
|
||||
|
||||
$addLinkTitleSettings.toggle(!textTypeWidget.hasSelection());
|
||||
|
||||
$addLinkTitleSettings.find('input[type=radio]').on('change', updateTitleFormGroupVisibility);
|
||||
$addLinkTitleSettings.find('input[type=radio]').on('change', updateTitleSettingsVisibility);
|
||||
|
||||
// with selection hyper link is implied
|
||||
if (textTypeWidget.hasSelection()) {
|
||||
@@ -27,11 +28,11 @@ export async function showDialog(widget) {
|
||||
$addLinkTitleSettings.find("input[value='reference-link']").prop("checked", true);
|
||||
}
|
||||
|
||||
updateTitleFormGroupVisibility();
|
||||
updateTitleSettingsVisibility();
|
||||
|
||||
utils.openDialog($dialog);
|
||||
|
||||
$autoComplete.val('').trigger('focus');
|
||||
$autoComplete.val('');
|
||||
$linkTitle.val('');
|
||||
|
||||
async function setDefaultLinkTitle(noteId) {
|
||||
@@ -40,13 +41,18 @@ export async function showDialog(widget) {
|
||||
$linkTitle.val(noteTitle);
|
||||
}
|
||||
|
||||
noteAutocompleteService.initNoteAutocomplete($autoComplete);
|
||||
noteAutocompleteService.initNoteAutocomplete($autoComplete, {
|
||||
allowExternalLinks: true,
|
||||
allowCreatingNotes: true
|
||||
});
|
||||
|
||||
$autoComplete.on('autocomplete:noteselected', function(event, suggestion, dataset) {
|
||||
$autoComplete.on('autocomplete:noteselected', (event, suggestion, dataset) => {
|
||||
if (!suggestion.notePath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
updateTitleSettingsVisibility();
|
||||
|
||||
const noteId = treeService.getNoteIdFromNotePath(suggestion.notePath);
|
||||
|
||||
if (noteId) {
|
||||
@@ -54,39 +60,71 @@ export async function showDialog(widget) {
|
||||
}
|
||||
});
|
||||
|
||||
$autoComplete.on('autocomplete:cursorchanged', function(event, suggestion, dataset) {
|
||||
const noteId = treeService.getNoteIdFromNotePath(suggestion.notePath);
|
||||
$autoComplete.on('autocomplete:externallinkselected', (event, suggestion, dataset) => {
|
||||
if (!suggestion.externalLink) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (noteId) {
|
||||
setDefaultLinkTitle(noteId);
|
||||
updateTitleSettingsVisibility();
|
||||
|
||||
$linkTitle.val(suggestion.externalLink);
|
||||
});
|
||||
|
||||
$autoComplete.on('autocomplete:cursorchanged', function(event, suggestion, dataset) {
|
||||
if (suggestion.externalLink) {
|
||||
$linkTitle.val(suggestion.externalLink)
|
||||
}
|
||||
else {
|
||||
const noteId = treeService.getNoteIdFromNotePath(suggestion.notePath);
|
||||
|
||||
if (noteId) {
|
||||
setDefaultLinkTitle(noteId);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
noteAutocompleteService.showRecentNotes($autoComplete);
|
||||
if (text && text.trim()) {
|
||||
noteAutocompleteService.setText($autoComplete, text);
|
||||
}
|
||||
else {
|
||||
noteAutocompleteService.showRecentNotes($autoComplete);
|
||||
}
|
||||
|
||||
$autoComplete
|
||||
.trigger('focus')
|
||||
.trigger('select'); // to be able to quickly remove entered text
|
||||
}
|
||||
|
||||
function getLinkType() {
|
||||
if ($autoComplete.getSelectedExternalLink()) {
|
||||
return 'external-link';
|
||||
}
|
||||
|
||||
return $addLinkTitleSettings.find('input[type=radio]:checked').val();
|
||||
}
|
||||
|
||||
function updateTitleFormGroupVisibility() {
|
||||
const visible = getLinkType() === 'hyper-link';
|
||||
function updateTitleSettingsVisibility() {
|
||||
const linkType = getLinkType();
|
||||
|
||||
$addLinkTitleFormGroup.toggle(visible);
|
||||
$addLinkTitleFormGroup.toggle(linkType !== 'reference-link');
|
||||
$addLinkTitleRadios.toggle(linkType !== 'external-link')
|
||||
}
|
||||
|
||||
$form.on('submit', () => {
|
||||
const notePath = $autoComplete.getSelectedNotePath();
|
||||
|
||||
if (notePath) {
|
||||
if ($autoComplete.getSelectedNotePath()) {
|
||||
$dialog.modal('hide');
|
||||
|
||||
const linkTitle = getLinkType() === 'reference-link' ? null : $linkTitle.val();
|
||||
|
||||
textTypeWidget.addLink(notePath, linkTitle);
|
||||
textTypeWidget.addLink($autoComplete.getSelectedNotePath(), linkTitle);
|
||||
}
|
||||
else if ($autoComplete.getSelectedExternalLink()) {
|
||||
$dialog.modal('hide');
|
||||
|
||||
textTypeWidget.addLink($autoComplete.getSelectedExternalLink(), $linkTitle.val());
|
||||
}
|
||||
else {
|
||||
logError("No path to add link.");
|
||||
logError("No link to add.");
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -13,6 +13,7 @@ const $textImportedAsTextCheckbox = $("#text-imported-as-text-checkbox");
|
||||
const $codeImportedAsCodeCheckbox = $("#code-imported-as-code-checkbox");
|
||||
const $explodeArchivesCheckbox = $("#explode-archives-checkbox");
|
||||
const $replaceUnderscoresWithSpacesCheckbox = $("#replace-underscores-with-spaces-checkbox");
|
||||
const $csrf = $("#import-csrf");
|
||||
|
||||
let parentNoteId = null;
|
||||
|
||||
|
||||
@@ -17,7 +17,10 @@ export async function showDialog(widget) {
|
||||
|
||||
utils.openDialog($dialog);
|
||||
|
||||
noteAutocompleteService.initNoteAutocomplete($autoComplete, { hideGoToSelectedNoteButton: true });
|
||||
noteAutocompleteService.initNoteAutocomplete($autoComplete, {
|
||||
hideGoToSelectedNoteButton: true,
|
||||
allowCreatingNotes: true
|
||||
});
|
||||
noteAutocompleteService.showRecentNotes($autoComplete);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ export async function showDialog() {
|
||||
utils.openDialog($dialog);
|
||||
|
||||
noteAutocompleteService.initNoteAutocomplete($autoComplete, { hideGoToSelectedNoteButton: true })
|
||||
// clear any event listener added in previous invocation of this function
|
||||
.off('autocomplete:noteselected')
|
||||
.on('autocomplete:noteselected', function(event, suggestion, dataset) {
|
||||
if (!suggestion.notePath) {
|
||||
return false;
|
||||
@@ -45,10 +47,9 @@ function showInFullText(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const searchText = $autoComplete.val();
|
||||
const searchString = $autoComplete.val();
|
||||
|
||||
appContext.triggerCommand('showSearch', {searchText});
|
||||
appContext.triggerCommand('searchForResults', {searchText});
|
||||
appContext.triggerCommand('searchNotes', {searchString});
|
||||
|
||||
$dialog.modal('hide');
|
||||
}
|
||||
|
||||
@@ -42,15 +42,21 @@ const TPL = `
|
||||
<div>
|
||||
<h4>Note erasure timeout</h4>
|
||||
|
||||
<p>Deleted notes are at first only marked as deleted and it is possible to recover them
|
||||
<p>Deleted notes (and attributes, revisions...) are at first only marked as deleted and it is possible to recover them
|
||||
from Recent Notes dialog. After a period of time, deleted notes are "erased" which means
|
||||
their content is not recoverable anymore. This setting allows you to configure the length
|
||||
of the period between deleting and erasing the note.</p>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="erase-notes-after-time-in-seconds">Erase notes after X seconds</label>
|
||||
<input class="form-control" id="erase-notes-after-time-in-seconds" type="number" min="0">
|
||||
<label for="erase-entities-after-time-in-seconds">Erase notes after X seconds</label>
|
||||
<input class="form-control" id="erase-entities-after-time-in-seconds" type="number" min="0">
|
||||
</div>
|
||||
|
||||
<p>You can also trigger erasing manually:</p>
|
||||
|
||||
<button id="erase-deleted-notes-now-button" class="btn">Erase deleted notes now</button>
|
||||
|
||||
<br/><br/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -105,18 +111,25 @@ export default class ProtectedSessionOptions {
|
||||
this.$availableLanguageCodes.text(webContents.session.availableSpellCheckerLanguages.join(', '));
|
||||
}
|
||||
|
||||
this.$eraseNotesAfterTimeInSeconds = $("#erase-notes-after-time-in-seconds");
|
||||
this.$eraseEntitiesAfterTimeInSeconds = $("#erase-entities-after-time-in-seconds");
|
||||
|
||||
this.$eraseNotesAfterTimeInSeconds.on('change', () => {
|
||||
const eraseNotesAfterTimeInSeconds = this.$eraseNotesAfterTimeInSeconds.val();
|
||||
this.$eraseEntitiesAfterTimeInSeconds.on('change', () => {
|
||||
const eraseEntitiesAfterTimeInSeconds = this.$eraseEntitiesAfterTimeInSeconds.val();
|
||||
|
||||
server.put('options', { 'eraseNotesAfterTimeInSeconds': eraseNotesAfterTimeInSeconds }).then(() => {
|
||||
server.put('options', { 'eraseEntitiesAfterTimeInSeconds': eraseEntitiesAfterTimeInSeconds }).then(() => {
|
||||
toastService.showMessage("Options change have been saved.");
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$eraseDeletedNotesButton = $("#erase-deleted-notes-now-button");
|
||||
this.$eraseDeletedNotesButton.on('click', () => {
|
||||
server.post('notes/erase-deleted-notes-now').then(() => {
|
||||
toastService.showMessage("Deleted notes have been erased.");
|
||||
});
|
||||
});
|
||||
|
||||
this.$protectedSessionTimeout = $("#protected-session-timeout-in-seconds");
|
||||
|
||||
this.$protectedSessionTimeout.on('change', () => {
|
||||
@@ -160,7 +173,7 @@ export default class ProtectedSessionOptions {
|
||||
this.$spellCheckEnabled.prop("checked", options['spellCheckEnabled'] === 'true');
|
||||
this.$spellCheckLanguageCode.val(options['spellCheckLanguageCode']);
|
||||
|
||||
this.$eraseNotesAfterTimeInSeconds.val(options['eraseNotesAfterTimeInSeconds']);
|
||||
this.$eraseEntitiesAfterTimeInSeconds.val(options['eraseEntitiesAfterTimeInSeconds']);
|
||||
this.$protectedSessionTimeout.val(options['protectedSessionTimeout']);
|
||||
this.$noteRevisionsTimeInterval.val(options['noteRevisionSnapshotTimeInterval']);
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ class Attribute {
|
||||
this.position = row.position;
|
||||
/** @param {boolean} isInheritable */
|
||||
this.isInheritable = !!row.isInheritable;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = !!row.isDeleted;
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
@@ -86,6 +88,17 @@ class Attribute {
|
||||
getDefinition() {
|
||||
return promotedAttributeDefinitionParser.parse(this.value);
|
||||
}
|
||||
|
||||
isDefinitionFor(attr) {
|
||||
return this.type === 'label' && this.name === `${attr.type}:${attr.name}`;
|
||||
}
|
||||
|
||||
get dto() {
|
||||
const dto = Object.assign({}, this);
|
||||
delete dto.treeCache;
|
||||
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
|
||||
export default Attribute;
|
||||
|
||||
@@ -20,9 +20,9 @@ class Branch {
|
||||
/** @param {boolean} */
|
||||
this.isExpanded = !!row.isExpanded;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = !!row.isDeleted;
|
||||
/** @param {boolean} */
|
||||
this.fromSearchNote = !!row.fromSearchNote;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = !!row.isDeleted;
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import server from '../services/server.js';
|
||||
import Attribute from './attribute.js';
|
||||
import noteAttributeCache from "../services/note_attribute_cache.js";
|
||||
import ws from "../services/ws.js";
|
||||
import options from "../services/options.js";
|
||||
|
||||
const LABEL = 'label';
|
||||
const RELATION = 'relation';
|
||||
@@ -75,14 +76,16 @@ class NoteShort {
|
||||
this.parentToBranch[parentNoteId] = branchId;
|
||||
}
|
||||
|
||||
addChild(childNoteId, branchId) {
|
||||
if (!this.children.includes(childNoteId)) {
|
||||
addChild(childNoteId, branchId, sort = true) {
|
||||
if (!(childNoteId in this.childToBranch)) {
|
||||
this.children.push(childNoteId);
|
||||
}
|
||||
|
||||
this.childToBranch[childNoteId] = branchId;
|
||||
|
||||
this.sortChildren();
|
||||
if (sort) {
|
||||
this.sortChildren();
|
||||
}
|
||||
}
|
||||
|
||||
sortChildren() {
|
||||
@@ -264,17 +267,21 @@ class NoteShort {
|
||||
return this.getAttributes(LABEL, name);
|
||||
}
|
||||
|
||||
getIcon(isFolder = false) {
|
||||
const iconCassLabels = this.getLabels('iconClass');
|
||||
getIcon() {
|
||||
const iconClassLabels = this.getLabels('iconClass');
|
||||
const workspaceIconClass = this.getWorkspaceIconClass();
|
||||
|
||||
if (iconCassLabels.length > 0) {
|
||||
return iconCassLabels.map(l => l.value).join(' ');
|
||||
if (iconClassLabels.length > 0) {
|
||||
return iconClassLabels.map(l => l.value).join(' ');
|
||||
}
|
||||
else if (workspaceIconClass) {
|
||||
return workspaceIconClass;
|
||||
}
|
||||
else if (this.noteId === 'root') {
|
||||
return "bx bx-chevrons-right";
|
||||
}
|
||||
else if (this.type === 'text') {
|
||||
if (isFolder) {
|
||||
if (this.isFolder()) {
|
||||
return "bx bx-folder";
|
||||
}
|
||||
else {
|
||||
@@ -289,6 +296,34 @@ class NoteShort {
|
||||
}
|
||||
}
|
||||
|
||||
isFolder() {
|
||||
return this.type === 'search'
|
||||
|| this.getFilteredChildBranches().length > 0;
|
||||
}
|
||||
|
||||
getFilteredChildBranches() {
|
||||
let childBranches = this.getChildBranches();
|
||||
|
||||
if (!childBranches) {
|
||||
ws.logError(`No children for ${parentNote}. This shouldn't happen.`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (options.is("hideIncludedImages_main")) {
|
||||
const imageLinks = this.getRelations('imageLink');
|
||||
|
||||
// image is already visible in the parent note so no need to display it separately in the book
|
||||
childBranches = childBranches.filter(branch => !imageLinks.find(rel => rel.value === branch.noteId));
|
||||
}
|
||||
|
||||
// we're not checking hideArchivedNotes since that would mean we need to lazy load the child notes
|
||||
// which would seriously slow down everything.
|
||||
// we check this flag only once user chooses to expand the parent. This has the negative consequence that
|
||||
// note may appear as folder but not contain any children when all of them are archived
|
||||
|
||||
return childBranches;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||
@@ -473,19 +508,42 @@ class NoteShort {
|
||||
return relations.map(rel => this.treeCache.notes[rel.value]);
|
||||
}
|
||||
|
||||
hasAncestor(ancestorNote) {
|
||||
getPromotedDefinitionAttributes() {
|
||||
if (this.hasLabel('hidePromotedAttributes')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return this.getAttributes()
|
||||
.filter(attr => attr.isDefinition())
|
||||
.filter(attr => {
|
||||
const def = attr.getDefinition();
|
||||
|
||||
return def && def.isPromoted;
|
||||
});
|
||||
}
|
||||
|
||||
hasAncestor(ancestorNote, visitedNoteIds) {
|
||||
if (this.noteId === ancestorNote.noteId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!visitedNoteIds) {
|
||||
visitedNoteIds = new Set();
|
||||
} else if (visitedNoteIds.has(this.noteId)) {
|
||||
// to avoid infinite cycle when template is descendent of the instance
|
||||
return false;
|
||||
}
|
||||
|
||||
visitedNoteIds.add(this.noteId);
|
||||
|
||||
for (const templateNote of this.getTemplateNotes()) {
|
||||
if (templateNote.hasAncestor(ancestorNote)) {
|
||||
if (templateNote.hasAncestor(ancestorNote, visitedNoteIds)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (const parentNote of this.getParentNotes()) {
|
||||
if (parentNote.hasAncestor(ancestorNote)) {
|
||||
if (parentNote.hasAncestor(ancestorNote, visitedNoteIds)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -546,6 +604,16 @@ class NoteShort {
|
||||
const labels = this.getLabels('cssClass');
|
||||
return labels.map(l => l.value).join(' ');
|
||||
}
|
||||
|
||||
getWorkspaceIconClass() {
|
||||
const labels = this.getLabels('workspaceIconClass');
|
||||
return labels.length > 0 ? labels[0].value : "";
|
||||
}
|
||||
|
||||
getWorkspaceTabBackgroundColor() {
|
||||
const labels = this.getLabels('workspaceTabBackgroundColor');
|
||||
return labels.length > 0 ? labels[0].value : "";
|
||||
}
|
||||
}
|
||||
|
||||
export default NoteShort;
|
||||
|
||||
@@ -5,11 +5,24 @@ import TitleBarButtonsWidget from "../widgets/title_bar_buttons.js";
|
||||
import NoteTreeWidget from "../widgets/note_tree.js";
|
||||
import TabCachingWidget from "../widgets/tab_caching_widget.js";
|
||||
import NoteTitleWidget from "../widgets/note_title.js";
|
||||
import RunScriptButtonsWidget from "../widgets/run_script_buttons.js";
|
||||
import NoteTypeWidget from "../widgets/note_type.js";
|
||||
import NoteActionsWidget from "../widgets/note_actions.js";
|
||||
import NoteDetailWidget from "../widgets/note_detail.js";
|
||||
import AttributeListWidget from "../widgets/attribute_list.js";
|
||||
import OwnedAttributeListWidget from "../widgets/type_property_widgets/owned_attribute_list.js";
|
||||
import CollapsibleSectionContainer from "../widgets/collapsible_section_container.js";
|
||||
import SearchDefinitionWidget from "../widgets/type_property_widgets/search_definition.js";
|
||||
import PromotedAttributesWidget from "../widgets/type_property_widgets/promoted_attributes.js";
|
||||
import InheritedAttributesWidget from "../widgets/type_property_widgets/inherited_attribute_list.js";
|
||||
import Container from "../widgets/container.js";
|
||||
import SqlTableSchemasWidget from "../widgets/sql_table_schemas.js";
|
||||
import NoteListWidget from "../widgets/note_list.js";
|
||||
import SqlResultWidget from "../widgets/sql_result.js";
|
||||
import FilePropertiesWidget from "../widgets/type_property_widgets/file_properties.js";
|
||||
import ImagePropertiesWidget from "../widgets/type_property_widgets/image_properties.js";
|
||||
import NotePropertiesWidget from "../widgets/type_property_widgets/note_properties.js";
|
||||
import NoteIconWidget from "../widgets/note_icon.js";
|
||||
import NotePathsWidget from "../widgets/note_paths.js";
|
||||
import SearchResultWidget from "../widgets/search_result.js";
|
||||
|
||||
export default class DesktopExtraWindowLayout {
|
||||
constructor(customWidgets) {
|
||||
@@ -32,15 +45,34 @@ export default class DesktopExtraWindowLayout {
|
||||
.filling()
|
||||
.child(new FlexContainer('column').id('center-pane').filling()
|
||||
.child(new FlexContainer('row').class('title-row')
|
||||
.css('align-items: center;')
|
||||
.cssBlock('.title-row > * { margin: 5px; }')
|
||||
.overflowing()
|
||||
.cssBlock('.title-row > * { margin: 5px 5px 0 5px; }')
|
||||
.child(new NoteIconWidget())
|
||||
.child(new NoteTitleWidget())
|
||||
.child(new RunScriptButtonsWidget().hideInZenMode())
|
||||
.child(new NotePathsWidget().hideInZenMode())
|
||||
.child(new NoteTypeWidget().hideInZenMode())
|
||||
.child(new NoteActionsWidget().hideInZenMode())
|
||||
)
|
||||
.child(new TabCachingWidget(() => new AttributeListWidget()))
|
||||
.child(new TabCachingWidget(() => new NoteDetailWidget()))
|
||||
.child(
|
||||
new TabCachingWidget(() => new CollapsibleSectionContainer()
|
||||
.child(new SearchDefinitionWidget())
|
||||
.child(new NotePropertiesWidget())
|
||||
.child(new FilePropertiesWidget())
|
||||
.child(new ImagePropertiesWidget())
|
||||
.child(new PromotedAttributesWidget())
|
||||
.child(new OwnedAttributeListWidget())
|
||||
.child(new InheritedAttributesWidget())
|
||||
)
|
||||
)
|
||||
.child(new Container()
|
||||
.css('height: 100%; overflow: auto;')
|
||||
.child(new TabCachingWidget(() => new SqlTableSchemasWidget()))
|
||||
.child(new TabCachingWidget(() => new NoteDetailWidget()))
|
||||
.child(new TabCachingWidget(() => new NoteListWidget()))
|
||||
.child(new TabCachingWidget(() => new SearchResultWidget()))
|
||||
.child(new TabCachingWidget(() => new SqlResultWidget()))
|
||||
)
|
||||
.child(...this.customWidgets.get('center-pane'))
|
||||
)
|
||||
);
|
||||
|
||||
@@ -4,15 +4,11 @@ import TabRowWidget from "../widgets/tab_row.js";
|
||||
import TitleBarButtonsWidget from "../widgets/title_bar_buttons.js";
|
||||
import StandardTopWidget from "../widgets/standard_top_widget.js";
|
||||
import SidePaneContainer from "../widgets/side_pane_container.js";
|
||||
import GlobalButtonsWidget from "../widgets/global_buttons.js";
|
||||
import SearchBoxWidget from "../widgets/search_box.js";
|
||||
import SearchResultsWidget from "../widgets/search_results.js";
|
||||
import NoteTreeWidget from "../widgets/note_tree.js";
|
||||
import TabCachingWidget from "../widgets/tab_caching_widget.js";
|
||||
import NotePathsWidget from "../widgets/note_paths.js";
|
||||
import NoteTitleWidget from "../widgets/note_title.js";
|
||||
import AttributeListWidget from "../widgets/attribute_list.js";
|
||||
import RunScriptButtonsWidget from "../widgets/run_script_buttons.js";
|
||||
import OwnedAttributeListWidget from "../widgets/type_property_widgets/owned_attribute_list.js";
|
||||
import NoteTypeWidget from "../widgets/note_type.js";
|
||||
import NoteActionsWidget from "../widgets/note_actions.js";
|
||||
import NoteDetailWidget from "../widgets/note_detail.js";
|
||||
@@ -24,6 +20,19 @@ import SimilarNotesWidget from "../widgets/similar_notes.js";
|
||||
import WhatLinksHereWidget from "../widgets/collapsible_widgets/what_links_here.js";
|
||||
import SidePaneToggles from "../widgets/side_pane_toggles.js";
|
||||
import EditedNotesWidget from "../widgets/collapsible_widgets/edited_notes.js";
|
||||
import CollapsibleSectionContainer from "../widgets/collapsible_section_container.js";
|
||||
import PromotedAttributesWidget from "../widgets/type_property_widgets/promoted_attributes.js";
|
||||
import InheritedAttributesWidget from "../widgets/type_property_widgets/inherited_attribute_list.js";
|
||||
import NoteListWidget from "../widgets/note_list.js";
|
||||
import SearchDefinitionWidget from "../widgets/type_property_widgets/search_definition.js";
|
||||
import Container from "../widgets/container.js";
|
||||
import SqlResultWidget from "../widgets/sql_result.js";
|
||||
import SqlTableSchemasWidget from "../widgets/sql_table_schemas.js";
|
||||
import FilePropertiesWidget from "../widgets/type_property_widgets/file_properties.js";
|
||||
import ImagePropertiesWidget from "../widgets/type_property_widgets/image_properties.js";
|
||||
import NotePropertiesWidget from "../widgets/type_property_widgets/note_properties.js";
|
||||
import NoteIconWidget from "../widgets/note_icon.js";
|
||||
import SearchResultWidget from "../widgets/search_result.js";
|
||||
|
||||
const RIGHT_PANE_CSS = `
|
||||
<style>
|
||||
@@ -40,7 +49,7 @@ const RIGHT_PANE_CSS = `
|
||||
|
||||
#right-pane .card-header {
|
||||
background: inherit;
|
||||
padding: 6px 10px 3px 10px;
|
||||
padding: 6px 10px 3px 0;
|
||||
width: 99%; /* to give minimal right margin */
|
||||
background-color: var(--button-background-color);
|
||||
border-color: var(--button-border-color);
|
||||
@@ -85,15 +94,19 @@ const RIGHT_PANE_CSS = `
|
||||
#right-pane .widget-toggle-button {
|
||||
cursor: pointer;
|
||||
color: var(--main-text-color) !important;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
#right-pane .widget-toggle-button:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
#right-pane .widget-toggle-icon {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
font-size: large;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#right-pane .body-wrapper {
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -137,24 +150,39 @@ export default class DesktopMainWindowLayout {
|
||||
.filling()
|
||||
.child(new SidePaneContainer('left')
|
||||
.hideInZenMode()
|
||||
.child(new GlobalButtonsWidget())
|
||||
.child(new SearchBoxWidget())
|
||||
.child(new SearchResultsWidget())
|
||||
.child(new TabCachingWidget(() => new NotePathsWidget()))
|
||||
.child(appContext.mainTreeWidget)
|
||||
.child(...this.customWidgets.get('left-pane'))
|
||||
)
|
||||
.child(new FlexContainer('column').id('center-pane')
|
||||
.child(new FlexContainer('row').class('title-row')
|
||||
.cssBlock('.title-row > * { margin: 5px 5px 0 5px; }')
|
||||
.css('align-items: center;')
|
||||
.cssBlock('.title-row > * { margin: 5px; }')
|
||||
.overflowing()
|
||||
.child(new NoteIconWidget())
|
||||
.child(new NoteTitleWidget())
|
||||
.child(new RunScriptButtonsWidget().hideInZenMode())
|
||||
.child(new NotePathsWidget().hideInZenMode())
|
||||
.child(new NoteTypeWidget().hideInZenMode())
|
||||
.child(new NoteActionsWidget().hideInZenMode())
|
||||
)
|
||||
.child(new TabCachingWidget(() => new AttributeListWidget()))
|
||||
.child(new TabCachingWidget(() => new NoteDetailWidget()))
|
||||
.child(
|
||||
new TabCachingWidget(() => new CollapsibleSectionContainer()
|
||||
.child(new SearchDefinitionWidget())
|
||||
.child(new NotePropertiesWidget())
|
||||
.child(new FilePropertiesWidget())
|
||||
.child(new ImagePropertiesWidget())
|
||||
.child(new PromotedAttributesWidget())
|
||||
.child(new OwnedAttributeListWidget())
|
||||
.child(new InheritedAttributesWidget())
|
||||
)
|
||||
)
|
||||
.child(new Container()
|
||||
.css('height: 100%; overflow: auto;')
|
||||
.child(new TabCachingWidget(() => new SqlTableSchemasWidget()))
|
||||
.child(new TabCachingWidget(() => new NoteDetailWidget()))
|
||||
.child(new TabCachingWidget(() => new NoteListWidget()))
|
||||
.child(new TabCachingWidget(() => new SearchResultWidget()))
|
||||
.child(new TabCachingWidget(() => new SqlResultWidget()))
|
||||
)
|
||||
.child(new TabCachingWidget(() => new SimilarNotesWidget()))
|
||||
.child(...this.customWidgets.get('center-pane'))
|
||||
)
|
||||
|
||||
@@ -40,44 +40,49 @@ function initAttributeNameAutocomplete({ $el, attributeType, open }) {
|
||||
}
|
||||
|
||||
async function initLabelValueAutocomplete({ $el, open, nameCallback }) {
|
||||
if (!$el.hasClass("aa-input")) {
|
||||
const attributeName = nameCallback();
|
||||
|
||||
if (attributeName.trim() === "") {
|
||||
return;
|
||||
}
|
||||
|
||||
const attributeValues = (await server.get('attributes/values/' + encodeURIComponent(attributeName)))
|
||||
.map(attribute => ({ value: attribute }));
|
||||
|
||||
if (attributeValues.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$el.autocomplete({
|
||||
appendTo: document.querySelector('body'),
|
||||
hint: false,
|
||||
openOnFocus: true,
|
||||
minLength: 0,
|
||||
tabAutocomplete: false
|
||||
}, [{
|
||||
displayKey: 'value',
|
||||
source: function (term, cb) {
|
||||
term = term.toLowerCase();
|
||||
|
||||
const filtered = attributeValues.filter(attr => attr.value.toLowerCase().includes(term));
|
||||
|
||||
cb(filtered);
|
||||
}
|
||||
}]);
|
||||
|
||||
$el.on('autocomplete:opened', () => {
|
||||
if ($el.attr("readonly")) {
|
||||
$el.autocomplete('close');
|
||||
}
|
||||
})
|
||||
if ($el.hasClass("aa-input")) {
|
||||
// we reinit everytime because autocomplete seems to have a bug where it retains state from last
|
||||
// open even though the value was resetted
|
||||
$el.autocomplete('destroy');
|
||||
}
|
||||
|
||||
const attributeName = nameCallback();
|
||||
|
||||
if (attributeName.trim() === "") {
|
||||
return;
|
||||
}
|
||||
|
||||
const attributeValues = (await server.get('attributes/values/' + encodeURIComponent(attributeName)))
|
||||
.map(attribute => ({ value: attribute }));
|
||||
|
||||
if (attributeValues.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$el.autocomplete({
|
||||
appendTo: document.querySelector('body'),
|
||||
hint: false,
|
||||
openOnFocus: false, // handled manually
|
||||
minLength: 0,
|
||||
tabAutocomplete: false
|
||||
}, [{
|
||||
displayKey: 'value',
|
||||
cache: false,
|
||||
source: async function (term, cb) {
|
||||
term = term.toLowerCase();
|
||||
|
||||
const filtered = attributeValues.filter(attr => attr.value.toLowerCase().includes(term));
|
||||
|
||||
cb(filtered);
|
||||
}
|
||||
}]);
|
||||
|
||||
$el.on('autocomplete:opened', () => {
|
||||
if ($el.attr("readonly")) {
|
||||
$el.autocomplete('close');
|
||||
}
|
||||
});
|
||||
|
||||
if (open) {
|
||||
$el.autocomplete("open");
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import utils from "./utils.js";
|
||||
|
||||
function lex(str) {
|
||||
str = str.trim();
|
||||
|
||||
@@ -105,14 +107,12 @@ function lex(str) {
|
||||
return tokens;
|
||||
}
|
||||
|
||||
const attrNameMatcher = new RegExp("^[\\p{L}\\p{N}_:]+$", "u");
|
||||
|
||||
function checkAttributeName(attrName) {
|
||||
if (attrName.length === 0) {
|
||||
throw new Error("Attribute name is empty, please fill the name.");
|
||||
}
|
||||
|
||||
if (!attrNameMatcher.test(attrName)) {
|
||||
if (!utils.isValidAttributeName(attrName)) {
|
||||
throw new Error(`Attribute name "${attrName}" contains disallowed characters, only alphanumeric characters, colon and underscore are allowed.`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ async function createNoteLink(noteId) {
|
||||
}
|
||||
|
||||
async function renderAttributes(attributes, renderIsInheritable) {
|
||||
const $container = $("<span>");
|
||||
const $container = $('<span class="rendered-note-attributes">');
|
||||
|
||||
for (let i = 0; i < attributes.length; i++) {
|
||||
const attribute = attributes[i];
|
||||
@@ -79,7 +79,31 @@ async function renderAttributes(attributes, renderIsInheritable) {
|
||||
return $container;
|
||||
}
|
||||
|
||||
async function renderNormalAttributes(note) {
|
||||
const promotedDefinitionAttributes = note.getPromotedDefinitionAttributes();
|
||||
let attrs = note.getAttributes();
|
||||
|
||||
if (promotedDefinitionAttributes.length > 0) {
|
||||
attrs = attrs.filter(attr => !!promotedDefinitionAttributes.find(promAttr => promAttr.isDefinitionFor(attr)));
|
||||
}
|
||||
else {
|
||||
attrs = attrs.filter(
|
||||
attr => !attr.isDefinition()
|
||||
&& !attr.isAutoLink
|
||||
&& attr.noteId === note.noteId
|
||||
);
|
||||
}
|
||||
|
||||
const $renderedAttributes = await renderAttributes(attrs, false);
|
||||
|
||||
return {
|
||||
count: attrs.length,
|
||||
$renderedAttributes
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
renderAttribute,
|
||||
renderAttributes
|
||||
renderAttributes,
|
||||
renderNormalAttributes
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import server from './server.js';
|
||||
|
||||
async function addLabel(noteId, name, value = "") {
|
||||
await server.put(`notes/${noteId}/attribute`, {
|
||||
type: 'label',
|
||||
name: name,
|
||||
value: value
|
||||
});
|
||||
}
|
||||
|
||||
async function setLabel(noteId, name, value = "") {
|
||||
await server.put(`notes/${noteId}/set-attribute`, {
|
||||
type: 'label',
|
||||
name: name,
|
||||
value: value
|
||||
});
|
||||
}
|
||||
|
||||
async function removeAttributeById(noteId, attributeId) {
|
||||
await server.remove(`notes/${noteId}/attributes/${attributeId}`);
|
||||
}
|
||||
|
||||
export default {
|
||||
addLabel,
|
||||
setLabel,
|
||||
removeAttributeById
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import ws from "./ws.js";
|
||||
|
||||
async function moveBeforeBranch(branchIdsToMove, beforeBranchId) {
|
||||
branchIdsToMove = filterRootNote(branchIdsToMove);
|
||||
branchIdsToMove = filterSearchBranches(branchIdsToMove);
|
||||
|
||||
if (beforeBranchId === 'root') {
|
||||
alert('Cannot move notes before root note.');
|
||||
@@ -25,6 +26,7 @@ async function moveBeforeBranch(branchIdsToMove, beforeBranchId) {
|
||||
|
||||
async function moveAfterBranch(branchIdsToMove, afterBranchId) {
|
||||
branchIdsToMove = filterRootNote(branchIdsToMove);
|
||||
branchIdsToMove = filterSearchBranches(branchIdsToMove);
|
||||
|
||||
const afterNote = await treeCache.getBranch(afterBranchId).getNote();
|
||||
|
||||
@@ -142,6 +144,10 @@ async function moveNodeUpInHierarchy(node) {
|
||||
}
|
||||
}
|
||||
|
||||
function filterSearchBranches(branchIds) {
|
||||
return branchIds.filter(branchId => !branchId.startsWith('virt-'));
|
||||
}
|
||||
|
||||
function filterRootNote(branchIds) {
|
||||
const hoistedNoteId = hoistedNoteService.getHoistedNoteId();
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import treeCache from "./tree_cache.js";
|
||||
import server from "./server.js";
|
||||
import ws from "./ws.js";
|
||||
|
||||
/** @return {NoteShort} */
|
||||
async function getInboxNote() {
|
||||
const note = await server.get('date-notes/inbox/' + dayjs().format("YYYY-MM-DD"), "date-note");
|
||||
|
||||
return await treeCache.getNote(note.noteId);
|
||||
}
|
||||
|
||||
/** @return {NoteShort} */
|
||||
async function getTodayNote() {
|
||||
@@ -34,10 +42,30 @@ async function createSqlConsole() {
|
||||
return await treeCache.getNote(note.noteId);
|
||||
}
|
||||
|
||||
/** @return {NoteShort} */
|
||||
async function createSearchNote(opts = {}) {
|
||||
const note = await server.post('search-note');
|
||||
|
||||
const attrsToUpdate = [
|
||||
opts.ancestorNoteId ? { type: 'relation', name: 'ancestor', value: opts.ancestorNoteId } : undefined,
|
||||
{ type: 'label', name: 'searchString', value: opts.searchString }
|
||||
].filter(attr => !!attr);
|
||||
|
||||
if (attrsToUpdate.length > 0) {
|
||||
await server.put(`notes/${note.noteId}/attributes`, attrsToUpdate);
|
||||
}
|
||||
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
|
||||
return await treeCache.getNote(note.noteId);
|
||||
}
|
||||
|
||||
export default {
|
||||
getInboxNote,
|
||||
getTodayNote,
|
||||
getDateNote,
|
||||
getMonthNote,
|
||||
getYearNote,
|
||||
createSqlConsole
|
||||
}
|
||||
createSqlConsole,
|
||||
createSearchNote
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Component from "../widgets/component.js";
|
||||
import appContext from "./app_context.js";
|
||||
import dateNoteService from "../services/date_notes.js";
|
||||
import noteCreateService from "../services/note_create.js";
|
||||
import treeService from "../services/tree.js";
|
||||
|
||||
export default class DialogCommandExecutor extends Component {
|
||||
jumpToNoteCommand() {
|
||||
@@ -64,7 +64,21 @@ export default class DialogCommandExecutor extends Component {
|
||||
|
||||
const tabContext = await appContext.tabManager.openTabWithNote(sqlConsoleNote.noteId, true);
|
||||
|
||||
appContext.triggerCommand('focusOnDetail', {tabId: tabContext.tabId});
|
||||
appContext.triggerEvent('focusOnDetail', {tabId: tabContext.tabId});
|
||||
}
|
||||
|
||||
async searchNotesCommand({searchString, ancestorNoteId}) {
|
||||
const searchNote = await dateNoteService.createSearchNote({searchString, ancestorNoteId});
|
||||
|
||||
const tabContext = await appContext.tabManager.openTabWithNote(searchNote.noteId, true);
|
||||
|
||||
appContext.triggerCommand('focusOnSearchDefinition', {tabId: tabContext.tabId});
|
||||
}
|
||||
|
||||
async searchInSubtreeCommand({notePath}) {
|
||||
const noteId = treeService.getNoteIdFromNotePath(notePath);
|
||||
|
||||
this.searchNotesCommand({ancestorNoteId: noteId});
|
||||
}
|
||||
|
||||
showBackendLogCommand() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import utils from "./utils.js";
|
||||
import dateNoteService from "./date_notes.js";
|
||||
import hoistedNoteService from "./hoisted_note.js";
|
||||
import protectedSessionHolder from './protected_session_holder.js';
|
||||
import server from "./server.js";
|
||||
import appContext from "./app_context.js";
|
||||
import Component from "../widgets/component.js";
|
||||
@@ -62,14 +62,14 @@ export default class Entrypoints extends Component {
|
||||
findInPage.openFindWindow();
|
||||
}
|
||||
|
||||
async createNoteIntoDayNoteCommand() {
|
||||
const todayNote = await dateNoteService.getTodayNote();
|
||||
async createNoteIntoInboxCommand() {
|
||||
const inboxNote = await dateNoteService.getInboxNote();
|
||||
|
||||
const {note} = await server.post(`notes/${todayNote.noteId}/children?target=into`, {
|
||||
const {note} = await server.post(`notes/${inboxNote.noteId}/children?target=into`, {
|
||||
title: 'new note',
|
||||
content: '',
|
||||
type: 'text',
|
||||
isProtected: todayNote.isProtected
|
||||
isProtected: inboxNote.isProtected && protectedSessionHolder.isProtectedSessionAvailable()
|
||||
});
|
||||
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
@@ -80,19 +80,30 @@ export default class Entrypoints extends Component {
|
||||
}
|
||||
|
||||
async toggleNoteHoistingCommand() {
|
||||
const note = appContext.tabManager.getActiveTabNote();
|
||||
const tabContext = appContext.tabManager.getActiveTabContext();
|
||||
|
||||
const hoistedNoteId = hoistedNoteService.getHoistedNoteId();
|
||||
if (note.noteId === hoistedNoteId) {
|
||||
hoistedNoteService.unhoist();
|
||||
if (tabContext.note.noteId === tabContext.hoistedNoteId) {
|
||||
await tabContext.unhoist();
|
||||
}
|
||||
else if (note.type !== 'search') {
|
||||
hoistedNoteService.setHoistedNoteId(note.noteId);
|
||||
else if (tabContext.note.type !== 'search') {
|
||||
await tabContext.setHoistedNoteId(tabContext.note.noteId);
|
||||
}
|
||||
}
|
||||
|
||||
async hoistNoteCommand({noteId}) {
|
||||
const tabContext = appContext.tabManager.getActiveTabContext();
|
||||
|
||||
if (tabContext.hoistedNoteId !== noteId) {
|
||||
await tabContext.setHoistedNoteId(noteId);
|
||||
}
|
||||
}
|
||||
|
||||
async unhoistCommand() {
|
||||
hoistedNoteService.unhoist();
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
|
||||
if (activeTabContext) {
|
||||
activeTabContext.unhoist();
|
||||
}
|
||||
}
|
||||
|
||||
copyWithoutFormattingCommand() {
|
||||
@@ -165,21 +176,6 @@ export default class Entrypoints extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
async searchForResultsCommand({searchText}) {
|
||||
const response = await server.get('search/' + encodeURIComponent(searchText) + '?includeNoteContent=true&excludeArchived=true&fuzzyAttributeSearch=false');
|
||||
|
||||
if (!response.success) {
|
||||
toastService.showError("Search failed: " + response.message, 10000);
|
||||
// even in this case we'll show the results
|
||||
}
|
||||
|
||||
this.triggerEvent('searchResults', {results: response.results});
|
||||
|
||||
// have at least some feedback which is good especially in situations
|
||||
// when the result list does not change with a query
|
||||
toastService.showMessage("Search finished successfully.");
|
||||
}
|
||||
|
||||
async switchToDesktopVersionCommand() {
|
||||
utils.setCookie('trilium-device', 'desktop');
|
||||
|
||||
@@ -188,11 +184,15 @@ export default class Entrypoints extends Component {
|
||||
|
||||
createTopLevelNoteCommand() { noteCreateService.createNewTopLevelNote(); }
|
||||
|
||||
async openInWindowCommand({notePath}) {
|
||||
async openInWindowCommand({notePath, hoistedNoteId}) {
|
||||
if (!hoistedNoteId) {
|
||||
hoistedNoteId = 'root';
|
||||
}
|
||||
|
||||
if (utils.isElectron()) {
|
||||
const {ipcRenderer} = utils.dynamicRequire('electron');
|
||||
|
||||
ipcRenderer.send('create-extra-window', {notePath});
|
||||
ipcRenderer.send('create-extra-window', {notePath, hoistedNoteId});
|
||||
}
|
||||
else {
|
||||
const url = window.location.protocol + '//' + window.location.host + window.location.pathname + '?extra=1#' + notePath;
|
||||
@@ -202,11 +202,12 @@ export default class Entrypoints extends Component {
|
||||
}
|
||||
|
||||
async openNewWindowCommand() {
|
||||
this.openInWindowCommand({notePath: ''});
|
||||
this.openInWindowCommand({notePath: '', hoistedNoteId: 'root'});
|
||||
}
|
||||
|
||||
async runActiveNoteCommand() {
|
||||
const note = appContext.tabManager.getActiveTabNote();
|
||||
const tabContext = appContext.tabManager.getActiveTabContext();
|
||||
const note = tabContext.note;
|
||||
|
||||
// ctrl+enter is also used elsewhere so make sure we're running only when appropriate
|
||||
if (!note || note.type !== 'code') {
|
||||
@@ -215,10 +216,12 @@ export default class Entrypoints extends Component {
|
||||
|
||||
if (note.mime.endsWith("env=frontend")) {
|
||||
await bundleService.getAndExecuteBundle(note.noteId);
|
||||
}
|
||||
|
||||
if (note.mime.endsWith("env=backend")) {
|
||||
} else if (note.mime.endsWith("env=backend")) {
|
||||
await server.post('script/run/' + note.noteId);
|
||||
} else if (note.mime === 'text/x-sqlite;schema=trilium') {
|
||||
const result = await server.post("sql/execute/" + note.noteId);
|
||||
|
||||
this.triggerEvent('sqlQueryResults', {tabId: tabContext.tabId, results: result.results});
|
||||
}
|
||||
|
||||
toastService.showMessage("Note executed");
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import treeService from './tree.js';
|
||||
import server from './server.js';
|
||||
import utils from './utils.js';
|
||||
import toastService from './toast.js';
|
||||
@@ -9,7 +8,6 @@ import protectedSessionService from './protected_session.js';
|
||||
import dateNotesService from './date_notes.js';
|
||||
import CollapsibleWidget from '../widgets/collapsible_widget.js';
|
||||
import ws from "./ws.js";
|
||||
import hoistedNoteService from "./hoisted_note.js";
|
||||
import appContext from "./app_context.js";
|
||||
import TabAwareWidget from "../widgets/tab_aware_widget.js";
|
||||
import TabCachingWidget from "../widgets/tab_caching_widget.js";
|
||||
@@ -73,6 +71,23 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
appContext.triggerEvent('focusAndSelectTitle');
|
||||
};
|
||||
|
||||
/**
|
||||
* Open a note in a new tab.
|
||||
*
|
||||
* @param {string} notePath (or noteId)
|
||||
* @param {boolean} activate - set to true to activate the new tab, false to stay on the current tab
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
this.openTabWithNote = async (notePath, activate) => {
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
|
||||
await appContext.tabManager.openTabWithNote(notePath, activate);
|
||||
|
||||
if (activate) {
|
||||
appContext.triggerEvent('focusAndSelectTitle');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {Object} ToolbarButtonOptions
|
||||
* @property {string} title
|
||||
@@ -89,7 +104,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
this.addButtonToToolbar = opts => {
|
||||
const buttonId = "toolbar-button-" + opts.title.replace(/\s/g, "-");
|
||||
|
||||
const button = $('<button>')
|
||||
const button = $('<button class="noborder">')
|
||||
.addClass("btn btn-sm")
|
||||
.on('click', opts.action);
|
||||
|
||||
@@ -274,7 +289,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
*
|
||||
* @method
|
||||
* @param {string} notePath (or noteId)
|
||||
* @param {string} [noteTitle] - if not present we'll use note title
|
||||
* @param {object} [params]
|
||||
* @param {boolean} [params.showTooltip=true] - enable/disable tooltip on the link
|
||||
* @param {boolean} [params.showNotePath=false] - show also whole note's path as part of the link
|
||||
* @param {string} [title=] - custom link tile with note's title as default
|
||||
*/
|
||||
this.createNoteLink = linkService.createNoteLink;
|
||||
|
||||
@@ -376,13 +394,19 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
this.getYearNote = dateNotesService.getYearNote;
|
||||
|
||||
/**
|
||||
* Hoist note. See https://github.com/zadam/trilium/wiki/Note-hoisting
|
||||
* Hoist note in the current tab. See https://github.com/zadam/trilium/wiki/Note-hoisting
|
||||
*
|
||||
* @method
|
||||
* @param {string} noteId - set hoisted note. 'root' will effectively unhoist
|
||||
* @return {Promise}
|
||||
*/
|
||||
this.setHoistedNoteId = hoistedNoteService.setHoistedNoteId;
|
||||
this.setHoistedNoteId = (noteId) => {
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
|
||||
if (activeTabContext) {
|
||||
activeTabContext.setHoistedNoteId(noteId);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @method
|
||||
|
||||
@@ -58,7 +58,7 @@ function setupGlobs() {
|
||||
'Line: ' + lineNo,
|
||||
'Column: ' + columnNo,
|
||||
'Error object: ' + JSON.stringify(error),
|
||||
'Stack: ' + error && error.stack
|
||||
'Stack: ' + (error && error.stack)
|
||||
].join(', ');
|
||||
}
|
||||
|
||||
@@ -73,11 +73,7 @@ function setupGlobs() {
|
||||
libraryLoader.requireCss(`api/notes/download/${appCssNoteId}`);
|
||||
}
|
||||
|
||||
const wikiBaseUrl = "https://github.com/zadam/trilium/wiki/";
|
||||
|
||||
$(document).on("click", "*[data-help-page]", e => {
|
||||
window.open(wikiBaseUrl + $(e.target).attr("data-help-page"), '_blank');
|
||||
});
|
||||
utils.initHelpButtons($(window));
|
||||
|
||||
$("body").on("click", "a.external", function () {
|
||||
window.open($(this).attr("href"), '_blank');
|
||||
|
||||
@@ -1,27 +1,18 @@
|
||||
import options from './options.js';
|
||||
import appContext from "./app_context.js";
|
||||
import treeService from "./tree.js";
|
||||
import treeCache from "./tree_cache.js";
|
||||
|
||||
function getHoistedNoteId() {
|
||||
return options.get('hoistedNoteId');
|
||||
}
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
|
||||
async function setHoistedNoteId(noteId) {
|
||||
if (getHoistedNoteId() === noteId) {
|
||||
return;
|
||||
}
|
||||
|
||||
await options.save('hoistedNoteId', noteId);
|
||||
|
||||
await treeCache.loadInitialTree();
|
||||
|
||||
// FIXME - just use option load event
|
||||
appContext.triggerEvent('hoistedNoteChanged', {noteId});
|
||||
return activeTabContext ? activeTabContext.hoistedNoteId : 'root';
|
||||
}
|
||||
|
||||
async function unhoist() {
|
||||
await setHoistedNoteId('root');
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
|
||||
if (activeTabContext) {
|
||||
await activeTabContext.unhoist();
|
||||
}
|
||||
}
|
||||
|
||||
function isTopLevelNode(node) {
|
||||
@@ -34,7 +25,7 @@ function isRootNode(node) {
|
||||
|| node.data.noteId === getHoistedNoteId();
|
||||
}
|
||||
|
||||
async function checkNoteAccess(notePath) {
|
||||
async function checkNoteAccess(notePath, tabContext) {
|
||||
// notePath argument can contain only noteId which is not good when hoisted since
|
||||
// then we need to check the whole note path
|
||||
const resolvedNotePath = await treeService.resolveNotePath(notePath);
|
||||
@@ -44,7 +35,7 @@ async function checkNoteAccess(notePath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const hoistedNoteId = getHoistedNoteId();
|
||||
const hoistedNoteId = tabContext.hoistedNoteId;
|
||||
|
||||
if (hoistedNoteId !== 'root' && !resolvedNotePath.includes(hoistedNoteId)) {
|
||||
const confirmDialog = await import('../dialogs/confirm.js');
|
||||
@@ -62,7 +53,6 @@ async function checkNoteAccess(notePath) {
|
||||
|
||||
export default {
|
||||
getHoistedNoteId,
|
||||
setHoistedNoteId,
|
||||
unhoist,
|
||||
isTopLevelNode,
|
||||
isRootNode,
|
||||
|
||||
@@ -27,7 +27,7 @@ export async function uploadFiles(parentNoteId, files, options) {
|
||||
|
||||
({noteId} = await $.ajax({
|
||||
url: baseApiUrl + 'notes/' + parentNoteId + '/import',
|
||||
headers: server.getHeaders(),
|
||||
headers: await server.getHeaders(),
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
@@ -71,4 +71,4 @@ ws.subscribeToMessages(async message => {
|
||||
|
||||
export default {
|
||||
uploadFiles
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ function goToLink(e) {
|
||||
|
||||
if (notePath) {
|
||||
if ((e.which === 1 && e.ctrlKey) || e.which === 2) {
|
||||
appContext.tabManager.openTabWithNote(notePath);
|
||||
appContext.tabManager.openTabWithNoteWithHoisting(notePath);
|
||||
}
|
||||
else if (e.which === 1) {
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
@@ -90,7 +90,7 @@ function goToLink(e) {
|
||||
|| $link.hasClass("ck-link-actions__preview") // within edit link dialog single click suffices
|
||||
) {
|
||||
const address = $link.attr('href');
|
||||
console.log("address", address);
|
||||
|
||||
if (address) {
|
||||
if (address.toLowerCase().startsWith('http')) {
|
||||
window.open(address, '_blank');
|
||||
@@ -127,10 +127,10 @@ function linkContextMenu(e) {
|
||||
],
|
||||
selectMenuItemHandler: ({command}) => {
|
||||
if (command === 'openNoteInNewTab') {
|
||||
appContext.tabManager.openTabWithNote(notePath);
|
||||
appContext.tabManager.openTabWithNoteWithHoisting(notePath);
|
||||
}
|
||||
else if (command === 'openNoteInNewWindow') {
|
||||
appContext.openInNewWindow(notePath);
|
||||
appContext.triggerCommand('openInWindow', {notePath, hoistedNoteId: 'root'});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -144,11 +144,8 @@ async function loadReferenceLinkTitle(noteId, $el) {
|
||||
if (!note) {
|
||||
title = '[missing]';
|
||||
}
|
||||
else if (!note.isDeleted) {
|
||||
title = note.title;
|
||||
}
|
||||
else {
|
||||
title = note.isErased ? '[erased]' : `${note.title} (deleted)`;
|
||||
title = note.isDeleted ? `${note.title} (deleted)` : note.title;
|
||||
}
|
||||
|
||||
$el.text(title);
|
||||
|
||||
@@ -54,6 +54,7 @@ export default class LoadResults {
|
||||
this.attributes.push({attributeId, sourceId});
|
||||
}
|
||||
|
||||
/** @return {Attribute[]} */
|
||||
getAttributes(sourceId = 'none') {
|
||||
return this.attributes
|
||||
.filter(row => row.sourceId !== sourceId)
|
||||
|
||||
@@ -3,10 +3,13 @@ import appContext from "./app_context.js";
|
||||
import utils from './utils.js';
|
||||
import noteCreateService from './note_create.js';
|
||||
import treeService from './tree.js';
|
||||
import treeCache from "./tree_cache.js";
|
||||
|
||||
// this key needs to have this value so it's hit by the tooltip
|
||||
const SELECTED_NOTE_PATH_KEY = "data-note-path";
|
||||
|
||||
const SELECTED_EXTERNAL_LINK_KEY = "data-external-link";
|
||||
|
||||
async function autocompleteSourceForCKEditor(queryText) {
|
||||
return await new Promise((res, rej) => {
|
||||
autocompleteSource(queryText, rows => {
|
||||
@@ -21,18 +24,20 @@ async function autocompleteSourceForCKEditor(queryText) {
|
||||
highlightedNotePathTitle: row.highlightedNotePathTitle
|
||||
}
|
||||
}));
|
||||
}, {
|
||||
allowCreatingNotes: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function autocompleteSource(term, cb) {
|
||||
async function autocompleteSource(term, cb, options = {}) {
|
||||
const activeNoteId = appContext.tabManager.getActiveTabNoteId();
|
||||
|
||||
let results = await server.get('autocomplete'
|
||||
+ '?query=' + encodeURIComponent(term)
|
||||
+ '&activeNoteId=' + activeNoteId);
|
||||
|
||||
if (term.trim().length >= 1) {
|
||||
if (term.trim().length >= 1 && options.allowCreatingNotes) {
|
||||
results = [
|
||||
{
|
||||
action: 'create-note',
|
||||
@@ -43,6 +48,16 @@ async function autocompleteSource(term, cb) {
|
||||
].concat(results);
|
||||
}
|
||||
|
||||
if (term.match(/^[a-z]+:\/\/.+/i) && options.allowExternalLinks) {
|
||||
results = [
|
||||
{
|
||||
action: 'external-link',
|
||||
externalLink: term,
|
||||
highlightedNotePathTitle: `Insert external link to "${term}"`
|
||||
}
|
||||
].concat(results);
|
||||
}
|
||||
|
||||
cb(results);
|
||||
}
|
||||
|
||||
@@ -55,6 +70,17 @@ function clearText($el) {
|
||||
$el.autocomplete("val", "").trigger('change');
|
||||
}
|
||||
|
||||
function setText($el, text) {
|
||||
if (utils.isMobile()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$el.setSelectedNotePath("");
|
||||
$el
|
||||
.autocomplete("val", text.trim())
|
||||
.autocomplete("open");
|
||||
}
|
||||
|
||||
function showRecentNotes($el) {
|
||||
if (utils.isMobile()) {
|
||||
return;
|
||||
@@ -119,7 +145,7 @@ function initNoteAutocomplete($el, options) {
|
||||
tabAutocomplete: false
|
||||
}, [
|
||||
{
|
||||
source: autocompleteSource,
|
||||
source: (term, cb) => autocompleteSource(term, cb, options),
|
||||
displayKey: 'notePathTitle',
|
||||
templates: {
|
||||
suggestion: suggestion => suggestion.highlightedNotePathTitle
|
||||
@@ -130,6 +156,19 @@ function initNoteAutocomplete($el, options) {
|
||||
]);
|
||||
|
||||
$el.on('autocomplete:selected', async (event, suggestion) => {
|
||||
if (suggestion.action === 'external-link') {
|
||||
$el.setSelectedNotePath(null);
|
||||
$el.setSelectedExternalLink(suggestion.externalLink);
|
||||
|
||||
$el.autocomplete("val", suggestion.externalLink);
|
||||
|
||||
$el.autocomplete("close");
|
||||
|
||||
$el.trigger('autocomplete:externallinkselected', [suggestion]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (suggestion.action === 'create-note') {
|
||||
const {note} = await noteCreateService.createNote(suggestion.parentNoteId, {
|
||||
title: suggestion.noteTitle,
|
||||
@@ -140,6 +179,7 @@ function initNoteAutocomplete($el, options) {
|
||||
}
|
||||
|
||||
$el.setSelectedNotePath(suggestion.notePath);
|
||||
$el.setSelectedExternalLink(null);
|
||||
|
||||
$el.autocomplete("val", suggestion.noteTitle);
|
||||
|
||||
@@ -193,6 +233,31 @@ function init() {
|
||||
.toggleClass("disabled", !notePath.trim())
|
||||
.attr(SELECTED_NOTE_PATH_KEY, notePath); // we also set attr here so tooltip can be displayed
|
||||
};
|
||||
|
||||
$.fn.getSelectedExternalLink = function () {
|
||||
if (!$(this).val().trim()) {
|
||||
return "";
|
||||
} else {
|
||||
return $(this).attr(SELECTED_EXTERNAL_LINK_KEY);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.setSelectedExternalLink = function (externalLink) {
|
||||
$(this).attr(SELECTED_EXTERNAL_LINK_KEY, externalLink);
|
||||
|
||||
$(this)
|
||||
.closest(".input-group")
|
||||
.find(".go-to-selected-note-button")
|
||||
.toggleClass("disabled", true);
|
||||
}
|
||||
|
||||
$.fn.setNote = async function (noteId) {
|
||||
const note = noteId ? await treeCache.getNote(noteId, true) : null;
|
||||
|
||||
$(this)
|
||||
.val(note ? note.title : "")
|
||||
.setSelectedNotePath(noteId);
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
@@ -200,5 +265,6 @@ export default {
|
||||
autocompleteSourceForCKEditor,
|
||||
initNoteAutocomplete,
|
||||
showRecentNotes,
|
||||
setText,
|
||||
init
|
||||
}
|
||||
|
||||
@@ -4,34 +4,42 @@ import protectedSessionService from "./protected_session.js";
|
||||
import protectedSessionHolder from "./protected_session_holder.js";
|
||||
import libraryLoader from "./library_loader.js";
|
||||
import openService from "./open.js";
|
||||
import treeCache from "./tree_cache.js";
|
||||
|
||||
async function getRenderedContent(note, options = {}) {
|
||||
options = Object.assign({
|
||||
trim: false,
|
||||
tooltip: false
|
||||
}, options);
|
||||
|
||||
async function getRenderedContent(note) {
|
||||
const type = getRenderingType(note);
|
||||
|
||||
let $rendered;
|
||||
const $renderedContent = $('<div class="rendered-note-content">');
|
||||
|
||||
if (type === 'text') {
|
||||
const fullNote = await server.get('notes/' + note.noteId);
|
||||
const noteComplement = await treeCache.getNoteComplement(note.noteId);
|
||||
|
||||
$rendered = $('<div class="ck-content">').html(fullNote.content);
|
||||
$renderedContent.append($('<div class="ck-content">').html(trim(noteComplement.content, options.trim)));
|
||||
|
||||
if ($rendered.find('span.math-tex').length > 0) {
|
||||
if ($renderedContent.find('span.math-tex').length > 0) {
|
||||
await libraryLoader.requireLibrary(libraryLoader.KATEX);
|
||||
|
||||
renderMathInElement($rendered[0], {});
|
||||
renderMathInElement($renderedContent[0], {});
|
||||
}
|
||||
}
|
||||
else if (type === 'code') {
|
||||
const fullNote = await server.get('notes/' + note.noteId);
|
||||
|
||||
$rendered = $("<pre>").text(fullNote.content);
|
||||
$renderedContent.append($("<pre>").text(trim(fullNote.content, options.trim)));
|
||||
}
|
||||
else if (type === 'image') {
|
||||
$rendered = $("<img>")
|
||||
.attr("src", `api/images/${note.noteId}/${note.title}`)
|
||||
.css("max-width", "100%");
|
||||
$renderedContent.append(
|
||||
$("<img>")
|
||||
.attr("src", `api/images/${note.noteId}/${note.title}`)
|
||||
.css("max-width", "100%")
|
||||
);
|
||||
}
|
||||
else if (type === 'file' || type === 'pdf') {
|
||||
else if (!options.tooltip && (type === 'file' || type === 'pdf')) {
|
||||
const $downloadButton = $('<button class="file-download btn btn-primary" type="button">Download</button>');
|
||||
const $openButton = $('<button class="file-open btn btn-primary" type="button">Open</button>');
|
||||
|
||||
@@ -41,48 +49,62 @@ async function getRenderedContent(note) {
|
||||
// open doesn't work for protected notes since it works through browser which isn't in protected session
|
||||
$openButton.toggle(!note.isProtected);
|
||||
|
||||
$rendered = $('<div style="display: flex; flex-direction: column; height: 100%;">');
|
||||
const $content = $('<div style="display: flex; flex-direction: column; height: 100%;">');
|
||||
|
||||
if (type === 'pdf') {
|
||||
const $pdfPreview = $('<iframe class="pdf-preview" style="width: 100%; flex-grow: 100;"></iframe>');
|
||||
$pdfPreview.attr("src", openService.getUrlForDownload("api/notes/" + note.noteId + "/open"));
|
||||
|
||||
$rendered.append($pdfPreview);
|
||||
$content.append($pdfPreview);
|
||||
}
|
||||
|
||||
$rendered.append(
|
||||
$("<div>")
|
||||
$content.append(
|
||||
$('<div style="display: flex; justify-content: space-evenly; margin-top: 5px;">')
|
||||
.append($downloadButton)
|
||||
.append(' ')
|
||||
.append($openButton)
|
||||
);
|
||||
|
||||
$renderedContent.append($content);
|
||||
}
|
||||
else if (type === 'render') {
|
||||
$rendered = $('<div>');
|
||||
const $content = $('<div>');
|
||||
|
||||
await renderService.render(note, $rendered, this.ctx);
|
||||
await renderService.render(note, $content, this.ctx);
|
||||
|
||||
$renderedContent.append($content);
|
||||
}
|
||||
else if (type === 'protected-session') {
|
||||
else if (!options.tooltip && type === 'protected-session') {
|
||||
const $button = $(`<button class="btn btn-sm"><span class="bx bx-log-in"></span> Enter protected session</button>`)
|
||||
.on('click', protectedSessionService.enterProtectedSession);
|
||||
|
||||
$rendered = $("<div>")
|
||||
.append("<div>This note is protected and to access it you need to enter password.</div>")
|
||||
.append("<br/>")
|
||||
.append($button);
|
||||
$renderedContent.append(
|
||||
$("<div>")
|
||||
.append("<div>This note is protected and to access it you need to enter password.</div>")
|
||||
.append("<br/>")
|
||||
.append($button)
|
||||
);
|
||||
}
|
||||
else {
|
||||
$rendered = $("<em>Content of this note cannot be displayed in the book format</em>");
|
||||
$renderedContent.append($("<em>Content of this note cannot be displayed in the book format</em>"));
|
||||
}
|
||||
|
||||
$rendered.addClass(note.getCssClass());
|
||||
$renderedContent.addClass(note.getCssClass());
|
||||
|
||||
return {
|
||||
renderedContent: $rendered,
|
||||
$renderedContent,
|
||||
type
|
||||
};
|
||||
}
|
||||
|
||||
function trim(text, doTrim) {
|
||||
if (!doTrim) {
|
||||
return text;
|
||||
}
|
||||
else {
|
||||
return text.substr(0, Math.min(text.length, 1000));
|
||||
}
|
||||
}
|
||||
|
||||
function getRenderingType(note) {
|
||||
let type = note.type;
|
||||
|
||||
|
||||
@@ -56,10 +56,10 @@ async function createNote(parentNoteId, options = {}) {
|
||||
await activeTabContext.setNote(note.noteId);
|
||||
|
||||
if (options.focus === 'title') {
|
||||
appContext.triggerCommand('focusAndSelectTitle');
|
||||
appContext.triggerEvent('focusAndSelectTitle');
|
||||
}
|
||||
else if (options.focus === 'content') {
|
||||
appContext.triggerCommand('focusOnDetail', {tabId: this.tabId});
|
||||
appContext.triggerEvent('focusOnDetail', {tabId: activeTabContext.tabId});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ function parseSelectedHtml(selectedHtml) {
|
||||
}
|
||||
}
|
||||
|
||||
async function duplicateNote(noteId, parentNoteId) {
|
||||
async function duplicateSubtree(noteId, parentNoteId) {
|
||||
const {note} = await server.post(`notes/${noteId}/duplicate/${parentNoteId}`);
|
||||
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
@@ -102,5 +102,5 @@ async function duplicateNote(noteId, parentNoteId) {
|
||||
export default {
|
||||
createNote,
|
||||
createNewTopLevelNote,
|
||||
duplicateNote
|
||||
duplicateSubtree
|
||||
};
|
||||
|
||||
@@ -0,0 +1,364 @@
|
||||
import linkService from "./link.js";
|
||||
import noteContentRenderer from "./note_content_renderer.js";
|
||||
import treeCache from "./tree_cache.js";
|
||||
import attributeService from "./attributes.js";
|
||||
import attributeRenderer from "./attribute_renderer.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="note-list">
|
||||
<style>
|
||||
.note-list {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.note-list.grid-view .note-list-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.note-list.grid-view .note-book-card {
|
||||
flex-basis: 300px;
|
||||
}
|
||||
|
||||
.note-list.grid-view .note-expander {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.note-list.grid-view .note-book-card {
|
||||
max-height: 300px;
|
||||
}
|
||||
|
||||
.note-book-card {
|
||||
border-radius: 10px;
|
||||
background-color: var(--accented-background-color);
|
||||
padding: 10px 15px 15px 8px;
|
||||
margin: 5px 5px 5px 0;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.note-book-card:not(.expanded) .note-book-content {
|
||||
display: none !important;
|
||||
padding: 10px
|
||||
}
|
||||
|
||||
.note-book-card.expanded .note-book-content {
|
||||
display: block;
|
||||
min-height: 0;
|
||||
height: 100%;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.note-book-title {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.note-book-title .rendered-note-attributes {
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
.note-book-title .rendered-note-attributes:before {
|
||||
content: "\\00a0\\00a0";
|
||||
}
|
||||
|
||||
.note-book-card .note-book-card {
|
||||
border: 1px solid var(--main-border-color);
|
||||
}
|
||||
|
||||
.note-book-content.type-image, .note-book-content.type-file, .note-book-content.type-protected-session {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.note-book-content.type-image img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.note-book-card.type-image .note-book-content img, .note-book-card.type-text .note-book-content img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.note-book-title {
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.note-list-wrapper {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.note-expander {
|
||||
font-size: x-large;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
padding-right: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.note-list-pager {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="btn-group floating-button" style="right: 20px; top: 10px;">
|
||||
<button type="button"
|
||||
class="collapse-all-button btn icon-button bx bx-layer-minus"
|
||||
title="Collapse all notes"></button>
|
||||
|
||||
|
||||
|
||||
<button type="button"
|
||||
class="expand-children-button btn icon-button bx bx-move-vertical"
|
||||
title="Expand all children"></button>
|
||||
|
||||
|
||||
|
||||
<button type="button"
|
||||
class="list-view-button btn icon-button bx bx-menu"
|
||||
title="List view"></button>
|
||||
|
||||
|
||||
|
||||
<button type="button"
|
||||
class="grid-view-button btn icon-button bx bx-grid-alt"
|
||||
title="Grid view"></button>
|
||||
</div>
|
||||
|
||||
<div class="note-list-wrapper">
|
||||
<div class="note-list-pager"></div>
|
||||
|
||||
<div class="note-list-container"></div>
|
||||
|
||||
<div class="note-list-pager"></div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
class NoteListRenderer {
|
||||
/*
|
||||
* We're using noteIds so that it's not necessary to load all notes at once when paging
|
||||
*/
|
||||
constructor($parent, parentNote, noteIds) {
|
||||
this.$noteList = $(TPL);
|
||||
|
||||
// note list must be added to the DOM immediatelly, otherwise some functionality scripting (canvas) won't work
|
||||
$parent.empty();
|
||||
|
||||
this.parentNote = parentNote;
|
||||
const includedNoteIds = this.getIncludedNoteIds();
|
||||
|
||||
this.noteIds = noteIds.filter(noteId => !includedNoteIds.has(noteId));
|
||||
|
||||
if (this.noteIds.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$parent.append(this.$noteList);
|
||||
|
||||
this.page = 1;
|
||||
this.pageSize = parseInt(parentNote.getLabelValue('pageSize'));
|
||||
|
||||
if (!this.pageSize || this.pageSize < 1) {
|
||||
this.pageSize = 20;
|
||||
}
|
||||
|
||||
this.viewType = parentNote.getLabelValue('viewType');
|
||||
|
||||
if (!['list', 'grid'].includes(this.viewType)) {
|
||||
// when not explicitly set decide based on note type
|
||||
this.viewType = parentNote.type === 'search' ? 'list' : 'grid';
|
||||
}
|
||||
|
||||
this.$noteList.addClass(this.viewType + '-view');
|
||||
|
||||
this.$noteList.find('.list-view-button').on('click', () => this.toggleViewType('list'));
|
||||
this.$noteList.find('.grid-view-button').on('click', () => this.toggleViewType('grid'));
|
||||
|
||||
this.$noteList.find('.expand-children-button').on('click', async () => {
|
||||
if (!this.parentNote.hasLabel('expanded')) {
|
||||
await attributeService.addLabel(this.parentNote.noteId, 'expanded');
|
||||
}
|
||||
|
||||
await this.renderList();
|
||||
});
|
||||
|
||||
this.$noteList.find('.collapse-all-button').on('click', async () => {
|
||||
// owned is important - we shouldn't remove inherited expanded labels
|
||||
for (const expandedAttr of this.parentNote.getOwnedLabels('expanded')) {
|
||||
await attributeService.removeAttributeById(this.parentNote.noteId, expandedAttr.attributeId);
|
||||
}
|
||||
|
||||
await this.renderList();
|
||||
});
|
||||
}
|
||||
|
||||
/** @return {Set<string>} list of noteIds included (images, included notes) into a parent note and which
|
||||
* don't have to be shown in the note list. */
|
||||
getIncludedNoteIds() {
|
||||
const includedLinks = this.parentNote
|
||||
? this.parentNote.getRelations().filter(rel => rel.name === 'imageLink' || rel.name === 'includeNoteLink')
|
||||
: [];
|
||||
|
||||
return new Set(includedLinks.map(rel => rel.value));
|
||||
}
|
||||
|
||||
async toggleViewType(type) {
|
||||
if (type !== 'list' && type !== 'grid') {
|
||||
throw new Error(`Invalid view type ${type}`);
|
||||
}
|
||||
|
||||
this.viewType = type;
|
||||
|
||||
this.$noteList
|
||||
.removeClass('grid-view')
|
||||
.removeClass('list-view')
|
||||
.addClass(this.viewType + '-view');
|
||||
|
||||
await attributeService.setLabel(this.parentNote.noteId, 'viewType', type);
|
||||
|
||||
await this.renderList();
|
||||
}
|
||||
|
||||
async renderList() {
|
||||
if (this.noteIds.length === 0) {
|
||||
this.$noteList.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
this.$noteList.show();
|
||||
|
||||
const $container = this.$noteList.find('.note-list-container').empty();
|
||||
|
||||
const startIdx = (this.page - 1) * this.pageSize;
|
||||
const endIdx = startIdx + this.pageSize;
|
||||
|
||||
const pageNoteIds = this.noteIds.slice(startIdx, Math.min(endIdx, this.noteIds.length));
|
||||
const pageNotes = await treeCache.getNotes(pageNoteIds);
|
||||
|
||||
for (const note of pageNotes) {
|
||||
const $card = await this.renderNote(note, this.parentNote.hasLabel('expanded'));
|
||||
|
||||
$container.append($card);
|
||||
}
|
||||
|
||||
this.renderPager();
|
||||
|
||||
return this.$noteList;
|
||||
}
|
||||
|
||||
renderPager() {
|
||||
const $pager = this.$noteList.find('.note-list-pager').empty();
|
||||
const pageCount = Math.ceil(this.noteIds.length / this.pageSize);
|
||||
|
||||
$pager.toggle(pageCount > 1);
|
||||
|
||||
let lastPrinted;
|
||||
|
||||
for (let i = 1; i <= pageCount; i++) {
|
||||
if (pageCount < 20 || i <= 5 || pageCount - i <= 5 || Math.abs(this.page - i) <= 2) {
|
||||
lastPrinted = true;
|
||||
|
||||
$pager.append(
|
||||
i === this.page
|
||||
? $('<span>').text(i).css('text-decoration', 'underline').css('font-weight', "bold")
|
||||
: $('<a href="javascript:">')
|
||||
.text(i)
|
||||
.on('click', () => {
|
||||
this.page = i;
|
||||
this.renderList();
|
||||
}),
|
||||
" "
|
||||
);
|
||||
}
|
||||
else if (lastPrinted) {
|
||||
$pager.append("... ");
|
||||
|
||||
lastPrinted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async renderNote(note, expand = false) {
|
||||
const $expander = $('<span class="note-expander bx bx-chevron-right"></span>');
|
||||
|
||||
const {$renderedAttributes} = await attributeRenderer.renderNormalAttributes(note);
|
||||
|
||||
const $card = $('<div class="note-book-card">')
|
||||
.attr('data-note-id', note.noteId)
|
||||
.append(
|
||||
$('<h5 class="note-book-title">')
|
||||
.append($expander)
|
||||
.append(await linkService.createNoteLink(note.noteId, {showTooltip: false}))
|
||||
.append($renderedAttributes)
|
||||
);
|
||||
|
||||
$expander.on('click', () => this.toggleContent($card, note, !$card.hasClass("expanded")));
|
||||
|
||||
await this.toggleContent($card, note, expand);
|
||||
|
||||
return $card;
|
||||
}
|
||||
|
||||
async toggleContent($card, note, expand) {
|
||||
if (this.viewType === 'list' && ((expand && $card.hasClass("expanded")) || (!expand && !$card.hasClass("expanded")))) {
|
||||
return;
|
||||
}
|
||||
|
||||
const $expander = $card.find('> .note-book-title .note-expander');
|
||||
|
||||
if (expand || this.viewType === 'grid') {
|
||||
$card.addClass("expanded");
|
||||
$expander.addClass("bx-chevron-down").removeClass("bx-chevron-right");
|
||||
}
|
||||
else {
|
||||
$card.removeClass("expanded");
|
||||
$expander.addClass("bx-chevron-right").removeClass("bx-chevron-down");
|
||||
}
|
||||
|
||||
if ((expand || this.viewType === 'grid') && $card.find('.note-book-content').length === 0) {
|
||||
$card.append(await this.renderNoteContent(note));
|
||||
}
|
||||
}
|
||||
|
||||
async renderNoteContent(note) {
|
||||
const $content = $('<div class="note-book-content">');
|
||||
|
||||
try {
|
||||
const {$renderedContent, type} = await noteContentRenderer.getRenderedContent(note, {
|
||||
trim: this.viewType === 'grid' // for grid only short content is needed
|
||||
});
|
||||
|
||||
$content.append($renderedContent);
|
||||
$content.addClass("type-" + type);
|
||||
} catch (e) {
|
||||
console.log(`Caught error while rendering note ${note.noteId} of type ${note.type}: ${e.message}, stack: ${e.stack}`);
|
||||
|
||||
$content.append("rendering error");
|
||||
}
|
||||
|
||||
if (this.viewType === 'list') {
|
||||
const imageLinks = note.getRelations('imageLink');
|
||||
|
||||
const childNotes = (await note.getChildNotes())
|
||||
.filter(childNote => !imageLinks.find(rel => rel.value === childNote.noteId));
|
||||
|
||||
for (const childNote of childNotes) {
|
||||
$content.append(await this.renderNote(childNote));
|
||||
}
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
export default NoteListRenderer;
|
||||
@@ -3,7 +3,7 @@ import linkService from "./link.js";
|
||||
import treeCache from "./tree_cache.js";
|
||||
import utils from "./utils.js";
|
||||
import attributeRenderer from "./attribute_renderer.js";
|
||||
import libraryLoader from "./library_loader.js";
|
||||
import noteContentRenderer from "./note_content_renderer.js";
|
||||
|
||||
function setupGlobalTooltip() {
|
||||
$(document).on("mouseenter", "a", mouseEnterHandler);
|
||||
@@ -45,9 +45,7 @@ async function mouseEnterHandler() {
|
||||
const noteId = treeService.getNoteIdFromNotePath(notePath);
|
||||
|
||||
const note = await treeCache.getNote(noteId);
|
||||
const noteComplement = await treeCache.getNoteComplement(noteId);
|
||||
|
||||
const content = await renderTooltip(note, noteComplement);
|
||||
const content = await renderTooltip(note);
|
||||
|
||||
if (utils.isHtmlEmpty(content)) {
|
||||
return;
|
||||
@@ -79,7 +77,7 @@ function mouseLeaveHandler() {
|
||||
$(this).tooltip('dispose');
|
||||
}
|
||||
|
||||
async function renderTooltip(note, noteComplement) {
|
||||
async function renderTooltip(note) {
|
||||
if (note.isDeleted) {
|
||||
return '<div>Note has been deleted.</div>';
|
||||
}
|
||||
@@ -90,39 +88,18 @@ async function renderTooltip(note, noteComplement) {
|
||||
return;
|
||||
}
|
||||
|
||||
let content = $("<h5>").text(await treeService.getNotePathTitle(someNotePath)).prop('outerHTML');
|
||||
let content = '<h5 class="note-tooltip-title">' + (await treeService.getNoteTitleWithPathAsSuffix(someNotePath)).prop('outerHTML') + '</h5>';
|
||||
|
||||
const attributes = note.getAttributes()
|
||||
.filter(attr => !attr.isDefinition());
|
||||
const {$renderedAttributes} = await attributeRenderer.renderNormalAttributes(note);
|
||||
|
||||
if (attributes.length > 0) {
|
||||
content += '<div class="tooltip-attributes"><strong>Attributes: </strong> '
|
||||
+ (await attributeRenderer.renderAttributes(attributes)).html()
|
||||
+ '</div>'
|
||||
}
|
||||
const {$renderedContent} = await noteContentRenderer.getRenderedContent(note, {
|
||||
tooltip: true,
|
||||
trim: true
|
||||
});
|
||||
|
||||
if (note.type === 'text' && !utils.isHtmlEmpty(noteComplement.content)) {
|
||||
const $content = $('<div class="ck-content">').append(noteComplement.content);
|
||||
|
||||
if ($content.find('span.math-tex').length > 0) {
|
||||
await libraryLoader.requireLibrary(libraryLoader.KATEX);
|
||||
|
||||
renderMathInElement($content[0], {});
|
||||
}
|
||||
|
||||
content += $content[0].outerHTML;
|
||||
}
|
||||
else if (note.type === 'code' && noteComplement.content && noteComplement.content.trim()) {
|
||||
content += $("<pre>")
|
||||
.text(noteComplement.content)
|
||||
.prop('outerHTML');
|
||||
}
|
||||
else if (note.type === 'image') {
|
||||
content += $("<img>")
|
||||
.prop("src", `api/images/${note.noteId}/${note.title}`)
|
||||
.prop('outerHTML');
|
||||
}
|
||||
// other types of notes don't have tooltip preview
|
||||
content = content
|
||||
+ '<div class="note-tooltip-attributes">' + $renderedAttributes[0].outerHTML + '</div>'
|
||||
+ $renderedContent[0].outerHTML;
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ function getHost() {
|
||||
}
|
||||
|
||||
export default {
|
||||
download,
|
||||
downloadFileNote,
|
||||
openFileNote,
|
||||
downloadNoteRevision,
|
||||
|
||||
@@ -2,13 +2,16 @@ import utils from './utils.js';
|
||||
|
||||
const REQUEST_LOGGING_ENABLED = false;
|
||||
|
||||
function getHeaders(headers) {
|
||||
async function getHeaders(headers) {
|
||||
const appContext = (await import('./app_context.js')).default;
|
||||
const activeTabContext = appContext.tabManager ? appContext.tabManager.getActiveTabContext() : null;
|
||||
|
||||
// headers need to be lowercase because node.js automatically converts them to lower case
|
||||
// so hypothetical protectedSessionId becomes protectedsessionid on the backend
|
||||
// also avoiding using underscores instead of dashes since nginx filters them out by default
|
||||
const allHeaders = {
|
||||
'trilium-source-id': glob.sourceId,
|
||||
'trilium-local-now-datetime': utils.localNowDateTime(),
|
||||
'trilium-hoisted-note-id': activeTabContext ? activeTabContext.hoistedNoteId : null,
|
||||
'x-csrf-token': glob.csrfToken
|
||||
};
|
||||
|
||||
@@ -44,6 +47,7 @@ async function remove(url, sourceId) {
|
||||
|
||||
let i = 1;
|
||||
const reqResolves = {};
|
||||
const reqRejects = {};
|
||||
|
||||
let maxKnownEntityChangeId = 0;
|
||||
|
||||
@@ -52,12 +56,15 @@ async function call(method, url, data, headers = {}) {
|
||||
|
||||
const start = Date.now();
|
||||
|
||||
headers = await getHeaders(headers);
|
||||
|
||||
if (utils.isElectron()) {
|
||||
const ipc = utils.dynamicRequire('electron').ipcRenderer;
|
||||
const requestId = i++;
|
||||
|
||||
resp = await new Promise((resolve, reject) => {
|
||||
reqResolves[requestId] = resolve;
|
||||
reqRejects[requestId] = reject;
|
||||
|
||||
if (REQUEST_LOGGING_ENABLED) {
|
||||
console.log(utils.now(), "Request #" + requestId + " to " + method + " " + url);
|
||||
@@ -65,7 +72,7 @@ async function call(method, url, data, headers = {}) {
|
||||
|
||||
ipc.send('server-request', {
|
||||
requestId: requestId,
|
||||
headers: getHeaders(headers),
|
||||
headers: headers,
|
||||
method: method,
|
||||
url: "/" + baseApiUrl + url,
|
||||
data: data
|
||||
@@ -91,12 +98,20 @@ async function call(method, url, data, headers = {}) {
|
||||
return resp.body;
|
||||
}
|
||||
|
||||
async function reportError(method, url, status, error) {
|
||||
const message = "Error when calling " + method + " " + url + ": " + status + " - " + error;
|
||||
|
||||
const toastService = (await import("./toast.js")).default;
|
||||
toastService.showError(message);
|
||||
toastService.throwError(message);
|
||||
}
|
||||
|
||||
function ajax(url, method, data, headers) {
|
||||
return new Promise((res, rej) => {
|
||||
const options = {
|
||||
url: baseApiUrl + url,
|
||||
type: method,
|
||||
headers: getHeaders(headers),
|
||||
headers: headers,
|
||||
timeout: 60000,
|
||||
success: (body, textStatus, jqXhr) => {
|
||||
const respHeaders = {};
|
||||
@@ -112,11 +127,8 @@ function ajax(url, method, data, headers) {
|
||||
headers: respHeaders
|
||||
});
|
||||
},
|
||||
error: async (jqXhr, textStatus, error) => {
|
||||
const message = "Error when calling " + method + " " + url + ": " + textStatus + " - " + error;
|
||||
const toastService = (await import("./toast.js")).default;
|
||||
toastService.showError(message);
|
||||
toastService.throwError(message);
|
||||
error: async (jqXhr, status, error) => {
|
||||
await reportError(method, url, status, error);
|
||||
|
||||
rej(error);
|
||||
}
|
||||
@@ -138,17 +150,25 @@ function ajax(url, method, data, headers) {
|
||||
if (utils.isElectron()) {
|
||||
const ipc = utils.dynamicRequire('electron').ipcRenderer;
|
||||
|
||||
ipc.on('server-response', (event, arg) => {
|
||||
ipc.on('server-response', async (event, arg) => {
|
||||
if (REQUEST_LOGGING_ENABLED) {
|
||||
console.log(utils.now(), "Response #" + arg.requestId + ": " + arg.statusCode);
|
||||
}
|
||||
|
||||
reqResolves[arg.requestId]({
|
||||
body: arg.body,
|
||||
headers: arg.headers
|
||||
});
|
||||
if (arg.statusCode >= 200 && arg.statusCode < 300) {
|
||||
reqResolves[arg.requestId]({
|
||||
body: arg.body,
|
||||
headers: arg.headers
|
||||
});
|
||||
}
|
||||
else {
|
||||
await reportError(arg.method, arg.url, arg.statusCode, arg.body);
|
||||
|
||||
reqRejects[arg.requestId]();
|
||||
}
|
||||
|
||||
delete reqResolves[arg.requestId];
|
||||
delete reqRejects[arg.requestId];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,15 @@ function setupSplit(left, right) {
|
||||
return;
|
||||
}
|
||||
|
||||
const leftPaneWidth = options.getInt('leftPaneWidth');
|
||||
const rightPaneWidth = options.getInt('rightPaneWidth');
|
||||
let leftPaneWidth = options.getInt('leftPaneWidth');
|
||||
if (!leftPaneWidth || leftPaneWidth < 5) {
|
||||
leftPaneWidth = 5;
|
||||
}
|
||||
|
||||
let rightPaneWidth = options.getInt('rightPaneWidth');
|
||||
if (!rightPaneWidth || rightPaneWidth < 5) {
|
||||
rightPaneWidth = 5;
|
||||
}
|
||||
|
||||
if (left && right) {
|
||||
instance = Split(['#left-pane', '#center-pane', '#right-pane'], {
|
||||
@@ -49,4 +56,4 @@ function setupSplit(left, right) {
|
||||
|
||||
export default {
|
||||
setupSplit
|
||||
};
|
||||
};
|
||||
|
||||
@@ -8,8 +8,8 @@ async function syncNow() {
|
||||
toastService.showMessage("Sync finished successfully.");
|
||||
}
|
||||
else {
|
||||
if (result.message.length > 100) {
|
||||
result.message = result.message.substr(0, 100);
|
||||
if (result.message.length > 200) {
|
||||
result.message = result.message.substr(0, 200) + "...";
|
||||
}
|
||||
|
||||
toastService.showError("Sync failed: " + result.message);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user