Changeset 2885

Show
Ignore:
Timestamp:
04/26/10 17:33:36
Author:
johnsa
Message:

ongoing update to free/busy mockup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/bedeworkFb.js

    r2884 r2885  
    173173  // ALWAYS set as a factor of 60 
    174174  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 
    175180 
    176181  this.addAttendee = function(name, uid, freebusy, role, status, type) { 
     
    208213      // generate the date row - includes top left empty corner  
    209214      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>'); 
    211216      for (i=0; i < range; i++) { 
    212217        var curDate = new Date(this.startRange);  
     
    236241      fbDisplayTimesRow = fbDisplay.insertRow(fbDisplay.rows.length); 
    237242      $(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>'); 
    239244      for (i=0; i < range; i++) { 
    240245        var curDate = new Date(this.startRange);  
     
    280285        // the status class is used for rollover descriptions of the icon 
    281286        switch (curAttendee.status) { 
    282           case bwAttendeeStatusAccepted :  
    283             $(fbDisplayAttendeeRow).html('<td class="status accepted"><span class="icon">&#10004;</span><span class="text">' + bwAttendeeDispStatusAccepted + '</span></td>'); 
     287          case bwAttendeeStatusAccepted : // &#10004; - 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>'); 
    284289            break; 
    285290          case bwAttendeeStatusDeclined :  
     
    305310        // the role class is used for rollover descriptions of the icon 
    306311        switch (curAttendee.role) { 
    307           case bwAttendeeRoleChair : // displays writing hand icon 
    308             $(fbDisplayAttendeeRow).append('<td class="role chair"><span class="icon">&#9997;</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">&#10137;</span><span class="text">' + bwAttendeeDispRoleRequired + '</span></td>'); 
     312          case bwAttendeeRoleChair : // displays writing hand icon - &#9997; 
     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 - &#10137; 
     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>'); 
    312317            break; 
    313318          case bwAttendeeRoleNonParticipant : // non-participant 
     
    320325        // output the attendee name or address (depending on which we have available) 
    321326        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>'); 
    323328        } 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        
    326335         
    327336        // build the time row for an attendee 
     
    360369      // generate the "add attendee" row 
    361370      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       
    363383      for (i = 0; i < range; i++) { 
    364384        var curDate = new Date(this.startRange); 
     
    384404      // generate a blank row at the end (this is just for visual padding) 
    385405      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>'); 
    387407      for (i = 0; i < range; i++) { 
    388408        var curDate = new Date(this.startRange); 
     
    422442      );   
    423443       
    424       $("#bwScheduleTable .fbcell").click
     444      $("#bwScheduleTable .fbcell").mousedown
    425445        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;           
    430462        } 
    431463      ); 
    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 
    433503    } catch (e) { 
    434504      alert(e); 
  • trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/index.html

    r2881 r2885  
    1818      // initialize the free/busy grid - values taken directly from the xml 
    1919      // 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); 
    2121       
    2222      // send in some attendees - these will come from interaction with the form 
  • trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/schedule.css

    r2884 r2885  
    7171} 
    7272#bwScheduleTable #addAttendee { 
     73  cursor: pointer; 
     74  padding: 4px 0; 
     75} 
     76#bwScheduleTable #addAttendee.pending { 
    7377  color: #bbb; 
    7478  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; 
    7790} 
    7891#bwScheduleTable td.busy { 
     
    8598} 
    8699#bwScheduleTable td.highlight { 
    87   background-color: #faa !important; 
     100  background-color: #ffa !important; 
    88101  color: black; 
    89102}