-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcalendarGantt-weekDemo-src.html
308 lines (274 loc) · 9.48 KB
/
calendarGantt-weekDemo-src.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Calendar Gantt</title>
<!-- jquery core -->
<script src="js/jquery/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="js/jquery/jquery-ui.min.js" type="text/javascript"></script>
<link href="js/jquery/jquery-ui-1.10.2.custom.css" rel="stylesheet">
<link href="js/google-code-prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/google-code-prettify/prettify.js"></script>
<!-- Vector -->
<script src="https://cdn.rawgit.com/jchome/vectorManager/master/js/vectorManager-1.3-min.js" type="text/javascript"></script>
<link href="https://cdn.rawgit.com/jchome/vectorManager/master/css/vectorManager.css" rel="stylesheet">
<!-- Calendar -->
<link href="js/ganttCalendar/css/ganttCalendar.css" media="screen, projection" rel="stylesheet" type="text/css" />
<script src="js/ganttCalendar/ganttCalendar-src.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
// Definition : EventCal(ressourceId, eventId, startDay, endDay, label)
var evt1 = new EventCal(1, "event_001", 4, 5, "Event Paris - WSDD");
var evt2 = new EventCal(2, "event_002", 5, 7, "Paris - WSDD(2-5)");
var evt2_bis = new EventCal(2, "event_002_bis", 4, 6, "Réunion");
var evt3 = new EventCal(2, "event_003", 14, 17, "Préparation Evènement");
var evt5 = new EventCal(3, "event_005", 9, 11, "Week-end");
var evt5_bis = new EventCal(3, "event_005_bis", 8, 9.5, "Réunion");
var evt5_ter = new EventCal(3, "event_005_ter", 6.5, 8.5, "Transfert");
var evt6 = new EventCal(4, "event_006", 9, 11, "Week-end");
var evt7 = new EventCal(5, "event_007", 9, 11, "Week-end");
var evt8 = new EventCal(6, "event_008", 9, 11, "Week-end");
var evt9 = new EventCal(7, "event_009", 9, 11, "Week-end");
var evt10 = new EventCal(8, "event_010", 9, 11, "Week-end");
var evt11 = new EventCal(9, "event_011", 9, 11, "Week-end");
var evt12 = new EventCal(10, "event_012", 9, 11, "Week-end");
var evt13 = new EventCal(11, "event_013", 9, 11, "Week-end");
var evt14 = new EventCal(1, "event_014", 9, 11, "Week-end");
var evt15 = new EventCal(2, "event_015", 9, 11, "Week-end");
var evt101 = new EventCal(101, "event_101", 7, 8, "Répétition générale");
var evt102 = new EventCal(102, "event_102", 6, 8, "Contrôle qualité");
var timeline = new TimeLineWeek("myGanttCalendar",10, 2013,
{groups:
[ {name: "Singers",
id: 1,
resources: [{name:"Henri", id:1},
{name:"Frank", id:2},
{name:"Jenny", id:3},
{name:"Stan", id:4},
{name:"Sammy", id:5},
{name:"Jason", id:6},
{name:"Robert", id:7},
{name:"Madison", id:8},
{name:"Juliette", id:9},
{name:"Nassa", id:10},
{name:"Tamara", id:11}]
}, {name: "Objects",
id: 2,
resources: [{name:"Micro",id:101},
{name:"Ampli", id:102}]
}]
},
function(){ // updateWeekCallback()
switch(this.year){
case 2011:
break;
case 2013:
switch (this.weekNumber) {
case 10:
evt1.drawIn(this);
evt2.drawIn(this);
evt2_bis.drawIn(this);
evt5.drawIn(this);
evt5_bis.drawIn(this);
evt5_ter.drawIn(this);
evt6.drawIn(this);
evt7.drawIn(this);
evt8.drawIn(this);
evt9.drawIn(this);
evt10.drawIn(this);
evt11.drawIn(this);
evt12.drawIn(this);
evt13.drawIn(this);
evt14.drawIn(this);
evt15.drawIn(this);
evt101.drawIn(this);
evt102.drawIn(this);
evt1.jObject.addClass("specialEvent");
evt2.jObject.addClass("flagEvent");
evt5.jObject.addClass("flagEvent");
break;
case 11:
evt3.drawIn(this);
break;
default:
break;
}
break;
default:
break;
}
}
);
timeline.lang = 'fr';
timeline.cellWidth = 150;
timeline.drawElements();
evt1.jObject.mouseover(
function(e){
var infoBox = $("#info_evt1");
var x = e.pageX - this.offsetLeft;
var y = e.pageY - this.offsetTop;
infoBox.css("left",x+10);
infoBox.css("top",y+15);
infoBox.show();
});
evt1.jObject.mouseout(function(e){
$("#info_evt1").hide();
});
/**
* Zoom feature
*/
$( "#zoomSlider" ).slider({ min:50, max: 200, step: 50,
value: timeline.cellWidth,
change: function( event, ui ) {
timeline.cellWidth = ui.value;
timeline.drawElements();
$("#zoomValue").html(ui.value);
}
});
$("#zoomValue").html(timeline.cellWidth);
});
</script>
</head>
<body onload="prettyPrint()">
<h1>GanttCalendar Demo</h1>
<p>Démo du mode "Affichage hebdomadaire" avec 4 niveaux de zoom.
<br/>
<a href="http://julien.coron.free.fr/?tag=gantt-calendar">Retour à l'article</a>
|
<a href="calendarGantt-monthDemo-src.html">Calendrier Mensuel</a>
</p>
<div id="myGanttCalendar">
</div>
<div style="margin: 20px;">Zoom :
<div class="zoomWidget">
<div id="zoomSlider"></div>
<div id="zoomValue"></div>
</div>
</div>
<div id="info_evt1" class="infoBox" style="display:none;position: absolute; top:10; left:10;">
<div class="header">Event Paris - WSDD</div>
<div class="content">
La 3e et la plus importante conférence des Nations Unies sur l’environnement et le
développement durable, aussi connue sous le nom de « Sommet planète Terre », a eu lieu à RIO
de Janeiro, au Brésil en juin 1992. Cette conférence a réuni les dirigeants politiques, les
diplomates, les scientifiques, les représentants des organisations non gouvernementales (ONG)
de 182 pays dans un élan visant à concilier l’impact des activités socio-économiques humaines et
l’environnement.
</div>
</div>
<div class="debug"></div>
<pre class="prettyprint">
$(function() {
// Definition : EventCal(ressourceId, eventId, startDay, endDay, label)
var evt1 = new EventCal(1, "event_001", 4, 5, "Event Paris - WSDD");
var evt2 = new EventCal(2, "event_002", 5, 7, "Paris - WSDD(2-5)");
var evt2_bis = new EventCal(2, "event_002_bis", 4, 6, "Réunion");
var evt3 = new EventCal(2, "event_003", 14, 17, "Préparation Evènement");
var evt5 = new EventCal(3, "event_005", 9, 11, "Week-end");
var evt5_bis = new EventCal(3, "event_005_bis", 8, 9.5, "Réunion");
var evt5_ter = new EventCal(3, "event_005_ter", 6.5, 8.5, "Transfert");
var evt6 = new EventCal(4, "event_006", 9, 11, "Week-end");
var evt7 = new EventCal(5, "event_007", 9, 11, "Week-end");
var evt8 = new EventCal(6, "event_008", 9, 11, "Week-end");
var evt9 = new EventCal(7, "event_009", 9, 11, "Week-end");
var evt10 = new EventCal(8, "event_010", 9, 11, "Week-end");
var evt11 = new EventCal(9, "event_011", 9, 11, "Week-end");
var evt12 = new EventCal(10, "event_012", 9, 11, "Week-end");
var evt13 = new EventCal(11, "event_013", 9, 11, "Week-end");
var evt14 = new EventCal(1, "event_014", 9, 11, "Week-end");
var evt15 = new EventCal(2, "event_015", 9, 11, "Week-end");
var evt101 = new EventCal(101, "event_101", 7, 8, "Répétition générale");
var evt102 = new EventCal(102, "event_102", 6, 8, "Contrôle qualité");
var timeline = new TimeLineWeek("myGanttCalendar",10, 2013,
{groups:
[ {name: "Singers",
id: 1,
resources: [{name:"Henri", id:1},
{name:"Frank", id:2},
{name:"Jenny", id:3},
{name:"Stan", id:4},
{name:"Sammy", id:5},
{name:"Jason", id:6},
{name:"Robert", id:7},
{name:"Madison", id:8},
{name:"Juliette", id:9},
{name:"Nassa", id:10},
{name:"Tamara", id:11}]
}, {name: "Objects",
id: 2,
resources: [{name:"Micro",id:101},
{name:"Ampli", id:102}]
}]
},
function(){ // updateWeekCallback()
switch(this.year){
case 2011:
break;
case 2013:
switch (this.weekNumber) {
case 10:
evt1.drawIn(this);
evt2.drawIn(this);
evt2_bis.drawIn(this);
evt5.drawIn(this);
evt5_bis.drawIn(this);
evt5_ter.drawIn(this);
evt6.drawIn(this);
evt7.drawIn(this);
evt8.drawIn(this);
evt9.drawIn(this);
evt10.drawIn(this);
evt11.drawIn(this);
evt12.drawIn(this);
evt13.drawIn(this);
evt14.drawIn(this);
evt15.drawIn(this);
evt101.drawIn(this);
evt102.drawIn(this);
evt1.jObject.addClass("specialEvent");
evt2.jObject.addClass("flagEvent");
evt5.jObject.addClass("flagEvent");
break;
case 11:
evt3.drawIn(this);
break;
default:
break;
}
break;
default:
break;
}
}
);
timeline.lang = 'fr';
timeline.cellWidth = 150;
timeline.drawElements();
evt1.jObject.mouseover(
function(e){
var infoBox = $("#info_evt1");
var x = e.pageX - this.offsetLeft;
var y = e.pageY - this.offsetTop;
infoBox.css("left",x+10);
infoBox.css("top",y+15);
infoBox.show();
});
evt1.jObject.mouseout(function(e){
$("#info_evt1").hide();
});
/**
* Zoom feature
*/
$( "#zoomSlider" ).slider({ min:50, max: 200, step: 50,
value: timeline.cellWidth,
change: function( event, ui ) {
timeline.cellWidth = ui.value;
timeline.drawElements();
$("#zoomValue").html(ui.value);
}
});
$("#zoomValue").html(timeline.cellWidth);
});
</pre>
</body>
</html>