diff --git a/.idea/dataSources/a2c75661-f9e2-478f-a69f-6a9409e69997.xml b/.idea/dataSources/a2c75661-f9e2-478f-a69f-6a9409e69997.xml index 412c4d435..b28d70ee3 100644 --- a/.idea/dataSources/a2c75661-f9e2-478f-a69f-6a9409e69997.xml +++ b/.idea/dataSources/a2c75661-f9e2-478f-a69f-6a9409e69997.xml @@ -76,7 +76,6 @@ contentHash UNINDEXED 1 apiTokenId - 1 @@ -145,25 +144,20 @@ contentHash UNINDEXED 1 attributeId - 1 noteId - name value - name - value - attributeId @@ -223,21 +217,17 @@ value 1 branchId - 1 noteId parentNoteId - noteId - parentNoteId - branchId @@ -265,7 +255,6 @@ parentNoteId 1 eventId - 1 @@ -318,16 +307,13 @@ parentNoteId 1 linkId - 1 noteId - targetNoteId - linkId @@ -358,7 +344,6 @@ parentNoteId 1 noteId - 1 @@ -376,7 +361,6 @@ parentNoteId 1 k - 1 @@ -446,7 +430,6 @@ parentNoteId 1 segid term - 1 @@ -520,20 +503,16 @@ term 1 noteRevisionId - 1 noteId - utcDateModifiedFrom - utcDateModifiedTo - noteRevisionId @@ -604,7 +583,6 @@ term 1 noteId - 1 @@ -646,7 +624,6 @@ term 1 name - 1 @@ -682,7 +659,6 @@ term 1 branchId - 1 @@ -703,7 +679,6 @@ term 1 sourceId - 1 @@ -766,12 +741,10 @@ term entityName entityId - 1 utcSyncDate - id diff --git a/package-lock.json b/package-lock.json index 2b1e3960e..192dc3060 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3222,6 +3222,11 @@ } } }, + "electron-find": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/electron-find/-/electron-find-1.0.4.tgz", + "integrity": "sha512-ZZK0PaxRJU47CGUxZgpbyLz29pr/hsQdXtMPNDJfX5q6EK1zPElSAmCwtvYleTam+URZ9326XNFGTLL5CWDwUA==" + }, "electron-in-page-search": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/electron-in-page-search/-/electron-in-page-search-1.3.2.tgz", diff --git a/package.json b/package.json index 2b176e2f0..8b5fd8627 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "ejs": "2.6.1", "electron-debug": "2.1.0", "electron-dl": "1.13.0", + "electron-find": "^1.0.4", "electron-in-page-search": "1.3.2", "electron-window-state": "5.0.3", "express": "4.16.4", diff --git a/src/public/javascripts/services/entrypoints.js b/src/public/javascripts/services/entrypoints.js index a85e04e90..456d20098 100644 --- a/src/public/javascripts/services/entrypoints.js +++ b/src/public/javascripts/services/entrypoints.js @@ -118,21 +118,29 @@ function registerEntrypoints() { $("#open-dev-tools-button").click(openDevTools); } + let findInPage; + + if (utils.isElectron()) { + const { remote } = require('electron'); + const { FindInPage } = require('electron-find'); + + findInPage = new FindInPage(remote.getCurrentWebContents(), { + offsetTop: 10, + offsetRight: 10, + boxBgColor: 'var(--main-background-color)', + boxShadowColor: '#000', + inputColor: 'var(--input-text-color)', + inputBgColor: 'var(--input-background-color)', + inputFocusColor: '#555', + textColor: 'var(--main-text-color)', + textHoverBgColor: '#555', + caseSelectedColor: 'var(--main-border-color)' + }); + } + function openInPageSearch() { if (utils.isElectron()) { - const $searchWindowWebview = $(".electron-in-page-search-window"); - $searchWindowWebview.show(); - - const searchInPage = require('electron-in-page-search').default; - const {remote} = require('electron'); - - const inPageSearch = searchInPage(remote.getCurrentWebContents(), { - searchWindowWebview: $searchWindowWebview[0], - //openDevToolsOfSearchWindow: true, - customCssPath: '/libraries/electron-in-page-search/default-style.css' - }); - - inPageSearch.openSearchWindow(); + findInPage.openFindWindow(); return false; } diff --git a/src/views/desktop.ejs b/src/views/desktop.ejs index 0a3e1bd17..bdf06aec8 100644 --- a/src/views/desktop.ejs +++ b/src/views/desktop.ejs @@ -241,8 +241,6 @@ <% include dialogs/note_info.ejs %> - -