This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.html
147 lines (137 loc) · 5.81 KB
/
settings.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>History is enabled | Settings</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<style>
* {
color-scheme: dark;
}
</style>
<h1 class="mx-auto my-8 text-center text-3xl">Settings</h1>
<grid class="mx-4 grid grid-cols-2 rounded-xl bg-black/25 px-2 py-8">
<div>
<p>Enable Tab Cloak: <input class="h-4 w-8" type="checkbox" id="tbclk" name="tbclk" value="1" /></p>
</div>
<div>
<p>Tab Cloak Preset:</p>
<select id="tcpset"
class="rounded-lg bg-slate-800 px-4 ring-2 ring-green-700 hover:bg-slate-900 focus:rounded-b-none focus:bg-slate-900">
<option value="custom">Custom</option>
<option value="google">Google</option>
<option value="classroom">Google Classroom</option>
<option value="drive">Google Drive</option>
<option value="docs">Google Docs</option>
<option value="sheets">Google Sheets</option>
<option value="slides">Google Slides</option>
<option value="gmail">Gmail</option>
<option value="canvas">Canvas</option>
<option value="launchpad">ClassLink Launchpad</option>
<option value="word">MS Word</option>
<option value="powerpoint">MS PowerPoint</option>
<option value="excel">MS Excel</option>
<option value="office">MS 365 (aka. Office)</option>
<option value="onedrive">OneDrive</option>
<option value="iready">I-Ready</option>
<option value="schoology">Schoology</option>
</select>
</div>
<div>
<p>Custom Tab Cloak URL: <textarea id="ctcurl" cols="36" rows="1"
class="resize-none rounded-lg bg-slate-800 px-3 ring-2 ring-green-700 hover:bg-slate-900 focus:bg-slate-900"
maxlength="350" placeholder="https://google.com/favicon.ico"></textarea></p>
</div>
<div>
<p>Custom Tab Cloak Name: <textarea id="ctcn" cols="36" rows="1"
class="resize-none rounded-lg bg-slate-800 px-3 ring-2 ring-green-700 hover:bg-slate-900 focus:bg-slate-900"
maxlength="350" placeholder="Google"></textarea></p>
</div>
<div> </div>
<div> </div>
<div>
<p>
Emergency Button Preset:<br />
<select id="emepset"
class="rounded-lg bg-slate-800 px-4 ring-2 ring-green-700 hover:bg-slate-900 focus:rounded-b-none focus:bg-slate-900">
<option value="custom">Custom</option>
<option value="google">Google</option>
<option value="classroom">Google Classroom</option>
<option value="drive">Google Drive</option>
<option value="docs">Google Docs</option>
<option value="sheets">Google Sheets</option>
<option value="slides">Google Slides</option>
<option value="gmail">Gmail</option>
<option value="canvas">Canvas</option>
<option value="launchpad">ClassLink Launchpad</option>
<option value="office">MS 365 (aka. Office)</option>
<option value="onedrive">OneDrive</option>
<option value="iready">I-Ready</option>
<option value="schoology">Schoology</option>
</select>
</p>
</div>
<div>
<p>Custom Emergency Button URL: <textarea id="emeurl" cols="36" rows="1"
class="resize-none rounded-lg bg-slate-800 px-3 ring-2 ring-green-700 hover:bg-slate-900 focus:bg-slate-900"
maxlength="350" placeholder="https://www.google.com"></textarea></p>
</div>
<div>
<button onclick="save()" class="rounded-lg bg-green-700 px-4 py-2 hover:bg-green-800">Save Changes</button>
<button onclick="reset()" class="rounded-lg bg-red-700 px-4 py-2 hover:bg-red-800">Reset to Defaults</button>
</div>
</grid>
<script>
window.onload = function () {
// Get the settings object from local storage
var settingsJSON = localStorage.getItem("settings");
if (settingsJSON !== null) {
// Parse the settings object from the JSON string
var settings = JSON.parse(settingsJSON);
// Set the values of the six elements to match the saved settings
document.getElementById("tbclk").checked = settings.tbclk;
document.getElementById("tcpset").value = settings.tcpset;
document.getElementById("ctcurl").value = settings.ctcurl;
document.getElementById("ctcn").value = settings.ctcn;
document.getElementById("emepset").value = settings.emepset;
document.getElementById("emeurl").value = settings.emeurl;
}
}
function save() {
// Get the values of the six elements
var tbclk = document.getElementById("tbclk").checked;
var tcpset = document.getElementById("tcpset").value;
var ctcurl = document.getElementById("ctcurl").value;
var ctcn = document.getElementById("ctcn").value;
var emepset = document.getElementById("emepset").value;
var emeurl = document.getElementById("emeurl").value;
// Create an object with the six values
var settings = {
"tbclk": tbclk,
"tcpset": tcpset,
"ctcurl": ctcurl,
"ctcn": ctcn,
"emepset": emepset,
"emeurl": emeurl
};
// Convert the object to a JSON string
var settingsJSON = JSON.stringify(settings);
// Save the settings to local storage
localStorage.setItem("settings", settingsJSON);
alert("Done.");
}
function reset() {
// Prompt the user for confirmation
var confirmed = confirm("Are you sure you want to reset the settings? This action cannot be undone.");
if (confirmed) {
// Delete the settings object from local storage
localStorage.removeItem("settings");
}
}
</script>
</body>
</html>