-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainWindow.html
71 lines (60 loc) · 1.94 KB
/
mainWindow.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
<!DOCTYPE html>
<html lang="pl">
<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>diceRollsApp</title>
<style>
div {
padding: 10px;
border-bottom: 2px solid white;
}
body {
background-color: rgb(105, 214, 105);
}
</style>
</head>
<body>
<div style="display: grid; grid-template-columns: auto auto; border: none">
<div></div>
<div><button onclick="newSession()">nowa sesja</button></div>
<div style="text-align: right;">
<label>ID sesji: </label>
<input type="number" id="openId" value="0">
</div>
<div><button onclick="openSessionId()">otwórz sesję po jej ID</button></div>
<div style="text-align: right;">
<label>pełny adres sesji: </label>
<input type="text" id="openUrl">
</div>
<div><button onclick="openSessionUrl()">otwórz sesję po jej adresie</button></div>
</div>
<br><button id="devBtn" onclick="onDevBtn()" hidden>DevTools</button>
<script>
{
window.MainApi.onDevel(() => {
let btn = document.getElementById('devBtn');
btn.hidden = false;
});
}
function onDevBtn() {
window.MainApi.toggleDevel();
}
function newSession() {
window.MainApi.newSession();
}
function openSessionId() {
let idBox = document.getElementById('openId');
let id = parseInt(idBox.value);
if (!isNaN(id))
window.MainApi.newSession(id);
}
function openSessionUrl() {
let urlBox = document.getElementById('openUrl');
let url = String(urlBox.value);
window.MainApi.newSession(0, url);
}
</script>
</body>
</html>