-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.html
executable file
·65 lines (62 loc) · 1.72 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="style.css">
<style type="text/css" media="all">
body {
background-color: black;
color: white;
overflow: auto ;
font-family: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
*{
font-weight: 400;
}
h1,h2{
margin: 5px;
}
</style>
<link rel="stylesheet" href="ui.css">
</head>
<body>
<!--<div id="dmode">
<label for="dm"></label>\<inputsaajsjs type="checkbox" name="dm" id="dm" />
</div>-->
<h1 data-t="apps.settings.name"></h1>
<div id="language">
<h2 data-t="apps.settings.lang"></h2>
</div>
<script>
let e = q => document.getElementById(q)
let hmm = {}
hmm = window.parent.hmm
const langCodes = hmm.langNames
//ui{
var el = (hmm.ui.choose(Object.keys(langCodes),hmm.storage.opts.lang))
el.id = 'lang'
e('language').appendChild(el)
//}
e("lang").value = Object.keys(langCodes).filter(e=>langCodes[e]==hmm.storage.opts.lang)[0]
e("lang").onchange = (ev) => {
hmm.storage.opts.lang = langCodes[ev.target.value]//Object.keys(langCodes).filter(e=>langCodes[e]==ev.target.value)[0]
hmm.setup(); t(hmm)
if(hmm.storage.opts.lang=="toksp"){
hmm.storage['.pr'].startup["linja-sike.js"]=`
if(hmm.storage.opts.lang=="toksp"){
hmm.switchFont("https://wyub.github.io/tokipona/linja-sike-5.otf")
}
`
}
}
function t(w) {
document.querySelectorAll("[data-t]").forEach(e => {
e.innerHTML = w.t(e.getAttribute("data-t"), eval('('+e.getAttribute("data-a")+')'))
})
}
t(hmm)
</script>
</body>
</html>