-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathoptions.html
More file actions
286 lines (250 loc) · 8.57 KB
/
Copy pathoptions.html
File metadata and controls
286 lines (250 loc) · 8.57 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
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Fluxon Options</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
margin: 0;
padding: 20px;
max-width: 800px;
margin: 0 auto;
color: #333;
background-color: #f9f9f9;
}
.card {
background: white;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
padding: 20px;
margin-bottom: 20px;
}
h2 {
margin-top: 0;
font-size: 18px;
border-bottom: 1px solid #eee;
padding-bottom: 10px;
}
.setting-row {
display: flex;
align-items: center;
margin-bottom: 15px;
}
.setting-row input[type="checkbox"] {
margin-right: 10px;
width: 16px;
height: 16px;
}
.setting-desc {
color: #666;
font-size: 13px;
margin-left: 26px;
margin-top: -5px;
margin-bottom: 15px;
}
button {
background-color: #0078d7;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
font-size: 14px;
cursor: pointer;
}
button:hover {
background-color: #0063b1;
}
button:disabled {
background-color: #ccc;
}
.danger {
background-color: #d83b01;
}
.danger:hover {
background-color: #a80000;
}
/* Rules Table */
table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
}
th,
td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f5f5f5;
}
.actions button {
padding: 4px 8px;
font-size: 12px;
margin-right: 5px;
}
#add-rule-form {
display: flex;
gap: 10px;
margin-top: 15px;
}
#add-rule-form input {
flex: 1;
padding: 6px;
border: 1px solid #ccc;
border-radius: 4px;
}
#save-msg {
color: green;
margin-left: 15px;
font-weight: bold;
opacity: 0;
transition: opacity 0.5s;
}
/* Toggle switch */
.toggle-row {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 12px 0;
border-bottom: 1px solid #f0f0f0;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-switch {
position: relative;
flex-shrink: 0;
width: 38px;
height: 22px;
margin-top: 1px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
position: absolute;
inset: 0;
background: #ccc;
border-radius: 22px;
cursor: pointer;
transition: background 0.2s;
}
.toggle-slider:before {
content: '';
position: absolute;
width: 16px; height: 16px;
left: 3px; top: 3px;
background: white;
border-radius: 50%;
transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: #0078d7; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(16px); }
.plugin-info { flex: 1; }
.plugin-name { font-weight: 600; font-size: 14px; }
.plugin-desc { color: #666; font-size: 12px; margin-top: 3px; }
</style>
<script src="i18n-helper.js"></script>
</head>
<body>
<div class="card">
<h2 data-i18n="card_general">General Settings</h2>
<div class="setting-row">
<input type="checkbox" id="enabled">
<label for="enabled"><strong data-i18n="opt_enable">Enable Fluxon</strong></label>
</div>
<div class="setting-row">
<input type="checkbox" id="nosmallfiles">
<label for="nosmallfiles"><strong data-i18n="opt_filter_size">筛选文件 size 的范围 (KB)</strong></label>
</div>
<div id="size-range-config" style="margin-left: 26px; margin-bottom: 20px;">
<div style="margin-bottom: 10px; display: flex; align-items: center; gap: 10px;">
<label for="minSize" data-i18n="lbl_min_size">最小值:</label>
<input type="number" id="minSize"
style="width: 80px; padding: 4px; border: 1px solid #ccc; border-radius: 4px;">
<label for="maxSize" style="margin-left: 10px;" data-i18n="lbl_max_size">最大值:</label>
<input type="number" id="maxSize"
style="width: 80px; padding: 4px; border: 1px solid #ccc; border-radius: 4px;">
<span style="font-size: 11px; color: #888;" data-i18n="size_no_limit">(0 表示不限制)</span>
</div>
<div class="setting-desc" style="margin: 0; line-height: 1.5; font-style: italic;" data-i18n="size_tips">
推荐配置:下载视频建议 800KB 左右;下载图片建议 200KB 左右。
</div>
</div>
<div class="setting-row">
<input type="checkbox" id="nozerofiles">
<label for="nozerofiles"><strong data-i18n="opt_ignore_zero">Ignore Zero Byte Files</strong></label>
</div>
<div class="setting-row">
<input type="checkbox" id="deduplicate">
<label for="deduplicate"><strong data-i18n="opt_deduplicate">Deduplicate Downloads</strong></label>
</div>
<div class="setting-desc" data-i18n="opt_deduplicate_desc">Do not download the same file more than once within 24
hours.</div>
<div class="setting-row">
<input type="checkbox" id="autoClean">
<label for="autoClean"><strong data-i18n="opt_auto_clean">Auto-clean history and files (24h)</strong></label>
</div>
<div class="setting-row" id="downloadToFolderRow">
<input type="checkbox" id="downloadToFolder">
<label for="downloadToFolder"><strong data-i18n="opt_download_to_folder">Organize downloads into Date/Domain subfolders</strong></label>
</div>
<div id="downloadToFolderDesc" class="setting-desc" data-i18n="opt_download_to_folder_desc">Groups saved files inside folders named by the current date and the website's domain. Uncheck to save directly to your Downloads folder with the date and domain as part of the filename.</div>
</div>
<div class="card">
<h2 data-i18n="card_rules">Capture Rules</h2>
<p class="setting-desc" data-i18n="opt_rules_desc">Configure which URLs and Content-Type patterns should be intercepted.
Uses <a href="https://en.wikipedia.org/wiki/Regular_expression" target="_blank">regular expressions (regex)</a>.</p>
<table id="rules-table">
<thead>
<tr>
<th width="5%" data-i18n="th_rule_enabled">Auto Download</th>
<th width="35%" data-i18n="th_url_pattern">URL Regex</th>
<th width="30%" data-i18n="th_content_type">Content-Type Regex</th>
<th width="15%" data-i18n="th_tag">Tag</th>
<th width="15%" data-i18n="th_action">Actions</th>
</tr>
</thead>
<tbody>
<!-- JS will populate rules -->
</tbody>
</table>
<div id="add-rule-form">
<input type="text" id="new-url" data-i18n-placeholder="ph_url" placeholder="URL Pattern (e.g. .*)">
<input type="text" id="new-ct" data-i18n-placeholder="ph_ct" placeholder="Content-Type Pattern (e.g. video/.*)">
<select id="new-tag" style="padding: 6px; border: 1px solid #ccc; border-radius: 4px;">
<option value="" data-i18n="opt_tag_empty">(Empty)</option>
<option value="video" data-i18n="opt_tag_video">Video</option>
<option value="audio" data-i18n="opt_tag_audio">Audio</option>
<option value="image" data-i18n="opt_tag_image">Image</option>
</select>
<button id="add-rule-btn" data-i18n="btn_add_rule">Add</button>
</div>
</div>
<div class="card">
<h2 data-i18n="title_ignored_extensions">Ignored Extensions</h2>
<p class="setting-desc" data-i18n="opt_ignored_extensions_desc">List of file extensions to skip during capture.</p>
<table id="extensions-table">
<thead>
<tr>
<th width="80%" data-i18n="th_extension">Extension</th>
<th width="20%" data-i18n="th_action">Actions</th>
</tr>
</thead>
<tbody>
<!-- JS will populate extensions -->
</tbody>
</table>
<div id="add-extension-form" style="display: flex; gap: 10px; margin-top: 15px;">
<input type="text" id="new-extension" data-i18n-placeholder="ph_extension" placeholder=".gif, .svg, .ico" style="flex: 1; padding: 6px; border: 1px solid #ccc; border-radius: 4px;">
<button id="add-extension-btn" data-i18n="btn_add_extension">Add Extension</button>
</div>
</div>
<div class="card">
<h2>Plugins</h2>
<p class="setting-desc">Enable or disable built-in plugins.</p>
<div id="plugins-list">
<!-- JS will populate -->
</div>
</div>
<script src="options.js"></script>
</body>
</html>