forked from proginosko/LeechBlockNG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.html
541 lines (527 loc) · 29.4 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
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<html lang="us">
<head>
<meta charset="utf-8">
<title>PoskBlock Options</title>
<link href="jquery-ui/jquery-ui.min.css" rel="stylesheet">
<link href="options.css" rel="stylesheet">
<link href="icons/leechblock16.ico" rel="icon" type="image/x-icon">
<link href="icons/leechblock16.ico" rel="shortcut icon" type="image/x-icon">
<link id="themeLink" rel="stylesheet">
</head>
<body>
<div id="form-container">
<form id="form" style="display: none;">
<div id="tabs">
<ul>
<li id="tabBlockSet1"><a href="#blockSet1"><span id="blockSetName1">Block Set 1</span></a></li>
<li id="tabGeneral"><a href="#paneGeneral">General</a></li>
<li id="tabAbout"><a href="#paneAbout">About</a></li>
</ul>
<div id="blockSet1">
<fieldset>
<legend>What to Block</legend>
<p>
<em>In this section, specify the sites you want to block.</em>
</p>
<hr>
<p>
<label>Enter a custom name for this block set (optional):</label><br>
<div><input id="setName1" type="text" size="60"></div>
</p>
<p>
<label>Enter the domain names of the sites to block (one item per line):</label><br>
<div><textarea id="sites1" cols="60" rows="10" spellcheck="false" placeholder="somesite.com"
title="Use * as wildcard and + to prefix exceptions"></textarea></div>
</p>
</fieldset>
<fieldset>
<legend>When to Block</legend>
<p>
<em>In this section, specify when you want to block these sites.</em>
</p>
<hr>
<p>
<label>Enter the time periods within which to block these sites (optional):</label>
<div>
<input id="times1" type="text" size="60" placeholder="Example: 0900-1230,1330-1700"
title="Leave blank for no time periods">
<button id="allDay1" type="button">All Day</button>
</div>
</p>
<p>
<label>Enter a time limit after which to block these sites (optional):</label>
<div>
<input id="limitMins1" type="text" size="4" title="Leave blank for no time limit">
minutes in every
<select id="limitPeriod1">
<option value=""></option>
<option value="900">quarter-hour (15 mins)</option>
<option value="1800">half-hour (30 mins)</option>
<option value="3600">hour</option>
<option value="7200">2 hours</option>
<option value="10800">3 hours</option>
<option value="14400">4 hours</option>
<option value="21600">6 hours</option>
<option value="28800">8 hours</option>
<option value="43200">half-day (12 hours)</option>
<option value="86400">day (24 hours)</option>
<option value="172800">2 days (48 hours)</option>
<option value="259200">3 days (72 hours)</option>
<option value="345600">4 days (96 hours)</option>
<option value="604800">week (7 days)</option>
<option value="1209600">2 weeks (14 days)</option>
</select>
</div>
</p>
<p>
<label>Select when to block these sites:</label>
<select id="conjMode1">
<option>within time periods OR after time limit</option>
<option>within time periods AND after time limit</option>
</select>
<a href="http://www.proginosko.com/leechblock/faq/difference-or-and/"
target="_blank">What's the difference?</a>
</p>
<p>
<label>Select the days on which to block these sites:</label>
<div id="days1">
<input id="day01" type="checkbox"><label for="day01">Sun</label>
<input id="day11" type="checkbox"><label for="day11">Mon</label>
<input id="day21" type="checkbox"><label for="day21">Tue</label>
<input id="day31" type="checkbox"><label for="day31">Wed</label>
<input id="day41" type="checkbox"><label for="day41">Thu</label>
<input id="day51" type="checkbox"><label for="day51">Fri</label>
<input id="day61" type="checkbox"><label for="day61">Sat</label>
</div>
</p>
</fieldset>
<fieldset>
<legend>How to Block</legend>
<p>
<em>In this section, specify how you want to block these sites.</em>
</p>
<hr>
<p>
<label>Enter the fully specified URL of the page to show instead of these blocked
sites:</label>
<div><input id="blockURL1" type="text" size="60"
placeholder="http://somesite.com/somepage.html"
title="Use $U to pass URL of blocked page"></div>
</p>
<p>
<div>
<label>Predefined URLs:</label>
<button id="defaultPage1" type="button">Default Page</button>
<button id="delayingPage1" type="button">Delaying Page</button>
<button id="blankPage1" type="button">Blank Page</button>
<button id="focusdPage1" type="button">StayFocusd Page</button>
</div>
</p>
<hr>
<p>
<input id="applyFilter1" type="checkbox">
<label for="applyFilter1">Apply filter instead of blocking page:</label>
<select id="filterName1">
<option>grayscale</option>
<option>invert</option>
<option>sepia</option>
</select>
</p>
<p>
<input id="activeBlock1" type="checkbox">
<label for="activeBlock1">Immediately block pages on these sites once blocking conditions
are met</label>
</p>
<p>
<input id="countFocus1" type="checkbox">
<label for="countFocus1">Count time spent on these sites only when browser tab is
active</label>
</p>
<p>
<input id="delayFirst1" type="checkbox">
<label for="delayFirst1">Block only first accessed page of site when delaying page is
used</label>
</p>
<p>
Delay access to sites by <input id="delaySecs1" type="text" size="2"> seconds when delaying
page is used
</p>
<p>
Attempt to reload blocked page every <input id="reloadSecs1" type="text" size="2"> seconds
(only applies to default page)
</p>
<p>
<input id="allowOverride1" type="checkbox">
<label for="allowOverride1">Allow temporary override for these sites</label>
</p>
</fieldset>
<p>
<button id="resetOpts1" type="button">Reset Options to Defaults</button>
<button id="showAdvOpts1" type="button">Show Advanced Options</button>
</p>
<fieldset id="advOpts1">
<legend>Advanced Options</legend>
<p>
<em>Be sure you understand the consequences of these options before changing any of
them!</em>
</p>
<hr>
<p>
<input id="showTimer1" type="checkbox">
<label for="showTimer1">Show countdown timer for this block set</label>
</p>
<hr>
<p>
<input id="prevOpts1" type="checkbox">
<label for="prevOpts1">Prevent access to options for this block set at times when these
sites are blocked</label>
</p>
<p>
<input id="prevAddons1" type="checkbox">
<label for="prevAddons1">Prevent access to about:addons at times when these sites are
blocked</label>
</p>
<p>
<input id="prevSupport1" type="checkbox">
<label for="prevSupport1">Prevent access to about:support at times when these sites are
blocked</label>
</p>
<p>
<input id="prevDebugging1" type="checkbox">
<label for="prevprevDebugging1">Prevent access to about:debugging at times when these sites
are blocked</label>
</p>
<hr>
<p>
Offset time limit period by <input id="limitOffset1" type="text" size="2"
title="Leave blank for no offset"> hours
<a href="http://www.proginosko.com/leechblock/faq/time-limit-offset/"
target="_blank">What does this do?</a>
</p>
<hr>
<p>
<label>Load list of sites from URL:</label>
<div><input id="sitesURL1" type="text" size="60"
title="Use $S to pass block set number and $T to pass UTC timestamp in milliseconds">
<a href="http://www.proginosko.com/leechblock/faq/load-from-url/"
target="_blank">What does this do?</a></div>
</p>
<p>
<label>Use <a
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions"
target="_blank">regular expression</a>
to match URLs to <strong>block</strong> (overrides list of sites):</label>
<div>
<input id="regexpBlock1" type="text" size="60">
<button id="clearRegExpBlock1" type="button">Clear</button>
<button id="genRegExpBlock1" type="button">Generate From Site List</button>
</div>
</p>
<p>
<label>Use <a
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions"
target="_blank">regular expression</a>
to match URLs to <strong>allow</strong> (overrides exceptions in list of sites):</label>
<div>
<input id="regexpAllow1" type="text" size="60">
<button id="clearRegExpAllow1" type="button">Clear</button>
<button id="genRegExpAllow1" type="button">Generate From Site List</button>
</div>
</p>
<p>
<input id="ignoreHash1" type="checkbox">
<label for="ignoreHash1">Ignore fragment (hash part) when checking URL</label>
</p>
<hr>
<p>
<button id="cancelLockdown1" type="button" disabled="true">Cancel Active Lockdown</button>
</p>
</fieldset>
</div>
<div id="paneGeneral">
<fieldset>
<legend>Block Sets</legend>
<p>
Number of block sets (1–<span id="maxSets">?</span>):
<input id="numSets" type="text" size="2" title="Default: 6">
</p>
</fieldset>
<fieldset>
<legend>Access Control</legend>
<p>
<label>Select the requirement for access to options:</label><br>
<div>
<select id="optionsAccess">
<option value="0">Don't require the user to enter any password or access code
</option>
<option value="1">Require the user to enter a password</option>
<option value="2">Require the user to enter a random 32-character access code
</option>
<option value="3">Require the user to enter a random 64-character access code
</option>
<option value="4">Require the user to enter a random 128-character access code
</option>
</select>
</div>
</p>
<p>
<label>Password:</label>
<input id="accessPassword" type="text" size="60">
</p>
<p>
<input id="hidePassword" type="checkbox">
<label for="hidePassword">Hide password characters when entered at prompt</label>
</p>
</fieldset>
<fieldset>
<legend>Countdown Timer</legend>
<p>
<input id="timerVisible" type="checkbox">
<label for="timerVisible">Show timer over page</label>
<label>Size:</label>
<select id="timerSize">
<option value="0">small</option>
<option value="1">medium</option>
<option value="2">large</option>
<option value="3">extra large</option>
</select>
<label>Location:</label>
<select id="timerLocation">
<option value="0">top left</option>
<option value="1">top right</option>
<option value="2">bottom right</option>
<option value="3">bottom left</option>
</select>
</p>
<p>
<input id="timerBadge" type="checkbox">
<label for="timerBadge">Show timer as icon badge (if time left is less than 10
minutes)</label>
</p>
<p>
<strong>Tip:</strong> Double-click on the over-page timer to hide it at any time (e.g.,
before printing page).
</p>
</fieldset>
<fieldset>
<legend>Warning Message</legend>
<p>
Display warning message <input id="warnSecs" type="text" size="2"
title="Leave blank for no warning"> seconds before site is blocked
</p>
<p>
<input id="warnImmediate" type="checkbox">
<label for="warnImmediate">Only display warning message on pages that will be immediately
blocked</label>
</p>
</fieldset>
<fieldset>
<legend>Temporary Override</legend>
<p>
Allow blocking to be suspended for a period of <input id="overrideMins" type="text" size="2"
title="Leave blank for no override"> minutes
</p>
<p>
<label>Select the requirement for activating the override:</label><br>
<div>
<select id="overrideAccess">
<option value="0">Don't require the user to enter any password or access code
</option>
<option value="1">Require the user to enter the access control password</option>
<option value="2">Require the user to enter a random 32-character access code
</option>
<option value="3">Require the user to enter a random 64-character access code
</option>
<option value="4">Require the user to enter a random 128-character access code
</option>
</select>
</div>
</p>
<p>
<input id="overrideConfirm" type="checkbox">
<label for="overrideConfirm">Show confirmation message when override is activated</label>
</p>
<p>
<strong>Note:</strong> You must also select "Allow temporary override for these sites" for
the relevant block sets.
</p>
</fieldset>
<fieldset>
<legend>Miscellaneous</legend>
<p>
<label>Theme:</label>
<select id="theme">
<option value="">Default</option>
<option value="dark">Dark</option>
<option value="spruce">Spruce</option>
</select>
</p>
<p>
<input id="contextMenu" type="checkbox">
<label for="contextMenu">Show context menu</label>
<input id="toolsMenu" type="checkbox">
<label for="toolsMenu">Show tools menu</label>
</p>
<p>
<input id="matchSubdomains" type="checkbox">
<label for="matchSubdomains">Block all subdomains (not just www)</label>
</p>
<p>
Save time data every <input id="saveSecs" type="text" size="2" title="Default: 10"> seconds
</p>
<p>
<input id="processActiveTabs" type="checkbox">
<label for="processActiveTabs">Process only active tabs (improves performance when multiple
tabs open)</label>
</p>
<p>
<input id="accessCodeImage" type="checkbox">
<label for="accessCodeImage">Display access code as image</label>
</p>
<p>
<input id="syncStorage" type="checkbox">
<label for="syncStorage">Use sync storage for options (experimental: use at your own
risk!)</label>
</p>
</fieldset>
<fieldset>
<legend>Export / Import</legend>
<p>
<button id="exportOptions" type="button">Export Options to File</button>
<button id="importOptions" type="button">Import Options from File</button>
<input type="file" id="importFile">
</p>
<hr>
<p>
<button id="exportOptionsSync" type="button">Export Options to Sync Storage</button>
<button id="importOptionsSync" type="button">Import Options from Sync Storage</button>
</p>
<p>
<input id="autoExportSync" type="checkbox">
<label for="autoExportSync">Automatically export options to sync storage (as backup)
whenever options are saved</label>
</p>
</fieldset>
<fieldset>
<legend>Saving Delay</legend>
<p>
Delay the saving of the options by <input id="delaySave" type="text" size="3"> seconds
</p>
</fieldset>
</div>
<div id="paneAbout">
<p>
<a href="http://www.proginosko.com/leechblock/" target="_blank"><img
src="images/leechblock_logo.svg" class="logo" alt="LeechBlock logo"
title="LeechBlock"></a>
</p>
<p>
PoskBlock blocks your webpages so you stop wasting your life.
</p>
<p><strong>Version:</strong> <span id="version">?<span></p>
<p><strong>Author:</strong> Oscar Palafox</p>
<p><strong>Forked From:</strong>
<a href="http://www.proginosko.com/leechblock" target="_blank">LeechBlock</a>
</p>
</div>
</div>
<p style="text-align: center;">
<button id="saveOptions" type="button">Save Options</button>
<button id="saveOptionsClose" type="button">Save Options & Close</button>
</p>
</form>
</div>
<div id="alerts" style="display: none;">
<div id="alertRetrieveError" title="LeechBlock Options">
<p><strong>Error:</strong> Unable to retrieve options from browser storage.</p>
</div>
<div id="alertBadTimes" title="LeechBlock Options">
<p>Please enter the time periods in the correct format. Use 24-hour clock format (HHMM) for times,
a dash (-) between start time and end time, and commas or spaces to separate time periods.</p>
</div>
<div id="alertBadTimeLimit" title="LeechBlock Options">
<p>Please enter the time limit in the correct format (as a positive whole number).</p>
</div>
<div id="alertBadTimeLimitOffset" title="LeechBlock Options">
<p>Please enter the time limit offset in the correct format (as a non-zero integer).</p>
</div>
<div id="alertBadSeconds" title="LeechBlock Options">
<p>Please enter the number of seconds in the correct format (as a positive whole number).</p>
</div>
<div id="alertBadMinutes" title="LeechBlock Options">
<p>Please enter the number of minutes in the correct format (as a positive whole number).</p>
</div>
<div id="alertBadBlockURL" title="LeechBlock Options">
<p>Please enter the URL for the blocking page in the correct format (as a fully specified URL).</p>
</div>
<div id="alertBadNumSets" title="LeechBlock Options">
<p>Please enter the number of block sets in the correct format (as a positive whole number).</p>
</div>
<div id="alertNoImportFile" title="LeechBlock Options">
<p>Please select a file containing the options to import.</p>
</div>
<div id="alertImportError" title="LeechBlock Options">
<p><strong>Error:</strong> Unable to import options from file.</p>
</div>
<div id="alertImportSyncError" title="LeechBlock Options">
<p><strong>Error:</strong> Unable to import options from sync storage.</p>
</div>
<div id="alertImportSuccess" title="LeechBlock Options">
<p>The options have been imported successfully.</p>
<p><strong>Note:</strong> The imported options will not be applied until you <strong>Save Options</strong>.
</p>
</div>
<div id="alertExportError" title="LeechBlock Options">
<p><strong>Error:</strong> Unable to download exported options.</p>
</div>
<div id="alertExportSyncError" title="LeechBlock Options">
<p><strong>Error:</strong> Unable to export options to sync storage.</p>
</div>
<div id="alertExportSuccess" title="LeechBlock Options">
<p>The options have been exported successfully.</p>
</div>
<div id="alertLockdownCancel" title="LeechBlock Options">
<p>The active lockdown has been canceled.</p>
</div>
<div id="alertResetOptions" title="LeechBlock Options">
<p>The options for this block set have been reset to the defaults.</p>
<p><strong>Note:</strong> The defaults will not be applied until you <strong>Save Options</strong>.</p>
</div>
<div id="alertSavingOptionsDelay" title="LeechBlock Options">
<p>There is a delay to save the options, time remaining: <span id="remainingTime"></span>.</p>
</div>
<div id="alertSavedOptions" title="LeechBlock Options">
<p>Options have been saved successfully.</p>
</div>
</div>
<div id="prompts" style="display: none;">
<div id="promptPassword" title="LeechBlock Options">
<p>Enter the password for access to options:</p>
<p><input id="promptPasswordInput" type="text" size="60"></p>
</div>
<div id="promptAccessCode" title="LeechBlock Options">
<p>Enter the following code for access to options:</p>
<p id="promptAccessCodeText"></p>
<p id="promptAccessCodeImage">
<canvas id="promptAccessCodeCanvas"></canvas>
</p>
<p><input id="promptAccessCodeInput" type="text" size="64"></p>
</div>
</div>
<script src="jquery-ui/external/jquery/jquery.js"></script>
<script src="jquery-ui/jquery-ui.min.js"></script>
<script src="common.js"></script>
<script src="options.js"></script>
</body>
</html>