This repository was archived by the owner on Aug 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
86 lines (77 loc) · 2.54 KB
/
Copy pathmain.js
File metadata and controls
86 lines (77 loc) · 2.54 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
document.addEventListener('contextmenu', function (e) {
e.preventDefault();
window.pywebview.api.close();
});
function hideSpecial(hide){
if (hide){
document.querySelectorAll('.specialchars').forEach(element => {
element.style.opacity = '0';
});
} else {
document.querySelectorAll('.specialchars').forEach(element => {
element.style.opacity = '1';
});
}
}
window.setLoad = function(hide){
if (hide == 0){
document.getElementById("loadingScreen").style.display = 'none';
} else if (hide == 1) {
document.getElementById("loadingScreen").style.display = 'flex';
}
}
window.setIdle = function(hide){
if (hide == 0){
document.getElementById("idleScreen").style.display = 'none';
} else if (hide == 1) {
document.getElementById("idleScreen").style.display = 'flex';
}
}
window.setMode = function(modeNum){
if (modeNum === 0){
hideSpecial(true)
document.getElementById("systat").setAttribute("fill", "#86A788");
document.getElementById("baistat").setAttribute("fill", "#3F72AF");
} else if (modeNum === 1){
hideSpecial(false)
document.getElementById("latinstat").setAttribute("fill", "#86A788");
document.getElementById("systat").setAttribute("fill", "#3F72AF");
} else if (modeNum === 2){
document.getElementById("askaozastat").setAttribute("fill", "#86A788");
document.getElementById("latinstat").setAttribute("fill", "#3F72AF");
} else if (modeNum === 3){
hideSpecial(true)
document.getElementById("baistat").setAttribute("fill", "#86A788");
document.getElementById("askaozastat").setAttribute("fill", "#3F72AF");
}
}
window.keyIn = function(key) {
try {
document.getElementById(removeLeadingPlus(key)).setAttribute("fill", "#86A788");
} catch (error) {}
};
window.keyOut = function(key) {
try {
document.getElementById(removeLeadingPlus(key)).setAttribute("fill", "#3F72AF");
} catch (error){}
};
window.updateMapping = function(keyMap){
for (const key in keyMap) {
try {
if (key != "tab"){
document.getElementById(key).nextElementSibling.textContent = keyMap[key].slice(0, -1);
}
} catch (error){}
}
};
window.setTextbar = function(text){
try {
document.getElementById("textbar").textContent = text;
} catch (error){}
}
function removeLeadingPlus(key) {
if (key.startsWith("+")) {
return key.slice(1);
}
return key;
}