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