From c43b20ec2bd3497772c00d436a85761a212b5fcc Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 6 Apr 2021 21:56:46 +0200 Subject: [PATCH] script api search ignores hoisting by default --- src/public/app/services/link.js | 6 ------ src/public/app/services/search.js | 2 +- src/public/app/widgets/note_paths.js | 1 - src/routes/api/search.js | 3 ++- src/services/backend_script_api.js | 4 ++++ src/services/note_cache/note_cache_service.js | 12 +++++++++--- src/services/search/search_context.js | 10 ++++++++-- src/services/search/services/search.js | 12 ++++-------- 8 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/public/app/services/link.js b/src/public/app/services/link.js index 6a8711714..0b759ca91 100644 --- a/src/public/app/services/link.js +++ b/src/public/app/services/link.js @@ -74,12 +74,8 @@ function goToLink(e) { const $link = $(e.target).closest("a,.block-link"); - console.log("zzzzz", $link); - const notePath = getNotePathFromLink($link); - console.log() - if (notePath) { if ((e.which === 1 && e.ctrlKey) || e.which === 2) { appContext.tabManager.openTabWithNoteWithHoisting(notePath); @@ -96,8 +92,6 @@ function goToLink(e) { ) { const address = $link.attr('href'); - console.log("address", address); - if (address) { if (address.toLowerCase().startsWith('http')) { window.open(address, '_blank'); diff --git a/src/public/app/services/search.js b/src/public/app/services/search.js index 7548712a4..c031a00aa 100644 --- a/src/public/app/services/search.js +++ b/src/public/app/services/search.js @@ -6,7 +6,7 @@ async function searchForNoteIds(searchString) { } async function searchForNotes(searchString) { - const noteIds = await server.get('search/' + encodeURIComponent(searchString)); + const noteIds = await searchForNoteIds(searchString); return await treeCache.getNotes(noteIds); } diff --git a/src/public/app/widgets/note_paths.js b/src/public/app/widgets/note_paths.js index 4e6357ad3..d18a664af 100644 --- a/src/public/app/widgets/note_paths.js +++ b/src/public/app/widgets/note_paths.js @@ -1,7 +1,6 @@ import TabAwareWidget from "./tab_aware_widget.js"; import treeService from "../services/tree.js"; import linkService from "../services/link.js"; -import hoistedNoteService from "../services/hoisted_note.js"; const TPL = `