From 5ad47d38665fbb78847cc01514607047dd3fa341 Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 17 Mar 2023 20:44:26 +0100 Subject: [PATCH 01/21] fix cache invalidation upon note title change --- src/becca/becca_loader.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/becca/becca_loader.js b/src/becca/becca_loader.js index ad4c90a10..f7659e964 100644 --- a/src/becca/becca_loader.js +++ b/src/becca/becca_loader.js @@ -70,7 +70,9 @@ function reload() { } function postProcessEntityUpdate(entityName, entity) { - if (entityName === 'branches') { + if (entityName === 'notes') { + noteUpdated(entity); + } else if (entityName === 'branches') { branchUpdated(entity); } else if (entityName === 'attributes') { attributeUpdated(entity); @@ -161,6 +163,15 @@ function branchDeleted(branchId) { delete becca.branches[branch.branchId]; } +function noteUpdated(entity) { + const note = becca.notes[entity.noteId]; + + if (note) { + // type / mime could have been changed, and they are present in flatTextCache + note.flatTextCache = null; + } +} + function branchUpdated(branch) { const childNote = becca.notes[branch.noteId]; From 4c3fcc3ea6f37debcb87ac1a7f5698c27be0e67b Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 17 Mar 2023 22:04:49 +0100 Subject: [PATCH 02/21] fix sanitization of autocomplete against XSS --- src/services/search/services/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/search/services/search.js b/src/services/search/services/search.js index 06362b28c..beb0555d1 100644 --- a/src/services/search/services/search.js +++ b/src/services/search/services/search.js @@ -307,7 +307,7 @@ function highlightSearchResults(searchResults, highlightedTokens) { for (const result of searchResults) { const note = becca.notes[result.noteId]; - result.highlightedNotePathTitle = result.notePathTitle.replace('/[<\{\}]/g', ''); + result.highlightedNotePathTitle = result.notePathTitle.replace(/[<{}]/g, ''); if (highlightedTokens.find(token => note.type.includes(token))) { result.highlightedNotePathTitle += ` "type: ${note.type}'`; From 64d8c7a657b84a77c19663bf30a663f2e342960b Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 17 Mar 2023 22:14:50 +0100 Subject: [PATCH 03/21] add a check for the hidden note existence, #3728 --- db/migrations/0212__delete_all_attributes_of_named_notes.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/migrations/0212__delete_all_attributes_of_named_notes.js b/db/migrations/0212__delete_all_attributes_of_named_notes.js index 47ddb9114..d90f25e44 100644 --- a/db/migrations/0212__delete_all_attributes_of_named_notes.js +++ b/db/migrations/0212__delete_all_attributes_of_named_notes.js @@ -2,12 +2,18 @@ module.exports = () => { const cls = require("../../src/services/cls"); const beccaLoader = require("../../src/becca/becca_loader"); const becca = require("../../src/becca/becca"); + const log = require("../../src/services/log"); cls.init(() => { beccaLoader.load(); const hidden = becca.getNote("_hidden"); + if (!hidden) { + log.info("MIGRATION 212: no _hidden note, skipping."); + return; + } + for (const noteId of hidden.getSubtreeNoteIds({includeHidden: true})) { if (noteId.startsWith("_")) { // is "named" note const note = becca.getNote(noteId); From 117f1101e48d820adec6565f510221703fa5a653 Mon Sep 17 00:00:00 2001 From: dymani Date: Sat, 18 Mar 2023 10:18:34 +0800 Subject: [PATCH 04/21] Fix typo in backend API createOrUpdateLauncher() (cherry picked from commit b3f47bb2b6617ed8a43c6235b7a9d153dc58eb95) --- src/services/backend_script_api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/backend_script_api.js b/src/services/backend_script_api.js index 50bab0c0d..bab0702f5 100644 --- a/src/services/backend_script_api.js +++ b/src/services/backend_script_api.js @@ -475,7 +475,7 @@ function BackendScriptApi(currentNote, apiParams) { const noteId = 'al_' + opts.id; const launcherNote = - becca.getNote(opts.id) || + becca.getNote(noteId) || specialNotesService.createLauncher({ noteId: noteId, parentNoteId: parentNoteId, @@ -514,7 +514,7 @@ function BackendScriptApi(currentNote, apiParams) { if (opts.icon) { launcherNote.setLabel('iconClass', `bx ${opts.icon}`); } else { - launcherNote.removeLabel('keyboardShortcut'); + launcherNote.removeLabel('iconClass'); } return {note: launcherNote}; From 6b1f9d3243a4bc4aa41796d9dc1fce15830c1e3a Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 19 Mar 2023 22:23:58 +0100 Subject: [PATCH 05/21] add #newNotesOnTop, closes #3734 (cherry picked from commit d31b5ac99fadfaeaf23fd809598fd0f816b629e2) --- .../attribute_widgets/attribute_detail.js | 3 ++- src/services/builtin_attributes.js | 1 + src/services/notes.js | 21 ++++++++++--------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/public/app/widgets/attribute_widgets/attribute_detail.js b/src/public/app/widgets/attribute_widgets/attribute_detail.js index dc018836a..488f3709b 100644 --- a/src/public/app/widgets/attribute_widgets/attribute_detail.js +++ b/src/public/app/widgets/attribute_widgets/attribute_detail.js @@ -242,7 +242,8 @@ const ATTR_HELP = { "keepCurrentHoisting": "Opening this link won't change hoisting even if the note is not displayable in the current hoisted subtree.", "executeButton": "Title of the button which will execute the current code note", "executeDescription": "Longer description of the current code note displayed together with the execute button", - "excludeFromNoteMap": "Notes with this label will be hidden from the Note Map" + "excludeFromNoteMap": "Notes with this label will be hidden from the Note Map", + "newNotesOnTop": "New notes will be created at the top of the parent note, not on the bottom." }, "relation": { "runOnNoteCreation": "executes when note is created on backend. Use this relation if you want to run the script for all notes created under a specific subtree. In that case, create it on the subtree root note and make it inheritable. A new note created within the subtree (any depth) will trigger the script.", diff --git a/src/services/builtin_attributes.js b/src/services/builtin_attributes.js index 1597c6599..abb569656 100644 --- a/src/services/builtin_attributes.js +++ b/src/services/builtin_attributes.js @@ -62,6 +62,7 @@ module.exports = [ { type: 'label', name: 'keepCurrentHoisting'}, { type: 'label', name: 'executeButton'}, { type: 'label', name: 'executeDescription'}, + { type: 'label', name: 'newNotesOnTop'}, // relation names { type: 'relation', name: 'internalLink' }, diff --git a/src/services/notes.js b/src/services/notes.js index 2c71a9a08..6dfa34cb0 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -22,17 +22,18 @@ const htmlSanitizer = require("./html_sanitizer"); const ValidationError = require("../errors/validation_error"); const noteTypesService = require("./note_types"); -function getNewNotePosition(parentNoteId) { - const note = becca.notes[parentNoteId]; +function getNewNotePosition(parentNote) { + if (parentNote.hasLabel('newNotesOnTop')) { + const minNotePos = parentNote.getChildBranches() + .reduce((min, note) => Math.min(min, note.notePosition), 0); - if (!note) { - throw new Error(`Can't find note ${parentNoteId}`); + return minNotePos - 10; + } else { + const maxNotePos = parentNote.getChildBranches() + .reduce((max, note) => Math.max(max, note.notePosition), 0); + + return maxNotePos + 10; } - - const maxNotePos = note.getChildBranches() - .reduce((max, note) => Math.max(max, note.notePosition), 0); - - return maxNotePos + 10; } function triggerNoteTitleChanged(note) { @@ -186,7 +187,7 @@ function createNewNote(params) { branch = new BBranch({ noteId: note.noteId, parentNoteId: params.parentNoteId, - notePosition: params.notePosition !== undefined ? params.notePosition : getNewNotePosition(params.parentNoteId), + notePosition: params.notePosition !== undefined ? params.notePosition : getNewNotePosition(parentNote), prefix: params.prefix, isExpanded: !!params.isExpanded }).save(); From c86be990d6d8f65fbfb957744fad96e9f102da92 Mon Sep 17 00:00:00 2001 From: MeIchthys <10717998+meichthys@users.noreply.github.com> Date: Tue, 21 Mar 2023 16:19:09 -0400 Subject: [PATCH 06/21] Use same margin all around note-book-card --- src/public/app/services/note_list_renderer.js | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/public/app/services/note_list_renderer.js b/src/public/app/services/note_list_renderer.js index f0d9eb9f7..72e79ae24 100644 --- a/src/public/app/services/note_list_renderer.js +++ b/src/public/app/services/note_list_renderer.js @@ -12,86 +12,86 @@ const TPL = ` 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; border: 1px solid transparent; } - + .note-list.grid-view .note-expander { display: none; } - + .note-list.grid-view .note-book-card { max-height: 300px; } - + .note-list.grid-view .note-book-card:hover { cursor: pointer; border: 1px solid var(--main-border-color); background: var(--more-accented-background-color); } - + .note-book-card { border-radius: 10px; background-color: var(--accented-background-color); padding: 10px 15px 15px 8px; - margin: 5px 5px 5px 0; + margin: 5px 5px 5px 5px; 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-header { margin-bottom: 0; word-break: break-all; } - + /* not-expanded title is limited to one line only */ .note-book-card:not(.expanded) .note-book-header { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } - + .note-book-header .rendered-note-attributes { font-size: medium; } - + .note-book-header .rendered-note-attributes:before { content: "\\00a0\\00a0"; } - + .note-book-header .note-icon { font-size: 100%; display: inline-block; padding-right: 7px; position: relative; } - + .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-protectedSession { display: flex; align-items: center; @@ -99,46 +99,46 @@ const TPL = ` text-align: center; padding: 10px; } - + .note-book-content.type-image img, .note-book-content.type-canvas svg { 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, .note-book-card.type-canvas .note-book-content img { max-width: 100%; max-height: 100%; } - + .note-book-header { flex-grow: 0; } - + .note-list-wrapper { height: 100%; overflow: auto; } - + .note-expander { font-size: x-large; position: relative; top: 3px; cursor: pointer; } - + .note-list-pager { text-align: center; } - +
- +
- +
`; From cd72ea524e52290181195ceb01c20bb57da29b6d Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 23 Mar 2023 23:47:28 +0100 Subject: [PATCH 07/21] promoted and inherited attributes should be shown grouped based on the owning note, #3761 --- src/public/app/entities/fnote.js | 9 ++++++++- .../ribbon_widgets/inherited_attribute_list.js | 13 ++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/public/app/entities/fnote.js b/src/public/app/entities/fnote.js index 1f44a97bf..70594d647 100644 --- a/src/public/app/entities/fnote.js +++ b/src/public/app/entities/fnote.js @@ -706,7 +706,14 @@ class FNote { }); // attrs are not resorted if position changes after initial load - promotedAttrs.sort((a, b) => a.position < b.position ? -1 : 1); + promotedAttrs.sort((a, b) => { + if (a.noteId === b.noteId) { + return a.position < b.position ? -1 : 1; + } else { + // inherited promoted attributes should stay grouped: https://github.com/zadam/trilium/issues/3761 + return a.noteId < b.noteId ? -1 : 1; + } + }); return promotedAttrs; } diff --git a/src/public/app/widgets/ribbon_widgets/inherited_attribute_list.js b/src/public/app/widgets/ribbon_widgets/inherited_attribute_list.js index e434c20a6..01031686e 100644 --- a/src/public/app/widgets/ribbon_widgets/inherited_attribute_list.js +++ b/src/public/app/widgets/ribbon_widgets/inherited_attribute_list.js @@ -92,7 +92,18 @@ export default class InheritedAttributesWidget extends NoteContextAwareWidget { } getInheritedAttributes(note) { - return note.getAttributes().filter(attr => attr.noteId !== this.noteId); + const attrs = note.getAttributes().filter(attr => attr.noteId !== this.noteId); + + attrs.sort((a, b) => { + if (a.noteId === b.noteId) { + return a.position < b.position ? -1 : 1; + } else { + // inherited attributes should stay grouped: https://github.com/zadam/trilium/issues/3761 + return a.noteId < b.noteId ? -1 : 1; + } + }); + + return attrs; } entitiesReloadedEvent({loadResults}) { From 874b6c71a306accf5433fa90076f43a657042e8a Mon Sep 17 00:00:00 2001 From: MeIchthys <10717998+meichthys@users.noreply.github.com> Date: Fri, 24 Mar 2023 11:29:16 -0400 Subject: [PATCH 08/21] Add bottom border to note-book-header --- src/public/app/services/note_list_renderer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/public/app/services/note_list_renderer.js b/src/public/app/services/note_list_renderer.js index 72e79ae24..b22fdc827 100644 --- a/src/public/app/services/note_list_renderer.js +++ b/src/public/app/services/note_list_renderer.js @@ -62,7 +62,9 @@ const TPL = ` } .note-book-header { + border-bottom: 1px solid var(--main-border-color); margin-bottom: 0; + padding-bottom: .5rem; word-break: break-all; } From fa6d1879ddeda9d690da52ecddb5ff3c2d4393fb Mon Sep 17 00:00:00 2001 From: MeIchthys <10717998+meichthys@users.noreply.github.com> Date: Fri, 24 Mar 2023 14:46:09 -0400 Subject: [PATCH 09/21] Move .tree-actions left to accomodate wider windows scrollbar --- src/public/app/widgets/note_tree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index 43d2ee8f8..b9974676f 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -49,7 +49,7 @@ const TPL = ` display: flex; align-items: flex-end; justify-content: flex-end; - right: 11.77px; + right: 17px; } button.tree-floating-button { From 8a4caaf6fb6f0e12d049ed86b65812c7ee50f5b0 Mon Sep 17 00:00:00 2001 From: MeIchthys <10717998+meichthys@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:17:17 -0400 Subject: [PATCH 10/21] Add border to tree-actions section and adjust padding --- src/public/app/widgets/note_tree.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index b9974676f..7837672d2 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -41,7 +41,6 @@ const TPL = ` } .tree-actions { - padding: 4px 0; background-color: var(--launcher-pane-background-color); z-index: 100; position: absolute; @@ -50,12 +49,14 @@ const TPL = ` align-items: flex-end; justify-content: flex-end; right: 17px; + border-radius: 7px; + border: 1px solid var(--main-border-color); } button.tree-floating-button { + margin: 1px; font-size: 1.5em; padding: 5px; - margin-right: 5px; max-height: 34px; color: var(--launcher-pane-text-color); background-color: var(--button-background-color); From 6d6221636c4e68f58092120ef63ea79757d16b65 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Sun, 26 Mar 2023 20:25:17 +0900 Subject: [PATCH 11/21] Add Japanese README --- README.ja.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 README.ja.md diff --git a/README.ja.md b/README.ja.md new file mode 100644 index 000000000..d5285722c --- /dev/null +++ b/README.ja.md @@ -0,0 +1,83 @@ +# Trilium Notes + +[![Join the chat at https://gitter.im/trilium-notes/Lobby](https://badges.gitter.im/trilium-notes/Lobby.svg)](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md) | [Japanese](https://github.com/zadam/trilium/blob/master/README.ja.md) + +Trilium Notes は、大規模な個人知識ベースの構築に焦点を当てた、階層型ノートアプリケーションです。概要は[スクリーンショット](https://github.com/zadam/trilium/wiki/Screenshot-tour)をご覧ください: + +Trilium Screenshot + +ウクライナは現在、ロシアの侵略から自国を守っています。[ウクライナ軍や人道的な慈善団体への寄付](https://standforukraine.com/)をご検討ください。 + +

+ drawing + Trilium Notes supports Ukraine! +

+ +## 🎁 特徴 + +* ノートは、任意の深さのツリーに配置できます。単一のノートをツリー内の複数の場所に配置できます ([cloning](https://github.com/zadam/trilium/wiki/Cloning-notes) を参照) +* マークダウン[オートフォーマット](https://github.com/zadam/trilium/wiki/Text-notes#autoformat)による、表、画像、[数学](https://github.com/zadam/trilium/wiki/Text-notes#math-support)などの豊富な WYSIWYG ノート編集機能 +* シンタックスハイライトを含む[ソースコード付きノート](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://trilium.cc/paid-hosting)があります +* 公開インターネットへのノートの[共有](https://github.com/zadam/trilium/wiki/Sharing)(公開) +* ノートごとの粒度を持つ強力な[ノート暗号化](https://github.com/zadam/trilium/wiki/Protected-notes) +* 組み込みの Excalidraw を使用した図のスケッチ (ノート タイプ"キャンバス") +* ノートとその関係を可視化するための[関係図](https://github.com/zadam/trilium/wiki/Relation-map)と[リンクマップ](https://github.com/zadam/trilium/wiki/Link-map) +* [スクリプティング](https://github.com/zadam/trilium/wiki/Scripts) - [高度なショーケース](https://github.com/zadam/trilium/wiki/Advanced-showcases)を参照 +* 自動化のための [REST API](https://github.com/zadam/trilium/wiki/ETAPI) +* ユーザビリティとパフォーマンスの両方で 100 000 ノート以上に拡張可能 +* スマートフォンとタブレット向けのタッチ最適化[モバイルフロントエンド](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 コンテンツを簡単に保存するための [Web クリッパー](https://github.com/zadam/trilium/wiki/Web-clipper) + +サードパーティのテーマ、スクリプト、プラグインなどは、 [awesome-trilium](https://github.com/Nriver/awesome-trilium) をチェックしてください。 + +## 🏗 ビルド + +Trilium は、デスクトップアプリケーション(Linux、Windows)またはサーバー上でホストされるウェブアプリケーション(Linux)として提供されます。 Mac OS のデスクトップビルドも利用可能ですが、 [unsupported](https://github.com/zadam/trilium/wiki/FAQ#mac-os-support) となっています。 + +* デスクトップで Trilium を使用したい場合は、 [latest release](https://github.com/zadam/trilium/releases/latest) からお使いのプラットフォームのバイナリリリースをダウンロードし、パッケージを解凍して ``trilium`` の実行ファイルを実行してください。 +* サーバーに Trilium をインストールする場合は、[このページ](https://github.com/zadam/trilium/wiki/Server-installation)に従ってください。 + * 現在、対応(動作確認)しているブラウザは、最近の Chrome と Firefox のみです。 + +Trilium は Flatpak としても提供されます: + +[](https://flathub.org/apps/details/com.github.zadam.trilium) + +## 📝 ドキュメント + +[ドキュメントページの全リストはwikiをご覧ください。](https://github.com/zadam/trilium/wiki/) + +また、[個人的な知識基盤のパターン](https://github.com/zadam/trilium/wiki/Patterns-of-personal-knowledge-base)を読むと、 Trilium の使い方のヒントを得ることができます。 + +## 💻 コントリビュート + +ブラウザベースの開発環境を使用 + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/zadam/trilium) + +または、ローカルにクローンして実行 +``` +npm install +npm run start-server +``` + +## 📢 シャウトアウト + +* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - 市場で最高の WYSIWYG エディター、非常にインタラクティブで聞き上手なチーム +* [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)で使用。 + +## 🤝 サポート + +GitHub スポンサー、[PayPal](https://paypal.me/za4am)もしくは Bitcoin (bitcoin:bc1qv3svjn40v89mnkre5vyvs2xw6y8phaltl385d2) にて Trilium をサポートすることができます。 + +## 🔑 ライセンス + +このプログラムはフリーソフトウェアです:フリーソフトウェア財団が発行した GNU Affero General Public License のバージョン3、またはそれ以降のバージョンのいずれかに従って、再配布および/または改変することができます。 From 5a32a7ce185167afab0c25586ffaeb1955b0970b Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Sun, 26 Mar 2023 20:33:59 +0900 Subject: [PATCH 12/21] minor fix --- README.ja.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.ja.md b/README.ja.md index d5285722c..621e3e0ff 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,6 +1,6 @@ # Trilium Notes -[![Join the chat at https://gitter.im/trilium-notes/Lobby](https://badges.gitter.im/trilium-notes/Lobby.svg)](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md) | [Japanese](https://github.com/zadam/trilium/blob/master/README.ja.md) +[English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md) | [Japanese](https://github.com/zadam/trilium/blob/master/README.ja.md) Trilium Notes は、大規模な個人知識ベースの構築に焦点を当てた、階層型ノートアプリケーションです。概要は[スクリーンショット](https://github.com/zadam/trilium/wiki/Screenshot-tour)をご覧ください: diff --git a/README.md b/README.md index d2806af64..23b5caa7d 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ npm run start-server ## 🤝 Support -You can support Trilum using GitHub Sponsors, [PayPal](https://paypal.me/za4am) or Bitcoin (bitcoin:bc1qv3svjn40v89mnkre5vyvs2xw6y8phaltl385d2). +You can support Trilium using GitHub Sponsors, [PayPal](https://paypal.me/za4am) or Bitcoin (bitcoin:bc1qv3svjn40v89mnkre5vyvs2xw6y8phaltl385d2). ## 🔑 License From cf904a874e68a6baccafc303c642bc2bfd406c16 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Sun, 26 Mar 2023 20:34:46 +0900 Subject: [PATCH 13/21] Add links --- README-ZH_CN.md | 2 +- README.md | 2 +- README.ru.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README-ZH_CN.md b/README-ZH_CN.md index a31caa2a1..47d93a3da 100644 --- a/README-ZH_CN.md +++ b/README-ZH_CN.md @@ -1,6 +1,6 @@ # Trilium Notes -[English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md) +[English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md) | [Japanese](https://github.com/zadam/trilium/blob/master/README.ja.md) [![Join the chat at https://gitter.im/trilium-notes/Lobby](https://badges.gitter.im/trilium-notes/Lobby.svg)](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)以快速了解: diff --git a/README.md b/README.md index 23b5caa7d..d8cd45f14 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Trilium Notes -[![Join the chat at https://gitter.im/trilium-notes/Lobby](https://badges.gitter.im/trilium-notes/Lobby.svg)](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md) +[![Join the chat at https://gitter.im/trilium-notes/Lobby](https://badges.gitter.im/trilium-notes/Lobby.svg)](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md) | [Japanese](https://github.com/zadam/trilium/blob/master/README.ja.md) Trilium Notes is a hierarchical note taking application with focus on building large personal knowledge bases. See [screenshots](https://github.com/zadam/trilium/wiki/Screenshot-tour) for quick overview: diff --git a/README.ru.md b/README.ru.md index 794e6c4b2..f79341e79 100644 --- a/README.ru.md +++ b/README.ru.md @@ -1,6 +1,6 @@ # Trilium Notes -[English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md) +[English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md) | [Japanese](https://github.com/zadam/trilium/blob/master/README.ja.md) [![Join the chat at https://gitter.im/trilium-notes/Lobby](https://badges.gitter.im/trilium-notes/Lobby.svg)](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): From a099876088ca923b12571749c6118bb8ffd764ea Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 26 Mar 2023 20:50:37 +0200 Subject: [PATCH 14/21] fix escaping in sql console results --- package-lock.json | 5 ++--- src/public/app/widgets/sql_result.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index dbd019d3b..8117a4a56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,11 @@ { "name": "trilium", - "version": "0.59.1", + "version": "0.59.2", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "trilium", - "version": "0.59.1", + "version": "0.59.2", "hasInstallScript": true, "license": "AGPL-3.0-only", "dependencies": { diff --git a/src/public/app/widgets/sql_result.js b/src/public/app/widgets/sql_result.js index 142dc79e3..4224e714b 100644 --- a/src/public/app/widgets/sql_result.js +++ b/src/public/app/widgets/sql_result.js @@ -60,7 +60,7 @@ export default class SqlResultWidget extends NoteContextAwareWidget { const $row = $(""); for (const key in result) { - $row.append($("").html(key)); + $row.append($("").text(key)); } $table.append($row); @@ -69,7 +69,7 @@ export default class SqlResultWidget extends NoteContextAwareWidget { const $row = $(""); for (const key in result) { - $row.append($("").html(result[key])); + $row.append($("").text(result[key])); } $table.append($row); From 53b4f0e0d5f15e9c0f54d9acfe9b9dfd07377d4a Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 26 Mar 2023 19:29:52 +0000 Subject: [PATCH 15/21] Add svg icons --- images/icon-black.svg | 12 ++++++++++++ images/icon-color.svg | 12 ++++++++++++ images/icon-grey.svg | 12 ++++++++++++ src/public/app/widgets/buttons/global_menu.js | 4 ++-- src/public/stylesheets/theme-dark.css | 2 +- 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 images/icon-black.svg create mode 100644 images/icon-color.svg create mode 100644 images/icon-grey.svg diff --git a/images/icon-black.svg b/images/icon-black.svg new file mode 100644 index 000000000..f3427da82 --- /dev/null +++ b/images/icon-black.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/images/icon-color.svg b/images/icon-color.svg new file mode 100644 index 000000000..bd266dab6 --- /dev/null +++ b/images/icon-color.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/images/icon-grey.svg b/images/icon-grey.svg new file mode 100644 index 000000000..92bc0906e --- /dev/null +++ b/images/icon-grey.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/public/app/widgets/buttons/global_menu.js b/src/public/app/widgets/buttons/global_menu.js index 8108655b7..73fa681d3 100644 --- a/src/public/app/widgets/buttons/global_menu.js +++ b/src/public/app/widgets/buttons/global_menu.js @@ -16,7 +16,7 @@ const TPL = ` } .global-menu-button { - background-image: url("${window.glob.assetPath}/images/icon-black.png"); + background-image: url("${window.glob.assetPath}/images/icon-black.svg"); background-repeat: no-repeat; background-position: 50% 45%; width: 100%; @@ -25,7 +25,7 @@ const TPL = ` } .global-menu-button:hover { - background-image: url("${window.glob.assetPath}/images/icon-color.png"); + background-image: url("${window.glob.assetPath}/images/icon-color.svg"); border: 0; } diff --git a/src/public/stylesheets/theme-dark.css b/src/public/stylesheets/theme-dark.css index e8b1de4b3..535282c30 100644 --- a/src/public/stylesheets/theme-dark.css +++ b/src/public/stylesheets/theme-dark.css @@ -72,7 +72,7 @@ } body .global-menu-button { - background-image: url("../images/icon-grey.png"); + background-image: url("../images/icon-grey.svg"); } body ::-webkit-calendar-picker-indicator { From 9881e6de3e4966af39ec6245562dca6ac7b25eaa Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 26 Mar 2023 23:09:15 +0200 Subject: [PATCH 16/21] fix hangup on highlighting empty tokens, closes #3772 --- src/services/search/services/search.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/search/services/search.js b/src/services/search/services/search.js index beb0555d1..d682af090 100644 --- a/src/services/search/services/search.js +++ b/src/services/search/services/search.js @@ -299,7 +299,9 @@ function highlightSearchResults(searchResults, highlightedTokens) { // which would make the resulting HTML string invalid. // { and } are used for marking and tag (to avoid matches on single 'b' character) // < and > are used for marking and - highlightedTokens = highlightedTokens.map(token => token.replace('/[<\{\}]/g', '')); + highlightedTokens = highlightedTokens + .map(token => token.replace('/[<\{\}]/g', '')) + .filter(token => !!token?.trim()); // sort by the longest, so we first highlight the longest matches highlightedTokens.sort((a, b) => a.length > b.length ? -1 : 1); From 79a6baca6f4137f82bcf378df37a623c943e468c Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 26 Mar 2023 23:23:13 +0200 Subject: [PATCH 17/21] adjust logo sizing/positioning --- src/public/app/widgets/buttons/global_menu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/buttons/global_menu.js b/src/public/app/widgets/buttons/global_menu.js index 73fa681d3..7d38e87b4 100644 --- a/src/public/app/widgets/buttons/global_menu.js +++ b/src/public/app/widgets/buttons/global_menu.js @@ -18,7 +18,8 @@ const TPL = ` .global-menu-button { background-image: url("${window.glob.assetPath}/images/icon-black.svg"); background-repeat: no-repeat; - background-position: 50% 45%; + background-position: 50% 80%; + background-size: 45px; width: 100%; height: 100%; position: relative; From 3192531d4c3243c30f6c20bf8f1719ffae1f8a54 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 27 Mar 2023 22:49:41 +0200 Subject: [PATCH 18/21] don't trigger menu items on right click, #3764 --- src/public/app/menus/context_menu.js | 5 +++++ src/public/app/widgets/type_widgets/relation_map.js | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/public/app/menus/context_menu.js b/src/public/app/menus/context_menu.js index ba42cc345..19b5f6433 100644 --- a/src/public/app/menus/context_menu.js +++ b/src/public/app/menus/context_menu.js @@ -99,11 +99,16 @@ class ContextMenu { const $item = $("
  • ") .addClass("dropdown-item") .append($link) + .on('contextmenu', e => false) // important to use mousedown instead of click since the former does not change focus // (especially important for focused text for spell check) .on('mousedown', e => { e.stopPropagation(); + if (e.which !== 1) { // only left click triggers menu items + return false; + } + this.hide(); if (item.handler) { diff --git a/src/public/app/widgets/type_widgets/relation_map.js b/src/public/app/widgets/type_widgets/relation_map.js index aa9d68a06..696ad250d 100644 --- a/src/public/app/widgets/type_widgets/relation_map.js +++ b/src/public/app/widgets/type_widgets/relation_map.js @@ -470,11 +470,7 @@ export default class RelationMapTypeWidget extends TypeWidget { async createNoteBox(noteId, title, x, y) { const $link = await linkService.createNoteLink(noteId, {title}); - $link.mousedown(e => { - console.log(e); - - linkService.goToLink(e); - }); + $link.mousedown(e => linkService.goToLink(e)); const note = await froca.getNote(noteId); From 45a74a046c4dab51b881bdfaa40c7efd3f562af8 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 27 Mar 2023 23:03:27 +0200 Subject: [PATCH 19/21] release 0.59.3 --- src/services/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/build.js b/src/services/build.js index 8b4a403e6..b8402c31e 100644 --- a/src/services/build.js +++ b/src/services/build.js @@ -1 +1 @@ -module.exports = { buildDate:"2023-03-14T21:15:08+01:00", buildRevision: "d8e9086bdeb721db795783b5d92395a9bd6882c9" }; +module.exports = { buildDate:"", buildRevision: "9881e6de3e4966af39ec6245562dca6ac7b25eaa" }; From ed52919f9ebe7f2f91d3add6b0fa4d3f4d06b908 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 27 Mar 2023 23:06:14 +0200 Subject: [PATCH 20/21] release 0.59.3 --- package.json | 2 +- src/services/build.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5d7c9d49b..343cc0ad8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "trilium", "productName": "Trilium Notes", "description": "Trilium Notes", - "version": "0.59.2", + "version": "0.59.3", "license": "AGPL-3.0-only", "main": "electron.js", "bin": { diff --git a/src/services/build.js b/src/services/build.js index 8b4a403e6..cea5cf6a6 100644 --- a/src/services/build.js +++ b/src/services/build.js @@ -1 +1 @@ -module.exports = { buildDate:"2023-03-14T21:15:08+01:00", buildRevision: "d8e9086bdeb721db795783b5d92395a9bd6882c9" }; +module.exports = { buildDate:"2023-03-27T23:06:14+02:00", buildRevision: "9881e6de3e4966af39ec6245562dca6ac7b25eaa" }; From d354c91d7cb4dbc4a3b7c4f18039ea40b9e81173 Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 29 Mar 2023 22:40:50 +0200 Subject: [PATCH 21/21] sort icons by how much they are used, #3784 --- src/public/app/widgets/icon_list.js | 16 +++++++++ src/public/app/widgets/note_icon.js | 52 ++++++++++++++++++----------- src/routes/api/other.js | 29 ++++++++++++++++ src/routes/routes.js | 2 ++ 4 files changed, 79 insertions(+), 20 deletions(-) create mode 100644 src/routes/api/other.js diff --git a/src/public/app/widgets/icon_list.js b/src/public/app/widgets/icon_list.js index 1ad713b10..32fe21a95 100644 --- a/src/public/app/widgets/icon_list.js +++ b/src/public/app/widgets/icon_list.js @@ -11175,6 +11175,22 @@ const icons = [ } ]; +function getIconClass(icon) { + if (icon.type_of_icon === 'LOGO') { + return `bxl-${icon.name}`; + } + else if (icon.type_of_icon === 'SOLID') { + return `bxs-${icon.name}`; + } + else { + return `bx-${icon.name}`; + } +} + +for (const icon of icons) { + icon.className = getIconClass(icon); +} + export default { categories, icons diff --git a/src/public/app/widgets/note_icon.js b/src/public/app/widgets/note_icon.js index 20bdeed79..ba2bbb683 100644 --- a/src/public/app/widgets/note_icon.js +++ b/src/public/app/widgets/note_icon.js @@ -1,5 +1,6 @@ import NoteContextAwareWidget from "./note_context_aware_widget.js"; import attributeService from "../services/attributes.js"; +import server from "../services/server.js"; const TPL = `