Changeset 5778
- Timestamp:
- 06/02/08 15:18:22 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinelz/trunk/compress/javascripts/spinelz/calendar.js
r5776 r5778 948 948 } 949 949 Element.setStyle(item,_116); 950 if(_111){ 951 var _117=Builder.node("DIV",{id:"scheduleDeleteImg_"+_10e.id,className:this.calendar.css.joinClassNames("deleteImg")}); 952 Element.hide(_117); 953 item.appendChild(_117); 950 var _117=(_10e.removable==undefined||_10e.removable); 951 if(_111&&_117){ 952 var _118=Builder.node("DIV",{id:"scheduleDeleteImg_"+_10e.id,className:this.calendar.css.joinClassNames("deleteImg")}); 953 Element.hide(_118); 954 item.appendChild(_118); 954 955 if(!_115){ 955 Event.observe(_11 7,"click",this.clickDeleteImage.bind(this,_10e));956 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_11 7));957 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_11 7));956 Event.observe(_118,"click",this.clickDeleteImage.bind(this,_10e)); 957 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_118)); 958 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_118)); 958 959 } 959 960 } … … 961 962 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_10e)); 962 963 } 963 var _11 8=null;964 var _119=null; 964 965 if(_111){ 965 _11 8=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")});966 _119=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 966 967 if(_115){ 967 Element.hide(_11 8);968 } 969 item.appendChild(_11 8);968 Element.hide(_119); 969 } 970 item.appendChild(_119); 970 971 } 971 972 var icon=null; … … 986 987 var body=Builder.node("DIV"); 987 988 var text=this.getTimeText((_10f)?_10e.start:{hour:"0",min:"0"},_10e.finish); 988 var _11 c=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]);989 this.calendar.css.addClassNames(_11 c,"scheduleTimeArea");990 item.appendChild(_11 c);991 var _11 d=_10e.description.unescapeHTML();992 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_11 d]));993 item.title=text+"-"+this.calendar.formatTime(_10e.finish)+" "+_11 d;989 var _11d=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]); 990 this.calendar.css.addClassNames(_11d,"scheduleTimeArea"); 991 item.appendChild(_11d); 992 var _11e=_10e.description.unescapeHTML(); 993 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_11e])); 994 item.title=text+"-"+this.calendar.formatTime(_10e.finish)+" "+_11e; 994 995 item.schedule=_10e; 995 return [item,_11 8];996 },adjustScheduleStyle:function(item,_1 1f,_120,_121){996 return [item,_119]; 997 },adjustScheduleStyle:function(item,_120,_121,_122){ 997 998 var self=this; 998 var _12 3=parseInt(Element.getStyle(item,"height"),10);999 var _124=parseInt(Element.getStyle(item,"height"),10); 999 1000 var top=parseInt(Element.getStyle(item,"top"),10); 1000 var _12 5=this.getScheduleRange(item);1001 var _126=this.getScheduleRange(item); 1001 1002 var tops=[]; 1002 var _12 7=3;1003 _12 1.each(function(_128){1004 var _12 9=self.getScheduleRange(_128);1005 if(_12 5.any(function(r){1006 return _12 9.include(r);1003 var _128=3; 1004 _122.each(function(_129){ 1005 var _12a=self.getScheduleRange(_129); 1006 if(_126.any(function(r){ 1007 return _12a.include(r); 1007 1008 })){ 1008 tops.push(_12 8.topIndex);1009 } 1010 }); 1011 var _12 b=$R(0,tops.length,true).detect(function(i){1009 tops.push(_129.topIndex); 1010 } 1011 }); 1012 var _12c=$R(0,tops.length,true).detect(function(i){ 1012 1013 return !tops.include(i); 1013 1014 }); 1014 if(isNaN(_12 b)){1015 _12 b=tops.length;1016 } 1017 item.topIndex=_12 b;1018 Element.setStyle(item,{top:top+(_12 3+2)*_12b+"px"});1019 if(_12 b>=_127){1015 if(isNaN(_12c)){ 1016 _12c=tops.length; 1017 } 1018 item.topIndex=_12c; 1019 Element.setStyle(item,{top:top+(_124+2)*_12c+"px"}); 1020 if(_12c>=_128){ 1020 1021 Element.hide(item); 1021 var node=this.buildSkipSchedule(_1 1f+"_"+_120,item);1022 var node=this.buildSkipSchedule(_120+"_"+_121,item); 1022 1023 if(node){ 1023 1024 var left=Element.getStyle(item,"left"); 1024 Element.setStyle(node,{top:top+(_12 3+2)*_12b+"px",left:left});1025 Element.setStyle(node,{top:top+(_124+2)*_12c+"px",left:left}); 1025 1026 } 1026 1027 return node; 1027 1028 } 1028 },buildSkipSchedule:function(_1 2f,item){1029 var id=this.calendar.element.id.appendSuffix(_1 2f);1029 },buildSkipSchedule:function(_130,item){ 1030 var id=this.calendar.element.id.appendSuffix(_130); 1030 1031 if(!this.skipNode[id]){ 1031 var _13 2=this.getAdjustSize()+(UserAgent.isIE()?0.5:0);1032 var _13 3=this.column.width+_132-1+"px";1033 var node=Builder.node("a",{id:id,style:"display: block; z-index: 1000; cursor: pointer; width: "+_13 3+";",href:"javascript:void(0);"},["more"]);1032 var _133=this.getAdjustSize()+(UserAgent.isIE()?0.5:0); 1033 var _134=this.column.width+_133-1+"px"; 1034 var node=Builder.node("a",{id:id,style:"display: block; z-index: 1000; cursor: pointer; width: "+_134+";",href:"javascript:void(0);"},["more"]); 1034 1035 this.calendar.css.addClassNames(node,"skipNode"); 1035 1036 node.skipId=id; … … 1043 1044 return item.cellIndex+i; 1044 1045 }); 1045 },setScheduleBaseStyle:function(item,_13 8,_139,_13a){1046 var _13 b=this.column.height;1047 var top=_13 b*_138+this.column.dateTextHeight;1048 var _13 d=this.getAdjustSize()+(UserAgent.isIE()?0.5:0);1049 Element.setStyle(item,{top:top+"px",width:this.column.width*_13 a+_13d*(_13a-1)+"px",left:this.column.width*_139+_139*_13d+"px"});1046 },setScheduleBaseStyle:function(item,_139,_13a,_13b){ 1047 var _13c=this.column.height; 1048 var top=_13c*_139+this.column.dateTextHeight; 1049 var _13e=this.getAdjustSize()+(UserAgent.isIE()?0.5:0); 1050 Element.setStyle(item,{top:top+"px",width:this.column.width*_13b+_13e*(_13b-1)+"px",left:this.column.width*_13a+_13a*_13e+"px"}); 1050 1051 },afterBuild:function(){ 1051 var _13 e=this.getTooltipId();1052 if($(_13 e)){1053 Element.appendToBody(_13 e);1052 var _13f=this.getTooltipId(); 1053 if($(_13f)){ 1054 Element.appendToBody(_13f); 1054 1055 } 1055 1056 this.scheduleNodes=[]; … … 1064 1065 this.setSelector(); 1065 1066 var self=this; 1066 var _14 0=this.calendar.options.displayIndexes;1067 var _14 1=this.getDragDistance();1068 var _14 2=$R(0,$(this.getCalendarTableId()).rows.length).map(function(){1067 var _141=this.calendar.options.displayIndexes; 1068 var _142=this.getDragDistance(); 1069 var _143=$R(0,$(this.getCalendarTableId()).rows.length).map(function(){ 1069 1070 return []; 1070 1071 }); 1071 1072 var date=this.calendar.date; 1072 var _14 4=DateUtil.getFirstDate(date.getFullYear(),date.getMonth());1073 var _14 5=_144.days();1074 var _14 6=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days();1075 self.calendar.options.schedules.each(function(_14 7,_148){1076 var _14 9=self.toDate(_147.start);1077 var _14 a=_149.days();1078 var _14 b=self.toDate(_147.finish);1079 var _14 c=_14b.days();1080 var days=self.getDayDiff(_14 7);1081 if(_14 7.finish.hour==0&&_147.finish.min==0){1073 var _145=DateUtil.getFirstDate(date.getFullYear(),date.getMonth()); 1074 var _146=_145.days(); 1075 var _147=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days(); 1076 self.calendar.options.schedules.each(function(_148,_149){ 1077 var _14a=self.toDate(_148.start); 1078 var _14b=_14a.days(); 1079 var _14c=self.toDate(_148.finish); 1080 var _14d=_14c.days(); 1081 var days=self.getDayDiff(_148); 1082 if(_148.finish.hour==0&&_148.finish.min==0){ 1082 1083 days--; 1083 1084 } 1084 if((_14 a>=_145&&_14a<=_146)||(_14c>=_145&&_14c<=_146)){1085 if(!_14 4.sameMonth(_149)){1086 _14 9=_144;1087 } 1088 self.setSchedule(_14 7,_142,_141,days);1085 if((_14b>=_146&&_14b<=_147)||(_14d>=_146&&_14d<=_147)){ 1086 if(!_145.sameMonth(_14a)){ 1087 _14a=_145; 1088 } 1089 self.setSchedule(_148,_143,_142,days); 1089 1090 } 1090 1091 }); … … 1111 1112 } 1112 1113 } 1113 },setSchedule:function(_15 0,_151,_152,days){1114 var _15 4=[];1115 var _15 5=6;1116 var _15 6=DateUtil.toDate(_150.start);1117 var date=_15 6;1118 var _15 8=this.calendar.options.displayIndexes;1119 var _15 9=this.calendar.date;1120 var _15 a=this.calendar.options.noEvent;1121 var _15 b=this.calendar.options.clickSkipNode;1114 },setSchedule:function(_151,_152,_153,days){ 1115 var _155=[]; 1116 var _156=6; 1117 var _157=DateUtil.toDate(_151.start); 1118 var date=_157; 1119 var _159=this.calendar.options.displayIndexes; 1120 var _15a=this.calendar.date; 1121 var _15b=this.calendar.options.noEvent; 1122 var _15c=this.calendar.options.clickSkipNode; 1122 1123 while(days>=0){ 1123 var _15 c=this.getLastWday(date);1124 var _15 d=days+1;1125 var _15 e=date.getDay();1126 var _1 5f=date.advance({days:_15d-1});1127 if(_1 5f.getTime()>_15c.getTime()){1128 _1 5f=_15c;1129 _15 d=_15f.days()-date.days()+1;1130 } 1131 var _16 0=_15f.getDay();1132 var _16 1=null;1133 if(_15 e<=_160){1134 _16 1=$R(_15e,_160,false);1135 }else{ 1136 _16 1=$R(0,_160,false).toArray().concat($R(_15e,_155,false).toArray());1137 } 1138 var _16 2=_161.findAll(function(day){1139 return _15 8.include(day);1124 var _15d=this.getLastWday(date); 1125 var _15e=days+1; 1126 var _15f=date.getDay(); 1127 var _160=date.advance({days:_15e-1}); 1128 if(_160.getTime()>_15d.getTime()){ 1129 _160=_15d; 1130 _15e=_160.days()-date.days()+1; 1131 } 1132 var _161=_160.getDay(); 1133 var _162=null; 1134 if(_15f<=_161){ 1135 _162=$R(_15f,_161,false); 1136 }else{ 1137 _162=$R(0,_161,false).toArray().concat($R(_15f,_156,false).toArray()); 1138 } 1139 var _163=_162.findAll(function(day){ 1140 return _159.include(day); 1140 1141 }).length; 1141 var _16 4=new Date(date.getTime());1142 while(_16 4.days()<=_15f.days()){1143 if(_16 4.getMonth()==_159.getMonth()){1144 var _16 5=this.getCellPosition(_164.getDate());1145 if(_16 5){1146 var _16 6=_165.rowIndex;1147 var _16 7=_165.cellIndex;1148 var _16 8=this.buildSchedule(_150,_156.sameDate(_164));1149 var item=_16 8.first();1150 item.length=_16 2;1151 item.cellIndex=_16 7;1152 item.cellDate=_16 4;1142 var _165=new Date(date.getTime()); 1143 while(_165.days()<=_160.days()){ 1144 if(_165.getMonth()==_15a.getMonth()){ 1145 var _166=this.getCellPosition(_165.getDate()); 1146 if(_166){ 1147 var _167=_166.rowIndex; 1148 var _168=_166.cellIndex; 1149 var _169=this.buildSchedule(_151,_157.sameDate(_165)); 1150 var item=_169.first(); 1151 item.length=_163; 1152 item.cellIndex=_168; 1153 item.cellDate=_165; 1153 1154 this.container.appendChild(item); 1154 this.setScheduleBaseStyle(item,_16 6,_167,_162);1155 var _16 a=this.adjustScheduleStyle(item,_166,_167,_151[_166]);1156 if(_16 a){1157 this.container.appendChild(_16 a);1158 Event.observe(_16 a,"click",this.clickSkipNode.bindAsEventListener(this,_164));1159 Event.observe(_16 a,"mouseover",this.showTooltip.bindAsEventListener(this,_16a.skipId,_164));1160 Event.observe(_16 a,"mouseout",this.hideTooltip.bindAsEventListener(this));1161 } 1162 if(!_15 a&&((_150.edit==undefined)||_150.edit)){1163 this.setDraggable(item,_16 8.last(),_152);1155 this.setScheduleBaseStyle(item,_167,_168,_163); 1156 var _16b=this.adjustScheduleStyle(item,_167,_168,_152[_167]); 1157 if(_16b){ 1158 this.container.appendChild(_16b); 1159 Event.observe(_16b,"click",this.clickSkipNode.bindAsEventListener(this,_165)); 1160 Event.observe(_16b,"mouseover",this.showTooltip.bindAsEventListener(this,_16b.skipId,_165)); 1161 Event.observe(_16b,"mouseout",this.hideTooltip.bindAsEventListener(this)); 1162 } 1163 if(!_15b&&((_151.edit==undefined)||_151.edit)){ 1164 this.setDraggable(item,_169.last(),_153); 1164 1165 this.setResize(item); 1165 1166 } 1166 _15 1[_166].push(item);1167 _152[_167].push(item); 1167 1168 this.scheduleNodes.push(item); 1168 1169 break; 1169 1170 }else{ 1170 if(_15 8.include(_164.getDay())){1171 _16 2--;1171 if(_159.include(_165.getDay())){ 1172 _163--; 1172 1173 }else{ 1173 1174 this.hasInvisibleSchedule=true; … … 1175 1176 } 1176 1177 }else{ 1177 if(_15 8.include(_164.getDay())){1178 _16 2--;1179 } 1180 } 1181 _16 4=_164.advance({days:1});1182 } 1183 if(_15 4.length==0){1184 days-=_15 d;1178 if(_159.include(_165.getDay())){ 1179 _163--; 1180 } 1181 } 1182 _165=_165.advance({days:1}); 1183 } 1184 if(_155.length==0){ 1185 days-=_15e; 1185 1186 }else{ 1186 1187 days-=7; 1187 1188 } 1188 var date=_1 5f.advance({days:1});1189 var date=_160.advance({days:1}); 1189 1190 if(item){ 1190 _15 4.push(item);1191 _155.push(item); 1191 1192 } 1192 1193 } 1193 1194 var self=this; 1194 if(!_15 a){1195 _15 4.each(function(item){1196 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_15 4));1197 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_15 4));1195 if(!_15b){ 1196 _155.each(function(item){ 1197 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_155)); 1198 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_155)); 1198 1199 }); 1199 1200 } … … 1202 1203 this.calendar.setIndex(); 1203 1204 } 1204 var _16 e=this.calendar.wdays.indexOf(date.getDay())+1;1205 return date.advance({days:this.calendar.wdays.length-_16 e});1205 var _16f=this.calendar.wdays.indexOf(date.getDay())+1; 1206 return date.advance({days:this.calendar.wdays.length-_16f}); 1206 1207 },setSelector:function(){ 1207 var _1 6f=$(this.getSelectorId());1208 Element.setStyle(_1 6f,{width:this.column.width+"px",height:this.column.height-2+"px"});1209 Element.setOpacity(_1 6f,0.6);1210 },setDraggable:function(item,_17 1,_172){1208 var _170=$(this.getSelectorId()); 1209 Element.setStyle(_170,{width:this.column.width+"px",height:this.column.height-2+"px"}); 1210 Element.setOpacity(_170,0.6); 1211 },setDraggable:function(item,_172,_173){ 1211 1212 var self=this; 1212 var _17 4=Position.cumulativeOffset(this.container);1213 var _17 5=$(this.getSelectorId());1214 var _17 6=this.column.width+(UserAgent.isIE()?0.5:0);1215 var _17 7=this.column.height+(UserAgent.isIE()?1:0);1216 var _17 8=this.rowMax||$(this.getCalendarTableId()).rows.length;1217 var _17 9=this.calendar.options.displayIndexes.length-1;1218 var _17 a=this.getAdjustSize();1219 new Draggable(item,{handle:_17 1,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_17b){1220 Element.show(_17 5);1221 },onDrag:function(_17 c,_17d){1222 var _17 e=_17c.element;1223 var top=parseInt(Element.getStyle(_17 e,"top"),10);1224 var _18 0=Math.floor(top/_177);1225 var left=parseInt(Element.getStyle(_17 e,"left"),10);1226 var _18 2=Math.floor(left/_176);1227 if((_18 2>=0&&_180>=0)&&(_182<=_179&&_180<=_178)){1228 Element.setStyle(_17 5,{left:_176*_182+_17a*_182+"px",top:_177*_180+"px"});1229 } 1230 },onEnd:function(_18 3){1231 Element.hide(_17 5);1232 self.changeSchedule(_18 3);1213 var _175=Position.cumulativeOffset(this.container); 1214 var _176=$(this.getSelectorId()); 1215 var _177=this.column.width+(UserAgent.isIE()?0.5:0); 1216 var _178=this.column.height+(UserAgent.isIE()?1:0); 1217 var _179=this.rowMax||$(this.getCalendarTableId()).rows.length; 1218 var _17a=this.calendar.options.displayIndexes.length-1; 1219 var _17b=this.getAdjustSize(); 1220 new Draggable(item,{handle:_172,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_17c){ 1221 Element.show(_176); 1222 },onDrag:function(_17d,_17e){ 1223 var _17f=_17d.element; 1224 var top=parseInt(Element.getStyle(_17f,"top"),10); 1225 var _181=Math.floor(top/_178); 1226 var left=parseInt(Element.getStyle(_17f,"left"),10); 1227 var _183=Math.floor(left/_177); 1228 if((_183>=0&&_181>=0)&&(_183<=_17a&&_181<=_179)){ 1229 Element.setStyle(_176,{left:_177*_183+_17b*_183+"px",top:_178*_181+"px"}); 1230 } 1231 },onEnd:function(_184){ 1232 Element.hide(_176); 1233 self.changeSchedule(_184); 1233 1234 }}); 1234 1235 },setResize:function(item){ 1235 1236 var self=this; 1236 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_18 6){1237 self.updateTirm(_18 6);1237 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_187){ 1238 self.updateTirm(_187); 1238 1239 }}); 1239 },getDate:function(_18 7){1240 },getDate:function(_188){ 1240 1241 var date=this.calendar.date; 1241 if(_18 7.constructor==String){1242 return new Date(date.getFullYear(),date.getMonth(),_18 7);1243 }else{ 1244 return new Date(date.getFullYear(),date.getMonth(),_18 7.id.getSuffix());1245 } 1246 },abstractSelect:function(_18 9,_18a){1247 var _18 b=null;1242 if(_188.constructor==String){ 1243 return new Date(date.getFullYear(),date.getMonth(),_188); 1244 }else{ 1245 return new Date(date.getFullYear(),date.getMonth(),_188.id.getSuffix()); 1246 } 1247 },abstractSelect:function(_18a,_18b){ 1248 var _18c=null; 1248 1249 if(this.calendar.options.size=="large"){ 1249 _18 b=this.findClickedElement(_189);1250 }else{ 1251 _18 b=Event.element(_189);1252 if(_18 b.tagName!="TD"){1253 _18 b=Element.getParentByTagName(["TD"],_18b);1254 } 1255 } 1256 if(_18 b&&_18b.id&&!_18b.id.match(/emptyRow/)){1257 var date=this.getDate(_18 b);1258 _18 a(date,_18b);1250 _18c=this.findClickedElement(_18a); 1251 }else{ 1252 _18c=Event.element(_18a); 1253 if(_18c.tagName!="TD"){ 1254 _18c=Element.getParentByTagName(["TD"],_18c); 1255 } 1256 } 1257 if(_18c&&_18c.id&&!_18c.id.match(/emptyRow/)){ 1258 var date=this.getDate(_18c); 1259 _18b(date,_18c); 1259 1260 } 1260 1261 },getSelectedTerm:function(){ 1261 1262 var self=this; 1262 var _18 e=this.calendar.getSelected();1263 return [_18 e.first(),_18e.last()].map(function(e){1263 var _18f=this.calendar.getSelected(); 1264 return [_18f.first(),_18f.last()].map(function(e){ 1264 1265 return self.getDate(e); 1265 1266 }); 1266 },selectDay:function(_19 0){1267 var _19 1=this.calendar;1268 var th=Event.element(_19 0);1267 },selectDay:function(_191){ 1268 var _192=this.calendar; 1269 var th=Event.element(_191); 1269 1270 if(th.tagName!="TH"){ 1270 1271 th=Element.getParentByTagName("TH",th); … … 1272 1273 this.iterateTable({doCell:function(cell){ 1273 1274 if((cell.cellIndex==th.cellIndex)&&cell.id){ 1274 _19 1.addSelectedClass(cell);1275 _192.addSelectedClass(cell); 1275 1276 } 1276 1277 }}); 1277 },inspectArgument:function(_19 4,time){1278 },inspectArgument:function(_195,time){ 1278 1279 var self=this; 1279 var _19 7=this.calendar.getSelected();1280 var _19 8=[];1281 self.calendar.recurrence(_19 4,function(o){1280 var _198=this.calendar.getSelected(); 1281 var _199=[]; 1282 self.calendar.recurrence(_195,function(o){ 1282 1283 if(!o.date){ 1283 _19 7.each(function(d){1284 var _19 b={};1284 _198.each(function(d){ 1285 var _19c={}; 1285 1286 if(!o.date){ 1286 _19 b={date:self.getDate(d)};1287 _19c={date:self.getDate(d)}; 1287 1288 if(time){ 1288 _19 b.start={hour:0,min:0};1289 _19 b.finish={hour:0,min:0};1290 } 1291 } 1292 Object.extend(_19 b,o);1293 _19 8.push(_19b);1289 _19c.start={hour:0,min:0}; 1290 _19c.finish={hour:0,min:0}; 1291 } 1292 } 1293 Object.extend(_19c,o); 1294 _199.push(_19c); 1294 1295 }); 1295 1296 }else{ 1296 1297 if(o.date.constructor==Object){ 1297 1298 o.date=new Date(o.date.year,o.date.month,o.date.day); 1298 _19 8.push(o);1299 }else{ 1300 _19 8.push(o);1301 } 1302 } 1303 }); 1304 return _19 8;1299 _199.push(o); 1300 }else{ 1301 _199.push(o); 1302 } 1303 } 1304 }); 1305 return _199; 1305 1306 },inspectDateArgument:function(date){ 1306 1307 if(date){ … … 1315 1316 return map; 1316 1317 }else{ 1317 var _19 e=this;1318 var _1 9f=this.calendar.getSelected();1319 if(_1 9f.length==0){1318 var _19f=this; 1319 var _1a0=this.calendar.getSelected(); 1320 if(_1a0.length==0){ 1320 1321 return null; 1321 1322 } 1322 return _1 9f.collect(function(d){1323 return _19 e.getDate(d);1324 }); 1325 } 1326 },findClickedElement:function(_1a 1){1327 var _1a 2=$(this.getScheduleContainerId());1328 var _1a 3=Position.cumulativeOffset(_1a2);1329 var _1a 4=Position.realOffset(_1a2).last();1330 _1a 4-=document.documentElement.scrollTop||document.body.scrollTop;1331 var x=Event.pointerX(_1a 1)-_1a3[0];1332 var y=Event.pointerY(_1a 1)-_1a3[1]+_1a4;1333 var _1a 7=Math.floor(y/this.column.height);1334 var _1a 8=Math.floor(x/this.column.width);1335 return $(this.calendarTable.rows[_1a 7].cells[_1a8]);1336 },multipleSelection:function(_1a 9){1323 return _1a0.collect(function(d){ 1324 return _19f.getDate(d); 1325 }); 1326 } 1327 },findClickedElement:function(_1a2){ 1328 var _1a3=$(this.getScheduleContainerId()); 1329 var _1a4=Position.cumulativeOffset(_1a3); 1330 var _1a5=Position.realOffset(_1a3).last(); 1331 _1a5-=document.documentElement.scrollTop||document.body.scrollTop; 1332 var x=Event.pointerX(_1a2)-_1a4[0]; 1333 var y=Event.pointerY(_1a2)-_1a4[1]+_1a5; 1334 var _1a8=Math.floor(y/this.column.height); 1335 var _1a9=Math.floor(x/this.column.width); 1336 return $(this.calendarTable.rows[_1a8].cells[_1a9]); 1337 },multipleSelection:function(_1aa){ 1337 1338 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 1338 1339 return; 1339 1340 } 1340 1341 var self=this; 1341 var _1a b=this.calendar;1342 var _1a c=this.calendar.selectedBase;1343 this.abstractSelect(_1a 9,function(date,_1ae){1344 var _1 af=$(_1ac.id);1345 var _1b 0=_1ab.createRange(parseInt(_1af.id.getSuffix()),parseInt(_1ae.id.getSuffix()));1342 var _1ac=this.calendar; 1343 var _1ad=this.calendar.selectedBase; 1344 this.abstractSelect(_1aa,function(date,_1af){ 1345 var _1b0=$(_1ad.id); 1346 var _1b1=_1ac.createRange(parseInt(_1b0.id.getSuffix()),parseInt(_1af.id.getSuffix())); 1346 1347 self.iterateTable({doCell:function(cell){ 1347 1348 if(cell.tagName!="TD"||!cell.id){ … … 1349 1350 } 1350 1351 var id=parseInt(cell.id.getSuffix(),10); 1351 if(_1b 0.include(id)){1352 _1a b.addSelectedClass(cell);1353 }else{ 1354 _1a b.removeSelectedClass(cell);1352 if(_1b1.include(id)){ 1353 _1ac.addSelectedClass(cell); 1354 }else{ 1355 _1ac.removeSelectedClass(cell); 1355 1356 } 1356 1357 }}); 1357 1358 }); 1358 1359 },iterateTable:function(){ 1359 var _1b 3=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]);1360 var _1b 4=$(this.getCalendarTableId());1361 if(_1b 3.doTable){1362 _1b 3.doTable(_1b4);1363 } 1364 $A(_1b 4.rows).each(function(row){1365 if(_1b 3.doRow){1366 _1b 3.doRow(row);1360 var _1b4=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]); 1361 var _1b5=$(this.getCalendarTableId()); 1362 if(_1b4.doTable){ 1363 _1b4.doTable(_1b5); 1364 } 1365 $A(_1b5.rows).each(function(row){ 1366 if(_1b4.doRow){ 1367 _1b4.doRow(row); 1367 1368 } 1368 1369 $A(row.cells).each(function(cell){ 1369 if(_1b 3.doCell){1370 _1b 3.doCell(cell);1371 } 1372 }); 1373 }); 1374 },findRow:function(_1b 7){1375 var _1b 8=$(this.getCalendarTableId());1376 return $A(_1b 8.rows).detect(function(row){1377 return row.rowIndex==_1b 7;1378 }); 1379 },findCell:function(_1b a,_1bb){1380 return $A(this.findRow(_1b a).cells).detect(function(cell){1381 return cell.cellIndex==_1b b;1370 if(_1b4.doCell){ 1371 _1b4.doCell(cell); 1372 } 1373 }); 1374 }); 1375 },findRow:function(_1b8){ 1376 var _1b9=$(this.getCalendarTableId()); 1377 return $A(_1b9.rows).detect(function(row){ 1378 return row.rowIndex==_1b8; 1379 }); 1380 },findCell:function(_1bb,_1bc){ 1381 return $A(this.findRow(_1bb).cells).detect(function(cell){ 1382 return cell.cellIndex==_1bc; 1382 1383 }); 1383 1384 },getDateId:function(date){ … … 1397 1398 return {cellIndex:cell.cellIndex,rowIndex:row.rowIndex}; 1398 1399 } 1399 },changeSchedule:function(_1c 3){1400 var _1c 4=_1c3.element;1401 var _1c 5=_1c4.schedule;1402 this.calendar.cacheSchedule(_1c 5);1403 var top=parseInt(Element.getStyle(_1c 4,"top"),10);1404 var _1c 7=Math.floor(top/this.column.height);1405 var left=parseInt(Element.getStyle(_1c 4,"left"),10);1406 var _1c 9=Math.floor(left/this.column.width);1407 var _1c a=$(this.getCalendarTableId());1408 var _1c b=_1ca.rows.length-1;1409 var _1c c=this.calendar.options.displayIndexes.length-1;1410 if((_1c 9>=0&&_1c7>=0)&&(_1c9<=_1cc&&_1c7<=_1cb)){1411 var cell=this.findCell(_1c 7,_1c9);1400 },changeSchedule:function(_1c4){ 1401 var _1c5=_1c4.element; 1402 var _1c6=_1c5.schedule; 1403 this.calendar.cacheSchedule(_1c6); 1404 var top=parseInt(Element.getStyle(_1c5,"top"),10); 1405 var _1c8=Math.floor(top/this.column.height); 1406 var left=parseInt(Element.getStyle(_1c5,"left"),10); 1407 var _1ca=Math.floor(left/this.column.width); 1408 var _1cb=$(this.getCalendarTableId()); 1409 var _1cc=_1cb.rows.length-1; 1410 var _1cd=this.calendar.options.displayIndexes.length-1; 1411 if((_1ca>=0&&_1c8>=0)&&(_1ca<=_1cd&&_1c8<=_1cc)){ 1412 var cell=this.findCell(_1c8,_1ca); 1412 1413 var date=new Date(this.calendar.date.getTime()); 1413 var _1 cf=_1c4.cellDate.days()-DateUtil.toDate(_1c5.start).days();1414 date.setDate(parseInt(cell.id.getSuffix(),10)-_1 cf);1415 var diff=this.getDayDiff(_1c 5);1416 var _1d 1=date.advance({days:diff});1417 if(_1c 5.start.month==date.getMonth()&&_1c5.start.day==date.getDate()&&_1c5.finish.month==_1d1.getMonth()&&_1c5.finish.day==_1d1.getDate()){1414 var _1d0=_1c5.cellDate.days()-DateUtil.toDate(_1c6.start).days(); 1415 date.setDate(parseInt(cell.id.getSuffix(),10)-_1d0); 1416 var diff=this.getDayDiff(_1c6); 1417 var _1d2=date.advance({days:diff}); 1418 if(_1c6.start.month==date.getMonth()&&_1c6.start.day==date.getDate()&&_1c6.finish.month==_1d2.getMonth()&&_1c6.finish.day==_1d2.getDate()){ 1418 1419 this.calendar.refreshSchedule(); 1419 1420 return; 1420 1421 } 1421 _1c 5.start.year=date.getFullYear();1422 _1c 5.start.month=date.getMonth();1423 _1c 5.start.day=date.getDate();1424 _1c 5.finish.year=_1d1.getFullYear();1425 _1c 5.finish.month=_1d1.getMonth();1426 _1c 5.finish.day=_1d1.getDate();1422 _1c6.start.year=date.getFullYear(); 1423 _1c6.start.month=date.getMonth(); 1424 _1c6.start.day=date.getDate(); 1425 _1c6.finish.year=_1d2.getFullYear(); 1426 _1c6.finish.month=_1d2.getMonth(); 1427 _1c6.finish.day=_1d2.getDate(); 1427 1428 this.calendar.refreshSchedule(); 1428 this.calendar.options.changeSchedule(_1c 5);1429 this.calendar.options.changeSchedule(_1c6); 1429 1430 }else{ 1430 1431 this.calendar.refreshSchedule(); 1431 1432 } 1432 },updateTirm:function(_1d 2){1433 var _1d 3=_1d2.schedule;1434 var _1d 4=parseInt(Element.getStyle(_1d2,"width"));1435 var top=parseInt(Element.getStyle(_1d 2,"top"));1436 var left=parseInt(Element.getStyle(_1d 2,"left"));1437 var _1d 7=Math.round((left+_1d4)/this.column.width)-1;1438 var _1d 8=Math.round(top/this.column.height);1439 var cell=this.findCell(_1d 8,_1d7);1440 var _1d a=_1d3.finish;1441 var _1d b=null;1433 },updateTirm:function(_1d3){ 1434 var _1d4=_1d3.schedule; 1435 var _1d5=parseInt(Element.getStyle(_1d3,"width")); 1436 var top=parseInt(Element.getStyle(_1d3,"top")); 1437 var left=parseInt(Element.getStyle(_1d3,"left")); 1438 var _1d8=Math.round((left+_1d5)/this.column.width)-1; 1439 var _1d9=Math.round(top/this.column.height); 1440 var cell=this.findCell(_1d9,_1d8); 1441 var _1db=_1d4.finish; 1442 var _1dc=null; 1442 1443 if(this.dateMap){ 1443 _1d b=this.dateMap[cell.id].toHash();1444 }else{ 1445 _1d b=new Date(this.calendar.date.getTime());1446 _1d b.setDate(parseInt(cell.id.getSuffix(),10));1447 _1d b=_1db.toHash();1448 } 1449 _1d b.hour=_1da.hour;1450 _1d b.min=_1da.min;1451 if(DateUtil.toDate(_1d 3.start).getTime()>=DateUtil.toDate(_1db).getTime()){1452 var _1d c=23;1453 var _1d d=55;1454 if(_1d 3.start.hour==_1dc&&_1d3.start.min==_1dd){1444 _1dc=this.dateMap[cell.id].toHash(); 1445 }else{ 1446 _1dc=new Date(this.calendar.date.getTime()); 1447 _1dc.setDate(parseInt(cell.id.getSuffix(),10)); 1448 _1dc=_1dc.toHash(); 1449 } 1450 _1dc.hour=_1db.hour; 1451 _1dc.min=_1db.min; 1452 if(DateUtil.toDate(_1d4.start).getTime()>=DateUtil.toDate(_1dc).getTime()){ 1453 var _1dd=23; 1454 var _1de=55; 1455 if(_1d4.start.hour==_1dd&&_1d4.start.min==_1de){ 1455 1456 this.calendar.refreshSchedule(); 1456 1457 this.calendar.options.updateTirm(); 1457 1458 return; 1458 1459 }else{ 1459 _1d b.hour=_1dc;1460 _1d b.min=_1dd;1461 } 1462 } 1463 _1d 3.finish=_1db;1460 _1dc.hour=_1dd; 1461 _1dc.min=_1de; 1462 } 1463 } 1464 _1d4.finish=_1dc; 1464 1465 this.calendar.refreshSchedule(); 1465 this.calendar.options.updateTirm(_1d 3);1466 },getTimeText:function(_1d e,_1df){1467 var _1e 0=this.calendar;1468 return _1e 0.formatTime(_1de);1469 },getDayDiff:function(_1e 1){1470 return DateUtil.numberOfDays(this.toDate(_1e 1.start),this.toDate(_1e1.finish));1466 this.calendar.options.updateTirm(_1d4); 1467 },getTimeText:function(_1df,_1e0){ 1468 var _1e1=this.calendar; 1469 return _1e1.formatTime(_1df); 1470 },getDayDiff:function(_1e2){ 1471 return DateUtil.numberOfDays(this.toDate(_1e2.start),this.toDate(_1e2.finish)); 1471 1472 }}); 1472 1473 var CalendarWeek=Class.create(); 1473 1474 CalendarWeek.id=["calTable","columnContainer","columnHeader","column","next","pre","headerText"]; 1474 1475 Object.extend(CalendarWeek.prototype,AbstractCalendar.prototype); 1475 Object.extend(CalendarWeek.prototype,{initialize:function(_1e 2){1476 this.calendar=_1e 2;1477 var _1e 3=this.getWeek();1478 this.week=_1e 3[0];1479 this.invisibleWeek=_1e 3[1];1476 Object.extend(CalendarWeek.prototype,{initialize:function(_1e3){ 1477 this.calendar=_1e3; 1478 var _1e4=this.getWeek(); 1479 this.week=_1e4[0]; 1480 this.invisibleWeek=_1e4[1]; 1480 1481 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 1481 1482 this.setDisplayTime(); … … 1483 1484 return "<td class='"+this.calendar.classNames.preYears+"'>"+"<div id='"+this.ids.pre+"' class='"+this.calendar.classNames.preWeekMark+"'></div>"+"</td>"; 1484 1485 },buildHeaderCenter:function(){ 1485 var _1e 4=[];1486 var _1e5=[]; 1486 1487 if(this.calendar.options.weekHeaderFormat){ 1487 _1e 4=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())];1488 } 1489 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1e 4[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1e4[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1e4[2]||this.week.last().toDateString())+"</span>"+"</td>";1488 _1e5=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())]; 1489 } 1490 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1e5[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1e5[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1e5[2]||this.week.last().toDateString())+"</span>"+"</td>"; 1490 1491 },formatHeaderDate:function(date){ 1491 1492 if(this.calendar.options.weekHeaderFormat){ … … 1496 1497 return "<td class='"+this.calendar.classNames.nextYears+"' align='right'>"+"<div id='"+this.ids.next+"' class='"+this.calendar.classNames.nextWeekMark+"'></div>"+"</td>"; 1497 1498 },buildCalendar:function(){ 1498 var _1e 6=(this.calendar.options.displayTimeLine)?this.buildTimeLine():"";1499 _1e 6+=this.buildCalendarContainer();1500 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1e 6+"</tr>"+"</table>";1499 var _1e7=(this.calendar.options.displayTimeLine)?this.buildTimeLine():""; 1500 _1e7+=this.buildCalendarContainer(); 1501 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1e7+"</tr>"+"</table>"; 1501 1502 },buildTimeLine:function(){ 1502 1503 var time=new Date(); 1503 var hour=0,_1e 9=24;1504 var hour=0,_1ea=24; 1504 1505 time.setHours(hour); 1505 1506 time.setMinutes(0); 1506 var _1e a=this.buildTimeLineTop();1507 var _1eb=this.buildTimeLineTop(); 1507 1508 var now=new Date().getHours(); 1508 while(hour<_1e 9){1509 while(hour<_1ea){ 1509 1510 if(this.includeDisplayTime(hour)){ 1510 var _1e c="pointer: default;";1511 if(_1e a.length==0){1512 _1e c+="border-top: none;";1513 } 1514 var _1e d=this.calendar.classNames.timeLineTime;1511 var _1ed="pointer: default;"; 1512 if(_1eb.length==0){ 1513 _1ed+="border-top: none;"; 1514 } 1515 var _1ee=this.calendar.classNames.timeLineTime; 1515 1516 if(hour==now){ 1516 _1e d+=" "+this.calendar.classNames.highlightTime;1517 } 1518 _1e a+="<div class='"+_1ed+"' style='"+_1ec+"'>"+this.formatTime(time)+"</div>";1517 _1ee+=" "+this.calendar.classNames.highlightTime; 1518 } 1519 _1eb+="<div class='"+_1ee+"' style='"+_1ed+"'>"+this.formatTime(time)+"</div>"; 1519 1520 } 1520 1521 hour++; 1521 1522 time.setHours(hour); 1522 1523 } 1523 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1e a+"</td>";1524 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1eb+"</td>"; 1524 1525 },buildTimeLineTop:function(){ 1525 1526 return "<div class='"+this.calendar.classNames.timeLineTimeTop+"'></div>"; … … 1527 1528 return "<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+this.buildCalendarHeader()+this.buildCalendarMain()+"</table>"+"</td>"; 1528 1529 },buildCalendarHeader:function(){ 1529 var _1e e=this.calendar.options.displayIndexes;1530 var _1ef=this.calendar.options.displayIndexes; 1530 1531 var ths=""; 1531 var _1f 0=new Date().days();1532 var _1f 1=100/_1ee.length+"%";1533 var _1f 2=this.calendar.element.id.appendSuffix(this.ids.column);1534 var _1f 3=this.calendar.element.id.appendSuffix(this.ids.headerText);1532 var _1f1=new Date().days(); 1533 var _1f2=100/_1ef.length+"%"; 1534 var _1f3=this.calendar.element.id.appendSuffix(this.ids.column); 1535 var _1f4=this.calendar.element.id.appendSuffix(this.ids.headerText); 1535 1536 this.headers=[]; 1536 var _1f 4=this.calendar.options.noEvent;1537 var _1f 5=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null;1538 this.week.each(function(w,_1f 7){1537 var _1f5=this.calendar.options.noEvent; 1538 var _1f6=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null; 1539 this.week.each(function(w,_1f8){ 1539 1540 var text=null; 1540 if(_1f 5){1541 text=_1f 5.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]});1541 if(_1f6){ 1542 text=_1f6.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]}); 1542 1543 }else{ 1543 1544 text=w.toDateString().split(" "); … … 1545 1546 text=text.join(" "); 1546 1547 } 1547 var _1f 9=(w.days()==_1f0)?this.calendar.classNames.highlightDay:"";1548 var _1f a=_1f3.appendSuffix(_1f7);1548 var _1fa=(w.days()==_1f1)?this.calendar.classNames.highlightDay:""; 1549 var _1fb=_1f4.appendSuffix(_1f8); 1549 1550 var node="<div class='"+this.calendar.classNames.headerColumn+"'>"; 1550 if(_1f 4){1551 node+="<span='#' id='"+_1f a+"' class='"+_1f9+"' style='cursor: default;'>"+text+"</a>";1552 }else{ 1553 node+="<a href='#' id='"+_1f a+"' class='"+_1f9+"'>"+text+"</a>";1551 if(_1f5){ 1552 node+="<span='#' id='"+_1fb+"' class='"+_1fa+"' style='cursor: default;'>"+text+"</a>"; 1553 }else{ 1554 node+="<a href='#' id='"+_1fb+"' class='"+_1fa+"'>"+text+"</a>"; 1554 1555 } 1555 1556 node+="</div>"; 1556 this.headers.push({id:_1f a,wday:w});1557 ths+="<th id='"+_1f 2.appendSuffix(_1f7)+"' width='"+_1f1+"'>"+node+"</th>";1557 this.headers.push({id:_1fb,wday:w}); 1558 ths+="<th id='"+_1f3.appendSuffix(_1f8)+"' width='"+_1f2+"'>"+node+"</th>"; 1558 1559 }.bind(this)); 1559 1560 return "<tr>"+"<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+"<tr>"+ths+"</tr>"+"</table>"+"</td>"+"</tr>"; 1560 1561 },buildCalendarMain:function(){ 1561 var _1f c=this.calendar.options.displayIndexes;1562 var _1fd=this.calendar.options.displayIndexes; 1562 1563 var tds=""; 1563 var _1f e=100/_1fc.length+"%";1564 var _1ff=100/_1fd.length+"%"; 1564 1565 this.dateMap={}; 1565 this.week.each(function(w,_20 0){1566 var _20 1=this.calendar.options.schedules[w.toDateString()];1567 var _20 2="";1566 this.week.each(function(w,_201){ 1567 var _202=this.calendar.options.schedules[w.toDateString()]; 1568 var _203=""; 1568 1569 var i=0,j=0; 1569 1570 while(i<24){ 1570 1571 if(this.includeDisplayTime(i)){ 1571 var _20 5="";1572 if(_20 2.length==0){1573 _20 5=this.calendar.classNames.columnTopDate;1572 var _206=""; 1573 if(_203.length==0){ 1574 _206=this.calendar.classNames.columnTopDate; 1574 1575 }else{ 1575 1576 if(i%1==0){ 1576 _20 5=this.calendar.classNames.columnDate;1577 }else{ 1578 _20 5=this.calendar.classNames.columnDateOdd;1579 } 1580 } 1581 var id=this.getDateId(w,i,_20 0);1577 _206=this.calendar.classNames.columnDate; 1578 }else{ 1579 _206=this.calendar.classNames.columnDateOdd; 1580 } 1581 } 1582 var id=this.getDateId(w,i,_201); 1582 1583 var hour=i/1; 1583 1584 var min=i%1*60; 1584 1585 this.dateMap[id]=new Date(w.getFullYear(),w.getMonth(),w.getDate(),hour,min,0); 1585 _20 2+="<div id='"+id+"' class='"+_205+"'></div>";1586 _203+="<div id='"+id+"' class='"+_206+"'></div>"; 1586 1587 } 1587 1588 i+=0.5; 1588 1589 } 1589 tds+="<td width='"+_1f e+"'>"+_202+"</td>";1590 tds+="<td width='"+_1ff+"'>"+_203+"</td>"; 1590 1591 }.bind(this)); 1591 1592 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>"; … … 1595 1596 var rule=CssUtil.getCssRuleBySelectorText("."+Calendar.className.columnDate); 1596 1597 this.column.height=parseInt(rule.style["height"],10)+1; 1597 },buildSchedule:function(_20 b){1598 var id="scheduleItem_"+_20 b.id;1599 var _20 d=(_20b.edit==undefined||_20b.edit);1598 },buildSchedule:function(_20c){ 1599 var id="scheduleItem_"+_20c.id; 1600 var _20e=(_20c.edit==undefined||_20c.edit); 1600 1601 var item=Builder.node("DIV",{id:id}); 1601 1602 this.calendar.css.addClassNames(item,"scheduleItemLarge"); 1602 var _20f=this.calendar.options.noEvent; 1603 var _210={}; 1604 if(_20b.background_color){ 1605 _210.backgroundColor=_20b.background_color; 1606 } 1607 if(_20b.frame_color){ 1608 _210.border="2px solid "+_20b.frame_color; 1609 } 1610 if(_20f){ 1611 _210.cursor="default"; 1612 } 1613 Element.setStyle(item,_210); 1614 if(_20d){ 1615 var _211=Builder.node("DIV",{id:"scheduleDeleteImg_"+_20b.id,className:this.calendar.css.joinClassNames("deleteImg")}); 1616 Element.hide(_211); 1617 item.appendChild(_211); 1618 if(!_20f){ 1619 Event.observe(_211,"click",this.clickDeleteImage.bind(this,_20b)); 1620 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_211)); 1621 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_211)); 1622 } 1623 } 1624 if(!_20f&&this.calendar.options.dblclickSchedule){ 1625 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_20b)); 1626 } 1627 var _212=null; 1628 if(_20d){ 1629 _212=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 1630 if(_20f){ 1603 var _210=this.calendar.options.noEvent; 1604 var _211={}; 1605 if(_20c.background_color){ 1606 _211.backgroundColor=_20c.background_color; 1607 } 1608 if(_20c.frame_color){ 1609 _211.border="2px solid "+_20c.frame_color; 1610 } 1611 if(_210){ 1612 _211.cursor="default"; 1613 } 1614 Element.setStyle(item,_211); 1615 if(_20e){ 1616 var _212=Builder.node("DIV",{id:"scheduleDeleteImg_"+_20c.id,className:this.calendar.css.joinClassNames("deleteImg")}); 1631 1617 Element.hide(_212); 1632 }1633 1618 item.appendChild(_212); 1619 if(!_210){ 1620 Event.observe(_212,"click",this.clickDeleteImage.bind(this,_20c)); 1621 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_212)); 1622 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_212)); 1623 } 1624 } 1625 if(!_210&&this.calendar.options.dblclickSchedule){ 1626 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_20c)); 1627 } 1628 var _213=null; 1629 if(_20e){ 1630 _213=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 1631 if(_210){ 1632 Element.hide(_213); 1633 } 1634 item.appendChild(_213); 1634 1635 } 1635 1636 var icon=null; 1636 if(_20 b.icon){1637 icon=Builder.node("IMG",{src:_20 b.icon,alt:"icon",style:"float: left;",width:16,height:16});1637 if(_20c.icon){ 1638 icon=Builder.node("IMG",{src:_20c.icon,alt:"icon",style:"float: left;",width:16,height:16}); 1638 1639 item.appendChild(icon); 1639 1640 } 1640 if(!_20 b.publicity){1641 if(!_20c.publicity){ 1641 1642 if(Calendar.privateImgPath){ 1642 1643 icon=Builder.node("IMG",{src:Calendar.privateImgPath,alt:"private",style:"float: left;",width:16,height:16}); 1643 1644 item.appendChild(icon); 1644 1645 }else{ 1645 icon=Builder.node("DIV",{id:"private_img_"+_20 b.id});1646 icon=Builder.node("DIV",{id:"private_img_"+_20c.id}); 1646 1647 this.calendar.css.addClassNames(icon,"privateImg"); 1647 1648 item.appendChild(icon); 1648 1649 } 1649 1650 } 1650 var text=this.getTimeText(_20 b.start,_20b.finish);1651 var _21 5=Builder.node("DIV",{id:id+"_text"},[text]);1652 this.calendar.css.addClassNames(_21 5,"scheduleTimeArea");1653 item.appendChild(_21 5);1654 var _21 6=_20b.description.unescapeHTML();1655 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_21 6]));1656 item.title=text.replace(/ /g,"")+" "+_21 6;1657 item.schedule=_20 b;1658 return [item,_21 2];1659 },adjustScheduleStyle:function(item,_21 8,_219){1660 var _21 a=item.schedule;1661 var time=this.convertHours(_21 a);1662 var _21 c=time[0];1663 var _21 d=time[1];1651 var text=this.getTimeText(_20c.start,_20c.finish); 1652 var _216=Builder.node("DIV",{id:id+"_text"},[text]); 1653 this.calendar.css.addClassNames(_216,"scheduleTimeArea"); 1654 item.appendChild(_216); 1655 var _217=_20c.description.unescapeHTML(); 1656 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_217])); 1657 item.title=text.replace(/ /g,"")+" "+_217; 1658 item.schedule=_20c; 1659 return [item,_213]; 1660 },adjustScheduleStyle:function(item,_219,_21a){ 1661 var _21b=item.schedule; 1662 var time=this.convertHours(_21b); 1663 var _21d=time[0]; 1664 var _21e=time[1]; 1664 1665 var same=[]; 1665 1666 var self=this; 1666 _21 9.each(function(h){1667 var _22 1=self.convertHours(h.schedule);1668 var _22 2=_221[0];1669 var _22 3=_221[1];1670 if(((_22 2<=_21c)&&(_223>_21c))||((_222<_21d)&&(_223>=_21d))||((_21c<=_222)&&(_21d>_222))||((_21c<_223)&&(_21d>=_223))){1667 _21a.each(function(h){ 1668 var _222=self.convertHours(h.schedule); 1669 var _223=_222[0]; 1670 var _224=_222[1]; 1671 if(((_223<=_21d)&&(_224>_21d))||((_223<_21e)&&(_224>=_21e))||((_21d<=_223)&&(_21e>_223))||((_21d<_224)&&(_21e>=_224))){ 1671 1672 same.push(h); 1672 1673 } 1673 1674 }); 1674 var _22 4=_218*this.getAdjustSize();1675 var _225=_219*this.getAdjustSize(); 1675 1676 if(UserAgent.isIE()||this.calendar.options.noEvent){ 1676 _22 4+=1;1677 } 1678 var left=this.column.width*_21 8+_224;1677 _225+=1; 1678 } 1679 var left=this.column.width*_219+_225; 1679 1680 if(same.length==0){ 1680 1681 Element.setStyle(item,{left:left+"px"}); 1681 1682 }else{ 1682 1683 same.push(item); 1683 var _22 6=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1;1684 var _227=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 1684 1685 same.each(function(s,i){
