-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.gohtml
76 lines (76 loc) · 1.59 KB
/
index.gohtml
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
<!DOCTYPE html>
<html>
<head>
<title>opacover</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background: black;
color: rgb(201, 201, 201);
}
body, pre, #info span {
font-family: Menlo, monospace;
font-weight: bold;
}
#content {
float: left;
margin-left: 10px;
margin-top: 20px;
color: rgb(80, 80, 80);
}
#info, #nav {
position: fixed
float: left;
margin-left: 10px;
}
.not-covered { color: rgb(192, 0, 0) }
.covered { color: rgb(20, 236, 155) }
</style>
</head>
<body>
<h1>opacover</h1>
<div id="info">
<span>Total coverage: {{.Coverage}}%</span>
</div>
<div id="nav">
<span>File coverage:</span>
<select id="files">
{{range $k, $v := .Files}}
<option value="f{{$v.Index}}">{{$k}} ({{printf "%.1f" $v.Coverage}}%)</option>
{{end}}
</select>
</div>
<div id="content">
{{range $k, $v := .Files}}
<pre class="file" id="f{{$v.Index}}" style="display: none">{{$v.Body}}</pre>
{{end}}
</div>
</body>
<script>
(function() {
var files = document.getElementById('files');
var visible;
files.addEventListener('change', onChange, false);
function select(part) {
if (visible)
visible.style.display = 'none';
visible = document.getElementById(part);
if (!visible)
return;
files.value = part;
visible.style.display = 'block';
location.hash = part;
}
function onChange() {
select(files.value);
window.scrollTo(0, 0);
}
if (location.hash != "") {
select(location.hash.substr(1));
}
if (!visible) {
select("f0");
}
})();
</script>
</html>