| 872 | | },buildEmptyRow:function(_f7,_f8,_f9,_fa){ |
|---|
| 873 | | var id=this.ids.emptyRow.appendSuffix(_fa); |
|---|
| 874 | | this.dateMap[id]=_f7; |
|---|
| 875 | | return "<td id='"+id+"' class='"+_f9+"' width='"+_f8+"'> </td>"; |
|---|
| 876 | | },buildLargeRow:function(_fc,_fd,_fe,_ff,_100){ |
|---|
| 877 | | var _101=null; |
|---|
| 878 | | var _102=(_fc.days()==_fe.days())?this.calendar.classNames.highlightDay:""; |
|---|
| 879 | | var _103=this.calendar.options.clickDateText; |
|---|
| 880 | | if(_103||(_103==null)){ |
|---|
| 881 | | _101="<span class='"+_102+"'>"+_fc.getDate()+"</span>"; |
|---|
| 882 | | }else{ |
|---|
| 883 | | _101="<span class='"+_102+"' style='text-decoration: none;'>"+_fc.getDate()+"</span>"; |
|---|
| 884 | | } |
|---|
| 885 | | var _104=""; |
|---|
| | 871 | },buildEmptyRow:function(_f6,_f7,_f8,_f9){ |
|---|
| | 872 | var id=this.ids.emptyRow.appendSuffix(_f9); |
|---|
| | 873 | this.dateMap[id]=_f6; |
|---|
| | 874 | return "<td id='"+id+"' class='"+_f8+"' width='"+_f7+"'> </td>"; |
|---|
| | 875 | },buildLargeRow:function(_fb,_fc,_fd,_fe,_ff){ |
|---|
| | 876 | var _100=null; |
|---|
| | 877 | var _101=(_fb.days()==_fd.days())?this.calendar.classNames.highlightDay:""; |
|---|
| | 878 | var _102=this.calendar.options.clickDateText; |
|---|
| | 879 | if(_102||(_102==null)){ |
|---|
| | 880 | _100="<span class='"+_101+"'>"+_fb.getDate()+"</span>"; |
|---|
| | 881 | }else{ |
|---|
| | 882 | _100="<span class='"+_101+"' style='text-decoration: none;'>"+_fb.getDate()+"</span>"; |
|---|
| | 883 | } |
|---|
| | 884 | var _103=""; |
|---|
| 887 | | if(_fd){ |
|---|
| 888 | | _104=this.calendar.classNames.holiday; |
|---|
| 889 | | name="<span class='"+this.calendar.classNames.holidayName+"'>"+_fd.name+"</span>"; |
|---|
| 890 | | }else{ |
|---|
| 891 | | if(this.calendar.isRegularHoliday(_fc.getDay())){ |
|---|
| 892 | | _104=this.calendar.classNames.regularHoliday; |
|---|
| 893 | | }else{ |
|---|
| 894 | | _104=this.calendar.classNames.date; |
|---|
| 895 | | } |
|---|
| 896 | | } |
|---|
| 897 | | _100=[_104,_100]; |
|---|
| 898 | | var id=this.getDateId(_fc); |
|---|
| 899 | | this.dateMap[id]=_fc; |
|---|
| 900 | | return "<td id='"+id+"' class='"+_100.join(" ")+"' width='"+_ff+"'>"+"<div class='"+this.calendar.classNames.dateContainer+"'>"+_101+name+"</div>"+"</td>"; |
|---|
| 901 | | },buildSmallRow:function(date,_108,_109,_10a,_10b,_10c){ |
|---|
| | 886 | if(_fc){ |
|---|
| | 887 | _103=this.calendar.classNames.holiday; |
|---|
| | 888 | name="<span class='"+this.calendar.classNames.holidayName+"'>"+_fc.name+"</span>"; |
|---|
| | 889 | }else{ |
|---|
| | 890 | if(this.calendar.isRegularHoliday(_fb.getDay())){ |
|---|
| | 891 | _103=this.calendar.classNames.regularHoliday; |
|---|
| | 892 | }else{ |
|---|
| | 893 | _103=this.calendar.classNames.date; |
|---|
| | 894 | } |
|---|
| | 895 | } |
|---|
| | 896 | _ff=[_103,_ff]; |
|---|
| | 897 | var id=this.getDateId(_fb); |
|---|
| | 898 | this.dateMap[id]=_fb; |
|---|
| | 899 | return "<td id='"+id+"' class='"+_ff.join(" ")+"' width='"+_fe+"'>"+"<div class='"+this.calendar.classNames.dateContainer+"'>"+_100+name+"</div>"+"</td>"; |
|---|
| | 900 | },buildSmallRow:function(date,_107,_108,_109,_10a,_10b){ |
|---|
| 918 | | _10c.push(this.calendar.classNames.regularHoliday); |
|---|
| 919 | | }else{ |
|---|
| 920 | | _10c.push(this.calendar.classNames.date); |
|---|
| 921 | | } |
|---|
| 922 | | } |
|---|
| 923 | | } |
|---|
| 924 | | if(date.days()==_10a.days()){ |
|---|
| 925 | | _10c.push(Calendar.className.highlightDay); |
|---|
| 926 | | } |
|---|
| 927 | | _10c.push(_10c); |
|---|
| 928 | | _10c=_10c.join(" "); |
|---|
| 929 | | _10e=_10e.inject("",function(html,pair){ |
|---|
| | 917 | _10b.push(this.calendar.classNames.regularHoliday); |
|---|
| | 918 | }else{ |
|---|
| | 919 | _10b.push(this.calendar.classNames.date); |
|---|
| | 920 | } |
|---|
| | 921 | } |
|---|
| | 922 | } |
|---|
| | 923 | if(date.days()==_109.days()){ |
|---|
| | 924 | _10b.push(Calendar.className.highlightDay); |
|---|
| | 925 | } |
|---|
| | 926 | _10b.push(_10b); |
|---|
| | 927 | _10b=_10b.join(" "); |
|---|
| | 928 | _10d=_10d.inject("",function(html,pair){ |
|---|
| 944 | | var _119=""; |
|---|
| 945 | | if(!_115&&_117){ |
|---|
| 946 | | _119+="cursor: move"; |
|---|
| 947 | | } |
|---|
| 948 | | var _11a=Builder.node("DIV",{id:id+"_container",style:_119}); |
|---|
| 949 | | item.appendChild(_11a); |
|---|
| 950 | | var _11b=DateUtil.toDate(_113.start); |
|---|
| 951 | | var _11c=DateUtil.toDate(_113.finish); |
|---|
| 952 | | if(_113.finish.hour==0&&_113.finish.min==0){ |
|---|
| 953 | | _11c=_11c.advance({days:-1}); |
|---|
| 954 | | } |
|---|
| 955 | | var _11d={}; |
|---|
| | 943 | var _118=""; |
|---|
| | 944 | if(!_114&&_116){ |
|---|
| | 945 | _118+="cursor: move"; |
|---|
| | 946 | } |
|---|
| | 947 | var _119=Builder.node("DIV",{id:id+"_container",style:_118}); |
|---|
| | 948 | item.appendChild(_119); |
|---|
| | 949 | var _11a=DateUtil.toDate(_112.start); |
|---|
| | 950 | var _11b=DateUtil.toDate(_112.finish); |
|---|
| | 951 | if(_112.finish.hour==0&&_112.finish.min==0){ |
|---|
| | 952 | _11b=_11b.advance({days:-1}); |
|---|
| | 953 | } |
|---|
| | 954 | var _11c={}; |
|---|
| 971 | | Element.setStyle(item,_11d); |
|---|
| 972 | | var _11e=[]; |
|---|
| 973 | | var _11f=(_113.removable==undefined||_113.removable); |
|---|
| 974 | | if(_117&&_11f){ |
|---|
| 975 | | var _120=Builder.node("DIV",{id:"scheduleDeleteImg_"+_113.id,className:this.calendar.css.joinClassNames("deleteImg"),style:"display: none;"}); |
|---|
| 976 | | _11e.push(_120); |
|---|
| 977 | | _11a.appendChild(_120); |
|---|
| 978 | | if(!_115){ |
|---|
| 979 | | Event.observe(_120,"click",this.clickDeleteImage.bind(this,_113)); |
|---|
| 980 | | } |
|---|
| 981 | | } |
|---|
| 982 | | if(!_115&&this.calendar.options.dblclickSchedule){ |
|---|
| 983 | | Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_113)); |
|---|
| | 970 | Element.setStyle(item,_11c); |
|---|
| | 971 | var _11d=[]; |
|---|
| | 972 | var _11e=(_112.removable==undefined||_112.removable); |
|---|
| | 973 | if(_116&&_11e){ |
|---|
| | 974 | var _11f=Builder.node("DIV",{id:"scheduleDeleteImg_"+_112.id,className:this.calendar.css.joinClassNames("deleteImg"),style:"display: none;"}); |
|---|
| | 975 | _11d.push(_11f); |
|---|
| | 976 | _119.appendChild(_11f); |
|---|
| | 977 | if(!_114){ |
|---|
| | 978 | Event.observe(_11f,"click",this.clickDeleteImage.bind(this,_112)); |
|---|
| | 979 | } |
|---|
| | 980 | } |
|---|
| | 981 | if(!_114&&this.calendar.options.dblclickSchedule){ |
|---|
| | 982 | Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_112)); |
|---|
| 998 | | _122=Builder.node("IMG",{src:Calendar.privateImgPath,alt:"private",style:"position: absolute; right: 0px; display: block;",width:16,height:16}); |
|---|
| 999 | | _11a.appendChild(_122); |
|---|
| 1000 | | }else{ |
|---|
| 1001 | | _122=Builder.node("DIV",{id:"private_img_"+_113.id}); |
|---|
| 1002 | | this.calendar.css.addClassNames(_122,"privateImg"); |
|---|
| 1003 | | _11a.appendChild(_122); |
|---|
| 1004 | | } |
|---|
| 1005 | | } |
|---|
| 1006 | | if(!_115&&(_11e.length>0)){ |
|---|
| 1007 | | Event.observe(item,"mouseover",this.showImage.bind(this,_11e,_122)); |
|---|
| 1008 | | Event.observe(item,"mouseout",this.hideImage.bind(this,_11e,_122)); |
|---|
| | 997 | _121=Builder.node("IMG",{src:Calendar.privateImgPath,alt:"private",style:"position: absolute; right: 0px; display: block;",width:16,height:16}); |
|---|
| | 998 | _119.appendChild(_121); |
|---|
| | 999 | }else{ |
|---|
| | 1000 | _121=Builder.node("DIV",{id:"private_img_"+_112.id}); |
|---|
| | 1001 | this.calendar.css.addClassNames(_121,"privateImg"); |
|---|
| | 1002 | _119.appendChild(_121); |
|---|
| | 1003 | } |
|---|
| | 1004 | } |
|---|
| | 1005 | if(!_114&&(_11d.length>0)){ |
|---|
| | 1006 | Event.observe(item,"mouseover",this.showImage.bind(this,_11d,_121)); |
|---|
| | 1007 | Event.observe(item,"mouseout",this.hideImage.bind(this,_11d,_121)); |
|---|
| 1011 | | var text=this.getTimeText((_114)?_113.start:{hour:"0",min:"0"},_113.finish); |
|---|
| 1012 | | var _125=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]); |
|---|
| 1013 | | this.calendar.css.addClassNames(_125,"scheduleTimeAreaMonth"); |
|---|
| 1014 | | _11a.appendChild(_125); |
|---|
| 1015 | | var _126=_113.description.unescapeHTML(); |
|---|
| 1016 | | _11a.appendChild(Builder.node("DIV",{id:id+"_description"},[_126])); |
|---|
| 1017 | | item.title=text+"-"+this.calendar.formatTime(_113.finish)+" "+_126; |
|---|
| 1018 | | item.schedule=_113; |
|---|
| 1019 | | return [item,_11a]; |
|---|
| 1020 | | },adjustScheduleStyle:function(item,_128,_129,_12a){ |
|---|
| | 1010 | var text=this.getTimeText((_113)?_112.start:{hour:"0",min:"0"},_112.finish); |
|---|
| | 1011 | var _124=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]); |
|---|
| | 1012 | this.calendar.css.addClassNames(_124,"scheduleTimeAreaMonth"); |
|---|
| | 1013 | _119.appendChild(_124); |
|---|
| | 1014 | var _125=_112.description.unescapeHTML(); |
|---|
| | 1015 | _119.appendChild(Builder.node("DIV",{id:id+"_description"},[_125])); |
|---|
| | 1016 | item.title=text+"-"+this.calendar.formatTime(_112.finish)+" "+_125; |
|---|
| | 1017 | item.schedule=_112; |
|---|
| | 1018 | return [item,_119]; |
|---|
| | 1019 | },adjustScheduleStyle:function(item,_127,_128,_129){ |
|---|
| 1069 | | },setScheduleBaseStyle:function(item,_141,_142,_143){ |
|---|
| 1070 | | var _144=this.column.height; |
|---|
| 1071 | | var top=_144*_141+this.column.dateTextHeight; |
|---|
| 1072 | | var _146=this.getAdjustSize()+(UserAgent.isIE()?0.5:0); |
|---|
| 1073 | | Element.setStyle(item,{top:top+"px",width:this.column.width*_143+_146*(_143-1)+"px",left:this.column.width*_142+_142*_146+"px"}); |
|---|
| | 1068 | },setScheduleBaseStyle:function(item,_140,_141,_142){ |
|---|
| | 1069 | var _143=this.column.height; |
|---|
| | 1070 | var top=_143*_140+this.column.dateTextHeight; |
|---|
| | 1071 | var _145=this.getAdjustSize()+(UserAgent.isIE()?0.5:0); |
|---|
| | 1072 | Element.setStyle(item,{top:top+"px",width:this.column.width*_142+_145*(_142-1)+"px",left:this.column.width*_141+_141*_145+"px"}); |
|---|
| 1097 | | var _14d=DateUtil.getFirstDate(date.getFullYear(),date.getMonth()); |
|---|
| 1098 | | var _14e=_14d.days(); |
|---|
| 1099 | | var _14f=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days(); |
|---|
| 1100 | | self.calendar.options.schedules.each(function(_150,_151){ |
|---|
| 1101 | | var _152=self.toDate(_150.start); |
|---|
| 1102 | | var _153=_152.days(); |
|---|
| 1103 | | var _154=self.toDate(_150.finish); |
|---|
| 1104 | | var _155=_154.days(); |
|---|
| 1105 | | var days=self.getDayDiff(_150); |
|---|
| 1106 | | if(_150.finish.hour==0&&_150.finish.min==0){ |
|---|
| | 1096 | var _14c=DateUtil.getFirstDate(date.getFullYear(),date.getMonth()); |
|---|
| | 1097 | var _14d=_14c.days(); |
|---|
| | 1098 | var _14e=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days(); |
|---|
| | 1099 | self.calendar.options.schedules.each(function(_14f,_150){ |
|---|
| | 1100 | var _151=self.toDate(_14f.start); |
|---|
| | 1101 | var _152=_151.days(); |
|---|
| | 1102 | var _153=self.toDate(_14f.finish); |
|---|
| | 1103 | var _154=_153.days(); |
|---|
| | 1104 | var days=self.getDayDiff(_14f); |
|---|
| | 1105 | if(_14f.finish.hour==0&&_14f.finish.min==0){ |
|---|
| 1138 | | },setSchedule:function(_159,_15a,_15b,days){ |
|---|
| 1139 | | var _15d=[]; |
|---|
| 1140 | | var _15e=6; |
|---|
| 1141 | | var _15f=DateUtil.toDate(_159.start); |
|---|
| 1142 | | var date=_15f; |
|---|
| 1143 | | var _161=this.calendar.options.displayIndexes; |
|---|
| 1144 | | var _162=this.calendar.date; |
|---|
| 1145 | | var _163=this.calendar.options.noEvent; |
|---|
| 1146 | | var _164=this.calendar.options.clickSkipNode; |
|---|
| | 1137 | },setSchedule:function(_158,_159,_15a,days){ |
|---|
| | 1138 | var _15c=[]; |
|---|
| | 1139 | var _15d=6; |
|---|
| | 1140 | var _15e=DateUtil.toDate(_158.start); |
|---|
| | 1141 | var date=_15e; |
|---|
| | 1142 | var _160=this.calendar.options.displayIndexes; |
|---|
| | 1143 | var _161=this.calendar.date; |
|---|
| | 1144 | var _162=this.calendar.options.noEvent; |
|---|
| | 1145 | var _163=this.calendar.options.clickSkipNode; |
|---|
| 1148 | | var _165=this.getLastWday(date); |
|---|
| 1149 | | var _166=days+1; |
|---|
| 1150 | | var _167=date.getDay(); |
|---|
| 1151 | | var _168=date.advance({days:_166-1}); |
|---|
| 1152 | | if(_168.getTime()>_165.getTime()){ |
|---|
| 1153 | | _168=_165; |
|---|
| 1154 | | _166=_168.days()-date.days()+1; |
|---|
| 1155 | | } |
|---|
| 1156 | | var _169=_168.getDay(); |
|---|
| 1157 | | var _16a=null; |
|---|
| 1158 | | if(_167<=_169){ |
|---|
| 1159 | | _16a=$R(_167,_169,false); |
|---|
| 1160 | | }else{ |
|---|
| 1161 | | _16a=$R(0,_169,false).toArray().concat($R(_167,_15e,false).toArray()); |
|---|
| 1162 | | } |
|---|
| 1163 | | var _16b=_16a.findAll(function(day){ |
|---|
| 1164 | | return _161.include(day); |
|---|
| | 1147 | var _164=this.getLastWday(date); |
|---|
| | 1148 | var _165=days+1; |
|---|
| | 1149 | var _166=date.getDay(); |
|---|
| | 1150 | var _167=date.advance({days:_165-1}); |
|---|
| | 1151 | if(_167.getTime()>_164.getTime()){ |
|---|
| | 1152 | _167=_164; |
|---|
| | 1153 | _165=_167.days()-date.days()+1; |
|---|
| | 1154 | } |
|---|
| | 1155 | var _168=_167.getDay(); |
|---|
| | 1156 | var _169=null; |
|---|
| | 1157 | if(_166<=_168){ |
|---|
| | 1158 | _169=$R(_166,_168,false); |
|---|
| | 1159 | }else{ |
|---|
| | 1160 | _169=$R(0,_168,false).toArray().concat($R(_166,_15d,false).toArray()); |
|---|
| | 1161 | } |
|---|
| | 1162 | var _16a=_169.findAll(function(day){ |
|---|
| | 1163 | return _160.include(day); |
|---|
| 1166 | | var _16d=new Date(date.getTime()); |
|---|
| 1167 | | while(_16d.days()<=_168.days()){ |
|---|
| 1168 | | if(_16d.getMonth()==_162.getMonth()){ |
|---|
| 1169 | | var _16e=this.getCellPosition(_16d.getDate()); |
|---|
| 1170 | | if(_16e){ |
|---|
| 1171 | | var _16f=_16e.rowIndex; |
|---|
| 1172 | | var _170=_16e.cellIndex; |
|---|
| 1173 | | var _171=this.buildSchedule(_159,_15f.sameDate(_16d)); |
|---|
| 1174 | | var item=_171.first(); |
|---|
| 1175 | | item.length=_16b; |
|---|
| 1176 | | item.cellIndex=_170; |
|---|
| 1177 | | item.cellDate=_16d; |
|---|
| | 1165 | var _16c=new Date(date.getTime()); |
|---|
| | 1166 | while(_16c.days()<=_167.days()){ |
|---|
| | 1167 | if(_16c.getMonth()==_161.getMonth()){ |
|---|
| | 1168 | var _16d=this.getCellPosition(_16c.getDate()); |
|---|
| | 1169 | if(_16d){ |
|---|
| | 1170 | var _16e=_16d.rowIndex; |
|---|
| | 1171 | var _16f=_16d.cellIndex; |
|---|
| | 1172 | var _170=this.buildSchedule(_158,_15e.sameDate(_16c)); |
|---|
| | 1173 | var item=_170.first(); |
|---|
| | 1174 | item.length=_16a; |
|---|
| | 1175 | item.cellIndex=_16f; |
|---|
| | 1176 | item.cellDate=_16c; |
|---|
| 1179 | | this.setScheduleBaseStyle(item,_16f,_170,_16b); |
|---|
| 1180 | | var _173=this.adjustScheduleStyle(item,_16f,_170,_15a[_16f]); |
|---|
| 1181 | | if(_173){ |
|---|
| 1182 | | this.container.appendChild(_173); |
|---|
| 1183 | | Event.observe(_173,"click",this.clickSkipNode.bindAsEventListener(this,_16d)); |
|---|
| 1184 | | Event.observe(_173,"mouseover",this.showTooltip.bindAsEventListener(this,_173.skipId,_16d)); |
|---|
| 1185 | | Event.observe(_173,"mouseout",this.hideTooltip.bindAsEventListener(this)); |
|---|
| | 1178 | this.setScheduleBaseStyle(item,_16e,_16f,_16a); |
|---|
| | 1179 | var _172=this.adjustScheduleStyle(item,_16e,_16f,_159[_16e]); |
|---|
| | 1180 | if(_172){ |
|---|
| | 1181 | this.container.appendChild(_172); |
|---|
| | 1182 | Event.observe(_172,"click",this.clickSkipNode.bindAsEventListener(this,_16c)); |
|---|
| | 1183 | Event.observe(_172,"mouseover",this.showTooltip.bindAsEventListener(this,_172.skipId,_16c)); |
|---|
| | 1184 | Event.observe(_172,"mouseout",this.hideTooltip.bindAsEventListener(this)); |
|---|
| 1224 | | if(!_163){ |
|---|
| 1225 | | _15d.each(function(item){ |
|---|
| 1226 | | Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_15d)); |
|---|
| 1227 | | Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_15d)); |
|---|
| | 1223 | if(!_162){ |
|---|
| | 1224 | _15c.each(function(item){ |
|---|
| | 1225 | Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_15c)); |
|---|
| | 1226 | Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_15c)); |
|---|
| 1237 | | var _178=$(this.getSelectorId()); |
|---|
| 1238 | | Element.setStyle(_178,{width:this.column.width+"px",height:this.column.height-2+"px"}); |
|---|
| 1239 | | Element.setOpacity(_178,0.6); |
|---|
| 1240 | | },setDraggable:function(item,_17a,_17b){ |
|---|
| | 1236 | var _177=$(this.getSelectorId()); |
|---|
| | 1237 | Element.setStyle(_177,{width:this.column.width+"px",height:this.column.height-2+"px"}); |
|---|
| | 1238 | Element.setOpacity(_177,0.6); |
|---|
| | 1239 | },setDraggable:function(item,_179,_17a){ |
|---|
| 1242 | | var _17d=Position.cumulativeOffset(this.container); |
|---|
| 1243 | | var _17e=$(this.getSelectorId()); |
|---|
| 1244 | | var _17f=this.column.width+(UserAgent.isIE()?0.5:0); |
|---|
| 1245 | | var _180=this.column.height+(UserAgent.isIE()?1:0); |
|---|
| 1246 | | var _181=this.rowMax||$(this.getCalendarTableId()).rows.length; |
|---|
| 1247 | | var _182=this.calendar.options.displayIndexes.length-1; |
|---|
| 1248 | | var _183=this.getAdjustSize(); |
|---|
| 1249 | | new Draggable(item,{handle:_17a,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_184,_185){ |
|---|
| 1250 | | Element.show(_17e); |
|---|
| 1251 | | },onDrag:function(_186,_187){ |
|---|
| 1252 | | var _188=_186.element; |
|---|
| 1253 | | var top=parseInt(Element.getStyle(_188,"top"),10)+_186.offset[1]; |
|---|
| 1254 | | var _18a=Math.floor(top/_180); |
|---|
| 1255 | | var left=parseInt(Element.getStyle(_188,"left"),10)+_186.offset[0]; |
|---|
| 1256 | | var _18c=Math.floor(left/_17f); |
|---|
| 1257 | | if((_18c>=0&&_18a>=0)&&(_18c<=_182&&_18a<=_181)){ |
|---|
| 1258 | | Element.setStyle(_17e,{left:_17f*_18c+_183*_18c+"px",top:_180*_18a+"px"}); |
|---|
| 1259 | | } |
|---|
| 1260 | | },onEnd:function(_18d,_18e){ |
|---|
| 1261 | | var _18f=_18d.currentDelta(); |
|---|
| 1262 | | Element.hide(_17e); |
|---|
| 1263 | | if(!(_18f[0]==_18d.delta[0]&&_18f[1]==_18d.delta[1])){ |
|---|
| 1264 | | self.changeSchedule(_18d); |
|---|
| | 1241 | var _17c=Position.cumulativeOffset(this.container); |
|---|
| | 1242 | var _17d=$(this.getSelectorId()); |
|---|
| | 1243 | var _17e=this.column.width+(UserAgent.isIE()?0.5:0); |
|---|
| | 1244 | var _17f=this.column.height+(UserAgent.isIE()?1:0); |
|---|
| | 1245 | var _180=this.rowMax||$(this.getCalendarTableId()).rows.length; |
|---|
| | 1246 | var _181=this.calendar.options.displayIndexes.length-1; |
|---|
| | 1247 | var _182=this.getAdjustSize(); |
|---|
| | 1248 | new Draggable(item,{handle:_179,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_183,_184){ |
|---|
| | 1249 | Element.show(_17d); |
|---|
| | 1250 | },onDrag:function(_185,_186){ |
|---|
| | 1251 | var _187=_185.element; |
|---|
| | 1252 | var top=parseInt(Element.getStyle(_187,"top"),10)+_185.offset[1]; |
|---|
| | 1253 | var _189=Math.floor(top/_17f); |
|---|
| | 1254 | var left=parseInt(Element.getStyle(_187,"left"),10)+_185.offset[0]; |
|---|
| | 1255 | var _18b=Math.floor(left/_17e); |
|---|
| | 1256 | if((_18b>=0&&_189>=0)&&(_18b<=_181&&_189<=_180)){ |
|---|
| | 1257 | Element.setStyle(_17d,{left:_17e*_18b+_182*_18b+"px",top:_17f*_189+"px"}); |
|---|
| | 1258 | } |
|---|
| | 1259 | },onEnd:function(_18c,_18d){ |
|---|
| | 1260 | var _18e=_18c.currentDelta(); |
|---|
| | 1261 | Element.hide(_17d); |
|---|
| | 1262 | if(!(_18e[0]==_18c.delta[0]&&_18e[1]==_18c.delta[1])){ |
|---|
| | 1263 | self.changeSchedule(_18c); |
|---|
| 1274 | | if(_193.constructor==String){ |
|---|
| 1275 | | return new Date(date.getFullYear(),date.getMonth(),_193); |
|---|
| 1276 | | }else{ |
|---|
| 1277 | | return new Date(date.getFullYear(),date.getMonth(),_193.id.getSuffix()); |
|---|
| 1278 | | } |
|---|
| 1279 | | },abstractSelect:function(_195,_196){ |
|---|
| 1280 | | var _197=null; |
|---|
| | 1273 | if(_192.constructor==String){ |
|---|
| | 1274 | return new Date(date.getFullYear(),date.getMonth(),_192); |
|---|
| | 1275 | }else{ |
|---|
| | 1276 | return new Date(date.getFullYear(),date.getMonth(),_192.id.getSuffix()); |
|---|
| | 1277 | } |
|---|
| | 1278 | },abstractSelect:function(_194,_195){ |
|---|
| | 1279 | var _196=null; |
|---|
| 1282 | | _197=this.findClickedElement(_195); |
|---|
| 1283 | | }else{ |
|---|
| 1284 | | _197=Event.element(_195); |
|---|
| 1285 | | if(_197.tagName!="TD"){ |
|---|
| 1286 | | _197=Element.getParentByTagName(["TD"],_197); |
|---|
| 1287 | | } |
|---|
| 1288 | | } |
|---|
| 1289 | | if(_197&&_197.id&&!_197.id.match(/emptyRow/)){ |
|---|
| 1290 | | var date=this.getDate(_197); |
|---|
| 1291 | | _196(date,_197); |
|---|
| | 1281 | _196=this.findClickedElement(_194); |
|---|
| | 1282 | }else{ |
|---|
| | 1283 | _196=Event.element(_194); |
|---|
| | 1284 | if(_196.tagName!="TD"){ |
|---|
| | 1285 | _196=Element.getParentByTagName(["TD"],_196); |
|---|
| | 1286 | } |
|---|
| | 1287 | } |
|---|
| | 1288 | if(_196&&_196.id&&!_196.id.match(/emptyRow/)){ |
|---|
| | 1289 | var date=this.getDate(_196); |
|---|
| | 1290 | _195(date,_196); |
|---|
| 1355 | | return _1ab.collect(function(d){ |
|---|
| 1356 | | return _1aa.getDate(d); |
|---|
| 1357 | | }); |
|---|
| 1358 | | } |
|---|
| 1359 | | },findClickedElement:function(_1ad){ |
|---|
| 1360 | | var _1ae=$(this.getScheduleContainerId()); |
|---|
| 1361 | | var _1af=Position.cumulativeOffset(_1ae); |
|---|
| 1362 | | var _1b0=Position.realOffset(_1ae).last(); |
|---|
| 1363 | | _1b0-=document.documentElement.scrollTop||document.body.scrollTop; |
|---|
| 1364 | | var x=Event.pointerX(_1ad)-_1af[0]; |
|---|
| 1365 | | var y=Event.pointerY(_1ad)-_1af[1]+_1b0; |
|---|
| 1366 | | var _1b3=Math.floor(y/this.column.height); |
|---|
| 1367 | | var _1b4=Math.floor(x/this.column.width); |
|---|
| 1368 | | return $(this.calendarTable.rows[_1b3].cells[_1b4]); |
|---|
| 1369 | | },multipleSelection:function(_1b5){ |
|---|
| | 1354 | return _1aa.collect(function(d){ |
|---|
| | 1355 | return _1a9.getDate(d); |
|---|
| | 1356 | }); |
|---|
| | 1357 | } |
|---|
| | 1358 | },findClickedElement:function(_1ac){ |
|---|
| | 1359 | var _1ad=$(this.getScheduleContainerId()); |
|---|
| | 1360 | var _1ae=Position.cumulativeOffset(_1ad); |
|---|
| | 1361 | var _1af=Position.realOffset(_1ad).last(); |
|---|
| | 1362 | _1af-=document.documentElement.scrollTop||document.body.scrollTop; |
|---|
| | 1363 | var x=Event.pointerX(_1ac)-_1ae[0]; |
|---|
| | 1364 | var y=Event.pointerY(_1ac)-_1ae[1]+_1af; |
|---|
| | 1365 | var _1b2=Math.floor(y/this.column.height); |
|---|
| | 1366 | var _1b3=Math.floor(x/this.column.width); |
|---|
| | 1367 | return $(this.calendarTable.rows[_1b2].cells[_1b3]); |
|---|
| | 1368 | },multipleSelection:function(_1b4){ |
|---|
| 1402 | | if(_1bf.doCell){ |
|---|
| 1403 | | _1bf.doCell(cell); |
|---|
| 1404 | | } |
|---|
| 1405 | | }); |
|---|
| 1406 | | }); |
|---|
| 1407 | | },findRow:function(_1c3){ |
|---|
| 1408 | | var _1c4=$(this.getCalendarTableId()); |
|---|
| 1409 | | return $A(_1c4.rows).detect(function(row){ |
|---|
| 1410 | | return row.rowIndex==_1c3; |
|---|
| 1411 | | }); |
|---|
| 1412 | | },findCell:function(_1c6,_1c7){ |
|---|
| 1413 | | return $A(this.findRow(_1c6).cells).detect(function(cell){ |
|---|
| 1414 | | return cell.cellIndex==_1c7; |
|---|
| | 1401 | if(_1be.doCell){ |
|---|
| | 1402 | _1be.doCell(cell); |
|---|
| | 1403 | } |
|---|
| | 1404 | }); |
|---|
| | 1405 | }); |
|---|
| | 1406 | },findRow:function(_1c2){ |
|---|
| | 1407 | var _1c3=$(this.getCalendarTableId()); |
|---|
| | 1408 | return $A(_1c3.rows).detect(function(row){ |
|---|
| | 1409 | return row.rowIndex==_1c2; |
|---|
| | 1410 | }); |
|---|
| | 1411 | },findCell:function(_1c5,_1c6){ |
|---|
| | 1412 | return $A(this.findRow(_1c5).cells).detect(function(cell){ |
|---|
| | 1413 | return cell.cellIndex==_1c6; |
|---|
| 1432 | | },changeSchedule:function(_1cf){ |
|---|
| 1433 | | var _1d0=_1cf.element; |
|---|
| 1434 | | var _1d1=_1d0.schedule; |
|---|
| 1435 | | this.calendar.cacheSchedule(_1d1); |
|---|
| 1436 | | var _1d2=$(this.getSelectorId()); |
|---|
| 1437 | | var top=parseInt(Element.getStyle(_1d2,"top"),10); |
|---|
| 1438 | | var _1d4=Math.floor(top/this.column.height); |
|---|
| 1439 | | var left=parseInt(Element.getStyle(_1d2,"left"),10); |
|---|
| 1440 | | var _1d6=Math.floor(left/this.column.width); |
|---|
| 1441 | | var _1d7=$(this.getCalendarTableId()); |
|---|
| 1442 | | var _1d8=_1d7.rows.length-1; |
|---|
| 1443 | | var _1d9=this.calendar.options.displayIndexes.length-1; |
|---|
| 1444 | | if((_1d6>=0&&_1d4>=0)&&(_1d6<=_1d9&&_1d4<=_1d8)){ |
|---|
| 1445 | | var cell=this.findCell(_1d4,_1d6); |
|---|
| | 1431 | },changeSchedule:function(_1ce){ |
|---|
| | 1432 | var _1cf=_1ce.element; |
|---|
| | 1433 | var _1d0=_1cf.schedule; |
|---|
| | 1434 | this.calendar.cacheSchedule(_1d0); |
|---|
| | 1435 | var _1d1=$(this.getSelectorId()); |
|---|
| | 1436 | var top=parseInt(Element.getStyle(_1d1,"top"),10); |
|---|
| | 1437 | var _1d3=Math.floor(top/this.column.height); |
|---|
| | 1438 | var left=parseInt(Element.getStyle(_1d1,"left"),10); |
|---|
| | 1439 | var _1d5=Math.floor(left/this.column.width); |
|---|
| | 1440 | var _1d6=$(this.getCalendarTableId()); |
|---|
| | 1441 | var _1d7=_1d6.rows.length-1; |
|---|
| | 1442 | var _1d8=this.calendar.options.displayIndexes.length-1; |
|---|
| | 1443 | if((_1d5>=0&&_1d3>=0)&&(_1d5<=_1d8&&_1d3<=_1d7)){ |
|---|
| | 1444 | var cell=this.findCell(_1d3,_1d5); |
|---|
| 1447 | | var _1dc=_1d0.cellDate.days()-DateUtil.toDate(_1d1.start).days(); |
|---|
| 1448 | | date.setDate(parseInt(cell.id.getSuffix(),10)-_1dc); |
|---|
| 1449 | | var diff=this.getDayDiff(_1d1); |
|---|
| 1450 | | var _1de=date.advance({days:diff}); |
|---|
| 1451 | | if(_1d1.start.month==date.getMonth()&&_1d1.start.day==date.getDate()&&_1d1.finish.month==_1de.getMonth()&&_1d1.finish.day==_1de.getDate()){ |
|---|
| | 1446 | var _1db=_1cf.cellDate.days()-DateUtil.toDate(_1d0.start).days(); |
|---|
| | 1447 | date.setDate(parseInt(cell.id.getSuffix(),10)-_1db); |
|---|
| | 1448 | var diff=this.getDayDiff(_1d0); |
|---|
| | 1449 | var _1dd=date.advance({days:diff}); |
|---|
| | 1450 | if(_1d0.start.month==date.getMonth()&&_1d0.start.day==date.getDate()&&_1d0.finish.month==_1dd.getMonth()&&_1d0.finish.day==_1dd.getDate()){ |
|---|
| 1455 | | _1d1.start.year=date.getFullYear(); |
|---|
| 1456 | | _1d1.start.month=date.getMonth(); |
|---|
| 1457 | | _1d1.start.day=date.getDate(); |
|---|
| 1458 | | _1d1.finish.year=_1de.getFullYear(); |
|---|
| 1459 | | _1d1.finish.month=_1de.getMonth(); |
|---|
| 1460 | | _1d1.finish.day=_1de.getDate(); |
|---|
| | 1454 | _1d0.start.year=date.getFullYear(); |
|---|
| | 1455 | _1d0.start.month=date.getMonth(); |
|---|
| | 1456 | _1d0.start.day=date.getDate(); |
|---|
| | 1457 | _1d0.finish.year=_1dd.getFullYear(); |
|---|
| | 1458 | _1d0.finish.month=_1dd.getMonth(); |
|---|
| | 1459 | _1d0.finish.day=_1dd.getDate(); |
|---|
| 1477 | | },updateTirm:function(_1e4){ |
|---|
| 1478 | | var _1e5=_1e4.schedule; |
|---|
| 1479 | | var _1e6=parseInt(Element.getStyle(_1e4,"width")); |
|---|
| 1480 | | var top=parseInt(Element.getStyle(_1e4,"top")); |
|---|
| 1481 | | var left=parseInt(Element.getStyle(_1e4,"left")); |
|---|
| 1482 | | var _1e9=Math.round((left+_1e6)/this.column.width)-1; |
|---|
| 1483 | | var _1ea=Math.round(top/this.column.height); |
|---|
| 1484 | | var cell=this.findCell(_1ea,_1e9); |
|---|
| 1485 | | var _1ec=_1e5.finish; |
|---|
| 1486 | | var _1ed=null; |
|---|
| | 1476 | },updateTirm:function(_1e3){ |
|---|
| | 1477 | var _1e4=_1e3.schedule; |
|---|
| | 1478 | var _1e5=parseInt(Element.getStyle(_1e3,"width")); |
|---|
| | 1479 | var top=parseInt(Element.getStyle(_1e3,"top")); |
|---|
| | 1480 | var left=parseInt(Element.getStyle(_1e3,"left")); |
|---|
| | 1481 | var _1e8=Math.round((left+_1e5)/this.column.width)-1; |
|---|
| | 1482 | var _1e9=Math.round(top/this.column.height); |
|---|
| | 1483 | var cell=this.findCell(_1e9,_1e8); |
|---|
| | 1484 | var _1eb=_1e4.finish; |
|---|
| | 1485 | var _1ec=null; |
|---|
| 1488 | | _1ed=this.dateMap[cell.id].toHash(); |
|---|
| 1489 | | }else{ |
|---|
| 1490 | | _1ed=new Date(this.calendar.date.getTime()); |
|---|
| 1491 | | _1ed.setDate(parseInt(cell.id.getSuffix(),10)); |
|---|
| 1492 | | _1ed=_1ed.toHash(); |
|---|
| 1493 | | } |
|---|
| 1494 | | _1ed.hour=_1ec.hour; |
|---|
| 1495 | | _1ed.min=_1ec.min; |
|---|
| 1496 | | if(DateUtil.toDate(_1e5.start).getTime()>=DateUtil.toDate(_1ed).getTime()){ |
|---|
| 1497 | | var _1ee=23; |
|---|
| 1498 | | var _1ef=55; |
|---|
| 1499 | | if(_1e5.start.hour==_1ee&&_1e5.start.min==_1ef){ |
|---|
| | 1487 | _1ec=this.dateMap[cell.id].toHash(); |
|---|
| | 1488 | }else{ |
|---|
| | 1489 | _1ec=new Date(this.calendar.date.getTime()); |
|---|
| | 1490 | _1ec.setDate(parseInt(cell.id.getSuffix(),10)); |
|---|
| | 1491 | _1ec=_1ec.toHash(); |
|---|
| | 1492 | } |
|---|
| | 1493 | _1ec.hour=_1eb.hour; |
|---|
| | 1494 | _1ec.min=_1eb.min; |
|---|
| | 1495 | if(DateUtil.toDate(_1e4.start).getTime()>=DateUtil.toDate(_1ec).getTime()){ |
|---|
| | 1496 | var _1ed=23; |
|---|
| | 1497 | var _1ee=55; |
|---|
| | 1498 | if(_1e4.start.hour==_1ed&&_1e4.start.min==_1ee){ |
|---|
| 1512 | | if(!((_1ed.year==_1ec.year)&&(_1ed.month==_1ec.month)&&(_1ed.day==_1ec.day))){ |
|---|
| 1513 | | this.calendar.options.updateTirm(_1e5); |
|---|
| 1514 | | } |
|---|
| 1515 | | },getTimeText:function(_1f0,_1f1){ |
|---|
| 1516 | | var _1f2=this.calendar; |
|---|
| 1517 | | return _1f2.formatTime(_1f0); |
|---|
| 1518 | | },getDayDiff:function(_1f3){ |
|---|
| 1519 | | return DateUtil.numberOfDays(this.toDate(_1f3.start),this.toDate(_1f3.finish)); |
|---|
| | 1511 | if(!((_1ec.year==_1eb.year)&&(_1ec.month==_1eb.month)&&(_1ec.day==_1eb.day))){ |
|---|
| | 1512 | this.calendar.options.updateTirm(_1e4); |
|---|
| | 1513 | } |
|---|
| | 1514 | },getTimeText:function(_1ef,_1f0){ |
|---|
| | 1515 | var _1f1=this.calendar; |
|---|
| | 1516 | return _1f1.formatTime(_1ef); |
|---|
| | 1517 | },getDayDiff:function(_1f2){ |
|---|
| | 1518 | return DateUtil.numberOfDays(this.toDate(_1f2.start),this.toDate(_1f2.finish)); |
|---|