Changeset 5658
- Timestamp:
- 02/22/08 20:34:16 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinelz/trunk/compress/javascripts/spinelz/calendar.js
r5566 r5658 885 885 _ff=CssUtil.getCssRuleBySelectorText("."+Calendar.className.dateContainer); 886 886 this.column.dateTextHeight=parseInt(_ff.style["height"],10); 887 },buildSchedule:function(_100 ){887 },buildSchedule:function(_100,_101){ 888 888 var id="scheduleItem_"+_100.id; 889 var _10 2=(_100.edit==undefined||_100.edit);889 var _103=(_100.edit==undefined||_100.edit); 890 890 var item=Builder.node("DIV",{id:id}); 891 var _10 4=DateUtil.toDate(_100.start);892 var _10 5=DateUtil.toDate(_100.finish);891 var _105=DateUtil.toDate(_100.start); 892 var _106=DateUtil.toDate(_100.finish); 893 893 if(_100.finish.hour==0&&_100.finish.min==0){ 894 _10 5=_105.advance({days:-1});895 } 896 var _10 6=this.calendar.options.noEvent;897 var _10 7={};898 if(_10 6){899 _10 7.cursor="default";900 } 901 if(_10 4.sameDate(_105)){894 _106=_106.advance({days:-1}); 895 } 896 var _107=this.calendar.options.noEvent; 897 var _108={}; 898 if(_107){ 899 _108.cursor="default"; 900 } 901 if(_105.sameDate(_106)){ 902 902 this.calendar.css.addClassNames(item,"scheduleItemNoBorder"); 903 903 }else{ 904 904 if(_100.background_color){ 905 _10 7.backgroundColor=_100.background_color;905 _108.backgroundColor=_100.background_color; 906 906 } 907 907 if(_100.frame_color){ 908 _10 7.border="2px solid "+_100.frame_color;908 _108.border="2px solid "+_100.frame_color; 909 909 } 910 910 this.calendar.css.addClassNames(item,"scheduleItemLarge"); 911 911 } 912 Element.setStyle(item,_10 7);913 if(_10 2){914 var _10 8=Builder.node("DIV",{id:"scheduleDeleteImg_"+_100.id,className:this.calendar.css.joinClassNames("deleteImg")});915 Element.hide(_10 8);916 item.appendChild(_10 8);917 if(!_10 6){918 Event.observe(_10 8,"click",this.clickDeleteImage.bind(this,_100));919 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_10 8));920 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_10 8));921 } 922 } 923 if(!_10 6&&this.calendar.options.dblclickSchedule){912 Element.setStyle(item,_108); 913 if(_103){ 914 var _109=Builder.node("DIV",{id:"scheduleDeleteImg_"+_100.id,className:this.calendar.css.joinClassNames("deleteImg")}); 915 Element.hide(_109); 916 item.appendChild(_109); 917 if(!_107){ 918 Event.observe(_109,"click",this.clickDeleteImage.bind(this,_100)); 919 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_109)); 920 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_109)); 921 } 922 } 923 if(!_107&&this.calendar.options.dblclickSchedule){ 924 924 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_100)); 925 925 } 926 var _10 9=null;927 if(_10 2){928 _10 9=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")});929 if(_10 6){930 Element.hide(_10 9);931 } 932 item.appendChild(_10 9);926 var _10a=null; 927 if(_103){ 928 _10a=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 929 if(_107){ 930 Element.hide(_10a); 931 } 932 item.appendChild(_10a); 933 933 } 934 934 var icon=null; … … 943 943 } 944 944 var body=Builder.node("DIV"); 945 var text=this.getTimeText( _100.start,_100.finish);945 var text=this.getTimeText((_101)?_100.start:{hour:"0",min:"0"},_100.finish); 946 946 text=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]); 947 947 this.calendar.css.addClassNames(text,"scheduleTimeArea"); 948 948 item.appendChild(text); 949 var _10 d=_100.description.unescapeHTML();950 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_10 d]));951 item.title=_10 d;949 var _10e=_100.description.unescapeHTML(); 950 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_10e])); 951 item.title=_10e; 952 952 item.schedule=_100; 953 return [item,_10 9];954 },adjustScheduleStyle:function(item,_1 0f,_110,_111){953 return [item,_10a]; 954 },adjustScheduleStyle:function(item,_110,_111,_112){ 955 955 var self=this; 956 var _11 3=parseInt(Element.getStyle(item,"height"),10);956 var _114=parseInt(Element.getStyle(item,"height"),10); 957 957 var top=parseInt(Element.getStyle(item,"top"),10); 958 var _11 5=this.getScheduleRange(item);958 var _116=this.getScheduleRange(item); 959 959 var tops=[]; 960 var _11 7=3;961 _11 1.each(function(_118){962 var _11 9=self.getScheduleRange(_118);963 if(_11 5.any(function(r){964 return _11 9.include(r);960 var _118=3; 961 _112.each(function(_119){ 962 var _11a=self.getScheduleRange(_119); 963 if(_116.any(function(r){ 964 return _11a.include(r); 965 965 })){ 966 tops.push(_11 8.topIndex);967 } 968 }); 969 var _11 b=$R(0,tops.length,true).detect(function(i){966 tops.push(_119.topIndex); 967 } 968 }); 969 var _11c=$R(0,tops.length,true).detect(function(i){ 970 970 return !tops.include(i); 971 971 }); 972 if(isNaN(_11 b)){973 _11 b=tops.length;974 } 975 item.topIndex=_11 b;976 Element.setStyle(item,{top:top+(_11 3+2)*_11b+"px"});977 if(_11 b>=_117){972 if(isNaN(_11c)){ 973 _11c=tops.length; 974 } 975 item.topIndex=_11c; 976 Element.setStyle(item,{top:top+(_114+2)*_11c+"px"}); 977 if(_11c>=_118){ 978 978 Element.hide(item); 979 var node=this.buildSkipSchedule(_1 0f+"_"+_110);979 var node=this.buildSkipSchedule(_110+"_"+_111); 980 980 if(node){ 981 981 var left=Element.getStyle(item,"left"); 982 Element.setStyle(node,{top:top+(_11 3+2)*_11b+"px",left:left});982 Element.setStyle(node,{top:top+(_114+2)*_11c+"px",left:left}); 983 983 } 984 984 return node; 985 985 } 986 },buildSkipSchedule:function(_1 1f){987 var id=this.calendar.element.id.appendSuffix(_1 1f);986 },buildSkipSchedule:function(_120){ 987 var id=this.calendar.element.id.appendSuffix(_120); 988 988 if(!this.skipNode[id]){ 989 989 var node=Builder.node("a",{id:id,style:"display: block; z-index: 1000; cursor: pointer;",href:"javascript:void(0);"},[this.calendar.options.skipString]); … … 996 996 return item.cellIndex+i; 997 997 }); 998 },setScheduleBaseStyle:function(item,_12 5,_126,_127){999 var _12 8=this.column.height;1000 var top=_12 8*_125+this.column.dateTextHeight;1001 var _12 a=this.getAdjustSize()+(UserAgent.isIE()?0.5:0);1002 Element.setStyle(item,{top:top+"px",width:this.column.width*_12 7+_12a*(_127-1)+"px",left:this.column.width*_126+_126*_12a+"px"});998 },setScheduleBaseStyle:function(item,_126,_127,_128){ 999 var _129=this.column.height; 1000 var top=_129*_126+this.column.dateTextHeight; 1001 var _12b=this.getAdjustSize()+(UserAgent.isIE()?0.5:0); 1002 Element.setStyle(item,{top:top+"px",width:this.column.width*_128+_12b*(_128-1)+"px",left:this.column.width*_127+_127*_12b+"px"}); 1003 1003 },afterBuild:function(){ 1004 1004 this.scheduleNodes=[]; … … 1011 1011 this.setSelector(); 1012 1012 var self=this; 1013 var _12 c=this.calendar.options.displayIndexes;1014 var _12 d=this.getDragDistance();1015 var _12 e=$R(0,$(this.getCalendarTableId()).rows.length).map(function(){1013 var _12d=this.calendar.options.displayIndexes; 1014 var _12e=this.getDragDistance(); 1015 var _12f=$R(0,$(this.getCalendarTableId()).rows.length).map(function(){ 1016 1016 return []; 1017 1017 }); 1018 1018 var date=this.calendar.date; 1019 var _13 0=DateUtil.getFirstDate(date.getFullYear(),date.getMonth());1020 var _13 1=_130.days();1021 var _13 2=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days();1022 self.calendar.options.schedules.each(function(_13 3,_134){1023 var _13 5=self.toDate(_133.start);1024 var _13 6=_135.days();1025 var _13 7=self.toDate(_133.finish);1026 var _13 8=_137.days();1027 var days=self.getDayDiff(_13 3);1028 if(_13 3.finish.hour==0&&_133.finish.min==0){1019 var _131=DateUtil.getFirstDate(date.getFullYear(),date.getMonth()); 1020 var _132=_131.days(); 1021 var _133=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days(); 1022 self.calendar.options.schedules.each(function(_134,_135){ 1023 var _136=self.toDate(_134.start); 1024 var _137=_136.days(); 1025 var _138=self.toDate(_134.finish); 1026 var _139=_138.days(); 1027 var days=self.getDayDiff(_134); 1028 if(_134.finish.hour==0&&_134.finish.min==0){ 1029 1029 days--; 1030 1030 } 1031 if((_13 6>=_131&&_136<=_132)||(_138>=_131&&_138<=_132)){1032 if(!_13 0.sameMonth(_135)){1033 _13 5=_130;1034 } 1035 self.setSchedule(_13 3,_12e,_12d,days);1031 if((_137>=_132&&_137<=_133)||(_139>=_132&&_139<=_133)){ 1032 if(!_131.sameMonth(_136)){ 1033 _136=_131; 1034 } 1035 self.setSchedule(_134,_12f,_12e,days); 1036 1036 } 1037 1037 }); … … 1057 1057 } 1058 1058 } 1059 },setSchedule:function(_13 c,_13d,_13e,days){1060 var _14 0=[];1061 var _14 1=6;1062 var _14 2=DateUtil.toDate(_13c.start);1063 var date=_14 2;1064 var _14 4=this.calendar.options.displayIndexes;1065 var _14 5=this.calendar.date;1066 var _14 6=this.calendar.options.noEvent;1067 var _14 7=this.calendar.options.clickSkipNode;1059 },setSchedule:function(_13d,_13e,_13f,days){ 1060 var _141=[]; 1061 var _142=6; 1062 var _143=DateUtil.toDate(_13d.start); 1063 var date=_143; 1064 var _145=this.calendar.options.displayIndexes; 1065 var _146=this.calendar.date; 1066 var _147=this.calendar.options.noEvent; 1067 var _148=this.calendar.options.clickSkipNode; 1068 1068 while(days>=0){ 1069 var _14 8=this.getLastWday(date);1070 var _14 9=days+1;1071 var _14 a=date.getDay();1072 var _14 b=date.advance({days:_149-1});1073 if(_14 b.getTime()>_148.getTime()){1074 _14 b=_148;1075 _14 9=_14b.days()-date.days()+1;1076 } 1077 var _14 c=_14b.getDay();1078 var _14 d=null;1079 if(_14 a<=_14c){1080 _14 d=$R(_14a,_14c,false);1081 }else{ 1082 _14 d=$R(0,_14c,false).toArray().concat($R(_14a,_141,false).toArray());1083 } 1084 var _14 e=_14d.findAll(function(day){1085 return _14 4.include(day);1069 var _149=this.getLastWday(date); 1070 var _14a=days+1; 1071 var _14b=date.getDay(); 1072 var _14c=date.advance({days:_14a-1}); 1073 if(_14c.getTime()>_149.getTime()){ 1074 _14c=_149; 1075 _14a=_14c.days()-date.days()+1; 1076 } 1077 var _14d=_14c.getDay(); 1078 var _14e=null; 1079 if(_14b<=_14d){ 1080 _14e=$R(_14b,_14d,false); 1081 }else{ 1082 _14e=$R(0,_14d,false).toArray().concat($R(_14b,_142,false).toArray()); 1083 } 1084 var _14f=_14e.findAll(function(day){ 1085 return _145.include(day); 1086 1086 }).length; 1087 var _15 0=new Date(date.getTime());1088 while(_15 0.days()<=_14b.days()){1089 if(_15 0.getMonth()==_145.getMonth()){1090 var _15 1=this.getCellPosition(_150.getDate());1091 if(_15 1){1092 var _15 2=_151.rowIndex;1093 var _15 3=_151.cellIndex;1094 var _15 4=this.buildSchedule(_13c);1095 var item=_15 4.first();1096 item.length=_14 e;1097 item.cellIndex=_15 3;1087 var _151=new Date(date.getTime()); 1088 while(_151.days()<=_14c.days()){ 1089 if(_151.getMonth()==_146.getMonth()){ 1090 var _152=this.getCellPosition(_151.getDate()); 1091 if(_152){ 1092 var _153=_152.rowIndex; 1093 var _154=_152.cellIndex; 1094 var _155=this.buildSchedule(_13d,_143.sameDate(_151)); 1095 var item=_155.first(); 1096 item.length=_14f; 1097 item.cellIndex=_154; 1098 1098 this.container.appendChild(item); 1099 this.setScheduleBaseStyle(item,_15 2,_153,_14e);1100 var _15 6=this.adjustScheduleStyle(item,_152,_153,_13d[_152]);1101 if(_15 6){1102 this.container.appendChild(_15 6);1103 Event.observe(_15 6,"click",_147.bindAsEventListener(this,_150));1104 } 1105 if(!_14 6&&((_13c.edit==undefined)||_13c.edit)){1106 this.setDraggable(item,_15 4.last(),_13e);1099 this.setScheduleBaseStyle(item,_153,_154,_14f); 1100 var _157=this.adjustScheduleStyle(item,_153,_154,_13e[_153]); 1101 if(_157){ 1102 this.container.appendChild(_157); 1103 Event.observe(_157,"click",_148.bindAsEventListener(this,_151)); 1104 } 1105 if(!_147&&((_13d.edit==undefined)||_13d.edit)){ 1106 this.setDraggable(item,_155.last(),_13f); 1107 1107 this.setResize(item); 1108 1108 } 1109 _13 d[_152].push(item);1109 _13e[_153].push(item); 1110 1110 this.scheduleNodes.push(item); 1111 1111 break; 1112 1112 }else{ 1113 if(_14 4.include(_150.getDay())){1114 _14 e--;1115 } 1116 } 1117 }else{ 1118 if(_14 4.include(_150.getDay())){1119 _14 e--;1120 } 1121 } 1122 _15 0=_150.advance({days:1});1123 } 1124 if(_14 0.length==0){1125 days-=_14 9;1113 if(_145.include(_151.getDay())){ 1114 _14f--; 1115 } 1116 } 1117 }else{ 1118 if(_145.include(_151.getDay())){ 1119 _14f--; 1120 } 1121 } 1122 _151=_151.advance({days:1}); 1123 } 1124 if(_141.length==0){ 1125 days-=_14a; 1126 1126 }else{ 1127 1127 days-=7; 1128 1128 } 1129 var date=_14 b.advance({days:1});1129 var date=_14c.advance({days:1}); 1130 1130 if(item){ 1131 _14 0.push(item);1131 _141.push(item); 1132 1132 } 1133 1133 } 1134 1134 var self=this; 1135 if(!_14 6){1136 _14 0.each(function(item){1137 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_14 0));1138 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_14 0));1135 if(!_147){ 1136 _141.each(function(item){ 1137 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_141)); 1138 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_141)); 1139 1139 }); 1140 1140 } … … 1143 1143 this.calendar.setIndex(); 1144 1144 } 1145 var _15 a=this.calendar.wdays.indexOf(date.getDay())+1;1146 return date.advance({days:this.calendar.wdays.length-_15 a});1145 var _15b=this.calendar.wdays.indexOf(date.getDay())+1; 1146 return date.advance({days:this.calendar.wdays.length-_15b}); 1147 1147 },setSelector:function(){ 1148 var _15 b=$(this.getSelectorId());1149 Element.setStyle(_15 b,{width:this.column.width+"px",height:this.column.height-2+"px"});1150 Element.setOpacity(_15 b,0.6);1151 },setDraggable:function(item,_15 d,_15e){1148 var _15c=$(this.getSelectorId()); 1149 Element.setStyle(_15c,{width:this.column.width+"px",height:this.column.height-2+"px"}); 1150 Element.setOpacity(_15c,0.6); 1151 },setDraggable:function(item,_15e,_15f){ 1152 1152 var self=this; 1153 var _16 0=Position.cumulativeOffset(this.container);1154 var _16 1=$(this.getSelectorId());1155 var _16 2=this.column.width+(UserAgent.isIE()?0.5:0);1156 var _16 3=this.column.height+(UserAgent.isIE()?1:0);1157 var _16 4=this.rowMax||$(this.getCalendarTableId()).rows.length;1158 var _16 5=this.calendar.options.displayIndexes.length-1;1159 var _16 6=this.getAdjustSize();1160 new Draggable(item,{handle:_15 d,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_167){1161 Element.show(_16 1);1162 },onDrag:function(_16 8,_169){1163 var _16 a=_168.element;1164 var top=parseInt(Element.getStyle(_16 a,"top"),10);1165 var _16 c=Math.floor(top/_163);1166 var left=parseInt(Element.getStyle(_16 a,"left"),10);1167 var _16 e=Math.floor(left/_162);1168 if((_16 e>=0&&_16c>=0)&&(_16e<=_165&&_16c<=_164)){1169 Element.setStyle(_16 1,{left:_162*_16e+_166*_16e+"px",top:_163*_16c+"px"});1170 } 1171 },onEnd:function(_1 6f){1172 Element.hide(_16 1);1173 self.changeSchedule(_1 6f);1153 var _161=Position.cumulativeOffset(this.container); 1154 var _162=$(this.getSelectorId()); 1155 var _163=this.column.width+(UserAgent.isIE()?0.5:0); 1156 var _164=this.column.height+(UserAgent.isIE()?1:0); 1157 var _165=this.rowMax||$(this.getCalendarTableId()).rows.length; 1158 var _166=this.calendar.options.displayIndexes.length-1; 1159 var _167=this.getAdjustSize(); 1160 new Draggable(item,{handle:_15e,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_168){ 1161 Element.show(_162); 1162 },onDrag:function(_169,_16a){ 1163 var _16b=_169.element; 1164 var top=parseInt(Element.getStyle(_16b,"top"),10); 1165 var _16d=Math.floor(top/_164); 1166 var left=parseInt(Element.getStyle(_16b,"left"),10); 1167 var _16f=Math.floor(left/_163); 1168 if((_16f>=0&&_16d>=0)&&(_16f<=_166&&_16d<=_165)){ 1169 Element.setStyle(_162,{left:_163*_16f+_167*_16f+"px",top:_164*_16d+"px"}); 1170 } 1171 },onEnd:function(_170){ 1172 Element.hide(_162); 1173 self.changeSchedule(_170); 1174 1174 }}); 1175 1175 },setResize:function(item){ 1176 1176 var self=this; 1177 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_17 2){1178 self.updateTirm(_17 2);1177 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_173){ 1178 self.updateTirm(_173); 1179 1179 }}); 1180 },getDate:function(_17 3){1180 },getDate:function(_174){ 1181 1181 var date=this.calendar.date; 1182 if(_17 3.constructor==String){1183 return new Date(date.getFullYear(),date.getMonth(),_17 3);1184 }else{ 1185 return new Date(date.getFullYear(),date.getMonth(),_17 3.id.getSuffix());1186 } 1187 },abstractSelect:function(_17 5,_176){1188 var _17 7=null;1182 if(_174.constructor==String){ 1183 return new Date(date.getFullYear(),date.getMonth(),_174); 1184 }else{ 1185 return new Date(date.getFullYear(),date.getMonth(),_174.id.getSuffix()); 1186 } 1187 },abstractSelect:function(_176,_177){ 1188 var _178=null; 1189 1189 if(this.calendar.options.size=="large"){ 1190 _17 7=this.findClickedElement(_175);1191 }else{ 1192 _17 7=Event.element(_175);1193 if(_17 7.tagName!="TD"){1194 _17 7=Element.getParentByTagName(["TD"],_177);1195 } 1196 } 1197 if(_17 7&&_177.id&&!_177.id.match(/emptyRow/)){1198 var date=this.getDate(_17 7);1199 _17 6(date,_177);1190 _178=this.findClickedElement(_176); 1191 }else{ 1192 _178=Event.element(_176); 1193 if(_178.tagName!="TD"){ 1194 _178=Element.getParentByTagName(["TD"],_178); 1195 } 1196 } 1197 if(_178&&_178.id&&!_178.id.match(/emptyRow/)){ 1198 var date=this.getDate(_178); 1199 _177(date,_178); 1200 1200 } 1201 1201 },getSelectedTerm:function(){ 1202 1202 var self=this; 1203 var _17 a=this.calendar.getSelected();1204 return [_17 a.first(),_17a.last()].map(function(e){1203 var _17b=this.calendar.getSelected(); 1204 return [_17b.first(),_17b.last()].map(function(e){ 1205 1205 return self.getDate(e); 1206 1206 }); 1207 },selectDay:function(_17 c){1208 var _17 d=this.calendar;1209 var th=Event.element(_17 c);1207 },selectDay:function(_17d){ 1208 var _17e=this.calendar; 1209 var th=Event.element(_17d); 1210 1210 if(th.tagName!="TH"){ 1211 1211 th=Element.getParentByTagName("TH",th); … … 1213 1213 this.iterateTable({doCell:function(cell){ 1214 1214 if((cell.cellIndex==th.cellIndex)&&cell.id){ 1215 _17 d.addSelectedClass(cell);1215 _17e.addSelectedClass(cell); 1216 1216 } 1217 1217 }}); 1218 },inspectArgument:function(_18 0,time){1218 },inspectArgument:function(_181,time){ 1219 1219 var self=this; 1220 var _18 3=this.calendar.getSelected();1221 var _18 4=[];1222 self.calendar.recurrence(_18 0,function(o){1220 var _184=this.calendar.getSelected(); 1221 var _185=[]; 1222 self.calendar.recurrence(_181,function(o){ 1223 1223 if(!o.date){ 1224 _18 3.each(function(d){1225 var _18 7={};1224 _184.each(function(d){ 1225 var _188={}; 1226 1226 if(!o.date){ 1227 _18 7={date:self.getDate(d)};1227 _188={date:self.getDate(d)}; 1228 1228 if(time){ 1229 _18 7.start={hour:0,min:0};1230 _18 7.finish={hour:0,min:0};1231 } 1232 } 1233 Object.extend(_18 7,o);1234 _18 4.push(_187);1229 _188.start={hour:0,min:0}; 1230 _188.finish={hour:0,min:0}; 1231 } 1232 } 1233 Object.extend(_188,o); 1234 _185.push(_188); 1235 1235 }); 1236 1236 }else{ 1237 1237 if(o.date.constructor==Object){ 1238 1238 o.date=new Date(o.date.year,o.date.month,o.date.day); 1239 _18 4.push(o);1240 }else{ 1241 _18 4.push(o);1242 } 1243 } 1244 }); 1245 return _18 4;1239 _185.push(o); 1240 }else{ 1241 _185.push(o); 1242 } 1243 } 1244 }); 1245 return _185; 1246 1246 },inspectDateArgument:function(date){ 1247 1247 if(date){ … … 1256 1256 return map; 1257 1257 }else{ 1258 var _18 a=this;1259 var _18 b=this.calendar.getSelected();1260 if(_18 b.length==0){1258 var _18b=this; 1259 var _18c=this.calendar.getSelected(); 1260 if(_18c.length==0){ 1261 1261 return null; 1262 1262 } 1263 return _18 b.collect(function(d){1264 return _18 a.getDate(d);1265 }); 1266 } 1267 },findClickedElement:function(_18 d){1268 var _18 e=$(this.getScheduleContainerId());1269 var _1 8f=Position.cumulativeOffset(_18e);1270 var _19 0=Position.realOffset(_18e).last();1271 _19 0-=document.documentElement.scrollTop||document.body.scrollTop;1272 var x=Event.pointerX(_18 d)-_18f[0];1273 var y=Event.pointerY(_18 d)-_18f[1]+_190;1274 var _19 3=Math.floor(y/this.column.height);1275 var _19 4=Math.floor(x/this.column.width);1276 return $(this.calendarTable.rows[_19 3].cells[_194]);1277 },multipleSelection:function(_19 5){1263 return _18c.collect(function(d){ 1264 return _18b.getDate(d); 1265 }); 1266 } 1267 },findClickedElement:function(_18e){ 1268 var _18f=$(this.getScheduleContainerId()); 1269 var _190=Position.cumulativeOffset(_18f); 1270 var _191=Position.realOffset(_18f).last(); 1271 _191-=document.documentElement.scrollTop||document.body.scrollTop; 1272 var x=Event.pointerX(_18e)-_190[0]; 1273 var y=Event.pointerY(_18e)-_190[1]+_191; 1274 var _194=Math.floor(y/this.column.height); 1275 var _195=Math.floor(x/this.column.width); 1276 return $(this.calendarTable.rows[_194].cells[_195]); 1277 },multipleSelection:function(_196){ 1278 1278 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 1279 1279 return; 1280 1280 } 1281 1281 var self=this; 1282 var _19 7=this.calendar;1283 var _19 8=this.calendar.selectedBase;1284 this.abstractSelect(_19 5,function(date,_19a){1285 var _19 b=$(_198.id);1286 var _19 c=_197.createRange(parseInt(_19b.id.getSuffix()),parseInt(_19a.id.getSuffix()));1282 var _198=this.calendar; 1283 var _199=this.calendar.selectedBase; 1284 this.abstractSelect(_196,function(date,_19b){ 1285 var _19c=$(_199.id); 1286 var _19d=_198.createRange(parseInt(_19c.id.getSuffix()),parseInt(_19b.id.getSuffix())); 1287 1287 self.iterateTable({doCell:function(cell){ 1288 1288 if(cell.tagName!="TD"||!cell.id){ … … 1290 1290 } 1291 1291 var id=parseInt(cell.id.getSuffix(),10); 1292 if(_19 c.include(id)){1293 _19 7.addSelectedClass(cell);1294 }else{ 1295 _19 7.removeSelectedClass(cell);1292 if(_19d.include(id)){ 1293 _198.addSelectedClass(cell); 1294 }else{ 1295 _198.removeSelectedClass(cell); 1296 1296 } 1297 1297 }}); 1298 1298 }); 1299 1299 },iterateTable:function(){ 1300 var _1 9f=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]);1301 var _1a 0=$(this.getCalendarTableId());1302 if(_1 9f.doTable){1303 _1 9f.doTable(_1a0);1304 } 1305 $A(_1a 0.rows).each(function(row){1306 if(_1 9f.doRow){1307 _1 9f.doRow(row);1300 var _1a0=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]); 1301 var _1a1=$(this.getCalendarTableId()); 1302 if(_1a0.doTable){ 1303 _1a0.doTable(_1a1); 1304 } 1305 $A(_1a1.rows).each(function(row){ 1306 if(_1a0.doRow){ 1307 _1a0.doRow(row); 1308 1308 } 1309 1309 $A(row.cells).each(function(cell){ 1310 if(_1 9f.doCell){1311 _1 9f.doCell(cell);1312 } 1313 }); 1314 }); 1315 },findRow:function(_1a 3){1316 var _1a 4=$(this.getCalendarTableId());1317 return $A(_1a 4.rows).detect(function(row){1318 return row.rowIndex==_1a 3;1319 }); 1320 },findCell:function(_1a 6,_1a7){1321 return $A(this.findRow(_1a 6).cells).detect(function(cell){1322 return cell.cellIndex==_1a 7;1310 if(_1a0.doCell){ 1311 _1a0.doCell(cell); 1312 } 1313 }); 1314 }); 1315 },findRow:function(_1a4){ 1316 var _1a5=$(this.getCalendarTableId()); 1317 return $A(_1a5.rows).detect(function(row){ 1318 return row.rowIndex==_1a4; 1319 }); 1320 },findCell:function(_1a7,_1a8){ 1321 return $A(this.findRow(_1a7).cells).detect(function(cell){ 1322 return cell.cellIndex==_1a8; 1323 1323 }); 1324 1324 },getDateId:function(date){ … … 1338 1338 return {cellIndex:cell.cellIndex,rowIndex:row.rowIndex}; 1339 1339 } 1340 },changeSchedule:function(_1 af){1341 var _1b 0=_1af.element;1342 var _1b 1=_1b0.schedule;1343 this.calendar.cacheSchedule(_1b 1);1344 var top=parseInt(Element.getStyle(_1b 0,"top"),10);1345 var _1b 3=Math.floor(top/this.column.height);1346 var left=parseInt(Element.getStyle(_1b 0,"left"),10);1347 var _1b 5=Math.floor(left/this.column.width);1348 var _1b 6=$(this.getCalendarTableId());1349 var _1b 7=_1b6.rows.length-1;1350 var _1b 8=this.calendar.options.displayIndexes.length-1;1351 if((_1b 5>=0&&_1b3>=0)&&(_1b5<=_1b8&&_1b3<=_1b7)){1352 var cell=this.findCell(_1b 3,_1b5);1340 },changeSchedule:function(_1b0){ 1341 var _1b1=_1b0.element; 1342 var _1b2=_1b1.schedule; 1343 this.calendar.cacheSchedule(_1b2); 1344 var top=parseInt(Element.getStyle(_1b1,"top"),10); 1345 var _1b4=Math.floor(top/this.column.height); 1346 var left=parseInt(Element.getStyle(_1b1,"left"),10); 1347 var _1b6=Math.floor(left/this.column.width); 1348 var _1b7=$(this.getCalendarTableId()); 1349 var _1b8=_1b7.rows.length-1; 1350 var _1b9=this.calendar.options.displayIndexes.length-1; 1351 if((_1b6>=0&&_1b4>=0)&&(_1b6<=_1b9&&_1b4<=_1b8)){ 1352 var cell=this.findCell(_1b4,_1b6); 1353 1353 var date=new Date(this.calendar.date.getTime()); 1354 1354 date.setDate(parseInt(cell.id.getSuffix(),10)); 1355 var diff=this.getDayDiff(_1b 1);1356 var _1b c=date.advance({days:diff});1357 if(_1b 1.start.month==date.getMonth()&&_1b1.start.day==date.getDate()&&_1b1.finish.month==_1bc.getMonth()&&_1b1.finish.day==_1bc.getDate()){1355 var diff=this.getDayDiff(_1b2); 1356 var _1bd=date.advance({days:diff}); 1357 if(_1b2.start.month==date.getMonth()&&_1b2.start.day==date.getDate()&&_1b2.finish.month==_1bd.getMonth()&&_1b2.finish.day==_1bd.getDate()){ 1358 1358 this.calendar.refreshSchedule(); 1359 1359 return; 1360 1360 } 1361 _1b 1.start.year=date.getFullYear();1362 _1b 1.start.month=date.getMonth();1363 _1b 1.start.day=date.getDate();1364 _1b 1.finish.year=_1bc.getFullYear();1365 _1b 1.finish.month=_1bc.getMonth();1366 _1b 1.finish.day=_1bc.getDate();1361 _1b2.start.year=date.getFullYear(); 1362 _1b2.start.month=date.getMonth(); 1363 _1b2.start.day=date.getDate(); 1364 _1b2.finish.year=_1bd.getFullYear(); 1365 _1b2.finish.month=_1bd.getMonth(); 1366 _1b2.finish.day=_1bd.getDate(); 1367 1367 this.calendar.refreshSchedule(); 1368 this.calendar.options.changeSchedule(_1b 1);1368 this.calendar.options.changeSchedule(_1b2); 1369 1369 }else{ 1370 1370 this.calendar.refreshSchedule(); 1371 1371 } 1372 },updateTirm:function(_1b d){1373 var _1b e=_1bd.schedule;1374 var _1 bf=parseInt(Element.getStyle(_1bd,"width"));1375 var top=parseInt(Element.getStyle(_1b d,"top"));1376 var left=parseInt(Element.getStyle(_1b d,"left"));1377 var _1c 2=Math.round((left+_1bf)/this.column.width)-1;1378 var _1c 3=Math.round(top/this.column.height);1379 var cell=this.findCell(_1c 3,_1c2);1380 var _1c 5=_1be.finish;1381 var _1c 6=null;1372 },updateTirm:function(_1be){ 1373 var _1bf=_1be.schedule; 1374 var _1c0=parseInt(Element.getStyle(_1be,"width")); 1375 var top=parseInt(Element.getStyle(_1be,"top")); 1376 var left=parseInt(Element.getStyle(_1be,"left")); 1377 var _1c3=Math.round((left+_1c0)/this.column.width)-1; 1378 var _1c4=Math.round(top/this.column.height); 1379 var cell=this.findCell(_1c4,_1c3); 1380 var _1c6=_1bf.finish; 1381 var _1c7=null; 1382 1382 if(this.dateMap){ 1383 _1c 6=this.dateMap[cell.id].toHash();1384 }else{ 1385 _1c 6=new Date(this.calendar.date.getTime());1386 _1c 6.setDate(parseInt(cell.id.getSuffix(),10));1387 _1c 6=_1c6.toHash();1388 } 1389 _1c 6.hour=_1c5.hour;1390 _1c 6.min=_1c5.min;1391 if(DateUtil.toDate(_1b e.start).getTime()>=DateUtil.toDate(_1c6).getTime()){1392 var _1c 7=23;1393 var _1c 8=55;1394 if(_1b e.start.hour==_1c7&&_1be.start.min==_1c8){1383 _1c7=this.dateMap[cell.id].toHash(); 1384 }else{ 1385 _1c7=new Date(this.calendar.date.getTime()); 1386 _1c7.setDate(parseInt(cell.id.getSuffix(),10)); 1387 _1c7=_1c7.toHash(); 1388 } 1389 _1c7.hour=_1c6.hour; 1390 _1c7.min=_1c6.min; 1391 if(DateUtil.toDate(_1bf.start).getTime()>=DateUtil.toDate(_1c7).getTime()){ 1392 var _1c8=23; 1393 var _1c9=55; 1394 if(_1bf.start.hour==_1c8&&_1bf.start.min==_1c9){ 1395 1395 this.calendar.refreshSchedule(); 1396 1396 this.calendar.options.updateTirm(); 1397 1397 return; 1398 1398 }else{ 1399 _1c 6.hour=_1c7;1400 _1c 6.min=_1c8;1401 } 1402 } 1403 _1b e.finish=_1c6;1399 _1c7.hour=_1c8; 1400 _1c7.min=_1c9; 1401 } 1402 } 1403 _1bf.finish=_1c7; 1404 1404 this.calendar.refreshSchedule(); 1405 this.calendar.options.updateTirm(_1b e);1406 },getTimeText:function(_1c 9,_1ca){1407 var _1c b=this.calendar;1408 return _1c b.formatTime(_1c9);1409 },getDayDiff:function(_1c c){1410 return DateUtil.numberOfDays(this.toDate(_1c c.start),this.toDate(_1cc.finish));1405 this.calendar.options.updateTirm(_1bf); 1406 },getTimeText:function(_1ca,_1cb){ 1407 var _1cc=this.calendar; 1408 return _1cc.formatTime(_1ca); 1409 },getDayDiff:function(_1cd){ 1410 return DateUtil.numberOfDays(this.toDate(_1cd.start),this.toDate(_1cd.finish)); 1411 1411 }}); 1412 1412 var CalendarWeek=Class.create(); 1413 1413 CalendarWeek.id=["calTable","columnContainer","columnHeader","column","next","pre","headerText"]; 1414 1414 Object.extend(CalendarWeek.prototype,AbstractCalendar.prototype); 1415 Object.extend(CalendarWeek.prototype,{initialize:function(_1c d){1416 this.calendar=_1c d;1415 Object.extend(CalendarWeek.prototype,{initialize:function(_1ce){ 1416 this.calendar=_1ce; 1417 1417 this.week=this.getWeek(); 1418 1418 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); … … 1421 1421 return "<td class='"+this.calendar.classNames.preYears+"'>"+"<div id='"+this.ids.pre+"' class='"+this.calendar.classNames.preWeekMark+"'></div>"+"</td>"; 1422 1422 },buildHeaderCenter:function(){ 1423 var _1c e=[];1423 var _1cf=[]; 1424 1424 if(this.calendar.options.weekHeaderFormat){ 1425 _1c e=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())];1426 } 1427 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1c e[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1ce[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1ce[2]||this.week.last().toDateString())+"</span>"+"</td>";1425 _1cf=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())]; 1426 } 1427 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1cf[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1cf[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1cf[2]||this.week.last().toDateString())+"</span>"+"</td>"; 1428 1428 },formatHeaderDate:function(date){ 1429 1429 if(this.calendar.options.weekHeaderFormat){ … … 1434 1434 return "<td class='"+this.calendar.classNames.nextYears+"' align='right'>"+"<div id='"+this.ids.next+"' class='"+this.calendar.classNames.nextWeekMark+"'></div>"+"</td>"; 1435 1435 },buildCalendar:function(){ 1436 var _1d 0=(this.calendar.options.displayTimeLine)?this.buildTimeLine():"";1437 _1d 0+=this.buildCalendarContainer();1438 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1d 0+"</tr>"+"</table>";1436 var _1d1=(this.calendar.options.displayTimeLine)?this.buildTimeLine():""; 1437 _1d1+=this.buildCalendarContainer(); 1438 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1d1+"</tr>"+"</table>"; 1439 1439 },buildTimeLine:function(){ 1440 1440 var time=new Date(); 1441 var hour=0,_1d 3=24;1441 var hour=0,_1d4=24; 1442 1442 time.setHours(hour); 1443 1443 time.setMinutes(0); 1444 var _1d 4=this.buildTimeLineTop();1444 var _1d5=this.buildTimeLineTop(); 1445 1445 var now=new Date().getHours(); 1446 while(hour<_1d 3){1446 while(hour<_1d4){ 1447 1447 if(this.includeDisplayTime(hour)){ 1448 var _1d 6="pointer: default;";1449 if(_1d 4.length==0){1450 _1d 6+="border-top: none;";1451 } 1452 var _1d 7=this.calendar.classNames.timeLineTime;1448 var _1d7="pointer: default;"; 1449 if(_1d5.length==0){ 1450 _1d7+="border-top: none;"; 1451 } 1452 var _1d8=this.calendar.classNames.timeLineTime; 1453 1453 if(hour==now){ 1454 _1d 7+=" "+this.calendar.classNames.highlightTime;1455 } 1456 _1d 4+="<div class='"+_1d7+"' style='"+_1d6+"'>"+this.formatTime(time)+"</div>";1454 _1d8+=" "+this.calendar.classNames.highlightTime; 1455 } 1456 _1d5+="<div class='"+_1d8+"' style='"+_1d7+"'>"+this.formatTime(time)+"</div>"; 1457 1457 } 1458 1458 hour++; 1459 1459 time.setHours(hour); 1460 1460 } 1461 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1d 4+"</td>";1461 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1d5+"</td>"; 1462 1462 },buildTimeLineTop:function(){ 1463 1463 return "<div class='"+this.calendar.classNames.timeLineTimeTop+"'></div>"; … … 1465 1465 return "<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+this.buildCalendarHeader()+this.buildCalendarMain()+"</table>"+"</td>"; 1466 1466 },buildCalendarHeader:function(){ 1467 var _1d 8=this.calendar.options.displayIndexes;1467 var _1d9=this.calendar.options.displayIndexes; 1468 1468 var ths=""; 1469 var _1d a=new Date().days();1470 var _1d b=100/_1d8.length+"%";1471 var _1d c=this.calendar.element.id.appendSuffix(this.ids.column);1472 var _1d d=this.calendar.element.id.appendSuffix(this.ids.headerText);1469 var _1db=new Date().days(); 1470 var _1dc=100/_1d9.length+"%"; 1471 var _1dd=this.calendar.element.id.appendSuffix(this.ids.column); 1472 var _1de=this.calendar.element.id.appendSuffix(this.ids.headerText); 1473 1473 this.headers=[]; 1474 var _1d e=this.calendar.options.noEvent;1475 var _1 df=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null;1476 this.week.each(function(w,_1e 1){1474 var _1df=this.calendar.options.noEvent; 1475 var _1e0=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null; 1476 this.week.each(function(w,_1e2){ 1477 1477 var text=null; 1478 if(_1 df){1479 text=_1 df.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]});1478 if(_1e0){ 1479 text=_1e0.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]}); 1480 1480 }else{ 1481 1481 text=w.toDateString().split(" "); … … 1483 1483 text=text.join(" "); 1484 1484 } 1485 var _1e 3=(w.days()==_1da)?this.calendar.classNames.highlightDay:"";1486 var _1e 4=_1dd.appendSuffix(_1e1);1485 var _1e4=(w.days()==_1db)?this.calendar.classNames.highlightDay:""; 1486 var _1e5=_1de.appendSuffix(_1e2); 1487 1487 var node="<div class='"+this.calendar.classNames.headerColumn+"'>"; 1488 if(_1d e){1489 node+="<span='#' id='"+_1e 4+"' class='"+_1e3+"' style='cursor: default;'>"+text+"</a>";1490 }else{ 1491 node+="<a href='#' id='"+_1e 4+"' class='"+_1e3+"'>"+text+"</a>";1488 if(_1df){ 1489 node+="<span='#' id='"+_1e5+"' class='"+_1e4+"' style='cursor: default;'>"+text+"</a>"; 1490 }else{ 1491 node+="<a href='#' id='"+_1e5+"' class='"+_1e4+"'>"+text+"</a>"; 1492 1492 } 1493 1493 node+="</div>"; 1494 this.headers.push({id:_1e 4,wday:w});1495 ths+="<th id='"+_1d c.appendSuffix(_1e1)+"' width='"+_1db+"'>"+node+"</th>";1494 this.headers.push({id:_1e5,wday:w}); 1495 ths+="<th id='"+_1dd.appendSuffix(_1e2)+"' width='"+_1dc+"'>"+node+"</th>"; 1496 1496 }.bind(this)); 1497 1497 return "<tr>"+"<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+"<tr>"+ths+"</tr>"+"</table>"+"</td>"+"</tr>"; 1498 1498 },buildCalendarMain:function(){ 1499 var _1e 6=this.calendar.options.displayIndexes;1499 var _1e7=this.calendar.options.displayIndexes; 1500 1500 var tds=""; 1501 var _1e 8=100/_1e6.length+"%";1501 var _1e9=100/_1e7.length+"%"; 1502 1502 this.dateMap={}; 1503 this.week.each(function(w,_1e a){1504 var _1e b=this.calendar.options.schedules[w.toDateString()];1505 var _1e c="";1503 this.week.each(function(w,_1eb){ 1504 var _1ec=this.calendar.options.schedules[w.toDateString()]; 1505 var _1ed=""; 1506 1506 var i=0,j=0; 1507 1507 while(i<24){ 1508 1508 if(this.includeDisplayTime(i)){ 1509 var _1 ef="";1510 if(_1e c.length==0){1511 _1 ef=this.calendar.classNames.columnTopDate;1509 var _1f0=""; 1510 if(_1ed.length==0){ 1511 _1f0=this.calendar.classNames.columnTopDate; 1512 1512 }else{ 1513 1513 if(i%1==0){ 1514 _1 ef=this.calendar.classNames.columnDate;1515 }else{ 1516 _1 ef=this.calendar.classNames.columnDateOdd;1517 } 1518 } 1519 var id=this.getDateId(w,i,_1e a);1514 _1f0=this.calendar.classNames.columnDate; 1515 }else{ 1516 _1f0=this.calendar.classNames.columnDateOdd; 1517 } 1518 } 1519 var id=this.getDateId(w,i,_1eb); 1520 1520 var hour=i/1; 1521 1521 var min=i%1*60; 1522 1522 this.dateMap[id]=new Date(w.getFullYear(),w.getMonth(),w.getDate(),hour,min,0); 1523 _1e c+="<div id='"+id+"' class='"+_1ef+"'></div>";1523 _1ed+="<div id='"+id+"' class='"+_1f0+"'></div>"; 1524 1524 } 1525 1525 i+=0.5; 1526 1526 } 1527 tds+="<td width='"+_1e 8+"'>"+_1ec+"</td>";1527 tds+="<td width='"+_1e9+"'>"+_1ed+"</td>"; 1528 1528 }.bind(this)); 1529 1529 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>"; … … 1533 1533 var rule=CssUtil.getCssRuleBySelectorText("."+Calendar.className.columnDate); 1534 1534 this.column.height=parseInt(rule.style["height"],10)+1; 1535 },buildSchedule:function(_1f 5){1536 var id="scheduleItem_"+_1f 5.id;1537 var _1f 7=(_1f5.edit==undefined||_1f5.edit);1535 },buildSchedule:function(_1f6){ 1536 var id="scheduleItem_"+_1f6.id; 1537 var _1f8=(_1f6.edit==undefined||_1f6.edit); 1538 1538 var item=Builder.node("DIV",{id:id}); 1539 1539 this.calendar.css.addClassNames(item,"scheduleItemLarge"); 1540 var _1f9=this.calendar.options.noEvent; 1541 var _1fa={}; 1542 if(_1f5.background_color){ 1543 _1fa.backgroundColor=_1f5.background_color; 1544 } 1545 if(_1f5.frame_color){ 1546 _1fa.border="2px solid "+_1f5.frame_color; 1547 } 1548 if(_1f9){ 1549 _1fa.cursor="default"; 1550 } 1551 Element.setStyle(item,_1fa); 1552 if(_1f7){ 1553 var _1fb=Builder.node("DIV",{id:"scheduleDeleteImg_"+_1f5.id,className:this.calendar.css.joinClassNames("deleteImg")}); 1554 Element.hide(_1fb); 1555 item.appendChild(_1fb); 1556 if(!_1f9){ 1557 Event.observe(_1fb,"click",this.clickDeleteImage.bind(this,_1f5)); 1558 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_1fb)); 1559 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_1fb)); 1560 } 1561 } 1562 if(!_1f9&&this.calendar.options.dblclickSchedule){ 1563 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_1f5)); 1564 } 1565 var _1fc=null; 1566 if(_1f7){ 1567 _1fc=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 1568 if(_1f9){ 1540 var _1fa=this.calendar.options.noEvent; 1541 var _1fb={}; 1542 if(_1f6.background_color){ 1543 _1fb.backgroundColor=_1f6.background_color; 1544 } 1545 if(_1f6.frame_color){ 1546 _1fb.border="2px solid "+_1f6.frame_color; 1547 } 1548 if(_1fa){ 1549 _1fb.cursor="default"; 1550 } 1551 Element.setStyle(item,_1fb); 1552 if(_1f8){ 1553 var _1fc=Builder.node("DIV",{id:"scheduleDeleteImg_"+_1f6.id,className:this.calendar.css.joinClassNames("deleteImg")}); 1569 1554 Element.hide(_1fc); 1570 }1571 1555 item.appendChild(_1fc); 1556 if(!_1fa){ 1557 Event.observe(_1fc,"click",this.clickDeleteImage.bind(this,_1f6)); 1558 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_1fc)); 1559 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_1fc)); 1560 } 1561 } 1562 if(!_1fa&&this.calendar.options.dblclickSchedule){ 1563 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_1f6)); 1564 } 1565 var _1fd=null; 1566 if(_1f8){ 1567 _1fd=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 1568 if(_1fa){ 1569 Element.hide(_1fd); 1570 } 1571 item.appendChild(_1fd); 1572 1572 } 1573 1573 var icon=null; 1574 if(_1f 5.icon){1575 icon=Builder.node("IMG",{src:_1f 5.icon,alt:"icon",style:"float: left;",width:16,height:16});1574 if(_1f6.icon){ 1575 icon=Builder.node("IMG",{src:_1f6.icon,alt:"icon",style:"float: left;",width:16,height:16}); 1576 1576 item.appendChild(icon); 1577 1577 } 1578 if(!_1f 5.publicity){1579 icon=Builder.node("DIV",{id:"private_img_"+_1f 5.id});1578 if(!_1f6.publicity){ 1579 icon=Builder.node("DIV",{id:"private_img_"+_1f6.id}); 1580 1580 this.calendar.css.addClassNames(icon,"privateImg"); 1581 1581 item.appendChild(icon); 1582 1582 } 1583 var text=this.getTimeText(_1f 5.start,_1f5.finish);1583 var text=this.getTimeText(_1f6.start,_1f6.finish); 1584 1584 text=Builder.node("DIV",{id:id+"_text"},[text]); 1585 1585 this.calendar.css.addClassNames(text,"scheduleTimeArea"); 1586 1586 item.appendChild(text); 1587 var _ 1ff=_1f5.description.unescapeHTML();1588 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_ 1ff]));1589 item.title=_ 1ff;1590 item.schedule=_1f 5;1591 return [item,_1f c];1592 },adjustScheduleStyle:function(item,_20 1,_202){1593 var _20 3=item.schedule;1594 var time=this.convertHours(_20 3);1595 var _20 5=time[0];1596 var _20 6=time[1];1587 var _200=_1f6.description.unescapeHTML(); 1588 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_200])); 1589 item.title=_200; 1590 item.schedule=_1f6; 1591 return [item,_1fd]; 1592 },adjustScheduleStyle:function(item,_202,_203){ 1593 var _204=item.schedule; 1594 var time=this.convertHours(_204); 1595 var _206=time[0]; 1596 var _207=time[1]; 1597 1597 var same=[]; 1598 1598 var self=this; 1599 _20 2.each(function(h){1600 var _20 a=self.convertHours(h.schedule);1601 var _20 b=_20a[0];1602 var _20 c=_20a[1];1603 if(((_20 b<=_205)&&(_20c>_205))||((_20b<_206)&&(_20c>=_206))||((_205<=_20b)&&(_206>_20b))||((_205<_20c)&&(_206>=_20c))){1599 _203.each(function(h){ 1600 var _20b=self.convertHours(h.schedule); 1601 var _20c=_20b[0]; 1602 var _20d=_20b[1]; 1603 if(((_20c<=_206)&&(_20d>_206))||((_20c<_207)&&(_20d>=_207))||((_206<=_20c)&&(_207>_20c))||((_206<_20d)&&(_207>=_20d))){ 1604 1604 same.push(h); 1605 1605 } 1606 1606 }); 1607 var _20 d=_201*this.getAdjustSize();1607 var _20e=_202*this.getAdjustSize(); 1608 1608 if(UserAgent.isIE()||this.calendar.options.noEvent){ 1609 _20 d+=1;1610 } 1611 var left=this.column.width*_20 1+_20d;1609 _20e+=1; 1610 } 1611 var left=this.column.width*_202+_20e; 1612 1612 if(same.length==0){ 1613 1613 Element.setStyle(item,{left:left+"px"}); 1614 1614 }else{ 1615 1615 same.push(item); 1616 var _2 0f=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1;1616 var _210=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 1617 1617 same.each(function(s,i){
