-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
80 lines (70 loc) · 3.01 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
69
70
71
72
73
74
75
76
77
78
79
80
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<!--<script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>-->
<!--<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>-->
<script type="text/javascript" src="js/timetable.js"></script>
<link rel="stylesheet" type="text/css" href="css/timetable.css"/>
<script type="text/javascript">
$(document).ready(function() {
var orientation = 0;
var orientations = ['portrait', 'landscape'];
var timetable = $('.timetable').timetable({
activities: {
url: "activities.json"
},
ActivityOptions: {
content: function() {
var content = $('<h4>'+this.moduleName+'</h4>'
+ '<ol>'
+ '<li>'+this.location.name+'</li>'
+ '<li>'+this.activityType+'</li>'
+ '<li>Wks: '+this.weekLabels+'</li>'
+ '</ol>'
);
return content;
}
},
orientation: orientations[orientation]
}).data( "timetable" );
$("#tt1").click(function() {
timetable.render({
url: "activities.json"
});
});
$("#tt2").click(function() {
timetable.render({
url: "activities2.json"
});
});
$("#orientation").click(function() {
orientation = 1-orientation;
timetable.option("orientation", orientations[orientation]);
});
$('#dayView').click(function() {
timetable.option("dayView", !timetable.option("dayView"));
});
});
</script>
</head>
<body>
<div style="width: 100%; height: 100%;">
<div class="timetable" style="width: 100%; height: 100%;">
</div>
</div>
<div class="controls">
<button id="tt1">Timetable 1</button>
<button id="tt2">Timetable 2</button>
<button id="orientation">Toggle orientation</button>
<button id="dayView">Toggle DayView</button>
</div>
</body>
</html>