-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.html
94 lines (89 loc) · 3.14 KB
/
install.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
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="styles/styleinstall.css" />
<title>Install</title>
<meta charset="UTF-8" />
<script src="info.js"></script>
<script src="scripts/components/hash.js"></script>
<script src="/libs/json5.min.js"></script>
<script src="/lang/localization.js"></script>
<script>
Localization.loadStrings();
</script>
</head>
<body>
<script>
// onload
if (localStorage.getItem("installed") == "true") {
window.location.replace("index.html");
}
function install() {
if (document.getElementById("username").value == "") {
alert(Localization.getString("invalid_username"));
} else if (document.getElementById("password").value == "") {
alert(Localization.getString("invalid_password"));
} else {
document.getElementById("cistainstall").style.display = "none";
document.getElementById("installing").style.display = "block";
setTimeout(() => {
localStorage.setItem("installed", "true");
localStorage.setItem(
"username",
document.getElementById("username").value,
);
localStorage.setItem(
"password",
hashCode(document.getElementById("password").value),
);
localStorage.setItem("updatesklindows", version);
window.location.replace("/");
}, 1800);
}
}
function cistainstall() {
document.getElementById("prvni").style.display = "none";
document.getElementById("cistainstall").style.display = "block";
}
</script>
<div class="installdiv">
<div id="prvni">
<label style="position: absolute; left: 20px; top: 10px">
<span>Language</span>
<select
onchange="localStorage.setItem('lang', this.value); window.location.reload();"
id="langselect"
>
<option value="en">English</option>
<option value="cs">Čeština</option>
</select>
<script>
document.querySelector("#langselect").childNodes.forEach(e => {
if (e.value == localStorage.lang) {
e.selected = true;
}
})
</script>
</label>
<img src="/logo/logo.png" alt="" class="icon" />
<h1 class="title">KLIND OS <span id="versionSpan"></span></h1>
<script>
document.querySelector("#versionSpan").textContent = version;
</script>
<div class="buttonnext" onclick="cistainstall()">$[start_install];</div>
</div>
<div id="cistainstall" style="display: none">
<h1 class="title">$[installation];</h1>
<input id="username" placeholder="$[username];" /><br />
<input id="password" type="password" placeholder="$[password];" />
<div class="buttonnext" onclick="install()">$[start_install];</div>
</div>
<div id="installing" style="display: none">
<h1 class="title">$[installing];</h1>
</div>
</div>
<script>
Localization.loadDOM();
</script>
</body>
</html>