mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
partial workaround for the broken in page search (next & previous don't work, but at least highlighting works)
This commit is contained in:
parent
8159564885
commit
3a06493459
8
package-lock.json
generated
8
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"version": "0.24.2-beta",
|
"version": "0.24.3-beta",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -10821,9 +10821,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "6.1.0",
|
"version": "6.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-6.1.2.tgz",
|
||||||
"integrity": "sha512-H3dGVdGvW2H8bnYpIDc3u3LH8Wue3Qh+Zto6aXXFzvESkTVT6rAfKR6tR/+coaUvxs8yHtmNV0uioBF62ZGSTg==",
|
"integrity": "sha512-rfUqzvz0WxmSXtJpPMX2EeASXabOrSMk1ruMOV3JBTBjo4ac2lDjGGsbQSyxj8Odhw5fBib8ZKEjDNvgouNKYw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"async-limiter": "~1.0.0"
|
"async-limiter": "~1.0.0"
|
||||||
}
|
}
|
||||||
|
@ -97,14 +97,19 @@ function registerEntrypoints() {
|
|||||||
|
|
||||||
$(document).bind('keydown', 'ctrl+f', () => {
|
$(document).bind('keydown', 'ctrl+f', () => {
|
||||||
if (utils.isElectron()) {
|
if (utils.isElectron()) {
|
||||||
alert("In page search doesn't work in this beta");
|
const $searchWindowWebview = $(".electron-in-page-search-window");
|
||||||
|
$searchWindowWebview.show();
|
||||||
|
|
||||||
// const searchInPage = require('electron-in-page-search').default;
|
const searchInPage = require('electron-in-page-search').default;
|
||||||
// const remote = require('electron').remote;
|
const {remote} = require('electron');
|
||||||
//
|
|
||||||
// const inPageSearch = searchInPage(remote.getCurrentWebContents());
|
const inPageSearch = searchInPage(remote.getCurrentWebContents(), {
|
||||||
//
|
searchWindowWebview: $searchWindowWebview[0],
|
||||||
// inPageSearch.openSearchWindow();
|
//openDevToolsOfSearchWindow: true,
|
||||||
|
customCssPath: '/libraries/electron-in-page-search/default-style.css'
|
||||||
|
});
|
||||||
|
|
||||||
|
inPageSearch.openSearchWindow();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,57 @@
|
|||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Meiryo", sans-serif;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inpage-search-body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 8px;
|
||||||
|
padding: 10px;
|
||||||
|
border: solid #aaaaaa 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inpage-search-input {
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inpage-search-matches {
|
||||||
|
color: #999;
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inpage-search-back {
|
||||||
|
margin-left: 2px;
|
||||||
|
padding-left: 6px;
|
||||||
|
padding-right: 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inpage-search-forward {
|
||||||
|
padding-left: 2px;
|
||||||
|
padding-right: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inpage-search-close {
|
||||||
|
margin-left: 4px;
|
||||||
|
padding: 0 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inpage-search-back:hover,
|
||||||
|
.inpage-search-forward:hover,
|
||||||
|
.inpage-search-close:hover {
|
||||||
|
background-color: #e2e0e2;
|
||||||
|
border-radius: 0.2em;
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes" />
|
||||||
|
<link href="/libraries/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="inpage-search-body">
|
||||||
|
<input class="inpage-search-input form-control form-control-sm" type="search" placeholder="Search..." autocomplete="off" autofocus/>
|
||||||
|
|
||||||
|
<div class="inpage-search-matches">0/0</div>
|
||||||
|
|
||||||
|
<div class="inpage-search-back" title="Previous result"><</div>
|
||||||
|
|
||||||
|
<div class="inpage-search-forward" title="Next result">></div>
|
||||||
|
|
||||||
|
<div class="inpage-search-close" title="Close search">✕</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<script>var exports = {}</script>
|
||||||
|
</html>
|
@ -214,12 +214,12 @@ div.ui-tooltip {
|
|||||||
*/
|
*/
|
||||||
.electron-in-page-search-window {
|
.electron-in-page-search-window {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 50px;
|
top: 45px;
|
||||||
right: 0;
|
right: 10px;
|
||||||
border: solid grey 1px;
|
width: 360px;
|
||||||
background-color: white;
|
height: 55px;
|
||||||
width: 300px;
|
display: none;
|
||||||
height: 36px;
|
z-index: 1001;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -187,6 +187,8 @@
|
|||||||
<% include dialogs/confirm.ejs %>
|
<% include dialogs/confirm.ejs %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<webview class="electron-in-page-search-window" nodeintegration disablewebsecurity src="/libraries/electron-in-page-search/search-window.html"></webview>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.baseApiUrl = 'api/';
|
window.baseApiUrl = 'api/';
|
||||||
window.glob = {
|
window.glob = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user