Changeset 2873
- Timestamp:
- 04/22/10 12:06:29
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/bedeworkFb.js
r2868 r2873 24 24 // ======================================================================== 25 25 26 // Constant values and display strings 27 // Should be internationalized 28 var bwAttendeePersonType = "person"; 29 var bwAttendeeLocationType = "location"; 30 var bwAttendeeResourceType = "resource"; 31 26 32 /* An attendee 27 33 * name: String - name of attendee, e.g. "Venerable Bede" … … 30 36 * role: String - Attendee role, e.g. CHAIR, REQ-PARTICIPANT, etc 31 37 * status: String - participation status (PARTSTAT) 38 * type: String - person, location, other resource 32 39 */ 33 var bwAttendee = function(name, uid, freebusy, role, status ) {40 var bwAttendee = function(name, uid, freebusy, role, status, type) { 34 41 this.name = name; 35 42 this.uid = uid; … … 37 44 this.role = role; 38 45 this.status = status; 46 this.type = type; 47 48 if (this.type == null || this.type == "") { 49 this.type == bwAttendeePersonType; 50 } 39 51 } 40 52 … … 66 78 // this is a constant for now, but could be variable. 67 79 // ALWAYS set as a factor of 60 68 this.hourDivision = 12;80 this.hourDivision = 4; 69 81 70 82 this.addAttendee = function(name, uid, freebusy, role, status) { … … 92 104 93 105 // generate the date row - includes top left empty corner 94 fbDisplayDateRow = fbDisplay.insertRow(0);106 var fbDisplayDateRow = fbDisplay.insertRow(0); 95 107 $(fbDisplayDateRow).html('<td rowspan="2" colspan="3" class="corner"></td><td class="fbBoundry"></td>'); 96 108 for (i=0; i < range; i++) { … … 109 121 // add the time cells by iterating over the hours 110 122 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 111 124 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>'); 113 126 curDate.addHours(1); 114 127 } … … 117 130 } 118 131 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 119 181 // finally, write the table back to the display 120 182 $("#" + displayId).html(fbDisplay); … … 127 189 } 128 190 129 130 /* code for calculating the time cells131 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 */140 191 141 192 trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/index.html
r2868 r2873 18 18 // initialize the free/busy grid 19 19 // 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); 21 21 22 22 // set datepicker defaults
