-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
68 lines (60 loc) · 2.25 KB
/
index.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
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Elm in WebAssembly</title>
<link rel="icon" href="./favicon.png" type="image/png" />
<style>
body {
background-color: black;
color: lightgreen;
height: 100%;
}
#controls {
padding: 16px 4px;
}
button {
background-color: #ccc;
font-weight: 700;
font-family: monospace;
}
#output {
width: 100%;
height: 100vw;
}
</style>
</head>
<body>
<div id="controls">
<button data-abbrev='a' onclick="selectTest(this)">ALL</button>
<button data-abbrev='t' onclick="selectTest(this)">types</button>
<button data-abbrev='u' onclick="selectTest(this)">utils</button>
<button data-abbrev='b' onclick="selectTest(this)">basics</button>
<button data-abbrev='s' onclick="selectTest(this)">string</button>
<button data-abbrev='c' onclick="selectTest(this)">char</button>
<button data-abbrev='l' onclick="selectTest(this)">list</button>
<button data-abbrev='d' onclick="selectTest(this)">debug</button>
<button data-abbrev='j' onclick="selectTest(this)">json</button>
<button data-abbrev='w' onclick="selectTest(this)">wrapper</button>
<button data-abbrev='p' onclick="selectTest(this)">platform</button>
<button data-abbrev='g' onclick="selectTest(this)">gc</button>
</div>
<pre id="output" height="100%"></pre>
<script type="text/javascript">
const controls = document.getElementById('controls');
const search = new URLSearchParams(location.search);
const argv = search.get('argv') || '-av';
document.getElementById('output').textContent = `Running tests with arguments ${argv}...\n\n`;
Array.from(controls.children).forEach(button => {
const { abbrev } = button.dataset;
button.style.backgroundColor = argv.includes(abbrev) ? 'gold' : '';
})
function selectTest(button) {
const { abbrev } = button.dataset;
location.href = `?argv=-${abbrev}v`;
}
</script>
<script async type="text/javascript" src="./dist/wasm/test.js"></script>
</body>
</html>