From 521d95021b4c7b355c3850daa0b1e909bf5ed3b9 Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 28 Oct 2022 20:05:53 +0200 Subject: [PATCH 1/3] fix refocusing find widget, closes #3252 --- package-lock.json | 4 ++-- src/public/app/widgets/find.js | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index b197bd93c..2f3024b08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "trilium", - "version": "0.56.1", + "version": "0.56.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "trilium", - "version": "0.56.1", + "version": "0.56.2", "hasInstallScript": true, "license": "AGPL-3.0-only", "dependencies": { diff --git a/src/public/app/widgets/find.js b/src/public/app/widgets/find.js index f165c3e5f..70116d0cb 100644 --- a/src/public/app/widgets/find.js +++ b/src/public/app/widgets/find.js @@ -142,26 +142,27 @@ export default class FindWidget extends NoteContextAwareWidget { return; } - if (!['text', 'code', 'render'].includes(this.note.type) || !this.$findBox.is(":hidden")) { + if (!['text', 'code', 'render'].includes(this.note.type)) { return; } - this.handler = await this.getHandler(); - this.$findBox.show(); this.$input.focus(); - this.$totalFound.text(0); - this.$currentFound.text(0); + this.handler = await this.getHandler(); - const searchTerm = await this.handler.getInitialSearchTerm(); + const isAlreadyVisible = this.$findBox.is(":visible"); - this.$input.val(searchTerm || ""); - - // Directly perform the search if there's some text to - // find, without delaying or waiting for enter - if (searchTerm !== "") { + if (isAlreadyVisible) { this.$input.select(); - await this.performFind(); + } else { + this.$totalFound.text(0); + this.$currentFound.text(0); + const searchTerm = await this.handler.getInitialSearchTerm(); + this.$input.val(searchTerm || ""); + if (searchTerm !== "") { + this.$input.select(); + await this.performFind(); + } } } From 38d6fddc6125a4850b5e74e997d8d52980d6069d Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 30 Oct 2022 09:05:12 +0100 Subject: [PATCH 2/3] redirect /share to /share/, closes #3264 --- src/share/routes.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/share/routes.js b/src/share/routes.js index 365bc4fba..66278fb36 100644 --- a/src/share/routes.js +++ b/src/share/routes.js @@ -109,7 +109,12 @@ function register(router) { router.use('/share/canvas_share.js', express.static(path.join(__dirname, 'canvas_share.js'))); - router.get(['/share', '/share/'], (req, res, next) => { + router.get('/share/', (req, res, next) => { + if (req.path.substr(-1) !== '/') { + res.redirect('../share/'); + return; + } + shacaLoader.ensureLoad(); renderNote(shaca.shareRootNote, req, res); From 44b85d252dbea5e8c9109689f6d404b4149ef6a2 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 1 Nov 2022 13:39:29 +0100 Subject: [PATCH 3/3] fix paste after, closes #3276 --- 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 9d8c77c2a..561189882 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -1462,7 +1462,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { clipboard.pasteInto(node.data.branchId); } - pasteNotesAfterFromClipboard({node}) { + pasteNotesAfterFromClipboardCommand({node}) { clipboard.pasteAfter(node.data.branchId); }