Changeset 5774
- Timestamp:
- 05/29/08 17:10:07 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinelz/trunk/compress/javascripts/spinelz/calendar.js
r5765 r5774 962 962 var body=Builder.node("DIV"); 963 963 var text=this.getTimeText((_105)?_104.start:{hour:"0",min:"0"},_104.finish); 964 text=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]);965 this.calendar.css.addClassNames( text,"scheduleTimeArea");966 item.appendChild( text);967 var _11 2=_104.description.unescapeHTML();968 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_11 2]));969 item.title= _112;964 var _112=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]); 965 this.calendar.css.addClassNames(_112,"scheduleTimeArea"); 966 item.appendChild(_112); 967 var _113=_104.description.unescapeHTML(); 968 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_113])); 969 item.title=text+"-"+this.calendar.formatTime(_104.finish)+" "+_113; 970 970 item.schedule=_104; 971 971 return [item,_10e]; 972 },adjustScheduleStyle:function(item,_11 4,_115,_116){972 },adjustScheduleStyle:function(item,_115,_116,_117){ 973 973 var self=this; 974 var _11 8=parseInt(Element.getStyle(item,"height"),10);974 var _119=parseInt(Element.getStyle(item,"height"),10); 975 975 var top=parseInt(Element.getStyle(item,"top"),10); 976 var _11 a=this.getScheduleRange(item);976 var _11b=this.getScheduleRange(item); 977 977 var tops=[]; 978 var _11 c=3;979 _11 6.each(function(_11d){980 var _11 e=self.getScheduleRange(_11d);981 if(_11 a.any(function(r){982 return _11 e.include(r);978 var _11d=3; 979 _117.each(function(_11e){ 980 var _11f=self.getScheduleRange(_11e); 981 if(_11b.any(function(r){ 982 return _11f.include(r); 983 983 })){ 984 tops.push(_11 d.topIndex);985 } 986 }); 987 var _12 0=$R(0,tops.length,true).detect(function(i){984 tops.push(_11e.topIndex); 985 } 986 }); 987 var _121=$R(0,tops.length,true).detect(function(i){ 988 988 return !tops.include(i); 989 989 }); 990 if(isNaN(_12 0)){991 _12 0=tops.length;992 } 993 item.topIndex=_12 0;994 Element.setStyle(item,{top:top+(_11 8+2)*_120+"px"});995 if(_12 0>=_11c){990 if(isNaN(_121)){ 991 _121=tops.length; 992 } 993 item.topIndex=_121; 994 Element.setStyle(item,{top:top+(_119+2)*_121+"px"}); 995 if(_121>=_11d){ 996 996 Element.hide(item); 997 var node=this.buildSkipSchedule(_11 4+"_"+_115);997 var node=this.buildSkipSchedule(_115+"_"+_116); 998 998 if(node){ 999 999 var left=Element.getStyle(item,"left"); 1000 Element.setStyle(node,{top:top+(_11 8+2)*_120+"px",left:left});1000 Element.setStyle(node,{top:top+(_119+2)*_121+"px",left:left}); 1001 1001 } 1002 1002 return node; 1003 1003 } 1004 },buildSkipSchedule:function(_12 4){1005 var id=this.calendar.element.id.appendSuffix(_12 4);1004 },buildSkipSchedule:function(_125){ 1005 var id=this.calendar.element.id.appendSuffix(_125); 1006 1006 if(!this.skipNode[id]){ 1007 1007 var node=Builder.node("a",{id:id,style:"display: block; z-index: 1000; cursor: pointer;",href:"javascript:void(0);"},[this.calendar.options.skipString]); … … 1014 1014 return item.cellIndex+i; 1015 1015 }); 1016 },setScheduleBaseStyle:function(item,_12 a,_12b,_12c){1017 var _12 d=this.column.height;1018 var top=_12 d*_12a+this.column.dateTextHeight;1019 var _1 2f=this.getAdjustSize()+(UserAgent.isIE()?0.5:0);1020 Element.setStyle(item,{top:top+"px",width:this.column.width*_12 c+_12f*(_12c-1)+"px",left:this.column.width*_12b+_12b*_12f+"px"});1016 },setScheduleBaseStyle:function(item,_12b,_12c,_12d){ 1017 var _12e=this.column.height; 1018 var top=_12e*_12b+this.column.dateTextHeight; 1019 var _130=this.getAdjustSize()+(UserAgent.isIE()?0.5:0); 1020 Element.setStyle(item,{top:top+"px",width:this.column.width*_12d+_130*(_12d-1)+"px",left:this.column.width*_12c+_12c*_130+"px"}); 1021 1021 },afterBuild:function(){ 1022 1022 this.scheduleNodes=[]; … … 1030 1030 this.setSelector(); 1031 1031 var self=this; 1032 var _13 1=this.calendar.options.displayIndexes;1033 var _13 2=this.getDragDistance();1034 var _13 3=$R(0,$(this.getCalendarTableId()).rows.length).map(function(){1032 var _132=this.calendar.options.displayIndexes; 1033 var _133=this.getDragDistance(); 1034 var _134=$R(0,$(this.getCalendarTableId()).rows.length).map(function(){ 1035 1035 return []; 1036 1036 }); 1037 1037 var date=this.calendar.date; 1038 var _13 5=DateUtil.getFirstDate(date.getFullYear(),date.getMonth());1039 var _13 6=_135.days();1040 var _13 7=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days();1041 self.calendar.options.schedules.each(function(_13 8,_139){1042 var _13 a=self.toDate(_138.start);1043 var _13 b=_13a.days();1044 var _13 c=self.toDate(_138.finish);1045 var _13 d=_13c.days();1046 var days=self.getDayDiff(_13 8);1047 if(_13 8.finish.hour==0&&_138.finish.min==0){1038 var _136=DateUtil.getFirstDate(date.getFullYear(),date.getMonth()); 1039 var _137=_136.days(); 1040 var _138=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days(); 1041 self.calendar.options.schedules.each(function(_139,_13a){ 1042 var _13b=self.toDate(_139.start); 1043 var _13c=_13b.days(); 1044 var _13d=self.toDate(_139.finish); 1045 var _13e=_13d.days(); 1046 var days=self.getDayDiff(_139); 1047 if(_139.finish.hour==0&&_139.finish.min==0){ 1048 1048 days--; 1049 1049 } 1050 if((_13 b>=_136&&_13b<=_137)||(_13d>=_136&&_13d<=_137)){1051 if(!_13 5.sameMonth(_13a)){1052 _13 a=_135;1053 } 1054 self.setSchedule(_13 8,_133,_132,days);1050 if((_13c>=_137&&_13c<=_138)||(_13e>=_137&&_13e<=_138)){ 1051 if(!_136.sameMonth(_13b)){ 1052 _13b=_136; 1053 } 1054 self.setSchedule(_139,_134,_133,days); 1055 1055 } 1056 1056 }); … … 1076 1076 } 1077 1077 } 1078 },setSchedule:function(_14 1,_142,_143,days){1079 var _14 5=[];1080 var _14 6=6;1081 var _14 7=DateUtil.toDate(_141.start);1082 var date=_14 7;1083 var _14 9=this.calendar.options.displayIndexes;1084 var _14 a=this.calendar.date;1085 var _14 b=this.calendar.options.noEvent;1086 var _14 c=this.calendar.options.clickSkipNode;1078 },setSchedule:function(_142,_143,_144,days){ 1079 var _146=[]; 1080 var _147=6; 1081 var _148=DateUtil.toDate(_142.start); 1082 var date=_148; 1083 var _14a=this.calendar.options.displayIndexes; 1084 var _14b=this.calendar.date; 1085 var _14c=this.calendar.options.noEvent; 1086 var _14d=this.calendar.options.clickSkipNode; 1087 1087 while(days>=0){ 1088 var _14 d=this.getLastWday(date);1089 var _14 e=days+1;1090 var _1 4f=date.getDay();1091 var _15 0=date.advance({days:_14e-1});1092 if(_15 0.getTime()>_14d.getTime()){1093 _15 0=_14d;1094 _14 e=_150.days()-date.days()+1;1095 } 1096 var _15 1=_150.getDay();1097 var _15 2=null;1098 if(_1 4f<=_151){1099 _15 2=$R(_14f,_151,false);1100 }else{ 1101 _15 2=$R(0,_151,false).toArray().concat($R(_14f,_146,false).toArray());1102 } 1103 var _15 3=_152.findAll(function(day){1104 return _14 9.include(day);1088 var _14e=this.getLastWday(date); 1089 var _14f=days+1; 1090 var _150=date.getDay(); 1091 var _151=date.advance({days:_14f-1}); 1092 if(_151.getTime()>_14e.getTime()){ 1093 _151=_14e; 1094 _14f=_151.days()-date.days()+1; 1095 } 1096 var _152=_151.getDay(); 1097 var _153=null; 1098 if(_150<=_152){ 1099 _153=$R(_150,_152,false); 1100 }else{ 1101 _153=$R(0,_152,false).toArray().concat($R(_150,_147,false).toArray()); 1102 } 1103 var _154=_153.findAll(function(day){ 1104 return _14a.include(day); 1105 1105 }).length; 1106 var _15 5=new Date(date.getTime());1107 while(_15 5.days()<=_150.days()){1108 if(_15 5.getMonth()==_14a.getMonth()){1109 var _15 6=this.getCellPosition(_155.getDate());1110 if(_15 6){1111 var _15 7=_156.rowIndex;1112 var _15 8=_156.cellIndex;1113 var _15 9=this.buildSchedule(_141,_147.sameDate(_155));1114 var item=_15 9.first();1115 item.length=_15 3;1116 item.cellIndex=_15 8;1117 item.cellDate=_15 5;1106 var _156=new Date(date.getTime()); 1107 while(_156.days()<=_151.days()){ 1108 if(_156.getMonth()==_14b.getMonth()){ 1109 var _157=this.getCellPosition(_156.getDate()); 1110 if(_157){ 1111 var _158=_157.rowIndex; 1112 var _159=_157.cellIndex; 1113 var _15a=this.buildSchedule(_142,_148.sameDate(_156)); 1114 var item=_15a.first(); 1115 item.length=_154; 1116 item.cellIndex=_159; 1117 item.cellDate=_156; 1118 1118 this.container.appendChild(item); 1119 this.setScheduleBaseStyle(item,_15 7,_158,_153);1120 var _15 b=this.adjustScheduleStyle(item,_157,_158,_142[_157]);1121 if(_15 b){1122 this.container.appendChild(_15 b);1123 Event.observe(_15 b,"click",_14c.bindAsEventListener(this,_155));1124 } 1125 if(!_14 b&&((_141.edit==undefined)||_141.edit)){1126 this.setDraggable(item,_15 9.last(),_143);1119 this.setScheduleBaseStyle(item,_158,_159,_154); 1120 var _15c=this.adjustScheduleStyle(item,_158,_159,_143[_158]); 1121 if(_15c){ 1122 this.container.appendChild(_15c); 1123 Event.observe(_15c,"click",_14d.bindAsEventListener(this,_156)); 1124 } 1125 if(!_14c&&((_142.edit==undefined)||_142.edit)){ 1126 this.setDraggable(item,_15a.last(),_144); 1127 1127 this.setResize(item); 1128 1128 } 1129 _14 2[_157].push(item);1129 _143[_158].push(item); 1130 1130 this.scheduleNodes.push(item); 1131 1131 break; 1132 1132 }else{ 1133 if(_14 9.include(_155.getDay())){1134 _15 3--;1133 if(_14a.include(_156.getDay())){ 1134 _154--; 1135 1135 }else{ 1136 1136 this.hasInvisibleSchedule=true; … … 1138 1138 } 1139 1139 }else{ 1140 if(_14 9.include(_155.getDay())){1141 _15 3--;1142 } 1143 } 1144 _15 5=_155.advance({days:1});1145 } 1146 if(_14 5.length==0){1147 days-=_14 e;1140 if(_14a.include(_156.getDay())){ 1141 _154--; 1142 } 1143 } 1144 _156=_156.advance({days:1}); 1145 } 1146 if(_146.length==0){ 1147 days-=_14f; 1148 1148 }else{ 1149 1149 days-=7; 1150 1150 } 1151 var date=_15 0.advance({days:1});1151 var date=_151.advance({days:1}); 1152 1152 if(item){ 1153 _14 5.push(item);1153 _146.push(item); 1154 1154 } 1155 1155 } 1156 1156 var self=this; 1157 if(!_14 b){1158 _14 5.each(function(item){1159 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_14 5));1160 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_14 5));1157 if(!_14c){ 1158 _146.each(function(item){ 1159 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_146)); 1160 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_146)); 1161 1161 }); 1162 1162 } … … 1165 1165 this.calendar.setIndex(); 1166 1166 } 1167 var _1 5f=this.calendar.wdays.indexOf(date.getDay())+1;1168 return date.advance({days:this.calendar.wdays.length-_1 5f});1167 var _160=this.calendar.wdays.indexOf(date.getDay())+1; 1168 return date.advance({days:this.calendar.wdays.length-_160}); 1169 1169 },setSelector:function(){ 1170 var _16 0=$(this.getSelectorId());1171 Element.setStyle(_16 0,{width:this.column.width+"px",height:this.column.height-2+"px"});1172 Element.setOpacity(_16 0,0.6);1173 },setDraggable:function(item,_16 2,_163){1170 var _161=$(this.getSelectorId()); 1171 Element.setStyle(_161,{width:this.column.width+"px",height:this.column.height-2+"px"}); 1172 Element.setOpacity(_161,0.6); 1173 },setDraggable:function(item,_163,_164){ 1174 1174 var self=this; 1175 var _16 5=Position.cumulativeOffset(this.container);1176 var _16 6=$(this.getSelectorId());1177 var _16 7=this.column.width+(UserAgent.isIE()?0.5:0);1178 var _16 8=this.column.height+(UserAgent.isIE()?1:0);1179 var _16 9=this.rowMax||$(this.getCalendarTableId()).rows.length;1180 var _16 a=this.calendar.options.displayIndexes.length-1;1181 var _16 b=this.getAdjustSize();1182 new Draggable(item,{handle:_16 2,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_16c){1183 Element.show(_16 6);1184 },onDrag:function(_16 d,_16e){1185 var _1 6f=_16d.element;1186 var top=parseInt(Element.getStyle(_1 6f,"top"),10);1187 var _17 1=Math.floor(top/_168);1188 var left=parseInt(Element.getStyle(_1 6f,"left"),10);1189 var _17 3=Math.floor(left/_167);1190 if((_17 3>=0&&_171>=0)&&(_173<=_16a&&_171<=_169)){1191 Element.setStyle(_16 6,{left:_167*_173+_16b*_173+"px",top:_168*_171+"px"});1192 } 1193 },onEnd:function(_17 4){1194 Element.hide(_16 6);1195 self.changeSchedule(_17 4);1175 var _166=Position.cumulativeOffset(this.container); 1176 var _167=$(this.getSelectorId()); 1177 var _168=this.column.width+(UserAgent.isIE()?0.5:0); 1178 var _169=this.column.height+(UserAgent.isIE()?1:0); 1179 var _16a=this.rowMax||$(this.getCalendarTableId()).rows.length; 1180 var _16b=this.calendar.options.displayIndexes.length-1; 1181 var _16c=this.getAdjustSize(); 1182 new Draggable(item,{handle:_163,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_16d){ 1183 Element.show(_167); 1184 },onDrag:function(_16e,_16f){ 1185 var _170=_16e.element; 1186 var top=parseInt(Element.getStyle(_170,"top"),10); 1187 var _172=Math.floor(top/_169); 1188 var left=parseInt(Element.getStyle(_170,"left"),10); 1189 var _174=Math.floor(left/_168); 1190 if((_174>=0&&_172>=0)&&(_174<=_16b&&_172<=_16a)){ 1191 Element.setStyle(_167,{left:_168*_174+_16c*_174+"px",top:_169*_172+"px"}); 1192 } 1193 },onEnd:function(_175){ 1194 Element.hide(_167); 1195 self.changeSchedule(_175); 1196 1196 }}); 1197 1197 },setResize:function(item){ 1198 1198 var self=this; 1199 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_17 7){1200 self.updateTirm(_17 7);1199 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_178){ 1200 self.updateTirm(_178); 1201 1201 }}); 1202 },getDate:function(_17 8){1202 },getDate:function(_179){ 1203 1203 var date=this.calendar.date; 1204 if(_17 8.constructor==String){1205 return new Date(date.getFullYear(),date.getMonth(),_17 8);1206 }else{ 1207 return new Date(date.getFullYear(),date.getMonth(),_17 8.id.getSuffix());1208 } 1209 },abstractSelect:function(_17 a,_17b){1210 var _17 c=null;1204 if(_179.constructor==String){ 1205 return new Date(date.getFullYear(),date.getMonth(),_179); 1206 }else{ 1207 return new Date(date.getFullYear(),date.getMonth(),_179.id.getSuffix()); 1208 } 1209 },abstractSelect:function(_17b,_17c){ 1210 var _17d=null; 1211 1211 if(this.calendar.options.size=="large"){ 1212 _17 c=this.findClickedElement(_17a);1213 }else{ 1214 _17 c=Event.element(_17a);1215 if(_17 c.tagName!="TD"){1216 _17 c=Element.getParentByTagName(["TD"],_17c);1217 } 1218 } 1219 if(_17 c&&_17c.id&&!_17c.id.match(/emptyRow/)){1220 var date=this.getDate(_17 c);1221 _17 b(date,_17c);1212 _17d=this.findClickedElement(_17b); 1213 }else{ 1214 _17d=Event.element(_17b); 1215 if(_17d.tagName!="TD"){ 1216 _17d=Element.getParentByTagName(["TD"],_17d); 1217 } 1218 } 1219 if(_17d&&_17d.id&&!_17d.id.match(/emptyRow/)){ 1220 var date=this.getDate(_17d); 1221 _17c(date,_17d); 1222 1222 } 1223 1223 },getSelectedTerm:function(){ 1224 1224 var self=this; 1225 var _1 7f=this.calendar.getSelected();1226 return [_1 7f.first(),_17f.last()].map(function(e){1225 var _180=this.calendar.getSelected(); 1226 return [_180.first(),_180.last()].map(function(e){ 1227 1227 return self.getDate(e); 1228 1228 }); 1229 },selectDay:function(_18 1){1230 var _18 2=this.calendar;1231 var th=Event.element(_18 1);1229 },selectDay:function(_182){ 1230 var _183=this.calendar; 1231 var th=Event.element(_182); 1232 1232 if(th.tagName!="TH"){ 1233 1233 th=Element.getParentByTagName("TH",th); … … 1235 1235 this.iterateTable({doCell:function(cell){ 1236 1236 if((cell.cellIndex==th.cellIndex)&&cell.id){ 1237 _18 2.addSelectedClass(cell);1237 _183.addSelectedClass(cell); 1238 1238 } 1239 1239 }}); 1240 },inspectArgument:function(_18 5,time){1240 },inspectArgument:function(_186,time){ 1241 1241 var self=this; 1242 var _18 8=this.calendar.getSelected();1243 var _18 9=[];1244 self.calendar.recurrence(_18 5,function(o){1242 var _189=this.calendar.getSelected(); 1243 var _18a=[]; 1244 self.calendar.recurrence(_186,function(o){ 1245 1245 if(!o.date){ 1246 _18 8.each(function(d){1247 var _18 c={};1246 _189.each(function(d){ 1247 var _18d={}; 1248 1248 if(!o.date){ 1249 _18 c={date:self.getDate(d)};1249 _18d={date:self.getDate(d)}; 1250 1250 if(time){ 1251 _18 c.start={hour:0,min:0};1252 _18 c.finish={hour:0,min:0};1253 } 1254 } 1255 Object.extend(_18 c,o);1256 _18 9.push(_18c);1251 _18d.start={hour:0,min:0}; 1252 _18d.finish={hour:0,min:0}; 1253 } 1254 } 1255 Object.extend(_18d,o); 1256 _18a.push(_18d); 1257 1257 }); 1258 1258 }else{ 1259 1259 if(o.date.constructor==Object){ 1260 1260 o.date=new Date(o.date.year,o.date.month,o.date.day); 1261 _18 9.push(o);1262 }else{ 1263 _18 9.push(o);1264 } 1265 } 1266 }); 1267 return _18 9;1261 _18a.push(o); 1262 }else{ 1263 _18a.push(o); 1264 } 1265 } 1266 }); 1267 return _18a; 1268 1268 },inspectDateArgument:function(date){ 1269 1269 if(date){ … … 1278 1278 return map; 1279 1279 }else{ 1280 var _1 8f=this;1281 var _19 0=this.calendar.getSelected();1282 if(_19 0.length==0){1280 var _190=this; 1281 var _191=this.calendar.getSelected(); 1282 if(_191.length==0){ 1283 1283 return null; 1284 1284 } 1285 return _19 0.collect(function(d){1286 return _1 8f.getDate(d);1287 }); 1288 } 1289 },findClickedElement:function(_19 2){1290 var _19 3=$(this.getScheduleContainerId());1291 var _19 4=Position.cumulativeOffset(_193);1292 var _19 5=Position.realOffset(_193).last();1293 _19 5-=document.documentElement.scrollTop||document.body.scrollTop;1294 var x=Event.pointerX(_19 2)-_194[0];1295 var y=Event.pointerY(_19 2)-_194[1]+_195;1296 var _19 8=Math.floor(y/this.column.height);1297 var _19 9=Math.floor(x/this.column.width);1298 return $(this.calendarTable.rows[_19 8].cells[_199]);1299 },multipleSelection:function(_19 a){1285 return _191.collect(function(d){ 1286 return _190.getDate(d); 1287 }); 1288 } 1289 },findClickedElement:function(_193){ 1290 var _194=$(this.getScheduleContainerId()); 1291 var _195=Position.cumulativeOffset(_194); 1292 var _196=Position.realOffset(_194).last(); 1293 _196-=document.documentElement.scrollTop||document.body.scrollTop; 1294 var x=Event.pointerX(_193)-_195[0]; 1295 var y=Event.pointerY(_193)-_195[1]+_196; 1296 var _199=Math.floor(y/this.column.height); 1297 var _19a=Math.floor(x/this.column.width); 1298 return $(this.calendarTable.rows[_199].cells[_19a]); 1299 },multipleSelection:function(_19b){ 1300 1300 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 1301 1301 return; 1302 1302 } 1303 1303 var self=this; 1304 var _19 c=this.calendar;1305 var _19 d=this.calendar.selectedBase;1306 this.abstractSelect(_19 a,function(date,_19f){1307 var _1a 0=$(_19d.id);1308 var _1a 1=_19c.createRange(parseInt(_1a0.id.getSuffix()),parseInt(_19f.id.getSuffix()));1304 var _19d=this.calendar; 1305 var _19e=this.calendar.selectedBase; 1306 this.abstractSelect(_19b,function(date,_1a0){ 1307 var _1a1=$(_19e.id); 1308 var _1a2=_19d.createRange(parseInt(_1a1.id.getSuffix()),parseInt(_1a0.id.getSuffix())); 1309 1309 self.iterateTable({doCell:function(cell){ 1310 1310 if(cell.tagName!="TD"||!cell.id){ … … 1312 1312 } 1313 1313 var id=parseInt(cell.id.getSuffix(),10); 1314 if(_1a 1.include(id)){1315 _19 c.addSelectedClass(cell);1316 }else{ 1317 _19 c.removeSelectedClass(cell);1314 if(_1a2.include(id)){ 1315 _19d.addSelectedClass(cell); 1316 }else{ 1317 _19d.removeSelectedClass(cell); 1318 1318 } 1319 1319 }}); 1320 1320 }); 1321 1321 },iterateTable:function(){ 1322 var _1a 4=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]);1323 var _1a 5=$(this.getCalendarTableId());1324 if(_1a 4.doTable){1325 _1a 4.doTable(_1a5);1326 } 1327 $A(_1a 5.rows).each(function(row){1328 if(_1a 4.doRow){1329 _1a 4.doRow(row);1322 var _1a5=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]); 1323 var _1a6=$(this.getCalendarTableId()); 1324 if(_1a5.doTable){ 1325 _1a5.doTable(_1a6); 1326 } 1327 $A(_1a6.rows).each(function(row){ 1328 if(_1a5.doRow){ 1329 _1a5.doRow(row); 1330 1330 } 1331 1331 $A(row.cells).each(function(cell){ 1332 if(_1a 4.doCell){1333 _1a 4.doCell(cell);1334 } 1335 }); 1336 }); 1337 },findRow:function(_1a 8){1338 var _1a 9=$(this.getCalendarTableId());1339 return $A(_1a 9.rows).detect(function(row){1340 return row.rowIndex==_1a 8;1341 }); 1342 },findCell:function(_1a b,_1ac){1343 return $A(this.findRow(_1a b).cells).detect(function(cell){1344 return cell.cellIndex==_1a c;1332 if(_1a5.doCell){ 1333 _1a5.doCell(cell); 1334 } 1335 }); 1336 }); 1337 },findRow:function(_1a9){ 1338 var _1aa=$(this.getCalendarTableId()); 1339 return $A(_1aa.rows).detect(function(row){ 1340 return row.rowIndex==_1a9; 1341 }); 1342 },findCell:function(_1ac,_1ad){ 1343 return $A(this.findRow(_1ac).cells).detect(function(cell){ 1344 return cell.cellIndex==_1ad; 1345 1345 }); 1346 1346 },getDateId:function(date){ … … 1360 1360 return {cellIndex:cell.cellIndex,rowIndex:row.rowIndex}; 1361 1361 } 1362 },changeSchedule:function(_1b 4){1363 var _1b 5=_1b4.element;1364 var _1b 6=_1b5.schedule;1365 this.calendar.cacheSchedule(_1b 6);1366 var top=parseInt(Element.getStyle(_1b 5,"top"),10);1367 var _1b 8=Math.floor(top/this.column.height);1368 var left=parseInt(Element.getStyle(_1b 5,"left"),10);1369 var _1b a=Math.floor(left/this.column.width);1370 var _1b b=$(this.getCalendarTableId());1371 var _1b c=_1bb.rows.length-1;1372 var _1b d=this.calendar.options.displayIndexes.length-1;1373 if((_1b a>=0&&_1b8>=0)&&(_1ba<=_1bd&&_1b8<=_1bc)){1374 var cell=this.findCell(_1b 8,_1ba);1362 },changeSchedule:function(_1b5){ 1363 var _1b6=_1b5.element; 1364 var _1b7=_1b6.schedule; 1365 this.calendar.cacheSchedule(_1b7); 1366 var top=parseInt(Element.getStyle(_1b6,"top"),10); 1367 var _1b9=Math.floor(top/this.column.height); 1368 var left=parseInt(Element.getStyle(_1b6,"left"),10); 1369 var _1bb=Math.floor(left/this.column.width); 1370 var _1bc=$(this.getCalendarTableId()); 1371 var _1bd=_1bc.rows.length-1; 1372 var _1be=this.calendar.options.displayIndexes.length-1; 1373 if((_1bb>=0&&_1b9>=0)&&(_1bb<=_1be&&_1b9<=_1bd)){ 1374 var cell=this.findCell(_1b9,_1bb); 1375 1375 var date=new Date(this.calendar.date.getTime()); 1376 var _1c 0=_1b5.cellDate.days()-DateUtil.toDate(_1b6.start).days();1377 date.setDate(parseInt(cell.id.getSuffix(),10)-_1c 0);1378 var diff=this.getDayDiff(_1b 6);1379 var _1c 2=date.advance({days:diff});1380 if(_1b 6.start.month==date.getMonth()&&_1b6.start.day==date.getDate()&&_1b6.finish.month==_1c2.getMonth()&&_1b6.finish.day==_1c2.getDate()){1376 var _1c1=_1b6.cellDate.days()-DateUtil.toDate(_1b7.start).days(); 1377 date.setDate(parseInt(cell.id.getSuffix(),10)-_1c1); 1378 var diff=this.getDayDiff(_1b7); 1379 var _1c3=date.advance({days:diff}); 1380 if(_1b7.start.month==date.getMonth()&&_1b7.start.day==date.getDate()&&_1b7.finish.month==_1c3.getMonth()&&_1b7.finish.day==_1c3.getDate()){ 1381 1381 this.calendar.refreshSchedule(); 1382 1382 return; 1383 1383 } 1384 _1b 6.start.year=date.getFullYear();1385 _1b 6.start.month=date.getMonth();1386 _1b 6.start.day=date.getDate();1387 _1b 6.finish.year=_1c2.getFullYear();1388 _1b 6.finish.month=_1c2.getMonth();1389 _1b 6.finish.day=_1c2.getDate();1384 _1b7.start.year=date.getFullYear(); 1385 _1b7.start.month=date.getMonth(); 1386 _1b7.start.day=date.getDate(); 1387 _1b7.finish.year=_1c3.getFullYear(); 1388 _1b7.finish.month=_1c3.getMonth(); 1389 _1b7.finish.day=_1c3.getDate(); 1390 1390 this.calendar.refreshSchedule(); 1391 this.calendar.options.changeSchedule(_1b 6);1391 this.calendar.options.changeSchedule(_1b7); 1392 1392 }else{ 1393 1393 this.calendar.refreshSchedule(); 1394 1394 } 1395 },updateTirm:function(_1c 3){1396 var _1c 4=_1c3.schedule;1397 var _1c 5=parseInt(Element.getStyle(_1c3,"width"));1398 var top=parseInt(Element.getStyle(_1c 3,"top"));1399 var left=parseInt(Element.getStyle(_1c 3,"left"));1400 var _1c 8=Math.round((left+_1c5)/this.column.width)-1;1401 var _1c 9=Math.round(top/this.column.height);1402 var cell=this.findCell(_1c 9,_1c8);1403 var _1c b=_1c4.finish;1404 var _1c c=null;1395 },updateTirm:function(_1c4){ 1396 var _1c5=_1c4.schedule; 1397 var _1c6=parseInt(Element.getStyle(_1c4,"width")); 1398 var top=parseInt(Element.getStyle(_1c4,"top")); 1399 var left=parseInt(Element.getStyle(_1c4,"left")); 1400 var _1c9=Math.round((left+_1c6)/this.column.width)-1; 1401 var _1ca=Math.round(top/this.column.height); 1402 var cell=this.findCell(_1ca,_1c9); 1403 var _1cc=_1c5.finish; 1404 var _1cd=null; 1405 1405 if(this.dateMap){ 1406 _1c c=this.dateMap[cell.id].toHash();1407 }else{ 1408 _1c c=new Date(this.calendar.date.getTime());1409 _1c c.setDate(parseInt(cell.id.getSuffix(),10));1410 _1c c=_1cc.toHash();1411 } 1412 _1c c.hour=_1cb.hour;1413 _1c c.min=_1cb.min;1414 if(DateUtil.toDate(_1c 4.start).getTime()>=DateUtil.toDate(_1cc).getTime()){1415 var _1c d=23;1416 var _1c e=55;1417 if(_1c 4.start.hour==_1cd&&_1c4.start.min==_1ce){1406 _1cd=this.dateMap[cell.id].toHash(); 1407 }else{ 1408 _1cd=new Date(this.calendar.date.getTime()); 1409 _1cd.setDate(parseInt(cell.id.getSuffix(),10)); 1410 _1cd=_1cd.toHash(); 1411 } 1412 _1cd.hour=_1cc.hour; 1413 _1cd.min=_1cc.min; 1414 if(DateUtil.toDate(_1c5.start).getTime()>=DateUtil.toDate(_1cd).getTime()){ 1415 var _1ce=23; 1416 var _1cf=55; 1417 if(_1c5.start.hour==_1ce&&_1c5.start.min==_1cf){ 1418 1418 this.calendar.refreshSchedule(); 1419 1419 this.calendar.options.updateTirm(); 1420 1420 return; 1421 1421 }else{ 1422 _1c c.hour=_1cd;1423 _1c c.min=_1ce;1424 } 1425 } 1426 _1c 4.finish=_1cc;1422 _1cd.hour=_1ce; 1423 _1cd.min=_1cf; 1424 } 1425 } 1426 _1c5.finish=_1cd; 1427 1427 this.calendar.refreshSchedule(); 1428 this.calendar.options.updateTirm(_1c 4);1429 },getTimeText:function(_1 cf,_1d0){1430 var _1d 1=this.calendar;1431 return _1d 1.formatTime(_1cf);1432 },getDayDiff:function(_1d 2){1433 return DateUtil.numberOfDays(this.toDate(_1d 2.start),this.toDate(_1d2.finish));1428 this.calendar.options.updateTirm(_1c5); 1429 },getTimeText:function(_1d0,_1d1){ 1430 var _1d2=this.calendar; 1431 return _1d2.formatTime(_1d0); 1432 },getDayDiff:function(_1d3){ 1433 return DateUtil.numberOfDays(this.toDate(_1d3.start),this.toDate(_1d3.finish)); 1434 1434 }}); 1435 1435 var CalendarWeek=Class.create(); 1436 1436 CalendarWeek.id=["calTable","columnContainer","columnHeader","column","next","pre","headerText"]; 1437 1437 Object.extend(CalendarWeek.prototype,AbstractCalendar.prototype); 1438 Object.extend(CalendarWeek.prototype,{initialize:function(_1d 3){1439 this.calendar=_1d 3;1440 var _1d 4=this.getWeek();1441 this.week=_1d 4[0];1442 this.invisibleWeek=_1d 4[1];1438 Object.extend(CalendarWeek.prototype,{initialize:function(_1d4){ 1439 this.calendar=_1d4; 1440 var _1d5=this.getWeek(); 1441 this.week=_1d5[0]; 1442 this.invisibleWeek=_1d5[1]; 1443 1443 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 1444 1444 this.setDisplayTime(); … … 1446 1446 return "<td class='"+this.calendar.classNames.preYears+"'>"+"<div id='"+this.ids.pre+"' class='"+this.calendar.classNames.preWeekMark+"'></div>"+"</td>"; 1447 1447 },buildHeaderCenter:function(){ 1448 var _1d 5=[];1448 var _1d6=[]; 1449 1449 if(this.calendar.options.weekHeaderFormat){ 1450 _1d 5=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())];1451 } 1452 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1d 5[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1d5[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1d5[2]||this.week.last().toDateString())+"</span>"+"</td>";1450 _1d6=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())]; 1451 } 1452 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1d6[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1d6[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1d6[2]||this.week.last().toDateString())+"</span>"+"</td>"; 1453 1453 },formatHeaderDate:function(date){ 1454 1454 if(this.calendar.options.weekHeaderFormat){ … … 1459 1459 return "<td class='"+this.calendar.classNames.nextYears+"' align='right'>"+"<div id='"+this.ids.next+"' class='"+this.calendar.classNames.nextWeekMark+"'></div>"+"</td>"; 1460 1460 },buildCalendar:function(){ 1461 var _1d 7=(this.calendar.options.displayTimeLine)?this.buildTimeLine():"";1462 _1d 7+=this.buildCalendarContainer();1463 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1d 7+"</tr>"+"</table>";1461 var _1d8=(this.calendar.options.displayTimeLine)?this.buildTimeLine():""; 1462 _1d8+=this.buildCalendarContainer(); 1463 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1d8+"</tr>"+"</table>"; 1464 1464 },buildTimeLine:function(){ 1465 1465 var time=new Date(); 1466 var hour=0,_1d a=24;1466 var hour=0,_1db=24; 1467 1467 time.setHours(hour); 1468 1468 time.setMinutes(0); 1469 var _1d b=this.buildTimeLineTop();1469 var _1dc=this.buildTimeLineTop(); 1470 1470 var now=new Date().getHours(); 1471 while(hour<_1d a){1471 while(hour<_1db){ 1472 1472 if(this.includeDisplayTime(hour)){ 1473 var _1d d="pointer: default;";1474 if(_1d b.length==0){1475 _1d d+="border-top: none;";1476 } 1477 var _1d e=this.calendar.classNames.timeLineTime;1473 var _1de="pointer: default;"; 1474 if(_1dc.length==0){ 1475 _1de+="border-top: none;"; 1476 } 1477 var _1df=this.calendar.classNames.timeLineTime; 1478 1478 if(hour==now){ 1479 _1d e+=" "+this.calendar.classNames.highlightTime;1480 } 1481 _1d b+="<div class='"+_1de+"' style='"+_1dd+"'>"+this.formatTime(time)+"</div>";1479 _1df+=" "+this.calendar.classNames.highlightTime; 1480 } 1481 _1dc+="<div class='"+_1df+"' style='"+_1de+"'>"+this.formatTime(time)+"</div>"; 1482 1482 } 1483 1483 hour++; 1484 1484 time.setHours(hour); 1485 1485 } 1486 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1d b+"</td>";1486 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1dc+"</td>"; 1487 1487 },buildTimeLineTop:function(){ 1488 1488 return "<div class='"+this.calendar.classNames.timeLineTimeTop+"'></div>"; … … 1490 1490 return "<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+this.buildCalendarHeader()+this.buildCalendarMain()+"</table>"+"</td>"; 1491 1491 },buildCalendarHeader:function(){ 1492 var _1 df=this.calendar.options.displayIndexes;1492 var _1e0=this.calendar.options.displayIndexes; 1493 1493 var ths=""; 1494 var _1e 1=new Date().days();1495 var _1e 2=100/_1df.length+"%";1496 var _1e 3=this.calendar.element.id.appendSuffix(this.ids.column);1497 var _1e 4=this.calendar.element.id.appendSuffix(this.ids.headerText);1494 var _1e2=new Date().days(); 1495 var _1e3=100/_1e0.length+"%"; 1496 var _1e4=this.calendar.element.id.appendSuffix(this.ids.column); 1497 var _1e5=this.calendar.element.id.appendSuffix(this.ids.headerText); 1498 1498 this.headers=[]; 1499 var _1e 5=this.calendar.options.noEvent;1500 var _1e 6=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null;1501 this.week.each(function(w,_1e 8){1499 var _1e6=this.calendar.options.noEvent; 1500 var _1e7=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null; 1501 this.week.each(function(w,_1e9){ 1502 1502 var text=null; 1503 if(_1e 6){1504 text=_1e 6.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]});1503 if(_1e7){ 1504 text=_1e7.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]}); 1505 1505 }else{ 1506 1506 text=w.toDateString().split(" "); … … 1508 1508 text=text.join(" "); 1509 1509 } 1510 var _1e a=(w.days()==_1e1)?this.calendar.classNames.highlightDay:"";1511 var _1e b=_1e4.appendSuffix(_1e8);1510 var _1eb=(w.days()==_1e2)?this.calendar.classNames.highlightDay:""; 1511 var _1ec=_1e5.appendSuffix(_1e9); 1512 1512 var node="<div class='"+this.calendar.classNames.headerColumn+"'>"; 1513 if(_1e 5){1514 node+="<span='#' id='"+_1e b+"' class='"+_1ea+"' style='cursor: default;'>"+text+"</a>";1515 }else{ 1516 node+="<a href='#' id='"+_1e b+"' class='"+_1ea+"'>"+text+"</a>";1513 if(_1e6){ 1514 node+="<span='#' id='"+_1ec+"' class='"+_1eb+"' style='cursor: default;'>"+text+"</a>"; 1515 }else{ 1516 node+="<a href='#' id='"+_1ec+"' class='"+_1eb+"'>"+text+"</a>"; 1517 1517 } 1518 1518 node+="</div>"; 1519 this.headers.push({id:_1e b,wday:w});1520 ths+="<th id='"+_1e 3.appendSuffix(_1e8)+"' width='"+_1e2+"'>"+node+"</th>";1519 this.headers.push({id:_1ec,wday:w}); 1520 ths+="<th id='"+_1e4.appendSuffix(_1e9)+"' width='"+_1e3+"'>"+node+"</th>"; 1521 1521 }.bind(this)); 1522 1522 return "<tr>"+"<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+"<tr>"+ths+"</tr>"+"</table>"+"</td>"+"</tr>"; 1523 1523 },buildCalendarMain:function(){ 1524 var _1e d=this.calendar.options.displayIndexes;1524 var _1ee=this.calendar.options.displayIndexes; 1525 1525 var tds=""; 1526 var _1 ef=100/_1ed.length+"%";1526 var _1f0=100/_1ee.length+"%"; 1527 1527 this.dateMap={}; 1528 this.week.each(function(w,_1f 1){1529 var _1f 2=this.calendar.options.schedules[w.toDateString()];1530 var _1f 3="";1528 this.week.each(function(w,_1f2){ 1529 var _1f3=this.calendar.options.schedules[w.toDateString()]; 1530 var _1f4=""; 1531 1531 var i=0,j=0; 1532 1532 while(i<24){ 1533 1533 if(this.includeDisplayTime(i)){ 1534 var _1f 6="";1535 if(_1f 3.length==0){1536 _1f 6=this.calendar.classNames.columnTopDate;1534 var _1f7=""; 1535 if(_1f4.length==0){ 1536 _1f7=this.calendar.classNames.columnTopDate; 1537 1537 }else{ 1538 1538 if(i%1==0){ 1539 _1f 6=this.calendar.classNames.columnDate;1540 }else{ 1541 _1f 6=this.calendar.classNames.columnDateOdd;1542 } 1543 } 1544 var id=this.getDateId(w,i,_1f 1);1539 _1f7=this.calendar.classNames.columnDate; 1540 }else{ 1541 _1f7=this.calendar.classNames.columnDateOdd; 1542 } 1543 } 1544 var id=this.getDateId(w,i,_1f2); 1545 1545 var hour=i/1; 1546 1546 var min=i%1*60; 1547 1547 this.dateMap[id]=new Date(w.getFullYear(),w.getMonth(),w.getDate(),hour,min,0); 1548 _1f 3+="<div id='"+id+"' class='"+_1f6+"'></div>";1548 _1f4+="<div id='"+id+"' class='"+_1f7+"'></div>"; 1549 1549 } 1550 1550 i+=0.5; 1551 1551 } 1552 tds+="<td width='"+_1 ef+"'>"+_1f3+"</td>";1552 tds+="<td width='"+_1f0+"'>"+_1f4+"</td>"; 1553 1553 }.bind(this)); 1554 1554 return "<tr>"+"<td>"+"<div id='"+this.getScheduleContainerId()+"' class='"+this.calendar.classNames.scheduleContainer+"' style='position: relative;'>"+"<table id='"+this.getCalendarTableId()+"' class='"+this.calendar.classNames.weekMainTable+"' style='position: relative;'>"+"<tr>"+tds+"</tr>"+"</table>"+"</div>"+"</td>"+"</tr>"; … … 1558 1558 var rule=CssUtil.getCssRuleBySelectorText("."+Calendar.className.columnDate); 1559 1559 this.column.height=parseInt(rule.style["height"],10)+1; 1560 },buildSchedule:function(_1f c){1561 var id="scheduleItem_"+_1f c.id;1562 var _1f e=(_1fc.edit==undefined||_1fc.edit);1560 },buildSchedule:function(_1fd){ 1561 var id="scheduleItem_"+_1fd.id; 1562 var _1ff=(_1fd.edit==undefined||_1fd.edit); 1563 1563 var item=Builder.node("DIV",{id:id}); 1564 1564 this.calendar.css.addClassNames(item,"scheduleItemLarge"); 1565 var _200=this.calendar.options.noEvent; 1566 var _201={}; 1567 if(_1fc.background_color){ 1568 _201.backgroundColor=_1fc.background_color; 1569 } 1570 if(_1fc.frame_color){ 1571 _201.border="2px solid "+_1fc.frame_color; 1572 } 1573 if(_200){ 1574 _201.cursor="default"; 1575 } 1576 Element.setStyle(item,_201); 1577 if(_1fe){ 1578 var _202=Builder.node("DIV",{id:"scheduleDeleteImg_"+_1fc.id,className:this.calendar.css.joinClassNames("deleteImg")}); 1579 Element.hide(_202); 1580 item.appendChild(_202); 1581 if(!_200){ 1582 Event.observe(_202,"click",this.clickDeleteImage.bind(this,_1fc)); 1583 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_202)); 1584 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_202)); 1585 } 1586 } 1587 if(!_200&&this.calendar.options.dblclickSchedule){ 1588 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_1fc)); 1589 } 1590 var _203=null; 1591 if(_1fe){ 1592 _203=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 1593 if(_200){ 1565 var _201=this.calendar.options.noEvent; 1566 var _202={}; 1567 if(_1fd.background_color){ 1568 _202.backgroundColor=_1fd.background_color; 1569 } 1570 if(_1fd.frame_color){ 1571 _202.border="2px solid "+_1fd.frame_color; 1572 } 1573 if(_201){ 1574 _202.cursor="default"; 1575 } 1576 Element.setStyle(item,_202); 1577 if(_1ff){ 1578 var _203=Builder.node("DIV",{id:"scheduleDeleteImg_"+_1fd.id,className:this.calendar.css.joinClassNames("deleteImg")}); 1594 1579 Element.hide(_203); 1595 }1596 1580 item.appendChild(_203); 1581 if(!_201){ 1582 Event.observe(_203,"click",this.clickDeleteImage.bind(this,_1fd)); 1583 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_203)); 1584 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_203)); 1585 } 1586 } 1587 if(!_201&&this.calendar.options.dblclickSchedule){ 1588 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_1fd)); 1589 } 1590 var _204=null; 1591 if(_1ff){ 1592 _204=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 1593 if(_201){ 1594 Element.hide(_204); 1595 } 1596 item.appendChild(_204); 1597 1597 } 1598 1598 var icon=null; 1599 if(_1f c.icon){1600 icon=Builder.node("IMG",{src:_1f c.icon,alt:"icon",style:"float: left;",width:16,height:16});1599 if(_1fd.icon){ 1600 icon=Builder.node("IMG",{src:_1fd.icon,alt:"icon",style:"float: left;",width:16,height:16}); 1601 1601 item.appendChild(icon); 1602 1602 } 1603 if(!_1f c.publicity){1603 if(!_1fd.publicity){ 1604 1604 if(Calendar.privateImgPath){ 1605 1605 icon=Builder.node("IMG",{src:Calendar.privateImgPath,alt:"private",style:"float: left;",width:16,height:16}); 1606 1606 item.appendChild(icon); 1607 1607 }else{ 1608 icon=Builder.node("DIV",{id:"private_img_"+_1f c.id});1608 icon=Builder.node("DIV",{id:"private_img_"+_1fd.id}); 1609 1609 this.calendar.css.addClassNames(icon,"privateImg"); 1610 1610 item.appendChild(icon); 1611 1611 } 1612 1612 } 1613 var text=this.getTimeText(_1f c.start,_1fc.finish);1614 text=Builder.node("DIV",{id:id+"_text"},[text]);1615 this.calendar.css.addClassNames( text,"scheduleTimeArea");1616 item.appendChild( text);1617 var _20 6=_1fc.description.unescapeHTML();1618 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_20 6]));1619 item.title= _206;1620 item.schedule=_1f c;1621 return [item,_20 3];1622 },adjustScheduleStyle:function(item,_20 8,_209){1623 var _20 a=item.schedule;1624 var time=this.convertHours(_20 a);1625 var _20 c=time[0];1626 var _20 d=time[1];1613 var text=this.getTimeText(_1fd.start,_1fd.finish); 1614 var _207=Builder.node("DIV",{id:id+"_text"},[text]); 1615 this.calendar.css.addClassNames(_207,"scheduleTimeArea"); 1616 item.appendChild(_207); 1617 var _208=_1fd.description.unescapeHTML(); 1618 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_208])); 1619 item.title=text.replace(/ /g,"")+" "+_208; 1620 item.schedule=_1fd; 1621 return [item,_204]; 1622 },adjustScheduleStyle:function(item,_20a,_20b){ 1623 var _20c=item.schedule; 1624 var time=this.convertHours(_20c); 1625 var _20e=time[0]; 1626 var _20f=time[1]; 1627 1627 var same=[]; 1628 1628 var self=this; 1629 _20 9.each(function(h){1630 var _21 1=self.convertHours(h.schedule);1631 var _21 2=_211[0];1632 var _21 3=_211[1];1633 if(((_21 2<=_20c)&&(_213>_20c))||((_212<_20d)&&(_213>=_20d))||((_20c<=_212)&&(_20d>_212))||((_20c<_213)&&(_20d>=_213))){1629 _20b.each(function(h){ 1630 var _213=self.convertHours(h.schedule); 1631 var _214=_213[0]; 1632 var _215=_213[1]; 1633 if(((_214<=_20e)&&(_215>_20e))||((_214<_20f)&&(_215>=_20f))||((_20e<=_214)&&(_20f>_214))||((_20e<_215)&&(_20f>=_215))){ 1634 1634 same.push(h); 1635 1635 } 1636 1636 }); 1637 var _21 4=_208*this.getAdjustSize();1637 var _216=_20a*this.getAdjustSize(); 1638 1638 if(UserAgent.isIE()||this.calendar.options.noEvent){ 1639 _21 4+=1;1640 } 1641 var left=this.column.width*_20 8+_214;1639 _216+=1; 1640 } 1641 var left=this.column.width*_20a+_216; 1642 1642 if(same.length==0){ 1643 1643 Element.setStyle(item,{left:left+"px"}); 1644 1644 }else{ 1645 1645 same.push(item); 1646 var _21 6=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1;1646 var _218=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 1647 1647 same.each(function(s,i){ 1648 var _21 9=left+_216*i+(2*i);1649 Element.setStyle(s,{width:_21 6+"px",left:_219+"px"});1648 var _21b=left+_218*i+(2*i); 1649 Element.setStyle(s,{width:_218+"px",left:_21b+"px"}); 1650 1650 }); 1651 1651 } 1652 1652 return left; 1653 1653 },setScheduleBaseStyle:function(item){ 1654 var _21 b=item.schedule;1655 if(!this.calendar.isSameDate(_21 b.start,_21b.finish)){1656 _21 b.finish.hour=24;1657 _21 b.finish.min=0;1658 } 1659 var time=this.convertHours(_21 b);1660 var _21 d=time.first();1661 var _2 1e=time.last();1662 var _2 1f=this.column.height*2;1663 var diff=this.calendar.getTimeDiff(_21 b.start,_21b.finish);1654 var _21d=item.schedule; 1655 if(!this.calendar.isSameDate(_21d.start,_21d.finish)){ 1656 _21d.finish.hour=24; 1657 _21d.finish.min=0; 1658 } 1659 var time=this.convertHours(_21d); 1660 var _21f=time.first(); 1661 var _220=time.last(); 1662 var _221=this.column.height*2; 1663 var diff=this.calendar.getTimeDiff(_21d.start,_21d.finish); 1664 1664 var rate=(diff.hour+(diff.min/60))||1; 1665 1665 var over=0; 1666 1666 var top=0; 1667 var _22 4=0;1668 var _22 5=this.includeDisplayTime(_21d);1669 var _22 6=this.includeDisplayTime(_21e,true);1670 if(!_22 5&&!_226){1671 if((this.startTime<=_21 d&&this.startTime<=_21e)||(_21d<this.finishTime&&_21e<this.finishTime)){1672 top=_22 4=0;1667 var _226=0; 1668 var _227=this.includeDisplayTime(_21f); 1669 var _228=this.includeDisplayTime(_220,true); 1670 if(!_227&&!_228){ 1671 if((this.startTime<=_21f&&this.startTime<=_220)||(_21f<this.finishTime&&_220<this.finishTime)){ 1672 top=_226=0; 1673 1673 Element.hide(item); 1674 1674 this.hasInvisibleSchedule=true; 1675 1675 }else{ 1676 1676 top=0; 1677 _22 4=_21f*(this.finishTime-this.startTime)-3;1678 } 1679 }else{ 1680 if(_22 5){1681 top=_2 1f*(_21d-this.startTime);1682 _22 4=_21f*rate-3;1677 _226=_221*(this.finishTime-this.startTime)-3; 1678 } 1679 }else{ 1680 if(_227){ 1681 top=_221*(_21f-this.startTime); 1682 _226=_221*rate-3; 1683 1683 }else{ 1684 1684 top=0; 1685 over=this.startTime-_21 d;1686 _22 4=_21f*(rate-over);1687 } 1688 if(_22 6){1689 }else{ 1690 over=_2 1e-this.finishTime;1691 <
