Changeset 2885
- Timestamp:
- 04/26/10 17:33:36
- Files:
-
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/bedeworkFb.js (modified) (9 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/chair.gif (added)
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/check.gif (added)
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/index.html (modified) (1 diff)
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/reqArrow.gif (added)
- trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/schedule.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/bedeworkFb.js
r2884 r2885 173 173 // ALWAYS set as a factor of 60 174 174 this.hourDivision = 4; 175 176 // internal variables 177 var startSelectionMils; // where a mouse selection begins, milliseconds parsed from the first half of a fbcell's ID 178 var endSelectionMils; // where a mouse selection ends, milliseconds parsed from the first half of a fbcell's ID 179 var selecting = false; // are we currently selecting? If true, we'll highlight as we hover 175 180 176 181 this.addAttendee = function(name, uid, freebusy, role, status, type) { … … 208 213 // generate the date row - includes top left empty corner 209 214 var fbDisplayDateRow = fbDisplay.insertRow(fbDisplay.rows.length); 210 $(fbDisplayDateRow).html('<td rowspan="2" colspan=" 3" class="corner"></td><td class="fbBoundry"></td>');215 $(fbDisplayDateRow).html('<td rowspan="2" colspan="4" class="corner"></td><td class="fbBoundry"></td>'); 211 216 for (i=0; i < range; i++) { 212 217 var curDate = new Date(this.startRange); … … 236 241 fbDisplayTimesRow = fbDisplay.insertRow(fbDisplay.rows.length); 237 242 $(fbDisplayTimesRow).addClass("allAttendees"); 238 $(fbDisplayTimesRow).html('<td class="status"></td><td class="role"></td><td class="name">All Attendees</td><td class=" fbBoundry"></td>');243 $(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>'); 239 244 for (i=0; i < range; i++) { 240 245 var curDate = new Date(this.startRange); … … 280 285 // the status class is used for rollover descriptions of the icon 281 286 switch (curAttendee.status) { 282 case bwAttendeeStatusAccepted : 283 $(fbDisplayAttendeeRow).html('<td class="status accepted"><span class="icon"> ✔</span><span class="text">' + bwAttendeeDispStatusAccepted + '</span></td>');287 case bwAttendeeStatusAccepted : // ✔ - make an image to avoid font issues 288 $(fbDisplayAttendeeRow).html('<td class="status accepted"><span class="icon"><img src="check.gif" alt="accepted" width="15" height="15"/></span><span class="text">' + bwAttendeeDispStatusAccepted + '</span></td>'); 284 289 break; 285 290 case bwAttendeeStatusDeclined : … … 305 310 // the role class is used for rollover descriptions of the icon 306 311 switch (curAttendee.role) { 307 case bwAttendeeRoleChair : // displays writing hand icon 308 $(fbDisplayAttendeeRow).append('<td class="role chair"><span class="icon"> ✍</span><span class="text">' + bwAttendeeDispRoleChair + '</span></td>');309 break; 310 case bwAttendeeRoleRequired : // displays right-pointing arrow icon 311 $(fbDisplayAttendeeRow).append('<td class="role required"><span class="icon"> ➙</span><span class="text">' + bwAttendeeDispRoleRequired + '</span></td>');312 case bwAttendeeRoleChair : // displays writing hand icon - ✍ 313 $(fbDisplayAttendeeRow).append('<td class="role chair"><span class="icon"><img src="chair.gif" alt="chair" width="17" height="15"/></span><span class="text">' + bwAttendeeDispRoleChair + '</span></td>'); 314 break; 315 case bwAttendeeRoleRequired : // displays right-pointing arrow icon - ➙ 316 $(fbDisplayAttendeeRow).append('<td class="role required"><span class="icon"><img src="reqArrow.gif" alt="required" width="17" height="12"/></span><span class="text">' + bwAttendeeDispRoleRequired + '</span></td>'); 312 317 break; 313 318 case bwAttendeeRoleNonParticipant : // non-participant … … 320 325 // output the attendee name or address (depending on which we have available) 321 326 if (curAttendee.name && curAttendee.name != "") { 322 $(fbDisplayAttendeeRow).append('<td class="name">' + curAttendee.name + '</td> <td class="fbBoundry"></td>');327 $(fbDisplayAttendeeRow).append('<td class="name">' + curAttendee.name + '</td>'); 323 328 } else { 324 $(fbDisplayAttendeeRow).append('<td class="name">' + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1) + '</td><td class="fbBoundry"></td>'); 325 } 329 $(fbDisplayAttendeeRow).append('<td class="name">' + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1) + '</td>'); 330 } 331 332 // output checkbox for attendee 333 $(fbDisplayAttendeeRow).append('<td class="check"><input type="checkbox" checked="checked" name="selectAllToggle" class="selectAllToggle"/></td><td class="fbBoundry"></td>'); 334 326 335 327 336 // build the time row for an attendee … … 360 369 // generate the "add attendee" row 361 370 fbDisplayAddAttendeeRow = fbDisplay.insertRow(fbDisplay.rows.length); 362 $(fbDisplayAddAttendeeRow).html('<td class="status"></td><td class="role"></td><td class="name" id="addAttendee">add attendee...</td><td class="fbBoundry"></td>'); 371 372 // create the add attendee form 373 var addAttendeeHtml = '<td class="status"></td><td class="role"></td><td class="name">'; 374 addAttendeeHtml += '<input type="text" value="add attendee..." name="attendee" id="addAttendee" class="pending" size="14"/>'; 375 addAttendeeHtml += '<div id="addAttendeeFields">'; 376 addAttendeeHtml += '<select><option>person</option><option>group</option><option>resource</option></select>'; 377 addAttendeeHtml += '<input type="checkbox"/>personal <input type="checkbox"/>public'; 378 addAttendeeHtml += '</div>'; 379 addAttendeeHtml += '</td><td></td><td class="fbBoundry"></td>'; 380 381 $(fbDisplayAddAttendeeRow).html(addAttendeeHtml); 382 363 383 for (i = 0; i < range; i++) { 364 384 var curDate = new Date(this.startRange); … … 384 404 // generate a blank row at the end (this is just for visual padding) 385 405 fbDisplayBlankRow = fbDisplay.insertRow(fbDisplay.rows.length); 386 $(fbDisplayBlankRow).html('<td class="status"></td><td class="role"></td><td class="name"></td><td class="fbBoundry"></td>');406 $(fbDisplayBlankRow).html('<td class="status"></td><td class="role"></td><td class="name"></td><td></td><td class="fbBoundry"></td>'); 387 407 for (i = 0; i < range; i++) { 388 408 var curDate = new Date(this.startRange); … … 422 442 ); 423 443 424 $("#bwScheduleTable .fbcell"). click(444 $("#bwScheduleTable .fbcell").mousedown ( 425 445 function () { 426 var curClass = $(this).attr("class"); 427 alert(curClass); 428 $("#bwScheduleTable ." + curClass).addClass("highlight"); 429 alert($(this).attr("class")); 446 // clear all previous highlighting 447 $("#bwScheduleTable .highlight").removeClass("highlight"); 448 449 // get the id of the current cell - takes the form "1271947500000-attendeestring" 450 // we want the first half, which is the same as the time class associated with the column 451 var splitId = $(this).attr("id").split("-"); 452 453 // set the start of the selection range in milliseconds (first half of the ID) 454 // we will use this to set the start time and to find cells in the same column 455 startSelectionMils = splitId[0]; 456 457 // find the cells (the column) that share the same class 458 $("#bwScheduleTable ." + startSelectionMils).addClass("highlight"); 459 460 // we are now selecting, so highlight as we go 461 selecting = true; 430 462 } 431 463 ); 432 464 465 $("#bwScheduleTable .fbcell").mouseover ( 466 function () { 467 if (selecting) { 468 // get the id of the current cell - takes the form "1271947500000-attendeestring" 469 // we want the first half, which is the same as the time class associated with the column 470 var splitId = $(this).attr("id").split("-"); 471 472 // find the cells (the column) that contain the first half as a class 473 $("#bwScheduleTable ." + splitId[0]).addClass("highlight"); 474 } 475 } 476 ); 477 478 $("#bwScheduleTable .fbcell").mouseup ( 479 function () { 480 // we are no longer selecting 481 selecting = false; 482 483 // get the id of the current cell - takes the form "1271947500000-attendeestring" 484 // we want the first half, which is the same as the time class associated with the column 485 var splitId = $(this).attr("id").split("-"); 486 487 // set the end of the selection range in milliseconds (first half of the ID) 488 // we will use this to set the end time / duration 489 endSelectionMils = splitId[0]; 490 491 } 492 ); 493 494 $("#bwScheduleTable #addAttendee").click ( 495 function () { 496 this.value = ""; 497 this.size = 32; 498 $(this).removeClass("pending"); 499 $("#addAttendeeFields").show("slow"); 500 } 501 ); 502 433 503 } catch (e) { 434 504 alert(e); trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/index.html
r2881 r2885 18 18 // initialize the free/busy grid - values taken directly from the xml 19 19 // send params: displayId, startRange, endRange, startDate, endDate, startHourRange, endHourRange, attendees, workday, zoom 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:["20100421T093000Z/PT2H00M","20100423T174500Z/PT8H30M"],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:["20100421T093000Z/PT2H00M","20100423T174500Z/PT8H30M"],role:"CHAIR",status:"ACCEPTED",type:"person"}],false,100); 21 21 22 22 // send in some attendees - these will come from interaction with the form trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/schedule.css
r2884 r2885 71 71 } 72 72 #bwScheduleTable #addAttendee { 73 cursor: pointer; 74 padding: 4px 0; 75 } 76 #bwScheduleTable #addAttendee.pending { 73 77 color: #bbb; 74 78 background-color: transparent; 75 cursor: pointer; 76 padding: 8px 0 8px 4px; 79 border: none; 80 } 81 #bwScheduleTable #addAttendeeFields, 82 #bwScheduleTable #attType { 83 display: none; 84 font-size: 0.8em; 85 } 86 #bwScheduleTable input.selectAllToggle { 87 } 88 #bwScheduleTable td.fbcell { 89 cursor: crosshair; 77 90 } 78 91 #bwScheduleTable td.busy { … … 85 98 } 86 99 #bwScheduleTable td.highlight { 87 background-color: #f aa !important;100 background-color: #ffa !important; 88 101 color: black; 89 102 }
