Changeset 2873

Show
Ignore:
Timestamp:
04/22/10 12:06:29
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

    r2868 r2873  
    2424// ======================================================================== 
    2525 
     26// Constant values and display strings 
     27// Should be internationalized 
     28var bwAttendeePersonType = "person"; 
     29var bwAttendeeLocationType = "location"; 
     30var bwAttendeeResourceType = "resource"; 
     31 
    2632/* An attendee 
    2733 * name:     String - name of attendee, e.g. "Venerable Bede" 
     
    3036 * role:     String - Attendee role, e.g. CHAIR, REQ-PARTICIPANT, etc 
    3137 * status:   String - participation status (PARTSTAT) 
     38 * type:     String - person, location, other resource 
    3239 */ 
    33 var bwAttendee = function(name, uid, freebusy, role, status) { 
     40var bwAttendee = function(name, uid, freebusy, role, status, type) { 
    3441  this.name = name; 
    3542  this.uid = uid; 
     
    3744  this.role = role; 
    3845  this.status = status; 
     46  this.type = type; 
     47   
     48  if (this.type == null || this.type == "") { 
     49    this.type == bwAttendeePersonType; 
     50  } 
    3951} 
    4052 
     
    6678  // this is a constant for now, but could be variable. 
    6779  // ALWAYS set as a factor of 60 
    68   this.hourDivision = 12
     80  this.hourDivision = 4
    6981   
    7082  this.addAttendee = function(name, uid, freebusy, role, status) { 
     
    92104       
    93105      // generate the date row - includes top left empty corner  
    94       fbDisplayDateRow = fbDisplay.insertRow(0); 
     106      var fbDisplayDateRow = fbDisplay.insertRow(0); 
    95107      $(fbDisplayDateRow).html('<td rowspan="2" colspan="3" class="corner"></td><td class="fbBoundry"></td>'); 
    96108      for (i=0; i < range; i++) { 
     
    109121        // add the time cells by iterating over the hours 
    110122        for (j = 0; j < hourRange; j++) { 
     123          // this is where we could use zoom to increase or decrease tick marks and time labels on the grid 
    111124          if (this.zoom == 100) { 
    112             $(fbDisplayTimesRow).append('<td class="hourBoundry" id="' + curDate.getTime() + '" colspan="' + this.hourDivision + '">' + curDate.getHours12() + ':' + curDate.getMinutesFull() + '</td>'); 
     125            $(fbDisplayTimesRow).append('<td class="hourBoundry" id="' + curDate.getTime() + '-TimeRow" colspan="' + this.hourDivision + '">' + curDate.getHours12() + ':' + curDate.getMinutesFull() + '</td>'); 
    113126            curDate.addHours(1); 
    114127          } 
     
    117130      } 
    118131       
     132      // generate the "All Attendees" row 
     133      fbDisplayTimesRow = fbDisplay.insertRow(2); 
     134      $(fbDisplayTimesRow).addClass("allAttendees"); 
     135      $(fbDisplayTimesRow).html('<td class="status"></td><td class="role"></td><td class="name">All Attendees</td><td class="fbBoundry"></td>'); 
     136      for (i=0; i < range; i++) { 
     137        var curDate = new Date(this.startRange);  
     138        curDate.setHours(this.startHoursRange); 
     139        curDate.addDays(i); 
     140        // add the time cells by iterating over the hours 
     141        for (j = 0; j < hourRange; j++) { 
     142          for (k = 0; k < this.hourDivision; k++) { 
     143            if (curDate.getMinutes() == 0) { 
     144              $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees" class="hourBoundry"></td>'); 
     145            } else { 
     146              $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees"></td>'); 
     147            } 
     148            curDate.addMinutes(60/this.hourDivision); 
     149          } 
     150        } 
     151        $(fbDisplayTimesRow).append('<td class="dayBoundry"></td>'); 
     152      } 
     153       
     154      // generate the regular attendees rows 
     155      for (attendee = 0; attendee < attendees.length; attendee++) { 
     156        fbDisplayTimesRow = fbDisplay.insertRow(attendee + 3); // offset by three to account for previous special rows 
     157        var curAttendee = attendees[attendee]; 
     158        $(fbDisplayTimesRow).html('<td class="status">' + curAttendee.status + '</td>'); 
     159        $(fbDisplayTimesRow).append('<td class="role">' + curAttendee.role + '</td>'); 
     160        $(fbDisplayTimesRow).append('<td class="name">' + curAttendee.name + '</td><td class="fbBoundry"></td>'); 
     161        for (i = 0; i < range; i++) { 
     162          var curDate = new Date(this.startRange); 
     163          curDate.setHours(this.startHoursRange); 
     164          curDate.addDays(i); 
     165          // add the time cells by iterating over the hours 
     166          for (j = 0; j < hourRange; j++) { 
     167            for (k = 0; k < this.hourDivision; k++) { 
     168              if (curDate.getMinutes() == 0) { 
     169                $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees" class="hourBoundry"></td>'); 
     170              } else { 
     171                $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees"></td>'); 
     172              } 
     173              // increment by the number of minutes in the hour division 
     174              curDate.addMinutes(60 / this.hourDivision); 
     175            } 
     176          } 
     177          $(fbDisplayTimesRow).append('<td class="dayBoundry"></td>'); 
     178        } 
     179      } 
     180       
    119181      // finally, write the table back to the display 
    120182      $("#" + displayId).html(fbDisplay); 
     
    127189} 
    128190 
    129  
    130 /* code for calculating the time cells 
    131           for (k = 0; k < hourDivision; k++) { 
    132             if (curDate.getMinutes() == 0) { 
    133               $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + 'class="hourBoundry"></td>'); 
    134             } else { 
    135               $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '"></td>'); 
    136             } 
    137             curDate.addMinutes(60/hourDivision); 
    138           } 
    139           */ 
    140191 
    141192 
  • trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/index.html

    r2868 r2873  
    1818      // initialize the free/busy grid 
    1919      // 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,["Arlen Johnson","mailto:johnsa@rpi.edu",[],"CHAIR","ACCEPTED"],true,100); 
     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); 
    2121 
    2222      // set datepicker defaults