-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathoptions.html
467 lines (438 loc) · 19.5 KB
/
options.html
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
<!DOCTYPE html>
<html lang="en">
<head>
<title>ArchiveBox Collector - Options</title>
<meta charset="UTF-8">
<link href="bootstrap.min.css" rel="stylesheet">
<style>
.list-group-item code {
background-color: #fdfaff;
padding: 3px 10px;
font-size: 13px;
border-radius: 4px;
text-overflow: ellipsis;
width: 96%;
white-space: nowrap;
display: inline-block;
overflow: hidden;
padding-left: 26px;
border-radius: 10px 4px 4px 10px;
margin-left: -26px;
z-index: 200;
position: relative;
}
.list-group-item img.favicon {
vertical-align: 1px;
margin-right: 4px;
width: 20px; height: 20px;
border-radius: 50%;
position: relative;
z-index: 400;
}
.container-full {
padding-left: 10px;
padding-right: 10px;
}
body, html {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow-x: hidden;
}
input[type=search]::-webkit-search-cancel-button {
-webkit-appearance: searchfield-cancel-button;
}
.col-lg-7 {
padding-bottom: 0px;
margin-bottom: 0px;
}
.nav-tabs {
margin-bottom: 20px;
}
.form-text {
font-size: 0.85em;
color: #666;
}
.status-indicator {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 50%;
margin-left: 8px;
}
.status-success {
background: #28a745;
}
.status-error {
background: #dc3545;
}
.test-section {
margin-top: 2rem;
padding-top: 1rem;
border-top: 1px solid #dee2e6;
}
.sync-status {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-left: 8px;
vertical-align: middle;
}
.sync-status.status-success {
background: #28a745;
}
.sync-status.status-error {
background: #dc3545;
}
@keyframes pulse {
0% { background-color: #28a745; }
50% { background-color: #dedede; }
100% { background-color: #28a745; }
}
</style>
</head>
<body class="container-full py-4">
<ul class="nav nav-tabs" id="optionsTabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="urls-tab" data-bs-toggle="tab" href="#urls" role="tab">📦 Saved URLs</a>
</li>
<li class="nav-item">
<a class="nav-link" id="config-tab" data-bs-toggle="tab" href="#config" role="tab">⚙️ Server Configuration</a>
</li>
<li class="nav-item">
<a class="nav-link" id="personas-tab" data-bs-toggle="tab" href="#personas" role="tab">👤 Authentication Profiles</a>
</li>
<li class="nav-item">
<a class="nav-link" id="import-tab" data-bs-toggle="tab" href="#import" role="tab">📤 Bulk Import URLs</a>
</li>
</ul>
<div class="tab-content">
<!-- URLs Tab (existing content) -->
<div class="tab-pane fade show active" id="urls" role="tabpanel">
<div class="row mt-4">
<div class="col-md-10">
<div class="d-flex gap-2 mb-3">
<div class="btn-group">
<button class="btn btn-outline-secondary" id="selectAllUrls">☑️ Select All</button>
<button class="btn btn-outline-secondary" id="deselectAllUrls">☐ Deselect All</button>
</div>
<div class="btn-group flex-grow-1">
<label class="input-group-text" aria-label="Search" for="filterInput">🔍</label>
<input type="search" class="form-control" id="filterInput" placeholder="Filter entries...">
<span class="input-group-text">
Selected: <span id="selectedUrlCount" class="ms-1">0</span>
</span>
</div>
<div class="btn-group">
<button class="btn btn-outline-secondary" id="editTags" data-bs-toggle="modal" data-bs-target="#editTagsModal">
✏️ Tags
</button>
</div>
<div class="btn-group">
<button class="btn btn-outline-secondary" id="downloadCsv">⬇️ CSV</button>
<button class="btn btn-outline-secondary" id="downloadJson">⬇️ JSON</button>
</div>
<div class="btn-group">
<button class="btn btn-outline-danger" id="deleteFiltered">🗑️ Delete</button>
</div>
<div class="btn-group">
<button class="btn btn-success" id="syncFiltered">⬆️ Sync to ArchiveBox</button>
</div>
</div>
<div class="d-flex gap-2 mb-3">
</div>
<div id="entriesList" class="list-group"></div>
</div>
<div class="col-md-2">
<h2>Tags</h2>
<div id="tagsList" class="list-group"></div>
</div>
</div>
</div>
<!-- Edit Tags Modal -->
<div class="modal fade" id="editTagsModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Edit Tags</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label class="form-label">Current Tags</label>
<div id="currentTagsList" class="mb-2"></div>
</div>
<div class="mb-3">
<label class="form-label">Add Tag</label>
<div class="position-relative">
<input type="text" class="form-control" id="addTagInput" placeholder="Type to add tag...">
<div id="tagAutocomplete" class="dropdown-menu w-100"></div>
</div>
</div>
<small class="text-muted">
Selected entries: <span id="selectedUrlCountModal">0</span>
</small>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="saveTagChanges">Save Changes</button>
</div>
</div>
</div>
</div>
<!-- Config Tab -->
<div class="tab-pane fade" id="config" role="tabpanel">
<div class="row mt-4">
<div class="col-md-8">
<form id="configForm" class="needs-validation" novalidate>
<div class="mb-3">
<label for="archivebox_server_url" class="form-label"><b>📟 ArchiveBox Server URL *</b></label>
<div class="input-group">
<input type="url" class="form-control" id="archivebox_server_url"
placeholder="https://archivebox.example.com">
<button type="button" id="loginServer" class="btn btn-outline-secondary">
⚙️ ADMIN UI
</button>
<button type="button" id="testServer" class="btn btn-outline-secondary">
TEST SERVER
<span class="status-indicator" id="serverStatus"></span>
</button>
</div>
<div class="form-text">
The base URL of your self-hosted <a href="https://github.com/ArchiveBox/archivebox#quickstart">ArchiveBox</a> server, e.g. <code>http://localhost:8000</code><br/>
This extension works by sending URLs from the browser to your remote ArchiveBox server via the <a href="https://demo.archivebox.io/docs/api/overview/">ArchiveBox REST API</a>.
<span id="serverStatusText" class="ms-2"></span>
</div>
</div>
<div class="mb-3">
<label for="archivebox_api_key" class="form-label"><b>🔐 ArchiveBox API Token</b></label>
<div class="input-group">
<input type="text" class="form-control" id="archivebox_api_key"
pattern="^[a-f0-9]{32}$"
placeholder="... abcexamplekey1234 ...">
<button type="button" id="generateApiKey" class="btn btn-outline-secondary">
🔑 GENERATE
</button>
<button type="button" id="testApiKey" class="btn btn-outline-secondary">
TEST API KEY
<span class="status-indicator" id="apiKeyStatus"></span>
</button>
</div>
<div class="form-text">
If the server is running ArchiveBox <code>>= v0.8.5</code>: <a href="#" id="generateApiKeyLink">Log In to your Admin UI & generate an API Token</a>, copy the <code>Token</code> value, set an <code>Expiration Date</code>, click <code>Save</code>, then paste the value here.<br/>
If the server is running ArchiveBox <code><= v0.7.3</code>: <a href="#" id="loginAdminUILink">Log In to your Admin UI</a> in this browser every 2 weeks and <i>leave this field blank</i>. To allow submitting URLs without requiring a login, run: <code>archivebox config --set PUBLIC_ADD_VIEW=True</code><br/>
<br/>
For detailed instructions and troubleshooting tips see the <a href="https://github.com/ArchiveBox/archivebox-browser-extension">ArchiveBox Extension Documentation</a> and <a href="https://github.com/ArchiveBox/archivebox/wiki/Configuration#public_index--public_snapshots--public_add_view">ArchiveBox Config Documentation</a> on Github.
<span id="apiKeyStatusText" class="ms-2"></span>
</div>
</div>
<br/><br/>
<hr/>
<br/><br/>
<div class="mb-3">
<label for="match_urls" class="form-label">🔍 Match URL Patterns</label>
<input type="text" class="form-control" id="match_urls" value="(youtube.com)|(wikipedia.org)|(reddit.com)|(news.ycombinator.com)|(x.com)|(github.com)"
placeholder="(youtube.com)|(wikipedia.org)|(reddit.com)|(news.ycombinator.com)|(x.com)|(github.com)">
<div class="form-text">By default sites are only archived when the extension icon is clicked. To archive some sites automatically whenever they are visited, specify them as a <a href="https://regexr.com/8d19s">regex</a> here. To archive <i>all</i> visited pages (not recommended), set this to: <code>.*</code></div>
</div>
<div class="mb-3">
<label for="exclude_urls" class="form-label">🚫 Exclude URL Patterns</label>
<input type="text" class="form-control" id="exclude_urls"
placeholder=":\/\/(mail.google.com)" value=":\/\/(mail.google.com)">
<div class="form-text"><a href="regexr.com/8d19v">Regex of URLs</a> to never auotomatically archive (overrides the setting above). Exclude sensitive domains like your email inbox, corporate documents provider, banking sites, etc. here.</div>
</div>
<br/><br/>
<div class="mb-3" style="background-color: #dfebfd; padding: 5px; border-radius: 6px;">
<label for="testUrl" class="form-label">🔍 Test the patterns and try adding a URL</label><span class="status-indicator mt-2" id="urlStatus" style="display:none;"></span>
<div class="input-group">
<input type="url" class="form-control" id="testUrl"
placeholder="Enter a URL to test against patterns">
<button type="button" id="testAdding" class="btn btn-outline-secondary" style="background-color: #dfebfd;">
TEST ADDING
<span class="status-indicator" id="addingStatus"></span>
</button>
</div>
<div class="form-text">
<span id="urlStatusText" class="ms-2"></span>
<span id="addingStatusText" class="ms-2"></span>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- Personas Tab -->
<div class="tab-pane fade" id="personas" role="tabpanel">
<div class="row mt-4">
<div class="col-md-12">
<div class="alert alert-info">
Import cookies from this browser into to an archiving profile to re-use those credentials for logged-in archiving.
</div>
<!-- Persona List -->
<div class="card mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<h5 class="mb-0" style="min-width: 150px;">Archiving Profile</h5>
<select class="form-select" id="activePersona">
<option value="">Select a profile...</option>
</select>
<div id="personaStats" class="text-muted small" style="min-width: 150px"></div>
<button class="btn btn-primary" id="newPersona" style="min-width: 95px">
➕ New
</button>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table" id="personaTable">
<thead>
<tr>
<th>Name</th>
<th>Domains</th>
<th>Last Used</th>
<th style="width: 50%;">Settings</th>
<th>Actions</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
<!-- Cookie Import Section -->
<div class="card">
<div class="card-header">
<h5 class="mb-0">Import Browser Cookies to Archiving Profile</h5>
</div>
<div class="card-body">
<div class="d-flex justify-content-between align-items-center mb-3">
<div>
<button class="btn btn-outline-secondary" id="selectAllCookies">Select All</button>
<button class="btn btn-outline-secondary" id="deselectAllCookies">Deselect All</button>
</div>
<div class="input-group" style="max-width: 800px;">
<span class="input-group-text">🔎</span>
<input type="search" class="form-control" id="cookieFilter" placeholder="Filter domains...">
</div>
<button class="btn btn-success" id="importCookies" disabled>
Import Cookies to Active Profile <i class="bi bi-arrow-right"></i>
</button>
</div>
<div class="table-responsive">
<table class="table" id="cookieTable">
<thead>
<tr>
<th style="width: 40px;"></th>
<th>Domain</th>
<th style="width: 100px;">Cookies</th>
<th>Export <code>cookies.txt</code></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="d-flex justify-content-between align-items-center mt-3">
<div>
<span class="me-3">Selected: <span id="selectedCookieCount">0</span></span>
<button class="btn btn-outline-secondary" id="selectAllCookiesBottom">Select All</button>
<button class="btn btn-outline-secondary" id="deselectAllCookiesBottom">Deselect All</button>
</div>
<button class="btn btn-primary" id="importCookies" disabled>
Import Cookies to Active Profile
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Import Tab -->
<div class="tab-pane fade" id="import" role="tabpanel">
<div class="row mt-4">
<div class="col-md-12">
<ul class="nav nav-pills mb-4" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="history-tab" data-bs-toggle="pill" href="#history" role="tab">Chrome History</a>
</li>
<li class="nav-item">
<a class="nav-link" id="bookmarks-tab" data-bs-toggle="pill" href="#bookmarks" role="tab">Chrome Bookmarks</a>
</li>
</ul>
<div class="tab-content">
<!-- History Import -->
<div class="tab-pane fade show active" id="history" role="tabpanel">
<div class="row mb-4">
<div class="col-md-6">
<div class="input-group">
<span class="input-group-text">From</span>
<input type="date" class="form-control" id="historyStartDate">
<span class="input-group-text">To</span>
<input type="date" class="form-control" id="historyEndDate">
<button class="btn btn-primary" id="loadHistory">Load History</button>
</div>
</div>
</div>
</div>
<!-- Bookmarks Import -->
<div class="tab-pane fade" id="bookmarks" role="tabpanel">
<div class="row mb-4">
<div class="col-md-6">
<button class="btn btn-primary" id="loadBookmarks">Load Bookmarks</button>
</div>
</div>
</div>
</div>
<!-- Common Import UI -->
<div class="card">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center mb-3">
<div>
<span class="me-3">Selected: <span id="selectedCount">0</span></span>
<button class="btn btn-outline-secondary" id="selectAll">Select All</button>
<button class="btn btn-outline-secondary" id="deselectAll">Deselect All</button>
</div>
<div class="input-group" style="max-width: 600px;">
<input type="search" class="form-control" id="importFilter" placeholder="Filter URLs and titles...">
<div class="input-group-text">
<input class="form-check-input mt-0" type="checkbox" id="showNewOnly">
<label class="form-check-label ms-2" for="showNewOnly">Show new only</label>
</div>
</div>
<div class="input-group" style="max-width: 600px;">
<span class="input-group-text">Tags</span>
<input type="text" class="form-control" id="importTags" placeholder="Add tags (comma separated)">
<button class="btn btn-success" id="importSelected">Import Selected <i class="bi bi-arrow-right"></i></button>
</div>
</div>
<div class="table-responsive">
<table class="table" id="importTable">
<thead>
<tr>
<th style="width: 40px;"><input type="checkbox" id="selectAllHeader"></th>
<th>URL</th>
<th>Title</th>
<th>Timestamp</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="bootstrap-icons.css">
<!-- <script type="module" src="options.js"></script> -->
<!-- <script type="module" src="entries-tab.js"></script>
<script type="module" src="import-tab.js"></script>
<script type="module" src="personas-tab.js"></script>
<script type="module" src="cookies-tab.js"></script> -->
<script type="module" src="options.js"></script>
</body>
</html>