Changeset 2891
- Timestamp:
- 05/04/10 16:48:14
- Files:
-
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/bedeworkFb.js (modified) (18 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/chair.gif (modified) (previous)
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/check.gif (modified) (previous)
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/index.html (modified) (2 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/reqArrow.gif (modified) (previous)
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/schedule.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/bedeworkFb.js
r2888 r2891 70 70 * status: String - participation status (PARTSTAT) 71 71 * type: String - person, location, other resource 72 * selected: Boolean - if attendee is included in picknext selections (checkbox next to attendee in grid) 72 73 */ 73 74 var bwAttendee = function(name, uid, freebusyStrings, role, status, type) { … … 78 79 this.status = status; 79 80 this.type = type; 81 this.selected = true; 80 82 81 83 //populate the freebusy objects … … 191 193 192 194 // how much will we divide the hour in the grid? 193 // this is a constant for now, but could be variable. 194 // ALWAYS set as a factor of 60 195 // ALWAYS set as a factor of 60 and never below 1 196 // Be forewarned: changing this value quantizes the set of 197 // times to be displayed, e.g. hourDivision = 4 quantizes the 198 // display to 15 minute increments; hourDivision = 1 locks the events to the 199 // nearest hour (not a good outcome) 200 // 4, 6, or 12 is preferred (and higher begins to slow down the display) 201 // If in doubt, leave this at 4 195 202 this.hourDivision = 4; 196 203 … … 204 211 var selecting = false; // are we currently selecting? If true, we'll highlight as we hover 205 212 var cellsInDuration = durationMils / incrementMils; // calculate the number of cells in the duration for use in setting freeTime lookup 213 var pickNextClicked = false; // false until the first time we click "pick next" - allows us to show the first free time window on first click 206 214 207 215 … … 213 221 } 214 222 215 this. deleteAttendee = function(index) {223 this.removeAttendee = function(index) { 216 224 this.attendees.splice(index, 1); 217 this.di play();225 this.display(); 218 226 } 219 227 … … 223 231 224 232 // go to the next freeTime if available and highlight it 225 if (this.freeTimeIndex < this.freeTime.length - 1) { 233 // don't increment if it's the very first time we've clicked the button 234 if (this.freeTimeIndex < this.freeTime.length - 1 && pickNextClicked) { 226 235 this.freeTimeIndex += 1; 227 236 } 228 237 229 238 // set the start of the selection range using the freeTimeIndex 230 239 var curSelectionTime = Number(this.freeTime[this.freeTimeIndex]); … … 239 248 } 240 249 }); 250 251 // we've clicked pickedNext - so set the pickNextClicked flag to true 252 // this flag lets us highlight the very first free time window on first click 253 pickNextClicked = true; 241 254 } 242 255 … … 283 296 } 284 297 } 298 } 299 300 this.setIncrement = function(val) { 301 this.hourDivision = val; 302 this.display(); 285 303 } 286 304 … … 338 356 fbDisplayTimesRow = fbDisplay.insertRow(fbDisplay.rows.length); 339 357 $(fbDisplayTimesRow).addClass("allAttendees"); 340 $(fbDisplayTimesRow).html('<td class="status"></td><td class="role"></td><td class="name">All Attendees</td><td class="check"><input type="checkbox" checked="checked" name="selectAllToggle" class="selectAllToggle"/></td><td class="fbBoundry"></td>');358 $(fbDisplayTimesRow).html('<td class="status"></td><td class="role"></td><td class="name">All Attendees</td><td></td><td class="fbBoundry"></td>'); 341 359 for (i=0; i < range; i++) { 342 360 var curDate = new Date(this.startRange); … … 364 382 // in which the class was always offset by one table cell - should find cause 365 383 var curDateUTC = curDate.getTime() + tzoffset + (60 / this.hourDivision * 60000); 366 if (this.attendees[att].freebusy[m].contains(curDateUTC) ) {384 if (this.attendees[att].freebusy[m].contains(curDateUTC) && this.attendees[att].selected) { 367 385 $(fbCell).addClass("busy"); 368 386 // change the last added fb in the hash to true … … 382 400 // generate the regular attendees rows 383 401 for (attendee = 0; attendee < this.attendees.length; attendee++) { 384 fbDisplayAttendeeRow = fbDisplay.insertRow(fbDisplay.rows.length); 402 fbDisplayAttendeeRow = fbDisplay.insertRow(fbDisplay.rows.length); 385 403 var curAttendee = this.attendees[attendee]; 404 405 // if the current attendee is deselected, mark the row as such 406 if (!curAttendee.selected) { 407 $(fbDisplayAttendeeRow).addClass("deselected"); 408 } 386 409 387 410 // set the status icon and class 388 411 // the status class is used for rollover descriptions of the icon 389 412 switch (curAttendee.status) { 390 case bwAttendeeStatusAccepted : // ✔ - make an image to avoid font issues413 case bwAttendeeStatusAccepted: // ✔ - make an image to avoid font issues 391 414 $(fbDisplayAttendeeRow).html('<td class="status accepted"><span class="icon"><img src="check.gif" alt="accepted" width="15" height="15"/></span><span class="tip">' + bwAttendeeDispStatusAccepted + '</span></td>'); 392 415 break; 393 case bwAttendeeStatusDeclined :416 case bwAttendeeStatusDeclined: 394 417 $(fbDisplayAttendeeRow).html('<td class="status declined"><span class="icon">x</span><span class="tip">' + bwAttendeeDispStatusDeclined + '</span></td>'); 395 418 break; 396 case bwAttendeeStatusTentative :419 case bwAttendeeStatusTentative: 397 420 $(fbDisplayAttendeeRow).html('<td class="status tentative"><span class="icon">-</span><span class="tip">' + bwAttendeeDispStatusTentative + '</span></td>'); 398 421 break; 399 case bwAttendeeStatusDelegated :422 case bwAttendeeStatusDelegated: 400 423 $(fbDisplayAttendeeRow).html('<td class="status delegated"><span class="icon"></span><span class="tip">' + bwAttendeeDispStatusDelegated + '</span></td>'); 401 424 break; 402 case bwAttendeeStatusCompleted :425 case bwAttendeeStatusCompleted: 403 426 $(fbDisplayAttendeeRow).html('<td class="status completed"><span class="icon"></span><span class="tip">' + bwAttendeeDispStatusCompleted + '</span></td>'); 404 427 break; 405 case bwAttendeeStatusInProcess :428 case bwAttendeeStatusInProcess: 406 429 $(fbDisplayAttendeeRow).html('<td class="status inprocess"><span class="icon"></span><span class="tip">' + bwAttendeeDispStatusInProcess + '</span></td>'); 407 430 break; 408 default : // default to bwAttendeeStatusNeedsAction - display question mark431 default: // default to bwAttendeeStatusNeedsAction - display question mark 409 432 $(fbDisplayAttendeeRow).html('<td class="status needsaction"><span class="icon">?</span><span class="tip">' + bwAttendeeDispStatusNeedsAction + '</span></td>'); 410 433 } 411 434 412 435 // set the role icon 413 436 // the role class is used for rollover descriptions of the icon 414 437 switch (curAttendee.role) { 415 case bwAttendeeRoleChair : // displays writing hand icon - ✍438 case bwAttendeeRoleChair: // displays writing hand icon - ✍ 416 439 $(fbDisplayAttendeeRow).append('<td class="role chair"><span class="icon"><img src="chair.gif" alt="chair" width="17" height="15"/></span><span class="tip">' + bwAttendeeDispRoleChair + '</span></td>'); 417 440 break; 418 case bwAttendeeRoleRequired : // displays right-pointing arrow icon - ➙441 case bwAttendeeRoleRequired: // displays right-pointing arrow icon - ➙ 419 442 $(fbDisplayAttendeeRow).append('<td class="role required"><span class="icon"><img src="reqArrow.gif" alt="required" width="17" height="12"/></span><span class="tip">' + bwAttendeeDispRoleRequired + '</span></td>'); 420 443 break; 421 case bwAttendeeRoleNonParticipant : // non-participant444 case bwAttendeeRoleNonParticipant: // non-participant 422 445 $(fbDisplayAttendeeRow).append('<td class="role nonparticipant"><span class="icon">x</span><span class="tip">' + bwAttendeeDispRoleNonParticipant + '</span></td>'); 423 446 break; 424 default : // bwAttendeeRoleOptional - no icon (use a space to provide a rollover)447 default: // bwAttendeeRoleOptional - no icon (use a space to provide a rollover) 425 448 $(fbDisplayAttendeeRow).append('<td class="role optional"><span class="icon"> </span><span class="tip">' + bwAttendeeDispRoleOptional + '</span></td>'); 426 449 } … … 429 452 // output the attendee name or address (depending on which we have available) 430 453 // and add attendee functions 431 var attendeeNameHtml = '<td class="name">'; 454 var attendeeAddress = curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":") + 1); 455 var attendeeNameHtml = '<td class="name"><span class="bwAttendee" id="' + attendeeAddress + '">'; 432 456 if (curAttendee.name && curAttendee.name != "") { 433 attendeeNameHtml += curAttendee.name;457 attendeeNameHtml += curAttendee.name; 434 458 } else { 435 attendeeNameHtml += curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1); 436 } 459 attendeeNameHtml += attendeeAddress; 460 } 461 attendeeNameHtml += '</span>'; 462 //attendeeNameHtml += '<div id="' + attendeeAddress + '-menu" class="attendeeMenu">hi</div>'; 437 463 attendeeNameHtml += '</td>'; 438 464 $(fbDisplayAttendeeRow).append(attendeeNameHtml); 439 465 440 // output checkbox for attendee 441 $(fbDisplayAttendeeRow).append('<td class="check"><input type="checkbox" checked="checked" name="selectAllToggle" class="selectAllToggle"/></td><td class="fbBoundry"></td>'); 442 466 // output delete mark and checkbox for attendee 467 if (curAttendee.selected) { 468 $(fbDisplayAttendeeRow).append('<td class="check"><span id="' + attendeeAddress + '-rm" class="removeAttendee">x</span> <input type="checkbox" checked="checked" name="selectedToggle" class="selectedToggle"/></td><td class="fbBoundry"></td>'); 469 } else { 470 $(fbDisplayAttendeeRow).append('<td class="check"><span id="' + attendeeAddress + '-rm" class="removeAttendee">x</span> <input type="checkbox" name="selectedToggle" class="selectedToggle"/></td><td class="fbBoundry"></td>'); 471 } 472 443 473 444 474 // build the time row for an attendee … … 451 481 for (k = 0; k < this.hourDivision; k++) { 452 482 var fbCell = document.createElement("td"); 453 fbCell.id = curDate.getTime() + "-" + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":") +1);483 fbCell.id = curDate.getTime() + "-" + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":") + 1); 454 484 $(fbCell).addClass("fbcell"); 455 485 $(fbCell).addClass(curDate.getTime().toString()); 456 486 if (curDate.getMinutes() == 0 && j != 0) { 457 487 $(fbCell).addClass("hourBoundry"); 458 } 488 } 459 489 for (m = 0; m < curAttendee.freebusy.length; m++) { 460 490 var tzoffset = -curDate.getTimezoneOffset() * 60000; // in milliseconds 461 491 // adding the hourdivision increment in the calculation below is to correct for a bug 462 492 // in which the class was always offset by one table cell - should find cause 463 var curDateUTC = curDate.getTime() + tzoffset + (60 / this.hourDivision * 60000); 493 var curDateUTC = curDate.getTime() + tzoffset + (60 / this.hourDivision * 60000); 464 494 if (curAttendee.freebusy[m].contains(curDateUTC)) { 465 495 if (curAttendee.freebusy[m].type.match("TENTATIVE")) { 466 496 $(fbCell).addClass("tentative"); 467 497 } else { 468 $(fbCell).addClass("busy"); 498 $(fbCell).addClass("busy"); 469 499 } 470 500 $(fbCell).addClass("activeCell"); … … 474 504 } 475 505 $(fbDisplayAttendeeRow).append(fbCell); 476 curDate.addMinutes(60 /this.hourDivision);506 curDate.addMinutes(60 / this.hourDivision); 477 507 } 478 508 } … … 504 534 for (k = 0; k < this.hourDivision; k++) { 505 535 var fbCell = document.createElement("td"); 506 fbCell.id = curDate.getTime() + "- " + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1);536 fbCell.id = curDate.getTime() + "-add"; 507 537 $(fbCell).addClass("fbcell"); 508 538 $(fbCell).addClass(curDate.getTime().toString()); … … 528 558 for (k = 0; k < this.hourDivision; k++) { 529 559 var fbCell = document.createElement("td"); 530 fbCell.id = curDate.getTime() + "- " + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1);560 fbCell.id = curDate.getTime() + "-blank"; 531 561 $(fbCell).addClass("fbcell"); 532 562 $(fbCell).addClass(curDate.getTime().toString()); … … 593 623 for (i = 0; i < bwGrid.freeTime.length; i++) { 594 624 if (Number(bwGrid.freeTime[i]) >= Number(startSelectionMils)) { 595 bwGrid.freeTimeIndex = i; 625 bwGrid.freeTimeIndex = i - 1; // this will make pick previous jump an extra gap after clicking in a busy space, but it makes pick next work correctly in the same circumstance 626 if (bwGrid.freeTimeIndex < 0) { 627 bwGrid.freeTimeIndex = 0; 628 } 596 629 break; 597 630 } … … 660 693 $(this).addClass("active"); 661 694 $(this).removeClass("pending"); 695 } 696 ); 697 698 $("#bwScheduleTable .removeAttendee").click ( 699 function () { 700 var i = $("#bwScheduleTable .removeAttendee").index(this); 701 bwGrid.removeAttendee(i); 702 } 703 ); 704 705 $("#bwScheduleTable input.selectedToggle").click ( 706 function () { 707 var i = $("#bwScheduleTable input.selectedToggle").index(this); 708 if (this.checked) { 709 bwGrid.attendees[i].selected = true; 710 } else { 711 bwGrid.attendees[i].selected = false; 712 } 713 bwGrid.display(); 662 714 } 663 715 ); trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/index.html
r2886 r2891 110 110 </tr> 111 111 <tr> 112 <td class="zoom"> 112 <td class="zoom"> 113 <!-- 113 114 <span class="zoomControl">-</span> 114 115 <select name="zoom"> … … 121 122 </select> 122 123 <span class="zoomControl">+</span> 124 --> 123 125 </td> 124 126 <td> trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/schedule.css
r2886 r2891 32 32 padding-right: 16px; 33 33 } 34 #bwScheduleTable tr.deselected { 35 background-color: #f8f8f8; 36 color: #aaa; 37 } 38 34 39 #bwScheduleTable .icon, 35 40 #bwScheduleTable .activeCell { … … 101 106 } 102 107 #bwScheduleTable td.busy { 103 background-color: #b1cbfa !important;108 background-color: #b1cbfa; 104 109 color: black; 105 110 } 111 #bwScheduleTable tr.deselected td.busy { 112 background-color: #D8E4FA; 113 color: black; 114 } 106 115 #bwScheduleTable td.tentative { 107 background: #eef url("tentativeLines.gif") !important;116 background: #eef url("tentativeLines.gif"); 108 117 color: black; 109 118 } … … 132 141 color: black; 133 142 } 143 #bwScheduleTable .removeAttendee { 144 cursor: pointer; 145 font-weight: bold; 146 color: #999; 147 background-color: transparent; 148 } 149 #bwScheduleTable .attendeeMenu { 150 position: absolute; 151 margin: 0 0 0 1em; 152 background-color: #ffe; 153 color: black; 154 padding: 0.5em; 155 border: 1px solid #ccc; 156 display: none; 157 } 134 158 #bwScheduleControls { 135 159 margin: 1.5em 1em;
