-
Notifications
You must be signed in to change notification settings - Fork 1
/
update.html
121 lines (119 loc) · 3.22 KB
/
update.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
<!doctype html>
<html>
<head>
<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 style="text-align: center; margin: 0; padding: 0">
<h1>KLIND OS | <span>$[update];</span></h1>
<p>$[klindos_was_updated];</p>
<div class="actions">
<h2>$[actions_after_install];</h2>
<div class="act">
<p>$[version_update];</p>
</div>
</div>
<button id="hotovo" onclick="finish()">$[finish];</button>
<script>
async function finish() {
for (var i = 0; i < todo.length; i++) {
await todo[i]();
}
localStorage.setItem("updatesklindows", version);
window.location.replace("index.html");
}
</script>
</body>
</html>
<script>
// Not bothered to translate these
var messages = [
[
6.1,
"<p>Změna localStorage hodnoty pro pozadí na zamykací obrazovce.</p>",
() => {
if (localStorage.getItem("background"))
localStorage.setItem(
"background-lockScreen",
localStorage.getItem("background"),
);
},
],
[
6.2,
"<p>Odstranení všech vlastních aplikací z důvodu změny formátu.</p><p>Změna uložení hesla na nový formát.</p>",
() => {
localStorage.removeItem("customapps");
localStorage.setItem(
"password",
hashCode(localStorage.getItem("password")),
);
},
],
[6.3, "", () => {}],
[6.4, "", () => {}],
[6.5, "", () => {}],
[
6.6,
"<p>Změnit místo pro uložení souborů</p>",
() => {
JSON.parse(localStorage["files-uploaded"]).forEach((file) => {
const content = storage.getSync(file[5]);
if (Object.keys(content).length == 0) {
const data = [file];
storage.setSync(file[5], data);
} else {
content.push(file);
storage.setSync(file[5], content);
}
});
localStorage.removeItem("files-uploaded");
},
],
[
6.7,
"<p>Migrace všech souborů</p>",
async () => {
const folders = localStorage["folders-uploaded"] || "[]";
await LowLevelApi.filesystem.migrations.migrateToBinary(
JSON.parse(folders),
);
localStorage.removeItem("folders-uploaded");
},
],
];
</script>
<script>
var startindex = undefined;
var endindex = undefined;
var todo = [];
for (var i = 0; i < messages.length; i++) {
if (messages[i][0] == localStorage.updatesklindows) {
startindex = i + 1;
}
}
for (var i = 0; i < messages.length; i++) {
if (messages[i][0] == version) {
endindex = i;
}
}
if (endindex == undefined) {
endindex = messages.length;
} else {
endindex++;
}
for (var i = startindex ? startindex : 0; i < endindex; i++) {
var info = messages[i];
if (info[2] !== undefined) {
todo.push(info[2]);
}
document.querySelector(".act").innerHTML += info[1] ? info[1] : "";
}
Localization.loadDOM();
</script>