@mytools-all/mytools-search 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -21
- package/app.mjs +476 -391
- package/common.mjs +69 -69
- package/index.html +246 -231
- package/package.json +45 -41
- package/plugin.json +34 -30
- package/resultPresentation.mjs +22 -0
- package/searchQuery.mjs +22 -22
- package/tool.css +295 -295
- package/utils.mjs +201 -201
package/common.mjs
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
export const $ = (selector) => document.querySelector(selector);
|
|
2
|
-
export const $$ = (selector) => [...document.querySelectorAll(selector)];
|
|
3
|
-
export function status(text, error = false) {
|
|
4
|
-
const el = $("#status");
|
|
5
|
-
if (el) {
|
|
6
|
-
el.textContent = text;
|
|
7
|
-
el.dataset.error = String(error);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export function action(fn) {
|
|
11
|
-
return async (...args) => {
|
|
12
|
-
try {
|
|
13
|
-
return await fn(...args);
|
|
14
|
-
} catch (e) {
|
|
15
|
-
status(e.message || String(e), true);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export async function call(id, args = {}) {
|
|
20
|
-
if (!window.mytools) throw Error("请从 MyTools 打开此工具");
|
|
21
|
-
return window.mytools.call(id, args);
|
|
22
|
-
}
|
|
23
|
-
export const copy = async (text) => {
|
|
24
|
-
await call("clipboard.write", { text: String(text) });
|
|
25
|
-
status("已复制到剪贴板");
|
|
26
|
-
};
|
|
27
|
-
export function ready(fn) {
|
|
28
|
-
if (window.mytools) window.mytools.onPluginReady(action(fn));
|
|
29
|
-
else status("预览模式:系统能力需从 MyTools 使用");
|
|
30
|
-
}
|
|
31
|
-
export const escapeHtml = (text) =>
|
|
32
|
-
String(text).replace(
|
|
33
|
-
/[&<>"']/g,
|
|
34
|
-
(c) =>
|
|
35
|
-
({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[
|
|
36
|
-
c
|
|
37
|
-
],
|
|
38
|
-
);
|
|
39
|
-
export function download(name, text, type = "text/plain") {
|
|
40
|
-
const url = URL.createObjectURL(new Blob([text], { type }));
|
|
41
|
-
const a = document.createElement("a");
|
|
42
|
-
a.href = url;
|
|
43
|
-
a.download = name;
|
|
44
|
-
a.click();
|
|
45
|
-
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
46
|
-
}
|
|
47
|
-
export function debounce(fn, ms = 200) {
|
|
48
|
-
let timer;
|
|
49
|
-
return (...args) => {
|
|
50
|
-
clearTimeout(timer);
|
|
51
|
-
timer = setTimeout(() => fn(...args), ms);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export const formatBytes = (n) =>
|
|
55
|
-
n < 1024
|
|
56
|
-
? n + " B"
|
|
57
|
-
: n < 1048576
|
|
58
|
-
? (n / 1024).toFixed(1) + " KB"
|
|
59
|
-
: (n / 1048576).toFixed(1) + " MB";
|
|
60
|
-
const savedTheme = localStorage.getItem("tool-theme");
|
|
61
|
-
document.documentElement.dataset.theme =
|
|
62
|
-
savedTheme ||
|
|
63
|
-
(matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
|
64
|
-
$("#theme")?.addEventListener("click", () => {
|
|
65
|
-
const theme =
|
|
66
|
-
document.documentElement.dataset.theme === "dark" ? "light" : "dark";
|
|
67
|
-
document.documentElement.dataset.theme = theme;
|
|
68
|
-
localStorage.setItem("tool-theme", theme);
|
|
69
|
-
});
|
|
1
|
+
export const $ = (selector) => document.querySelector(selector);
|
|
2
|
+
export const $$ = (selector) => [...document.querySelectorAll(selector)];
|
|
3
|
+
export function status(text, error = false) {
|
|
4
|
+
const el = $("#status");
|
|
5
|
+
if (el) {
|
|
6
|
+
el.textContent = text;
|
|
7
|
+
el.dataset.error = String(error);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export function action(fn) {
|
|
11
|
+
return async (...args) => {
|
|
12
|
+
try {
|
|
13
|
+
return await fn(...args);
|
|
14
|
+
} catch (e) {
|
|
15
|
+
status(e.message || String(e), true);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export async function call(id, args = {}) {
|
|
20
|
+
if (!window.mytools) throw Error("请从 MyTools 打开此工具");
|
|
21
|
+
return window.mytools.call(id, args);
|
|
22
|
+
}
|
|
23
|
+
export const copy = async (text) => {
|
|
24
|
+
await call("clipboard.write", { text: String(text) });
|
|
25
|
+
status("已复制到剪贴板");
|
|
26
|
+
};
|
|
27
|
+
export function ready(fn) {
|
|
28
|
+
if (window.mytools) window.mytools.onPluginReady(action(fn));
|
|
29
|
+
else status("预览模式:系统能力需从 MyTools 使用");
|
|
30
|
+
}
|
|
31
|
+
export const escapeHtml = (text) =>
|
|
32
|
+
String(text).replace(
|
|
33
|
+
/[&<>"']/g,
|
|
34
|
+
(c) =>
|
|
35
|
+
({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[
|
|
36
|
+
c
|
|
37
|
+
],
|
|
38
|
+
);
|
|
39
|
+
export function download(name, text, type = "text/plain") {
|
|
40
|
+
const url = URL.createObjectURL(new Blob([text], { type }));
|
|
41
|
+
const a = document.createElement("a");
|
|
42
|
+
a.href = url;
|
|
43
|
+
a.download = name;
|
|
44
|
+
a.click();
|
|
45
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
46
|
+
}
|
|
47
|
+
export function debounce(fn, ms = 200) {
|
|
48
|
+
let timer;
|
|
49
|
+
return (...args) => {
|
|
50
|
+
clearTimeout(timer);
|
|
51
|
+
timer = setTimeout(() => fn(...args), ms);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export const formatBytes = (n) =>
|
|
55
|
+
n < 1024
|
|
56
|
+
? n + " B"
|
|
57
|
+
: n < 1048576
|
|
58
|
+
? (n / 1024).toFixed(1) + " KB"
|
|
59
|
+
: (n / 1048576).toFixed(1) + " MB";
|
|
60
|
+
const savedTheme = localStorage.getItem("tool-theme");
|
|
61
|
+
document.documentElement.dataset.theme =
|
|
62
|
+
savedTheme ||
|
|
63
|
+
(matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
|
64
|
+
$("#theme")?.addEventListener("click", () => {
|
|
65
|
+
const theme =
|
|
66
|
+
document.documentElement.dataset.theme === "dark" ? "light" : "dark";
|
|
67
|
+
document.documentElement.dataset.theme = theme;
|
|
68
|
+
localStorage.setItem("tool-theme", theme);
|
|
69
|
+
});
|
package/index.html
CHANGED
|
@@ -1,231 +1,246 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
6
|
-
<title>本地搜索</title>
|
|
7
|
-
<link rel="stylesheet" href="tool.css" />
|
|
8
|
-
<style>
|
|
9
|
-
.search-layout {
|
|
10
|
-
display: grid;
|
|
11
|
-
grid-template-columns: 142px minmax(0, 1fr);
|
|
12
|
-
flex: 1;
|
|
13
|
-
min-height: 0;
|
|
14
|
-
}
|
|
15
|
-
.filters {
|
|
16
|
-
border-right: 1px solid var(--border);
|
|
17
|
-
background: var(--bg);
|
|
18
|
-
padding: 14px 0;
|
|
19
|
-
overflow: auto;
|
|
20
|
-
}
|
|
21
|
-
.filters strong {
|
|
22
|
-
display: block;
|
|
23
|
-
padding: 0 14px 14px;
|
|
24
|
-
}
|
|
25
|
-
.filters button {
|
|
26
|
-
display: block;
|
|
27
|
-
text-align: left;
|
|
28
|
-
width: 100%;
|
|
29
|
-
border: 0;
|
|
30
|
-
border-radius: 0;
|
|
31
|
-
padding: 10px 18px;
|
|
32
|
-
color: var(--muted);
|
|
33
|
-
}
|
|
34
|
-
.filters button.active {
|
|
35
|
-
color: var(--accent);
|
|
36
|
-
background: var(--soft);
|
|
37
|
-
}
|
|
38
|
-
.search-main {
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
min-width: 0;
|
|
42
|
-
min-height: 0;
|
|
43
|
-
}
|
|
44
|
-
.search-field {
|
|
45
|
-
display: flex;
|
|
46
|
-
gap: 8px;
|
|
47
|
-
padding: 10px;
|
|
48
|
-
border-bottom: 1px solid var(--border);
|
|
49
|
-
}
|
|
50
|
-
.search-field input {
|
|
51
|
-
flex: 1;
|
|
52
|
-
font-size: 15px;
|
|
53
|
-
}
|
|
54
|
-
.results {
|
|
55
|
-
flex: 1;
|
|
56
|
-
overflow: auto;
|
|
57
|
-
outline: none;
|
|
58
|
-
min-height: 0;
|
|
59
|
-
}
|
|
60
|
-
.result {
|
|
61
|
-
display: grid;
|
|
62
|
-
grid-template-columns: 34px minmax(0, 1fr) 110px;
|
|
63
|
-
gap: 10px;
|
|
64
|
-
align-items: center;
|
|
65
|
-
padding: 10px 14px;
|
|
66
|
-
border-bottom: 1px solid var(--border);
|
|
67
|
-
cursor: default;
|
|
68
|
-
}
|
|
69
|
-
.result.selected {
|
|
70
|
-
background: var(--soft);
|
|
71
|
-
}
|
|
72
|
-
.file-icon {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
flex:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
color:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
.
|
|
141
|
-
.
|
|
142
|
-
.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
<
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
6
|
+
<title>本地搜索</title>
|
|
7
|
+
<link rel="stylesheet" href="tool.css" />
|
|
8
|
+
<style>
|
|
9
|
+
.search-layout {
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-columns: 142px minmax(0, 1fr);
|
|
12
|
+
flex: 1;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
}
|
|
15
|
+
.filters {
|
|
16
|
+
border-right: 1px solid var(--border);
|
|
17
|
+
background: var(--bg);
|
|
18
|
+
padding: 14px 0;
|
|
19
|
+
overflow: auto;
|
|
20
|
+
}
|
|
21
|
+
.filters strong {
|
|
22
|
+
display: block;
|
|
23
|
+
padding: 0 14px 14px;
|
|
24
|
+
}
|
|
25
|
+
.filters button {
|
|
26
|
+
display: block;
|
|
27
|
+
text-align: left;
|
|
28
|
+
width: 100%;
|
|
29
|
+
border: 0;
|
|
30
|
+
border-radius: 0;
|
|
31
|
+
padding: 10px 18px;
|
|
32
|
+
color: var(--muted);
|
|
33
|
+
}
|
|
34
|
+
.filters button.active {
|
|
35
|
+
color: var(--accent);
|
|
36
|
+
background: var(--soft);
|
|
37
|
+
}
|
|
38
|
+
.search-main {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
min-height: 0;
|
|
43
|
+
}
|
|
44
|
+
.search-field {
|
|
45
|
+
display: flex;
|
|
46
|
+
gap: 8px;
|
|
47
|
+
padding: 10px;
|
|
48
|
+
border-bottom: 1px solid var(--border);
|
|
49
|
+
}
|
|
50
|
+
.search-field input {
|
|
51
|
+
flex: 1;
|
|
52
|
+
font-size: 15px;
|
|
53
|
+
}
|
|
54
|
+
.results {
|
|
55
|
+
flex: 1;
|
|
56
|
+
overflow: auto;
|
|
57
|
+
outline: none;
|
|
58
|
+
min-height: 0;
|
|
59
|
+
}
|
|
60
|
+
.result {
|
|
61
|
+
display: grid;
|
|
62
|
+
grid-template-columns: 34px minmax(0, 1fr) 110px;
|
|
63
|
+
gap: 10px;
|
|
64
|
+
align-items: center;
|
|
65
|
+
padding: 10px 14px;
|
|
66
|
+
border-bottom: 1px solid var(--border);
|
|
67
|
+
cursor: default;
|
|
68
|
+
}
|
|
69
|
+
.result.selected {
|
|
70
|
+
background: var(--soft);
|
|
71
|
+
}
|
|
72
|
+
.file-icon {
|
|
73
|
+
display:flex;
|
|
74
|
+
align-items:center;
|
|
75
|
+
justify-content:center;
|
|
76
|
+
width:32px;
|
|
77
|
+
height:32px;
|
|
78
|
+
}
|
|
79
|
+
.file-icon img { width:28px; height:28px; object-fit:contain; }
|
|
80
|
+
.file-name {
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
text-overflow: ellipsis;
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
}
|
|
86
|
+
.file-path {
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
color: var(--muted);
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
text-overflow: ellipsis;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
}
|
|
93
|
+
.meta {
|
|
94
|
+
font-size: 11px;
|
|
95
|
+
color: var(--muted);
|
|
96
|
+
text-align: right;
|
|
97
|
+
}
|
|
98
|
+
.body-row {
|
|
99
|
+
display: flex;
|
|
100
|
+
flex: 1;
|
|
101
|
+
min-height: 0;
|
|
102
|
+
}
|
|
103
|
+
.preview {
|
|
104
|
+
flex: 0 0 35%;
|
|
105
|
+
padding: 14px;
|
|
106
|
+
border-left: 1px solid var(--border);
|
|
107
|
+
overflow: auto;
|
|
108
|
+
min-width: 0;
|
|
109
|
+
}
|
|
110
|
+
.preview img {
|
|
111
|
+
max-width: 100%;
|
|
112
|
+
}
|
|
113
|
+
#connection {
|
|
114
|
+
padding: 16px;
|
|
115
|
+
margin: 20px;
|
|
116
|
+
border: 1px solid var(--border);
|
|
117
|
+
border-radius: 6px;
|
|
118
|
+
}
|
|
119
|
+
.bottom {
|
|
120
|
+
padding: 6px 10px;
|
|
121
|
+
gap: 6px;
|
|
122
|
+
font-size: 12px;
|
|
123
|
+
}
|
|
124
|
+
.bottom button,
|
|
125
|
+
.bottom select {
|
|
126
|
+
padding: 4px 8px;
|
|
127
|
+
}
|
|
128
|
+
mark {
|
|
129
|
+
background: #ffe87d;
|
|
130
|
+
color: #333;
|
|
131
|
+
}
|
|
132
|
+
.hintline {
|
|
133
|
+
padding: 3px 12px;
|
|
134
|
+
color: var(--muted);
|
|
135
|
+
font-size: 11px;
|
|
136
|
+
}
|
|
137
|
+
#history {
|
|
138
|
+
max-width: 150px;
|
|
139
|
+
}
|
|
140
|
+
.filter-settings { padding:12px; font-size:12px; }.filter-settings input { width:100%; box-sizing:border-box; margin:5px 0; }.filter-settings button { font-size:11px; }.filter-settings summary { cursor:pointer; color:var(--muted); }
|
|
141
|
+
.filter-settings summary { color:var(--fg); font-weight:600; margin-bottom:8px; }
|
|
142
|
+
.custom-filter { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:11px 0; border-top:1px solid var(--border); }
|
|
143
|
+
.custom-filter__text { flex:1 1 56px; min-width:0; }
|
|
144
|
+
.custom-filter__text strong { padding:0; margin:0 0 3px; color:var(--fg); overflow-wrap:anywhere; font-size:12px; }
|
|
145
|
+
.custom-filter__text code { display:block; color:var(--muted); font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
146
|
+
.filters .filter-delete { display:inline-flex; width:auto; flex:none; align-items:center; justify-content:center; gap:4px; min-height:30px; padding:5px 7px; border:1px solid color-mix(in srgb,var(--danger) 40%,var(--border)); border-radius:6px; color:var(--danger); background:color-mix(in srgb,var(--danger) 7%,var(--bg)); font-size:11px; font-weight:600; }
|
|
147
|
+
.filters .filter-delete:hover { color:var(--danger); border-color:var(--danger); background:color-mix(in srgb,var(--danger) 16%,var(--bg)); }
|
|
148
|
+
.filters .filter-delete:focus-visible { outline:2px solid var(--danger); outline-offset:2px; }
|
|
149
|
+
.filter-delete svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
|
|
150
|
+
.filter-empty { color:var(--muted); margin:10px 0 0; font-size:11px; }
|
|
151
|
+
#save-filter { margin:4px 0 10px; border:1px solid var(--border); border-radius:6px; text-align:center; padding:7px; color:var(--accent); }
|
|
152
|
+
.preview iframe { width:100%; min-height:320px; border:0; }.preview video,.preview audio { width:100%; }
|
|
153
|
+
.advanced-filters { display:flex; flex-wrap:wrap; gap:10px; padding:10px; border-bottom:1px solid var(--border); background:var(--bg); }
|
|
154
|
+
.advanced-filters label { display:flex; align-items:center; gap:6px; font-size:12px; }
|
|
155
|
+
.advanced-filters input { width:140px; }
|
|
156
|
+
.preview-meta { white-space:pre-wrap; overflow-wrap:anywhere; color:var(--muted); font-size:11px; margin:10px 0 16px; }
|
|
157
|
+
.bottom { flex-wrap:wrap; }
|
|
158
|
+
@media (max-width: 650px) {
|
|
159
|
+
.search-layout {
|
|
160
|
+
grid-template-columns: 100px 1fr;
|
|
161
|
+
}
|
|
162
|
+
.filters button {
|
|
163
|
+
padding: 9px 12px;
|
|
164
|
+
}
|
|
165
|
+
.result {
|
|
166
|
+
grid-template-columns: 26px minmax(0, 1fr);
|
|
167
|
+
}
|
|
168
|
+
.meta {
|
|
169
|
+
display: none;
|
|
170
|
+
}
|
|
171
|
+
.preview {
|
|
172
|
+
flex-basis: 45%;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
</style>
|
|
176
|
+
</head>
|
|
177
|
+
<body>
|
|
178
|
+
<main>
|
|
179
|
+
<div class="search-layout">
|
|
180
|
+
<aside class="filters">
|
|
181
|
+
<strong>过滤项</strong>
|
|
182
|
+
<nav id="types"></nav>
|
|
183
|
+
<details class="filter-settings"><summary>管理过滤项</summary><input id="filter-name" placeholder="名称" aria-label="过滤项名称" /><input id="filter-query" placeholder="例如 ext:rs;ts" aria-label="过滤项条件" /><button id="save-filter">+ 新增过滤项</button><div id="custom-filter-list"></div></details>
|
|
184
|
+
</aside>
|
|
185
|
+
<section class="search-main">
|
|
186
|
+
<div class="search-field">
|
|
187
|
+
<input
|
|
188
|
+
id="query"
|
|
189
|
+
placeholder="搜索文件、文件夹…(支持 Everything 语法)"
|
|
190
|
+
aria-label="搜索文件"
|
|
191
|
+
autocomplete="off"
|
|
192
|
+
/><button id="filter-toggle" aria-expanded="false">筛选</button><button id="refresh" title="刷新">↻</button
|
|
193
|
+
><button id="theme" title="切换主题">◐</button>
|
|
194
|
+
</div>
|
|
195
|
+
<div id="advanced-filters" class="advanced-filters hidden">
|
|
196
|
+
<label>扩展名 <input id="extension-filter" placeholder="txt;md;pdf" /></label>
|
|
197
|
+
<label>排除 <input id="exclude-filter" placeholder="名称或路径,分号分隔" /></label>
|
|
198
|
+
<label>修改时间 <select id="modified-period"><option value="">不限</option><option value="today">今天</option><option value="yesterday">昨天</option><option value="thisweek">本周</option><option value="thismonth">本月</option><option value="custom">自定义日期</option></select></label>
|
|
199
|
+
<span id="date-range" class="hidden"><input id="modified-from" type="date" aria-label="开始日期" /> 至 <input id="modified-to" type="date" aria-label="结束日期" /></span>
|
|
200
|
+
<button id="reset-filters">重置筛选</button>
|
|
201
|
+
</div>
|
|
202
|
+
<div class="hintline">
|
|
203
|
+
↑↓ 选择 · Enter 打开 · Ctrl+Enter 定位 · 空格预览
|
|
204
|
+
</div>
|
|
205
|
+
<div id="connection" class="hidden">
|
|
206
|
+
<strong>未连接到 Everything</strong>
|
|
207
|
+
<p id="connection-message">请启动 Everything 并等待索引就绪。</p>
|
|
208
|
+
<div class="row">
|
|
209
|
+
<button id="start" class="primary">启动已安装的 Everything</button
|
|
210
|
+
><button id="retry">重新连接</button>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
<div class="body-row">
|
|
214
|
+
<div
|
|
215
|
+
id="results"
|
|
216
|
+
class="results"
|
|
217
|
+
tabindex="0"
|
|
218
|
+
role="listbox"
|
|
219
|
+
aria-label="搜索结果"
|
|
220
|
+
></div>
|
|
221
|
+
<section id="preview" class="preview hidden"></section>
|
|
222
|
+
</div>
|
|
223
|
+
<div class="toolbar bottom">
|
|
224
|
+
<select id="sort" aria-label="排序">
|
|
225
|
+
<option value="1">按名称升序</option>
|
|
226
|
+
<option value="2">按名称降序</option>
|
|
227
|
+
<option value="13">按修改时间升序</option>
|
|
228
|
+
<option value="14">按修改时间降序</option>
|
|
229
|
+
<option value="5">按大小升序</option>
|
|
230
|
+
<option value="6">按大小降序</option>
|
|
231
|
+
<option value="3">按路径升序</option><option value="4">按路径降序</option><option value="7">按扩展名升序</option><option value="8">按扩展名降序</option></select
|
|
232
|
+
><select id="history" aria-label="搜索历史">
|
|
233
|
+
<option value="">搜索历史</option></select
|
|
234
|
+
><span class="spacer"></span><button id="previous">‹</button
|
|
235
|
+
><span id="count">0 / 0</span><button id="next">›</button
|
|
236
|
+
><button id="preview-toggle">预览面板</button
|
|
237
|
+
><button id="open">打开</button><button id="reveal">定位</button
|
|
238
|
+
><button id="copy">复制路径</button>
|
|
239
|
+
</div>
|
|
240
|
+
</section>
|
|
241
|
+
</div>
|
|
242
|
+
<footer id="status" class="status" role="status"></footer>
|
|
243
|
+
</main>
|
|
244
|
+
<script type="module" src="app.mjs"></script>
|
|
245
|
+
</body>
|
|
246
|
+
</html>
|