-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsettings.html
More file actions
197 lines (191 loc) · 5.21 KB
/
settings.html
File metadata and controls
197 lines (191 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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
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
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
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Settings</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
}
.container {
max-width: 600px;
margin: auto;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
h1,
h2 {
color: #333;
}
.section {
margin-bottom: 20px;
}
.label-item,
.file-item {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.label-item input,
.file-item input {
flex: 1;
margin-right: 10px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
}
.label-item select,
#writer {
flex: 1;
margin-right: 10px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
width: auto;
}
button {
padding: 8px 12px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
.export-button-container {
display: flex;
justify-content: flex-start;
}
.action-button-container {
display: flex;
justify-content: flex-end;
}
textarea,
input[type="text"] {
width: calc(100% - 10px);
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
}
#application-section {
display: none;
}
#application-section select,
#application-section textarea,
#application-section input[type="text"] {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
margin-bottom: 10px;
}
.application-select {
margin-top: 10px;
}
.info-text {
color: #666;
font-size: 0.9em;
}
.toggle-button {
background-color: #6c757d; /* 标准灰色 */
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
padding: 8px 12px;
display: flex;
align-items: center;
}
.toggle-button:after {
content: " ▼"; /* 向下的指示符号 */
font-size: 0.8em;
margin-left: 5px;
}
</style>
</head>
<body>
<div class="container">
<h1>Settings</h1>
<div class="section" id="labels-section">
<h2>Labels</h2>
<div id="labels"></div>
<button onclick="addLabel()">Add Label</button>
</div>
<div class="section">
<h2>Writer</h2>
<div style="display: flex; align-items: center">
<select id="writer" style="flex: 1; margin-right: 10px">
<!-- 动态添加选项 -->
</select>
<input
type="text"
id="custom-writer"
placeholder="Custom writer"
style="display: none; flex: 2"
/>
</div>
</div>
<div class="section">
<h2>Template</h2>
<textarea
id="template"
rows="4"
placeholder="Template content goes here"
></textarea>
</div>
<div class="section" id="files-section">
<h2>User Defined Files</h2>
<div id="files"></div>
<button onclick="addFile()">Add File</button>
</div>
<div class="section">
<button class="toggle-button" onclick="toggleApplication()">
Advanced
</button>
<div class="application-section" id="application-section">
<h2>Search Opener Application</h2>
<select id="application-select">
<option
value="/Applications/Visual Studio Code.app/Contents/MacOS/Electron"
>
/Applications/Visual Studio Code.app/Contents/MacOS/Electron
</option>
<option value="custom">Customize...</option>
</select>
<input
type="text"
id="application-custom"
placeholder="Customized search result viewer"
style="display: none"
/>
<div class="info-text">
Specify a specific editor to open the search content, currently only
supporting VSCode editor.
</div>
<h2>Manual Customization</h2>
<div class="info-text">
Customization config path:
<kbd><span id="setting-file-path"></span></kbd>
</div>
<h2>Export Config</h2>
<div class="export-button-container">
<button onclick="exportJson()">Export</button>
</div>
<h2>Contact Author</h2>
<div class="info-text">Wechat: hustos / Email: hustos@gmail.com</div>
</div>
</div>
<div class="action-button-container">
<button onclick="saveJson()">Save</button>
<button onclick="cancel()" style="margin-left: 10px">Cancel</button>
</div>
</div>
<script src="settings-script.js"></script>
</body>
</html>