Changeset 2883
- Timestamp:
- 04/25/10 10:07:32
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/bedeworkFb.js
r2882 r2883 207 207 208 208 // generate the date row - includes top left empty corner 209 var fbDisplayDateRow = fbDisplay.insertRow( 0);209 var fbDisplayDateRow = fbDisplay.insertRow(fbDisplay.rows.length); 210 210 $(fbDisplayDateRow).html('<td rowspan="2" colspan="3" class="corner"></td><td class="fbBoundry"></td>'); 211 211 for (i=0; i < range; i++) { … … 216 216 217 217 // generate the times row - each cell spans over the day divisions 218 fbDisplayTimesRow = fbDisplay.insertRow( 1);218 fbDisplayTimesRow = fbDisplay.insertRow(fbDisplay.rows.length); 219 219 $(fbDisplayTimesRow).html('<td class="fbBoundry"></td>'); 220 220 for (i=0; i < range; i++) { … … 234 234 235 235 // generate the "All Attendees" row 236 fbDisplayTimesRow = fbDisplay.insertRow( 2);236 fbDisplayTimesRow = fbDisplay.insertRow(fbDisplay.rows.length); 237 237 $(fbDisplayTimesRow).addClass("allAttendees"); 238 238 $(fbDisplayTimesRow).html('<td class="status"></td><td class="role"></td><td class="name">All Attendees</td><td class="fbBoundry"></td>'); … … 273 273 // generate the regular attendees rows 274 274 for (attendee = 0; attendee < this.attendees.length; attendee++) { 275 fbDisplay TimesRow = fbDisplay.insertRow(attendee + 3); // offset by three to account for previous special rows275 fbDisplayAttendeeRow = fbDisplay.insertRow(fbDisplay.rows.length); 276 276 var curAttendee = this.attendees[attendee]; 277 277 … … 280 280 switch (curAttendee.status) { 281 281 case bwAttendeeStatusAccepted : 282 $(fbDisplay TimesRow).html('<td class="status accepted"><span class="icon">✔</span><span class="text">' + bwAttendeeDispStatusAccepted + '</span></td>');282 $(fbDisplayAttendeeRow).html('<td class="status accepted"><span class="icon">✔</span><span class="text">' + bwAttendeeDispStatusAccepted + '</span></td>'); 283 283 break; 284 284 case bwAttendeeStatusDeclined : 285 $(fbDisplay TimesRow).html('<td class="status declined"><span class="icon">x</span><span class="text">' + bwAttendeeDispStatusDeclined + '</span></td>');285 $(fbDisplayAttendeeRow).html('<td class="status declined"><span class="icon">x</span><span class="text">' + bwAttendeeDispStatusDeclined + '</span></td>'); 286 286 break; 287 287 case bwAttendeeStatusTentative : 288 $(fbDisplay TimesRow).html('<td class="status tentative"><span class="icon">-</span><span class="text">' + bwAttendeeDispStatusTentative + '</span></td>');288 $(fbDisplayAttendeeRow).html('<td class="status tentative"><span class="icon">-</span><span class="text">' + bwAttendeeDispStatusTentative + '</span></td>'); 289 289 break; 290 290 case bwAttendeeStatusDelegated : 291 $(fbDisplay TimesRow).html('<td class="status delegated"><span class="icon"></span><span class="text">' + bwAttendeeDispStatusDelegated + '</span></td>');291 $(fbDisplayAttendeeRow).html('<td class="status delegated"><span class="icon"></span><span class="text">' + bwAttendeeDispStatusDelegated + '</span></td>'); 292 292 break; 293 293 case bwAttendeeStatusCompleted : 294 $(fbDisplay TimesRow).html('<td class="status completed"><span class="icon"></span><span class="text">' + bwAttendeeDispStatusCompleted + '</span></td>');294 $(fbDisplayAttendeeRow).html('<td class="status completed"><span class="icon"></span><span class="text">' + bwAttendeeDispStatusCompleted + '</span></td>'); 295 295 break; 296 296 case bwAttendeeStatusInProcess : 297 $(fbDisplay TimesRow).html('<td class="status inprocess"><span class="icon"></span><span class="text">' + bwAttendeeDispStatusInProcess + '</span></td>');297 $(fbDisplayAttendeeRow).html('<td class="status inprocess"><span class="icon"></span><span class="text">' + bwAttendeeDispStatusInProcess + '</span></td>'); 298 298 break; 299 299 default : // default to bwAttendeeStatusNeedsAction - display question mark 300 $(fbDisplay TimesRow).html('<td class="status needsaction"><span class="icon">?</span><span class="text">' + bwAttendeeDispStatusNeedsAction + '</span></td>');300 $(fbDisplayAttendeeRow).html('<td class="status needsaction"><span class="icon">?</span><span class="text">' + bwAttendeeDispStatusNeedsAction + '</span></td>'); 301 301 } 302 302 … … 305 305 switch (curAttendee.role) { 306 306 case bwAttendeeRoleChair : // displays writing hand icon 307 $(fbDisplay TimesRow).append('<td class="role chair"><span class="icon">✍</span><span class="text">' + bwAttendeeDispRoleChair + '</span></td>');307 $(fbDisplayAttendeeRow).append('<td class="role chair"><span class="icon">✍</span><span class="text">' + bwAttendeeDispRoleChair + '</span></td>'); 308 308 break; 309 309 case bwAttendeeRoleRequired : // displays right-pointing arrow icon 310 $(fbDisplay TimesRow).append('<td class="role required"><span class="icon">➙</span><span class="text">' + bwAttendeeDispRoleRequired + '</span></td>');310 $(fbDisplayAttendeeRow).append('<td class="role required"><span class="icon">➙</span><span class="text">' + bwAttendeeDispRoleRequired + '</span></td>'); 311 311 break; 312 312 case bwAttendeeRoleNonParticipant : // non-participant 313 $(fbDisplay TimesRow).append('<td class="role nonparticipant"><span class="icon">x</span><span class="text">' + bwAttendeeDispRoleNonParticipant + '</span></td>');313 $(fbDisplayAttendeeRow).append('<td class="role nonparticipant"><span class="icon">x</span><span class="text">' + bwAttendeeDispRoleNonParticipant + '</span></td>'); 314 314 break; 315 315 default : // bwAttendeeRoleOptional - no icon (use a space to provide a rollover) 316 $(fbDisplay TimesRow).append('<td class="role optional"><span class="icon"> </span><span class="text">' + bwAttendeeDispRoleOptional + '</span></td>');316 $(fbDisplayAttendeeRow).append('<td class="role optional"><span class="icon"> </span><span class="text">' + bwAttendeeDispRoleOptional + '</span></td>'); 317 317 } 318 318 319 319 // output the attendee name or address (depending on which we have available) 320 320 if (curAttendee.name && curAttendee.name != "") { 321 $(fbDisplay TimesRow).append('<td class="name">' + curAttendee.name + '</td><td class="fbBoundry"></td>');321 $(fbDisplayAttendeeRow).append('<td class="name">' + curAttendee.name + '</td><td class="fbBoundry"></td>'); 322 322 } else { 323 $(fbDisplay TimesRow).append('<td class="name">' + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1) + '</td><td class="fbBoundry"></td>');323 $(fbDisplayAttendeeRow).append('<td class="name">' + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1) + '</td><td class="fbBoundry"></td>'); 324 324 } 325 325 … … 342 342 // adding the hourdivision increment in the calculation below is to correct for a bug 343 343 // in which the class was always offset by one table cell - should find cause 344 var curDateUTC = curDate.getTime() + tzoffset + (60 /this.hourDivision*60000);344 var curDateUTC = curDate.getTime() + tzoffset + (60 / this.hourDivision * 60000); 345 345 if (curAttendee.freebusy[m].contains(curDateUTC)) { 346 346 $(fbCell).addClass("busy"); … … 348 348 } 349 349 } 350 $(fbDisplay TimesRow).append(fbCell);350 $(fbDisplayAttendeeRow).append(fbCell); 351 351 curDate.addMinutes(60/this.hourDivision); 352 352 } 353 353 } 354 $(fbDisplayTimesRow).append('<td class="dayBoundry"></td>'); 355 } 356 } 357 358 // 359 360 // finally, write the table back to the display 354 $(fbDisplayAttendeeRow).append('<td class="dayBoundry"></td>'); 355 } 356 } 357 358 // generate the "add attendee" row 359 fbDisplayAddAttendeeRow = fbDisplay.insertRow(fbDisplay.rows.length); 360 $(fbDisplayAddAttendeeRow).html('<td class="status"></td><td class="role"></td><td class="name" id="addAttendee">add attendee...</td><td class="fbBoundry"></td>'); 361 for (i = 0; i < range; i++) { 362 var curDate = new Date(this.startRange); 363 curDate.setHours(startHour); 364 curDate.addDays(i); 365 // add the time cells by iterating over the hours 366 for (j = 0; j < hourRange; j++) { 367 for (k = 0; k < this.hourDivision; k++) { 368 var fbCell = document.createElement("td"); 369 fbCell.id = curDate.getTime() + "-" + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1); 370 $(fbCell).addClass("fbcell"); 371 if (curDate.getMinutes() == 0 && j != 0) { 372 $(fbCell).addClass("hourBoundry"); 373 } 374 $(fbDisplayAddAttendeeRow).append(fbCell); 375 curDate.addMinutes(60/this.hourDivision); 376 } 377 } 378 $(fbDisplayAddAttendeeRow).append('<td class="dayBoundry"></td>'); 379 } 380 381 // generate a blank row at the end (this is just for visual padding) 382 fbDisplayBlankRow = fbDisplay.insertRow(fbDisplay.rows.length); 383 $(fbDisplayBlankRow).html('<td class="status"></td><td class="role"></td><td class="name"></td><td class="fbBoundry"></td>'); 384 for (i = 0; i < range; i++) { 385 var curDate = new Date(this.startRange); 386 curDate.setHours(startHour); 387 curDate.addDays(i); 388 // add the time cells by iterating over the hours 389 for (j = 0; j < hourRange; j++) { 390 for (k = 0; k < this.hourDivision; k++) { 391 var fbCell = document.createElement("td"); 392 fbCell.id = curDate.getTime() + "-" + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1); 393 $(fbCell).addClass("fbcell"); 394 if (curDate.getMinutes() == 0 && j != 0) { 395 $(fbCell).addClass("hourBoundry"); 396 } 397 $(fbDisplayBlankRow).append(fbCell); 398 curDate.addMinutes(60/this.hourDivision); 399 } 400 } 401 $(fbDisplayBlankRow).append('<td class="dayBoundry"></td>'); 402 } 403 404 405 // write the table back to the display 361 406 $("#" + displayId).html(fbDisplay); 362 407 363 408 364 // now add some rollovers to the elements of the freebusy grid 409 // now add some rollovers and onclick actions 410 // to the elements of the freebusy grid 365 411 $("#bwScheduleTable .icon").hover( 366 412 function () { trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/schedule.css
r2882 r2883 4 4 } 5 5 s#bwSchedule { 6 position: relative; 7 margin: 2em; 8 padding: 0; 9 overflow: scroll; 6 } 7 #bwFreeBusyDisplay { 8 margin: 2em 2em 0 2em; 9 width: 90%; 10 overflow: scroll; 10 11 } 11 12 #bwScheduleTable { … … 58 59 font-size: 1.6em; 59 60 } 61 #bwScheduleTable td.name { 62 padding-right: 1em; 63 } 60 64 #bwScheduleTable td.accepted { 61 65 color: #5a0; … … 66 70 font-family: Paladino, Times, serif; 67 71 } 68 #bwScheduleTable input.addAttendee { 69 margin-top: 4px; 70 border: none; 71 font-size: 0.9em; 72 #bwScheduleTable #addAttendee { 72 73 color: #bbb; 73 74 background-color: transparent; 75 cursor: pointer; 76 padding: 8px 0 8px 4px; 74 77 } 75 78 #bwScheduleTable td.busy {
