/
index.html
126 lines (114 loc) · 4.36 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html>
<!--
Copyright 2013, Brian Milton
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<title>SCDX Demo</title>
<link href="css/SCDX.css" type="text/css" rel="stylesheet">
<link href="css/demo.css" type="text/css" rel="stylesheet">
</head>
<body>
<!-- This is where the schedule object will be -->
<div>
<div width="1024" id="scheduleView"></div>
</div>
<!-- A set of inputs to change the view as a demo -->
<div>
Year: <input type="text" value="2013" style="width:40px" id="yearField">
Month: <select id="monthDrop">
<option value=1 selected>January</option>
<option value=2>February</option>
<option value=3>March</option>
<option value=4>April</option>
<option value=5>May</option>
<option value=6>June</option>
<option value=7>July</option>
<option value=8>August</option>
<option value=9>September</option>
<option value=10>October</option>
<option value=11>November</option>
<option value=12>December</option>
</select>
Length: <select id="lengthDrop">
<option value=1>1 Month</option>
<option value=2>2 Months</option>
<option value=3>3 Months</option>
<option value=4>4 Months</option>
<option value=5>5 Months</option>
<option value=6>6 Months</option>
<option value=12 selected>12 Months</option>
<option value=15>15 Months</option>
<option value=18>18 Months</option>
<option value=24>24 Months</option>
</select>
<button onClick="updateView()">Change</button>
</div>
<script src="js/SCDX.js"></script>
<script>
// A hard coded set of schedule items.
// Yes, they're in the global namespace, but it's only a demo! :P
var scheduleList = [{
'groupId':1,
'rowLabel':'Team One',
'startDate':1360886400000,
'endDate':1363305600000,
'prio':'high',
'description':"Project: Test<br>Stakeholder: Me, Myself & I<br>Members: 10"
},{
'groupId':1,
'rowLabel':'Team One',
'startDate':1363392000000,
'endDate':1364688000000,
'prio':'low'
},{
'groupId':2,
'rowLabel':'Team Five',
'startDate':1360886400000,
'endDate':1364688000000
},{
'groupId':2,
'rowLabel':'Team Five',
'startDate':1364774400000,
'endDate':1367280000000,
'prio':'low'
},{
'groupId':2,
'rowLabel':'Team Five',
'startDate':1367366400000,
'endDate':1375228800000,
'prio':'high'
},{
'groupId':3,
'rowLabel':'Team Four',
'startDate':1367366400000,
'endDate':1375228800000,
'description':'Event: Big Project<br>Brian Milton<br>Includes: 5 developers'
}];
// Create the schedule object:
// Passes the '#scheduleView', specifies 2013 as the year, with 1024px width displaying 12 months from January.
SCDX.createSchedule('scheduleView',2013,1024,12,1);
// Assign the array of items to the view.
SCDX.setSchedule(scheduleList);
// Pop up an error message, but as a demonstration, not because of an error.
//SCDX.displayErrorMessage("Welcome to SCDX. Don't panic!",2500);
// When the button is clicked, this function will triger a view change:
function updateView() {
var year = document.getElementById('yearField').value,
month = document.getElementById('monthDrop').value,
duration = document.getElementById('lengthDrop').value;
// And it is really that simple...
SCDX.changeView(year,month,duration);
}
</script>
</body>
</html>