Changeset 2879
- Timestamp:
- 04/23/10 11:42:51
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/bedeworkFb.js
r2878 r2879 92 92 * zoom: integer - scalar value for zooming the grid 93 93 */ 94 var bw FreeBusy= function(displayId, startRange, endRange, startDate, endDate, startHoursRange, endHoursRange, attendees, workday, zoom) {94 var bwSchedulingGrid = function(displayId, startRange, endRange, startDate, endDate, startHoursRange, endHoursRange, attendees, workday, zoom) { 95 95 this.displayId = displayId; 96 96 this.startRange = new Date(startRange); … … 170 170 for (j = 0; j < hourRange; j++) { 171 171 for (k = 0; k < this.hourDivision; k++) { 172 var fbCell = document.createElement("td"); 173 fbCell.id = curDate.getTime() + "-AllAttendees"; 174 $(fbCell).addClass("fbcell"); 172 175 if (curDate.getMinutes() == 0) { 173 $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees" class="hourBoundry fbcell"></td>'); 174 } else { 175 $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees" class="fbcell"></td>'); 176 } 176 $(fbCell).addClass("hourBoundry"); 177 } 178 $(fbDisplayTimesRow).append(fbCell); 177 179 curDate.addMinutes(60/this.hourDivision); 178 180 } … … 225 227 $(fbDisplayTimesRow).append('<td class="role optional"><span class="icon"> </span><span class="text">' + bwAttendeeDispRoleOptional + '</span></td>'); 226 228 } 227 $(fbDisplayTimesRow).append('<td class="name">' + curAttendee.name + '</td><td class="fbBoundry"></td>'); 229 230 // output the attendee name or address (depending on which we have available) 231 if (curAttendee.name && curAttendee.name != "") { 232 $(fbDisplayTimesRow).append('<td class="name">' + curAttendee.name + '</td><td class="fbBoundry"></td>'); 233 } else { 234 $(fbDisplayTimesRow).append('<td class="name">' + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1) + '</td><td class="fbBoundry"></td>'); 235 } 236 237 // build the time row for an attendee 228 238 for (i = 0; i < range; i++) { 229 239 var curDate = new Date(this.startRange); … … 233 243 for (j = 0; j < hourRange; j++) { 234 244 for (k = 0; k < this.hourDivision; k++) { 245 var fbCell = document.createElement("td"); 246 fbCell.id = curDate.getTime() + "-" + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1); 247 $(fbCell).addClass("fbcell"); 235 248 if (curDate.getMinutes() == 0) { 236 $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees" class="hourBoundry"></td>'); 237 } else { 238 $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees fbcell"></td>'); 239 } 240 // increment by the number of minutes in the hour division 241 curDate.addMinutes(60 / this.hourDivision); 249 $(fbCell).addClass("hourBoundry"); 250 } 251 //switch (bwFreeBusycurDate.getTime()) 252 $(fbDisplayTimesRow).append(fbCell); 253 curDate.addMinutes(60/this.hourDivision); 242 254 } 243 255 } … … 245 257 } 246 258 } 259 260 // 247 261 248 262 // finally, write the table back to the display … … 312 326 313 327 /* 314 315 316 328 * From RFC 5545 317 329 * The following is an example of a "VFREEBUSY" calendar component 318 319 320 321 330 used to reply to the request with busy time information: 322 323 324 331 325 332 BEGIN:VFREEBUSY 326 327 328 329 333 UID:19970901T095957Z-76A912@example.com 330 331 332 333 334 ORGANIZER:mailto:jane_doe@example.com 334 335 336 337 335 ATTENDEE:mailto:john_public@example.com 338 339 340 341 336 DTSTAMP:19970901T100000Z 342 343 344 345 337 FREEBUSY:19971015T050000Z/PT8H30M, 346 347 348 349 338 19971015T160000Z/PT5H30M,19971015T223000Z/PT6H30M 350 351 352 353 339 URL:http://example.com/pub/busy/jpublic-01.ifb 354 355 356 357 340 COMMENT:This iCalendar file contains busy time information for 358 359 360 361 341 the next three months. 362 363 364 365 342 END:VFREEBUSY 366 343 367 368 369 344 The following is an example of a "VFREEBUSY" calendar component 370 371 372 373 345 used to publish busy time information: 374 346 375 376 377 347 BEGIN:VFREEBUSY 378 379 380 381 348 UID:19970901T115957Z-76A912@example.com 382 383 384 385 349 DTSTAMP:19970901T120000Z 386 387 388 389 350 ORGANIZER:jsmith@example.com 390 391 392 393 351 DTSTART:19980313T141711Z 394 395 396 397 352 DTEND:19980410T141711Z 398 399 400 401 353 FREEBUSY:19980314T233000Z/19980315T003000Z 402 403 404 405 354 FREEBUSY:19980316T153000Z/19980316T163000Z 406 407 408 409 355 FREEBUSY:19980318T030000Z/19980318T040000Z 410 411 412 413 356 URL:http://www.example.com/calendar/busytime/jsmith.ifb 414 415 416 417 357 END:VFREEBUSY 418 419 420 421 358 * 422 423 424 425 359 */ 426 427 428 trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/index.html
r2875 r2879 18 18 // initialize the free/busy grid - values taken directly from the xml 19 19 // send params: displayId, startRange, endRange, startDate, endDate, attendees, workday, zoom 20 var fbGrid = new bwFreeBusy("bwFreeBusyDisplay","April 21, 2010","April 27, 2010","April 21, 2010 11:00:00","April 21, 2010 11:30:00",8,17,[{name:"Arlen Johnson",uid:"mailto:johnsa@rpi.edu",freebusy:[],role:"CHAIR",status:"ACCEPTED",type:"person"}],true,100);20 var bwGrid = new bwSchedulingGrid("bwFreeBusyDisplay","April 21, 2010","April 27, 2010","April 21, 2010 11:00:00","April 21, 2010 11:30:00",8,17,[{name:"Arlen Johnson",uid:"mailto:johnsa@rpi.edu",freebusy:["20100421T050000Z/PT2H00M","20100423T050000Z/PT8H30M"],role:"CHAIR",status:"ACCEPTED",type:"person"}],true,100); 21 21 22 22 // send in some attendees - these will come from interaction with the form 23 fbGrid.addAttendee("Gary Schwartz", "mailto:schwag@rpi.edu", [], "REQ-PARTICIPANT", "NEEDS-ACTION"); 24 fbGrid.addAttendee("Mike Douglass", "mailto:douglm@rpi.edu", [], "OPT-PARTICIPANT", "DECLINED"); 25 26 23 bwGrid.addAttendee("Gary Schwartz", "mailto:schwag@rpi.edu", ["20100422T050000Z/PT1H00M"], "REQ-PARTICIPANT", "NEEDS-ACTION"); 24 bwGrid.addAttendee("", "mailto:douglm@rpi.edu", ["20100421T120000Z/20100421T130000Z","20100421T050000Z/20100422T050000Z"], "OPT-PARTICIPANT", "DECLINED"); 27 25 28 26 // set datepicker defaults … … 50 48 51 49 // buld the free/busy grid 52 fbGrid.display();50 bwGrid.display(); 53 51 54 52 });
