forked from mumud1/MiningBots-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsettings.html
More file actions
93 lines (88 loc) · 5.51 KB
/
settings.html
File metadata and controls
93 lines (88 loc) · 5.51 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Settings — Mining Bots</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous" />
<link href="/styles/settings.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.4/purify.min.js"
integrity="sha384-KGmzmwrs7oAU2sG5qfETslFsscVcCaxQrX2d7PW7I9bTrsuTD/eSMFr9jaMS9i+b"
crossorigin="anonymous"></script>
<script src="/scripts/utilities/svgimporter.js" type="module"></script>
<script src="/scripts/settings.js" type="module"></script>
</head>
<body>
<div id="main">
<nav id="navbar" class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Settings</a>
<div id="action-container">
<a role="button" onclick="SettingsManager.ClickHandlers.reset_settings_clicked();" title="Reset all settings"
id="reset-all-button" helpon-available><svgfile aria-hidden="true" src="/assets/ui/reset.svg"></svgfile></a>
<a role="button" onclick="SettingsManager.ClickHandlers.ok_clicked();" title="OK"
id="ok-button" helpon-available><svgfile aria-hidden="true" src="/assets/ui/ok.svg"></svgfile></a>
<a role="button" onclick="SettingsManager.ClickHandlers.cancel_clicked();" title="Cancel"
id="cancel-button" helpon-available><svgfile aria-hidden="true" src="/assets/ui/cancel.svg" style="width:20px;"></svgfile></a>
<a role="button" onclick="SettingsManager.ClickHandlers.apply_clicked();" title="Apply"
id="apply-button" helpon-available><svgfile aria-hidden="true" src="/assets/ui/apply.svg"></svgfile></a>
<a role="button" onclick="SettingsManager.export_settings();" title="Export settings"
id="export-button" helpon-available><svgfile aria-hidden="true" src="/assets/ui/export.svg"></svgfile></a>
<a role="button" onclick="SettingsManager.import_settings();" title="Import settings"
id="import-button" helpon-available><svgfile aria-hidden="true" src="/assets/ui/import.svg"></svgfile></a>
<script type="module">
import KeyboardUtilities from '/scripts/utilities/keyboard_utilities.js';
function setMnemonic(element, useSecondary, key,additional_key) {
let keyTag = KeyboardUtilities.joinMnemonic(useSecondary,key) + (additional_key ? ` or ${additional_key}` : '')
element.title += ` (${keyTag})`;
let describerId=`${element.id}-description`;
element.setAttribute("aria-labelledby", `${element.id}-label`);
document.getElementById(describerId).textContent = `Shortcut: (${keyTag})`;
element.setAttribute("aria-describedby", describerId);
}
setMnemonic(document.getElementById("reset-all-button"),false,'D');
setMnemonic(document.getElementById("ok-button"),false,'O');
setMnemonic(document.getElementById("cancel-button"),false,'C','Escape');
setMnemonic(document.getElementById("apply-button"),false,'A');
setMnemonic(document.getElementById("export-button"),false,'S');
setMnemonic(document.getElementById("import-button"),false,'I');
</script>
</div>
</nav>
<form id="settings-megacontainer">
<!-- Items will be auto-populated by settings.js -->
</form>
</div>
<div id="saving-cover-board" style="display:none">
<div id="saving-cover-board-content">
<b style="color:white;font-size: 32px;user-select: none;">
Saving...
</b>
</div>
</div>
<script type="module">
import SettingsManager from "/scripts/settings.js";
SettingsManager.initialize_popup();
</script>
<div id="accessibility-labels">
<span id="reset-all-button-label">Reset All</span>
<span id="reset-all-button-description"></span>
<span id="reset-all-button-help"><svgfile noimport src="/assets/ui/reset.svg"></svgfile>(Reset All): Use this button to reset all settings to their default values. This action cannot be undone!</span>
<span id="ok-button-label">OK</span>
<span id="ok-button-description"></span>
<span id="ok-button-help"><svgfile noimport src="/assets/ui/ok.svg"></svgfile>(OK): Use this button to save the settings, reload the main page, and close the dialog.</span>
<span id="cancel-button-label">Cancel</span>
<span id="cancel-button-description"></span>
<span id="cancel-button-help"><svgfile noimport src="/assets/ui/cancel.svg"></svgfile>(Cancel): Use this button to discard changes and close the dialog.</span>
<span id="apply-button-label">Apply</span>
<span id="apply-button-description"></span>
<span id="apply-button-help"><svgfile noimport src="/assets/ui/apply.svg"></svgfile>(Apply): Use this button to apply the settings and reload the main page without closing the dialog.</span>
<span id="export-button-label">Export</span>
<span id="export-button-description"></span>
<span id="export-button-help"><svgfile noimport src="/assets/ui/export.svg"></svgfile>(Export): Use this button to export the current settings to settings.json.</span>
<span id="import-button-label">Import</span>
<span id="import-button-description"></span>
<span id="import-button-help"><svgfile noimport src="/assets/ui/import.svg"></svgfile>(Import): Use this button to import settings from a JSON file.</span>
</div>
</body>
</html>