-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathview.template
45 lines (45 loc) · 1.71 KB
/
view.template
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
<html>
<head>
<style type='text/css'>
body { margin: 0; padding: 0; height: 100%; width: {{.BodyWidth}}% }
html, day { margin: 0; padding: 0; height: 100% }
.day { width: {{.DayWidth}}%; float: left }
.event_outer { overflow: hidden; margin: 0 }
.event_inner { height: 100%; padding: 2px; border: thin solid black;
font-family: Verdana, Geneva, sans-serif;
color: white; font-weight: bold }
</style>
<script type="text/javascript">
document.onkeypress = function(e) {
e = e || window.event;
var dir; var scale;
switch(e.keyCode) {
case 122: document.body.style.height = document.body.style.width = "100%"; return;
case 107: case 119: dir = "height"; factor = 9/10; break;
case 106: case 115: dir = "height"; factor = 10/9; break;
case 104: case 97: dir = "width"; factor = 9/10; break;
case 108: case 100: dir = "width"; factor = 10/9; break;
default: return;
}
document.body.style[dir] = (parseInt(document.body.style[dir] || "100%") * factor) + "%";
}
function onload_things() {
window.scroll(document.body.scrollWidth,0);
document.body.style["width"] = "{{.BodyWidth}}%";
}
</script>
</head>
<body onload="onload_things()">
{{range .Days}}
<div class='day'>
{{range .Events}}
<div class='event_outer' style='background-color: {{.Color}}; height: {{.Height}}%'>
<div class='event_inner'>
<span title='{{.Name}} ({{.DurationDescription}})'>{{.Name}}</span>
</div>
</div>
{{end}}
</div>
{{end}}
</body>
</html>