Changeset 5776
- Timestamp:
- 06/02/08 14:17:23 (6 months ago)
- Files:
-
- spinelz/trunk/compress/javascripts/spinelz/calendar.js (modified) (34 diffs)
- spinelz/trunk/compress/javascripts/spinelz/spinelz_for_rubricks.js (modified) (34 diffs)
- spinelz/trunk/compress/stylesheets/spinelz/calendar.css (modified) (1 diff)
- spinelz/trunk/compress/stylesheets/spinelz/spinelz_for_rubricks.css (modified) (1 diff)
- spinelz/trunk/src/javascripts/spinelz/calendar.js (modified) (11 diffs)
- spinelz/trunk/src/stylesheets/spinelz/calendar.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinelz/trunk/compress/javascripts/spinelz/calendar.js
r5774 r5776 9 9 this.options=Object.extend({initDate:new Date(),cssPrefix:"custom_",holidays:[],schedules:[],size:Calendar.size.large,regularHoliday:[0,6],displayIndexes:[0,1,2,3,4,5,6],displayTime:[{hour:0,min:0},{hour:24,min:0}],weekIndex:0,dblclickListener:null,afterSelect:Prototype.emptyFunction,beforeRefresh:Prototype.emptyFunction,changeSchedule:Prototype.emptyFunction,changeCalendar:Prototype.emptyFunction,displayType:"month",highlightDay:true,beforeRemoveSchedule:function(){ 10 10 return true; 11 },dblclickSchedule:null,updateTirm:Prototype.emptyFunction,displayTimeLine:true,clickDateText:null,monthHeaderFormat:null,weekHeaderFormat:null,weekSubHeaderFormat:null,dayHeaderFormat:null,dayOfWeek:DateUtil.dayOfWeek,skipString:"... more",clickSkipNode:Prototype.emptyFunction,noEvent:false,build:true,endAfterBuild:Prototype.emptyFunction,enableCtrKey:false},arguments[1]||{});11 },dblclickSchedule:null,updateTirm:Prototype.emptyFunction,displayTimeLine:true,clickDateText:null,monthHeaderFormat:null,weekHeaderFormat:null,weekSubHeaderFormat:null,dayHeaderFormat:null,dayOfWeek:DateUtil.dayOfWeek,skipString:"... #{count} more",clickSkipNode:Prototype.emptyFunction,noEvent:false,build:true,endAfterBuild:Prototype.emptyFunction,enableCtrKey:false},arguments[1]||{}); 12 12 this.date=this.options.initDate; 13 13 this.options.holidays=this.toHolidayHash(this.options.holidays); … … 548 548 }}; 549 549 var AbstractCalendar=Class.create(); 550 AbstractCalendar.id={container:"container",scheduleContainer:"scheduleContainer",selector:"selector" };550 AbstractCalendar.id={container:"container",scheduleContainer:"scheduleContainer",selector:"selector",tooltip:"tooltip"}; 551 551 AbstractCalendar.prototype={destroy:Prototype.emptyFunction,beforeBuild:Prototype.emptyFunction,build:function(){ 552 return "<div id='"+this.getContainerId()+"' class='"+this.calendar.classNames.container+"'>"+this.buildHeader()+this.buildCalendar()+"< /div>";552 return "<div id='"+this.getContainerId()+"' class='"+this.calendar.classNames.container+"'>"+this.buildHeader()+this.buildCalendar()+"<div id=\""+this.getTooltipId+"\" class=\"calendar_tooltip\" style=\"display: none;\"></div>"+"</div>"; 553 553 },buildHeader:function(){ 554 554 var _96=this.calendar.options.noEvent; … … 622 622 },getContainerId:function(){ 623 623 return this.calendar.element.id.appendSuffix(AbstractCalendar.id.container); 624 },getTooltipId:function(){ 625 return this.calendar.element.id.appendSuffix(AbstractCalendar.id.tooltip); 624 626 },getScheduleContainerId:function(){ 625 627 return this.calendar.element.id.appendSuffix(AbstractCalendar.id.scheduleContainer); … … 710 712 },getCalendarTableId:function(){ 711 713 return this.ids.calTable; 714 },setSkipNode:function(){ 715 var _c1=new Template(this.calendar.options.skipString); 716 this.skipNode.each(function(_c2){ 717 _c2.value.innerHTML=_c1.evaluate({count:this.skipSchedules[_c2.key].length}); 718 }.bind(this)); 719 },clickSkipNode:function(){ 720 this.hideTooltip(); 721 this.calendar.options.clickSkipNode.apply(this,arguments); 722 },showTooltip:function(e,id,_c5){ 723 var _c6=$(this.getTooltipId()); 724 var _c7=this.skipSchedules[id]; 725 var _c8=null; 726 var _c9=null; 727 _c6.innerHTML=_c7.map(function(s){ 728 _c8=(DateUtil.toDate(s.start).sameDate(_c5))?s.start:{hour:0,min:0}; 729 _c9=(DateUtil.toDate(s.finish).sameDate(_c5))?s.finish:{hour:0,min:0}; 730 return this.calendar.formatTime(_c8)+"-"+this.calendar.formatTime(_c9)+" "+s.description; 731 }.bind(this)).join("<br />"); 732 Element.positionedByCursor(_c6,e,{top:10,left:10}); 733 _c6.show(); 734 },hideTooltip:function(){ 735 $(this.getTooltipId()).hide(); 712 736 }}; 713 737 var CalendarMonth=Class.create(); 714 738 CalendarMonth.id=["year","month","column","nextYear","nextMonth","preYear","preMonth","calTable","scheduleContainer","container","emptyRow"]; 715 739 Object.extend(CalendarMonth.prototype,AbstractCalendar.prototype); 716 Object.extend(CalendarMonth.prototype,{initialize:function(_c 1){717 this.calendar=_c 1;740 Object.extend(CalendarMonth.prototype,{initialize:function(_cb){ 741 this.calendar=_cb; 718 742 this.week=this.getWeek()[0]; 719 743 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarMonth.id); … … 722 746 return "<td class='"+this.calendar.classNames.preYears+"'>"+"<div id='"+this.ids.preYear+"' class='"+this.calendar.classNames.preYearMark+"'></div>"+"<div id='"+this.ids.preMonth+"' class='"+this.calendar.classNames.preMonthMark+"'></div>"+"</td>"; 723 747 },buildHeaderCenter:function(){ 724 var _c 2=[];748 var _cc=[]; 725 749 if(this.calendar.options.monthHeaderFormat){ 726 var _c 3=this.calendar.date;727 var _c 4=new Template(this.calendar.options.monthHeaderFormat).evaluate({year:_c3.getFullYear(),month:_c3.getMonth()+1});728 _c 2=[_c4," "];729 } 730 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.ids.month+"' class='"+this.calendar.classNames.ym+"'>"+(_c 2[0]||DateUtil.months[this.calendar.date.getMonth()])+"</span>"+"<span id='"+this.ids.year+"' class='"+this.calendar.classNames.ym+"'>"+(_c2[1]||this.calendar.date.getFullYear())+"</span>"+"</td>";750 var _cd=this.calendar.date; 751 var _ce=new Template(this.calendar.options.monthHeaderFormat).evaluate({year:_cd.getFullYear(),month:_cd.getMonth()+1}); 752 _cc=[_ce," "]; 753 } 754 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.ids.month+"' class='"+this.calendar.classNames.ym+"'>"+(_cc[0]||DateUtil.months[this.calendar.date.getMonth()])+"</span>"+"<span id='"+this.ids.year+"' class='"+this.calendar.classNames.ym+"'>"+(_cc[1]||this.calendar.date.getFullYear())+"</span>"+"</td>"; 731 755 },buildHeaderRight:function(){ 732 756 return "<td class='"+this.calendar.classNames.nextYears+"'>"+"<div id='"+this.ids.nextMonth+"' class='"+this.calendar.classNames.nextMonthMark+"'></div>"+"<div id='"+this.ids.nextYear+"' class='"+this.calendar.classNames.nextYearMark+"'></div>"+"</td>"; … … 734 758 return "<div>"+this.buildTableHeader()+this.buildScheduleContainer()+"</div>"; 735 759 },buildTableHeader:function(){ 736 var _c 5=100/this.calendar.options.displayIndexes.length+"%";737 var _ c6=this.calendar.options.displayIndexes.last();738 var _ c7=this.ids.column;739 var _ c8=this.calendar.options.displayIndexes.inject("",function(_c9,i){740 var id=_ c7.appendSuffix(i);760 var _cf=100/this.calendar.options.displayIndexes.length+"%"; 761 var _d0=this.calendar.options.displayIndexes.last(); 762 var _d1=this.ids.column; 763 var _d2=this.calendar.options.displayIndexes.inject("",function(_d3,i){ 764 var id=_d1.appendSuffix(i); 741 765 this.columnIds.push(id); 742 var _ cc=(_c6==i)?this.calendar.classNames.thRight:"";743 _ c9+="<th id='"+id+"' class='"+_cc+"' width='"+_c5+"'>"+this.calendar.options.dayOfWeek[i]+"</th>";744 return _ c9;766 var _d6=(_d0==i)?this.calendar.classNames.thRight:""; 767 _d3+="<th id='"+id+"' class='"+_d6+"' width='"+_cf+"'>"+this.calendar.options.dayOfWeek[i]+"</th>"; 768 return _d3; 745 769 }.bind(this)); 746 return "<table class='"+this.calendar.classNames.table+"'>"+"<tr>"+_ c8+"</tr>"+"</table>";770 return "<table class='"+this.calendar.classNames.table+"'>"+"<tr>"+_d2+"</tr>"+"</table>"; 747 771 },buildScheduleContainer:function(){ 748 var _ cd=(this.calendar.options.size=="large")?"position: relative":"";749 return "<div id='"+this.getScheduleContainerId()+"' style='"+_ cd+";'>"+this.buildTableData()+this.buildSelector()+"</div>";772 var _d7=(this.calendar.options.size=="large")?"position: relative":""; 773 return "<div id='"+this.getScheduleContainerId()+"' style='"+_d7+";'>"+this.buildTableData()+this.buildSelector()+"</div>"; 750 774 },buildTableData:function(){ 751 var _ ce=this.calendar.options.displayIndexes;752 var _ cf=new Date();753 var _d 0=this.calendar.date.getFullYear();754 var _d 1=this.calendar.date.getMonth();755 var _d 2=DateUtil.getFirstDate(_d0,_d1).getDay();756 var _d 3=DateUtil.getLastDate(_d0,_d1).getDate();775 var _d8=this.calendar.options.displayIndexes; 776 var _d9=new Date(); 777 var _da=this.calendar.date.getFullYear(); 778 var _db=this.calendar.date.getMonth(); 779 var _dc=DateUtil.getFirstDate(_da,_db).getDay(); 780 var _dd=DateUtil.getLastDate(_da,_db).getDate(); 757 781 var trs=[]; 758 782 var tds=[]; 759 var _ d6=100/_ce.length+"%";760 var _ d7=_ce.last();761 var _ d8,_d9,_da,_db,_dc,i=null;783 var _e0=100/_d8.length+"%"; 784 var _e1=_d8.last(); 785 var _e2,_e3,_e4,_e5,_e6,i=null; 762 786 this.dateMap={}; 763 var _ de=this.calendar.options.weekIndex;764 var _ df=DateUtil.dayOfWeek.length*6;787 var _e8=this.calendar.options.weekIndex; 788 var _e9=DateUtil.dayOfWeek.length*6; 765 789 var i=null; 766 790 var day=1; 767 if(_ de<=_d2){768 i=_ de;769 _ df+=i;770 }else{ 771 i=_ de-7;772 _ df-=i;773 } 774 var _e 1=_d2-_de;775 if(_e 1<0){776 _e 1+DateUtil.dayOfWeek.length;777 } 778 if((_d 3+_e1)>_df){779 _ df+=DateUtil.dayOfWeek.length;780 } 781 var _e 2=_de;782 var _e 3=0;783 for(;i<_ df;i++){784 if(_ ce.include(_e2)){785 var _e 4=(_e2==_d7)?this.calendar.classNames.tdRight:"";786 if(i<_d 2){787 var _e 5=i-_d2+1;788 _ db=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),_e5);789 tds.push(this.buildEmptyRow(_ db,_d6,_e4,_e5));790 }else{ 791 if(day>_d 3){792 _ db=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day);793 tds.push(this.buildEmptyRow(_ db,_d6,_e4,day));794 }else{ 795 if(i==_d 2){796 _ df+=_e3;797 } 798 _ db=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day);799 _ d9=this.calendar.options.holidays[_db.toDateString()];791 if(_e8<=_dc){ 792 i=_e8; 793 _e9+=i; 794 }else{ 795 i=_e8-7; 796 _e9-=i; 797 } 798 var _eb=_dc-_e8; 799 if(_eb<0){ 800 _eb+DateUtil.dayOfWeek.length; 801 } 802 if((_dd+_eb)>_e9){ 803 _e9+=DateUtil.dayOfWeek.length; 804 } 805 var _ec=_e8; 806 var _ed=0; 807 for(;i<_e9;i++){ 808 if(_d8.include(_ec)){ 809 var _ee=(_ec==_e1)?this.calendar.classNames.tdRight:""; 810 if(i<_dc){ 811 var _ef=i-_dc+1; 812 _e5=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),_ef); 813 tds.push(this.buildEmptyRow(_e5,_e0,_ee,_ef)); 814 }else{ 815 if(day>_dd){ 816 _e5=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day); 817 tds.push(this.buildEmptyRow(_e5,_e0,_ee,day)); 818 }else{ 819 if(i==_dc){ 820 _e9+=_ed; 821 } 822 _e5=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day); 823 _e3=this.calendar.options.holidays[_e5.toDateString()]; 800 824 if(this.calendar.options.size==Calendar.size.large){ 801 tds.push(this.buildLargeRow(_ db,_d9,_cf,_d6,_e4));802 }else{ 803 _ da=this.calendar.options.schedules.detect(function(_e6){804 var _ e7=DateUtil.toDate(_e6.start);805 return _ db.sameDate(_e7);806 }); 807 tds.push(this.buildSmallRow(_ db,_d9,_da,_cf,_d6,_e4));808 } 809 } 810 } 811 _e 3++;812 } 813 if(i>=_d 2){825 tds.push(this.buildLargeRow(_e5,_e3,_d9,_e0,_ee)); 826 }else{ 827 _e4=this.calendar.options.schedules.detect(function(_f0){ 828 var _f1=DateUtil.toDate(_f0.start); 829 return _e5.sameDate(_f1); 830 }); 831 tds.push(this.buildSmallRow(_e5,_e3,_e4,_d9,_e0,_ee)); 832 } 833 } 834 } 835 _ed++; 836 } 837 if(i>=_dc){ 814 838 day++; 815 839 } 816 if(_e 2==_d7){840 if(_ec==_e1){ 817 841 if(!(tds.first().match(/empty/)&&tds.last().match(/empty/))){ 818 842 trs.push("<tr>"+tds.join("")+"</tr>"); … … 820 844 tds=[]; 821 845 } 822 if(_e 2>=6){823 _e 2=0;824 }else{ 825 _e 2++;846 if(_ec>=6){ 847 _ec=0; 848 }else{ 849 _ec++; 826 850 } 827 851 } 828 852 this.rowMax=trs.length-1; 829 853 return "<table id='"+this.getCalendarTableId()+"' class='"+this.calendar.classNames.table+"'>"+trs.join("")+"</table>"; 830 },buildEmptyRow:function(_ e8,_e9,_ea,_eb){831 var id=this.ids.emptyRow.appendSuffix(_ eb);832 this.dateMap[id]=_ e8;833 return "<td id='"+id+"' class='"+_ ea+"' width='"+_e9+"'> </td>";834 },buildLargeRow:function(_ ed,_ee,_ef,_f0,_f1){835 var _f 2=null;836 var _f 3=(_ed.days()==_ef.days())?this.calendar.classNames.highlightDay:"";837 var _f 4=this.calendar.options.clickDateText;838 if(_f 4||(_f4==null)){839 _f 2="<span class='"+_f3+"'>"+_ed.getDate()+"</span>";840 }else{ 841 _f 2="<span class='"+_f3+"' style='text-decoration: none;'>"+_ed.getDate()+"</span>";842 } 843 var _f 5="";844 var _f6="";845 if(_ ee){846 _f 5=this.calendar.classNames.holiday;847 _f6="<span class='"+this.calendar.classNames.holidayName+"'>"+_ee.name+"</span>";848 }else{ 849 if(this.calendar.isRegularHoliday(_ ed.getDay())){850 _f 5=this.calendar.classNames.regularHoliday;851 }else{ 852 _f 5=this.calendar.classNames.date;853 } 854 } 855 _f 1=[_f5,_f1];856 var id=this.getDateId(_ ed);857 this.dateMap[id]=_ ed;858 return "<td id='"+id+"' class='"+_f 1.join(" ")+"' width='"+_f0+"'>"+"<div class='"+this.calendar.classNames.dateContainer+"'>"+_f2+_f6+"</div>"+"</td>";859 },buildSmallRow:function( _f8,_f9,_fa,_fb,_fc,_fd){860 var id=this.getDateId( _f8);861 this.dateMap[id]= _f8;862 var _ ff=$H({id:id,width:_fc});863 _ fd=[];864 if(_ fa){865 _ fd.push(this.calendar.classNames.schedule);866 var _10 0=_fa[0];867 if(_10 0){868 _ ff.title=_100.description;869 } 870 }else{ 871 if(_ f9){872 _ fd.push(this.calendar.classNames.holiday);873 _ ff.title=_f9.name.stripTags();874 }else{ 875 if(this.calendar.isRegularHoliday( _f8.getDay())){876 _ fd.push(this.calendar.classNames.regularHoliday);877 }else{ 878 _ fd.push(this.calendar.classNames.date);879 } 880 } 881 } 882 if( _f8.days()==_fb.days()){883 _ fd.push(Calendar.className.highlightDay);884 } 885 _ fd.push(_fd);886 _ fd=_fd.join(" ");887 _ ff=_ff.inject("",function(html,pair){854 },buildEmptyRow:function(_f2,_f3,_f4,_f5){ 855 var id=this.ids.emptyRow.appendSuffix(_f5); 856 this.dateMap[id]=_f2; 857 return "<td id='"+id+"' class='"+_f4+"' width='"+_f3+"'> </td>"; 858 },buildLargeRow:function(_f7,_f8,_f9,_fa,_fb){ 859 var _fc=null; 860 var _fd=(_f7.days()==_f9.days())?this.calendar.classNames.highlightDay:""; 861 var _fe=this.calendar.options.clickDateText; 862 if(_fe||(_fe==null)){ 863 _fc="<span class='"+_fd+"'>"+_f7.getDate()+"</span>"; 864 }else{ 865 _fc="<span class='"+_fd+"' style='text-decoration: none;'>"+_f7.getDate()+"</span>"; 866 } 867 var _ff=""; 868 var name=""; 869 if(_f8){ 870 _ff=this.calendar.classNames.holiday; 871 name="<span class='"+this.calendar.classNames.holidayName+"'>"+_f8.name+"</span>"; 872 }else{ 873 if(this.calendar.isRegularHoliday(_f7.getDay())){ 874 _ff=this.calendar.classNames.regularHoliday; 875 }else{ 876 _ff=this.calendar.classNames.date; 877 } 878 } 879 _fb=[_ff,_fb]; 880 var id=this.getDateId(_f7); 881 this.dateMap[id]=_f7; 882 return "<td id='"+id+"' class='"+_fb.join(" ")+"' width='"+_fa+"'>"+"<div class='"+this.calendar.classNames.dateContainer+"'>"+_fc+name+"</div>"+"</td>"; 883 },buildSmallRow:function(date,_103,_104,_105,_106,_107){ 884 var id=this.getDateId(date); 885 this.dateMap[id]=date; 886 var _109=$H({id:id,width:_106}); 887 _107=[]; 888 if(_104){ 889 _107.push(this.calendar.classNames.schedule); 890 var _10a=_104[0]; 891 if(_10a){ 892 _109.title=_10a.description; 893 } 894 }else{ 895 if(_103){ 896 _107.push(this.calendar.classNames.holiday); 897 _109.title=_103.name.stripTags(); 898 }else{ 899 if(this.calendar.isRegularHoliday(date.getDay())){ 900 _107.push(this.calendar.classNames.regularHoliday); 901 }else{ 902 _107.push(this.calendar.classNames.date); 903 } 904 } 905 } 906 if(date.days()==_105.days()){ 907 _107.push(Calendar.className.highlightDay); 908 } 909 _107.push(_107); 910 _107=_107.join(" "); 911 _109=_109.inject("",function(html,pair){ 888 912 return html+" "+pair.key+"=\""+pair.value+"\""; 889 913 }); 890 return "<td class=\""+_ fd+"\""+_ff+">"+_f8.getDate()+"</td>";914 return "<td class=\""+_107+"\""+_109+">"+date.getDate()+"</td>"; 891 915 },beforeBuild:function(){ 892 916 this.column={}; … … 895 919 rule=CssUtil.getCssRuleBySelectorText("."+Calendar.className.dateContainer); 896 920 this.column.dateTextHeight=parseInt(rule.style["height"],10); 897 },buildSchedule:function(_10 4,_105){898 var id="scheduleItem_"+_10 4.id;899 var _1 07=(_104.edit==undefined||_104.edit);921 },buildSchedule:function(_10e,_10f){ 922 var id="scheduleItem_"+_10e.id; 923 var _111=(_10e.edit==undefined||_10e.edit); 900 924 var item=Builder.node("DIV",{id:id}); 901 var _1 09=DateUtil.toDate(_104.start);902 var _1 0a=DateUtil.toDate(_104.finish);903 if(_10 4.finish.hour==0&&_104.finish.min==0){904 _1 0a=_10a.advance({days:-1});905 } 906 var _1 0b=this.calendar.options.noEvent;907 var _1 0c={};925 var _113=DateUtil.toDate(_10e.start); 926 var _114=DateUtil.toDate(_10e.finish); 927 if(_10e.finish.hour==0&&_10e.finish.min==0){ 928 _114=_114.advance({days:-1}); 929 } 930 var _115=this.calendar.options.noEvent; 931 var _116={}; 908 932 if(!UserAgent.isIE()){ 909 _1 0c.whiteSpace="nowrap";910 } 911 if(_1 0b){912 _1 0c.cursor="default";913 } 914 if(_1 09.sameDate(_10a)){933 _116.whiteSpace="nowrap"; 934 } 935 if(_115){ 936 _116.cursor="default"; 937 } 938 if(_113.sameDate(_114)){ 915 939 this.calendar.css.addClassNames(item,"scheduleItemNoBorder"); 916 940 }else{ 917 if(_10 4.background_color){918 _1 0c.backgroundColor=_104.background_color;919 } 920 if(_10 4.frame_color){921 _1 0c.border="2px solid "+_104.frame_color;941 if(_10e.background_color){ 942 _116.backgroundColor=_10e.background_color; 943 } 944 if(_10e.frame_color){ 945 _116.border="2px solid "+_10e.frame_color; 922 946 } 923 947 this.calendar.css.addClassNames(item,"scheduleItemLarge"); 924 948 } 925 Element.setStyle(item,_1 0c);926 if(_1 07){927 var _1 0d=Builder.node("DIV",{id:"scheduleDeleteImg_"+_104.id,className:this.calendar.css.joinClassNames("deleteImg")});928 Element.hide(_1 0d);929 item.appendChild(_1 0d);930 if(!_1 0b){931 Event.observe(_1 0d,"click",this.clickDeleteImage.bind(this,_104));932 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_1 0d));933 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_1 0d));934 } 935 } 936 if(!_1 0b&&this.calendar.options.dblclickSchedule){937 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_10 4));938 } 939 var _1 0e=null;940 if(_1 07){941 _1 0e=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")});942 if(_1 0b){943 Element.hide(_1 0e);944 } 945 item.appendChild(_1 0e);949 Element.setStyle(item,_116); 950 if(_111){ 951 var _117=Builder.node("DIV",{id:"scheduleDeleteImg_"+_10e.id,className:this.calendar.css.joinClassNames("deleteImg")}); 952 Element.hide(_117); 953 item.appendChild(_117); 954 if(!_115){ 955 Event.observe(_117,"click",this.clickDeleteImage.bind(this,_10e)); 956 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_117)); 957 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_117)); 958 } 959 } 960 if(!_115&&this.calendar.options.dblclickSchedule){ 961 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_10e)); 962 } 963 var _118=null; 964 if(_111){ 965 _118=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 966 if(_115){ 967 Element.hide(_118); 968 } 969 item.appendChild(_118); 946 970 } 947 971 var icon=null; 948 if(_10 4.icon){949 icon=Builder.node("IMG",{src:_10 4.icon,alt:"icon",style:"float: left;",width:16,height:16});972 if(_10e.icon){ 973 icon=Builder.node("IMG",{src:_10e.icon,alt:"icon",style:"float: left;",width:16,height:16}); 950 974 item.appendChild(icon); 951 975 } 952 if(!_10 4.publicity){976 if(!_10e.publicity){ 953 977 if(Calendar.privateImgPath){ 954 978 icon=Builder.node("IMG",{src:Calendar.privateImgPath,alt:"private",style:"float: left;",width:16,height:16}); 955 979 item.appendChild(icon); 956 980 }else{ 957 icon=Builder.node("DIV",{id:"private_img_"+_10 4.id});981 icon=Builder.node("DIV",{id:"private_img_"+_10e.id}); 958 982 this.calendar.css.addClassNames(icon,"privateImg"); 959 983 item.appendChild(icon); … … 961 985 } 962 986 var body=Builder.node("DIV"); 963 var text=this.getTimeText((_10 5)?_104.start:{hour:"0",min:"0"},_104.finish);964 var _11 2=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]);965 this.calendar.css.addClassNames(_11 2,"scheduleTimeArea");966 item.appendChild(_11 2);967 var _11 3=_104.description.unescapeHTML();968 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_11 3]));969 item.title=text+"-"+this.calendar.formatTime(_10 4.finish)+" "+_113;970 item.schedule=_10 4;971 return [item,_1 0e];972 },adjustScheduleStyle:function(item,_11 5,_116,_117){987 var text=this.getTimeText((_10f)?_10e.start:{hour:"0",min:"0"},_10e.finish); 988 var _11c=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]); 989 this.calendar.css.addClassNames(_11c,"scheduleTimeArea"); 990 item.appendChild(_11c); 991 var _11d=_10e.description.unescapeHTML(); 992 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_11d])); 993 item.title=text+"-"+this.calendar.formatTime(_10e.finish)+" "+_11d; 994 item.schedule=_10e; 995 return [item,_118]; 996 },adjustScheduleStyle:function(item,_11f,_120,_121){ 973 997 var self=this; 974 var _1 19=parseInt(Element.getStyle(item,"height"),10);998 var _123=parseInt(Element.getStyle(item,"height"),10); 975 999 var top=parseInt(Element.getStyle(item,"top"),10); 976 var _1 1b=this.getScheduleRange(item);1000 var _125=this.getScheduleRange(item); 977 1001 var tops=[]; 978 var _1 1d=3;979 _1 17.each(function(_11e){980 var _1 1f=self.getScheduleRange(_11e);981 if(_1 1b.any(function(r){982 return _1 1f.include(r);1002 var _127=3; 1003 _121.each(function(_128){ 1004 var _129=self.getScheduleRange(_128); 1005 if(_125.any(function(r){ 1006 return _129.include(r); 983 1007 })){ 984 tops.push(_1 1e.topIndex);985 } 986 }); 987 var _12 1=$R(0,tops.length,true).detect(function(i){1008 tops.push(_128.topIndex); 1009 } 1010 }); 1011 var _12b=$R(0,tops.length,true).detect(function(i){ 988 1012 return !tops.include(i); 989 1013 }); 990 if(isNaN(_12 1)){991 _12 1=tops.length;992 } 993 item.topIndex=_12 1;994 Element.setStyle(item,{top:top+(_1 19+2)*_121+"px"});995 if(_12 1>=_11d){1014 if(isNaN(_12b)){ 1015 _12b=tops.length; 1016 } 1017 item.topIndex=_12b; 1018 Element.setStyle(item,{top:top+(_123+2)*_12b+"px"}); 1019 if(_12b>=_127){ 996 1020 Element.hide(item); 997 var node=this.buildSkipSchedule(_11 5+"_"+_116);1021 var node=this.buildSkipSchedule(_11f+"_"+_120,item); 998 1022 if(node){ 999 1023 var left=Element.getStyle(item,"left"); 1000 Element.setStyle(node,{top:top+(_1 19+2)*_121+"px",left:left});1024 Element.setStyle(node,{top:top+(_123+2)*_12b+"px",left:left}); 1001 1025 } 1002 1026 return node; 1003 1027 } 1004 },buildSkipSchedule:function(_12 5){1005 var id=this.calendar.element.id.appendSuffix(_12 5);1028 },buildSkipSchedule:function(_12f,item){ 1029 var id=this.calendar.element.id.appendSuffix(_12f); 1006 1030 if(!this.skipNode[id]){ 1007 var node=Builder.node("a",{id:id,style:"display: block; z-index: 1000; cursor: pointer;",href:"javascript:void(0);"},[this.calendar.options.skipString]); 1031 var _132=this.getAdjustSize()+(UserAgent.isIE()?0.5:0); 1032 var _133=this.column.width+_132-1+"px"; 1033 var node=Builder.node("a",{id:id,style:"display: block; z-index: 1000; cursor: pointer; width: "+_133+";",href:"javascript:void(0);"},["more"]); 1008 1034 this.calendar.css.addClassNames(node,"skipNode"); 1035 node.skipId=id; 1009 1036 this.skipNode[id]=node; 1037 this.skipSchedules[id]=[item.schedule]; 1010 1038 return node; 1011 1039 } 1040 this.skipSchedules[id].push(item.schedule); 1012 1041 },getScheduleRange:function(item){ 1013 1042 return $R(0,item.length,true).map(function(i){ 1014 1043 return item.cellIndex+i; 1015 1044 }); 1016 },setScheduleBaseStyle:function(item,_1 2b,_12c,_12d){1017 var _1 2e=this.column.height;1018 var top=_1 2e*_12b+this.column.dateTextHeight;1019 var _13 0=this.getAdjustSize()+(UserAgent.isIE()?0.5:0);1020 Element.setStyle(item,{top:top+"px",width:this.column.width*_1 2d+_130*(_12d-1)+"px",left:this.column.width*_12c+_12c*_130+"px"});1045 },setScheduleBaseStyle:function(item,_138,_139,_13a){ 1046 var _13b=this.column.height; 1047 var top=_13b*_138+this.column.dateTextHeight; 1048 var _13d=this.getAdjustSize()+(UserAgent.isIE()?0.5:0); 1049 Element.setStyle(item,{top:top+"px",width:this.column.width*_13a+_13d*(_13a-1)+"px",left:this.column.width*_139+_139*_13d+"px"}); 1021 1050 },afterBuild:function(){ 1051 var _13e=this.getTooltipId(); 1052 if($(_13e)){ 1053 Element.appendToBody(_13e); 1054 } 1022 1055 this.scheduleNodes=[]; 1023 1056 this.skipNode=$H({}); 1057 this.skipSchedules=$H({}); 1024 1058 this.hasInvisibleSchedule=false; 1025 1059 if(this.calendar.options.size!=Calendar.size.small){ … … 1030 1064 this.setSelector(); 1031 1065 var self=this; 1032 var _1 32=this.calendar.options.displayIndexes;1033 var _1 33=this.getDragDistance();1034 var _1 34=$R(0,$(this.getCalendarTableId()).rows.length).map(function(){1066 var _140=this.calendar.options.displayIndexes; 1067 var _141=this.getDragDistance(); 1068 var _142=$R(0,$(this.getCalendarTableId()).rows.length).map(function(){ 1035 1069 return []; 1036 1070 }); 1037 1071 var date=this.calendar.date; 1038 var _1 36=DateUtil.getFirstDate(date.getFullYear(),date.getMonth());1039 var _1 37=_136.days();1040 var _1 38=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days();1041 self.calendar.options.schedules.each(function(_1 39,_13a){1042 var _1 3b=self.toDate(_139.start);1043 var _1 3c=_13b.days();1044 var _1 3d=self.toDate(_139.finish);1045 var _1 3e=_13d.days();1046 var days=self.getDayDiff(_1 39);1047 if(_1 39.finish.hour==0&&_139.finish.min==0){1072 var _144=DateUtil.getFirstDate(date.getFullYear(),date.getMonth()); 1073 var _145=_144.days(); 1074 var _146=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days(); 1075 self.calendar.options.schedules.each(function(_147,_148){ 1076 var _149=self.toDate(_147.start); 1077 var _14a=_149.days(); 1078 var _14b=self.toDate(_147.finish); 1079 var _14c=_14b.days(); 1080 var days=self.getDayDiff(_147); 1081 if(_147.finish.hour==0&&_147.finish.min==0){ 1048 1082 days--; 1049 1083 } 1050 if((_13c>=_137&&_13c<=_138)||(_13e>=_137&&_13e<=_138)){ 1051 if(!_136.sameMonth(_13b)){ 1052 _13b=_136; 1053 } 1054 self.setSchedule(_139,_134,_133,days); 1055 } 1056 }); 1084 if((_14a>=_145&&_14a<=_146)||(_14c>=_145&&_14c<=_146)){ 1085 if(!_144.sameMonth(_149)){ 1086 _149=_144; 1087 } 1088 self.setSchedule(_147,_142,_141,days); 1089 } 1090 }); 1091 this.setSkipNode(); 1057 1092 this.calendar.options.endAfterBuild(); 1058 1093 } … … 1076 1111 } 1077 1112 } 1078 },setSchedule:function(_1 42,_143,_144,days){1079 var _1 46=[];1080 var _1 47=6;1081 var _1 48=DateUtil.toDate(_142.start);1082 var date=_1 48;1083 var _1 4a=this.calendar.options.displayIndexes;1084 var _1 4b=this.calendar.date;1085 var _1 4c=this.calendar.options.noEvent;1086 var _1 4d=this.calendar.options.clickSkipNode;1113 },setSchedule:function(_150,_151,_152,days){ 1114 var _154=[]; 1115 var _155=6; 1116 var _156=DateUtil.toDate(_150.start); 1117 var date=_156; 1118 var _158=this.calendar.options.displayIndexes; 1119 var _159=this.calendar.date; 1120 var _15a=this.calendar.options.noEvent; 1121 var _15b=this.calendar.options.clickSkipNode; 1087 1122 while(days>=0){ 1088 var _1 4e=this.getLastWday(date);1089 var _1 4f=days+1;1090 var _15 0=date.getDay();1091 var _15 1=date.advance({days:_14f-1});1092 if(_15 1.getTime()>_14e.getTime()){1093 _15 1=_14e;1094 _1 4f=_151.days()-date.days()+1;1095 } 1096 var _1 52=_151.getDay();1097 var _1 53=null;1098 if(_15 0<=_152){1099 _1 53=$R(_150,_152,false);1100 }else{ 1101 _1 53=$R(0,_152,false).toArray().concat($R(_150,_147,false).toArray());1102 } 1103 var _1 54=_153.findAll(function(day){1104 return _1 4a.include(day);1123 var _15c=this.getLastWday(date); 1124 var _15d=days+1; 1125 var _15e=date.getDay(); 1126 var _15f=date.advance({days:_15d-1}); 1127 if(_15f.getTime()>_15c.getTime()){ 1128 _15f=_15c; 1129 _15d=_15f.days()-date.days()+1; 1130 } 1131 var _160=_15f.getDay(); 1132 var _161=null; 1133 if(_15e<=_160){ 1134 _161=$R(_15e,_160,false); 1135 }else{ 1136 _161=$R(0,_160,false).toArray().concat($R(_15e,_155,false).toArray()); 1137 } 1138 var _162=_161.findAll(function(day){ 1139 return _158.include(day); 1105 1140 }).length; 1106 var _1 56=new Date(date.getTime());1107 while(_1 56.days()<=_151.days()){1108 if(_1 56.getMonth()==_14b.getMonth()){1109 var _1 57=this.getCellPosition(_156.getDate());1110 if(_1 57){1111 var _1 58=_157.rowIndex;1112 var _1 59=_157.cellIndex;1113 var _1 5a=this.buildSchedule(_142,_148.sameDate(_156));1114 var item=_1 5a.first();1115 item.length=_1 54;1116 item.cellIndex=_1 59;1117 item.cellDate=_1 56;1141 var _164=new Date(date.getTime()); 1142 while(_164.days()<=_15f.days()){ 1143 if(_164.getMonth()==_159.getMonth()){ 1144 var _165=this.getCellPosition(_164.getDate()); 1145 if(_165){ 1146 var _166=_165.rowIndex; 1147 var _167=_165.cellIndex; 1148 var _168=this.buildSchedule(_150,_156.sameDate(_164)); 1149 var item=_168.first(); 1150 item.length=_162; 1151 item.cellIndex=_167; 1152 item.cellDate=_164; 1118 1153 this.container.appendChild(item); 1119 this.setScheduleBaseStyle(item,_158,_159,_154); 1120 var _15c=this.adjustScheduleStyle(item,_158,_159,_143[_158]); 1121 if(_15c){ 1122 this.container.appendChild(_15c); 1123 Event.observe(_15c,"click",_14d.bindAsEventListener(this,_156)); 1124 } 1125 if(!_14c&&((_142.edit==undefined)||_142.edit)){ 1126 this.setDraggable(item,_15a.last(),_144); 1154 this.setScheduleBaseStyle(item,_166,_167,_162); 1155 var _16a=this.adjustScheduleStyle(item,_166,_167,_151[_166]); 1156 if(_16a){ 1157 this.container.appendChild(_16a); 1158 Event.observe(_16a,"click",this.clickSkipNode.bindAsEventListener(this,_164)); 1159 Event.observe(_16a,"mouseover",this.showTooltip.bindAsEventListener(this,_16a.skipId,_164)); 1160 Event.observe(_16a,"mouseout",this.hideTooltip.bindAsEventListener(this)); 1161 } 1162 if(!_15a&&((_150.edit==undefined)||_150.edit)){ 1163 this.setDraggable(item,_168.last(),_152); 1127 1164 this.setResize(item); 1128 1165 } 1129 _1 43[_158].push(item);1166 _151[_166].push(item); 1130 1167 this.scheduleNodes.push(item); 1131 1168 break; 1132 1169 }else{ 1133 if(_1 4a.include(_156.getDay())){1134 _1 54--;1170 if(_158.include(_164.getDay())){ 1171 _162--; 1135 1172 }else{ 1136 1173 this.hasInvisibleSchedule=true; … … 1138 1175 } 1139 1176 }else{ 1140 if(_1 4a.include(_156.getDay())){1141 _1 54--;1142 } 1143 } 1144 _1 56=_156.advance({days:1});1145 } 1146 if(_1 46.length==0){1147 days-=_1 4f;1177 if(_158.include(_164.getDay())){ 1178 _162--; 1179 } 1180 } 1181 _164=_164.advance({days:1}); 1182 } 1183 if(_154.length==0){ 1184 days-=_15d; 1148 1185 }else{ 1149 1186 days-=7; 1150 1187 } 1151 var date=_15 1.advance({days:1});1188 var date=_15f.advance({days:1}); 1152 1189 if(item){ 1153 _1 46.push(item);1190 _154.push(item); 1154 1191 } 1155 1192 } 1156 1193 var self=this; 1157 if(!_1 4c){1158 _1 46.each(function(item){1159 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_1 46));1160 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_1 46));1194 if(!_15a){ 1195 _154.each(function(item){ 1196 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_154)); 1197 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_154)); 1161 1198 }); 1162 1199 } … … 1165 1202 this.calendar.setIndex(); 1166 1203 } 1167 var _16 0=this.calendar.wdays.indexOf(date.getDay())+1;1168 return date.advance({days:this.calendar.wdays.length-_16 0});1204 var _16e=this.calendar.wdays.indexOf(date.getDay())+1; 1205 return date.advance({days:this.calendar.wdays.length-_16e}); 1169 1206 },setSelector:function(){ 1170 var _16 1=$(this.getSelectorId());1171 Element.setStyle(_16 1,{width:this.column.width+"px",height:this.column.height-2+"px"});1172 Element.setOpacity(_16 1,0.6);1173 },setDraggable:function(item,_1 63,_164){1207 var _16f=$(this.getSelectorId()); 1208 Element.setStyle(_16f,{width:this.column.width+"px",height:this.column.height-2+"px"}); 1209 Element.setOpacity(_16f,0.6); 1210 },setDraggable:function(item,_171,_172){ 1174 1211 var self=this; 1175 var _1 66=Position.cumulativeOffset(this.container);1176 var _1 67=$(this.getSelectorId());1177 var _1 68=this.column.width+(UserAgent.isIE()?0.5:0);1178 var _1 69=this.column.height+(UserAgent.isIE()?1:0);1179 var _1 6a=this.rowMax||$(this.getCalendarTableId()).rows.length;1180 var _1 6b=this.calendar.options.displayIndexes.length-1;1181 var _1 6c=this.getAdjustSize();1182 new Draggable(item,{handle:_1 63,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_16d){1183 Element.show(_1 67);1184 },onDrag:function(_1 6e,_16f){1185 var _17 0=_16e.element;1186 var top=parseInt(Element.getStyle(_17 0,"top"),10);1187 var _1 72=Math.floor(top/_169);1188 var left=parseInt(Element.getStyle(_17 0,"left"),10);1189 var _1 74=Math.floor(left/_168);1190 if((_1 74>=0&&_172>=0)&&(_174<=_16b&&_172<=_16a)){1191 Element.setStyle(_1 67,{left:_168*_174+_16c*_174+"px",top:_169*_172+"px"});1192 } 1193 },onEnd:function(_1 75){1194 Element.hide(_1 67);1195 self.changeSchedule(_1 75);1212 var _174=Position.cumulativeOffset(this.container); 1213 var _175=$(this.getSelectorId()); 1214 var _176=this.column.width+(UserAgent.isIE()?0.5:0); 1215 var _177=this.column.height+(UserAgent.isIE()?1:0); 1216 var _178=this.rowMax||$(this.getCalendarTableId()).rows.length; 1217 var _179=this.calendar.options.displayIndexes.length-1; 1218 var _17a=this.getAdjustSize(); 1219 new Draggable(item,{handle:_171,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_17b){ 1220 Element.show(_175); 1221 },onDrag:function(_17c,_17d){ 1222 var _17e=_17c.element; 1223 var top=parseInt(Element.getStyle(_17e,"top"),10); 1224 var _180=Math.floor(top/_177); 1225 var left=parseInt(Element.getStyle(_17e,"left"),10); 1226 var _182=Math.floor(left/_176); 1227 if((_182>=0&&_180>=0)&&(_182<=_179&&_180<=_178)){ 1228 Element.setStyle(_175,{left:_176*_182+_17a*_182+"px",top:_177*_180+"px"}); 1229 } 1230 },onEnd:function(_183){ 1231 Element.hide(_175); 1232 self.changeSchedule(_183); 1196 1233 }}); 1197 1234 },setResize:function(item){ 1198 1235 var self=this; 1199 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_1 78){1200 self.updateTirm(_1 78);1236 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_186){ 1237 self.updateTirm(_186); 1201 1238 }}); 1202 },getDate:function(_1 79){1239 },getDate:function(_187){ 1203 1240 var date=this.calendar.date; 1204 if(_1 79.constructor==String){1205 return new Date(date.getFullYear(),date.getMonth(),_1 79);1206 }else{ 1207 return new Date(date.getFullYear(),date.getMonth(),_1 79.id.getSuffix());1208 } 1209 },abstractSelect:function(_1 7b,_17c){1210 var _1 7d=null;1241 if(_187.constructor==String){ 1242 return new Date(date.getFullYear(),date.getMonth(),_187); 1243 }else{ 1244 return new Date(date.getFullYear(),date.getMonth(),_187.id.getSuffix()); 1245 } 1246 },abstractSelect:function(_189,_18a){ 1247 var _18b=null; 1211 1248 if(this.calendar.options.size=="large"){ 1212 _1 7d=this.findClickedElement(_17b);1213 }else{ 1214 _1 7d=Event.element(_17b);1215 if(_1 7d.tagName!="TD"){1216 _1 7d=Element.getParentByTagName(["TD"],_17d);1217 } 1218 } 1219 if(_1 7d&&_17d.id&&!_17d.id.match(/emptyRow/)){1220 var date=this.getDate(_1 7d);1221 _1 7c(date,_17d);1249 _18b=this.findClickedElement(_189); 1250 }else{ 1251 _18b=Event.element(_189); 1252 if(_18b.tagName!="TD"){ 1253 _18b=Element.getParentByTagName(["TD"],_18b); 1254 } 1255 } 1256 if(_18b&&_18b.id&&!_18b.id.match(/emptyRow/)){ 1257 var date=this.getDate(_18b); 1258 _18a(date,_18b); 1222 1259 } 1223 1260 },getSelectedTerm:function(){ 1224 1261 var self=this; 1225 var _18 0=this.calendar.getSelected();1226 return [_18 0.first(),_180.last()].map(function(e){1262 var _18e=this.calendar.getSelected(); 1263 return [_18e.first(),_18e.last()].map(function(e){ 1227 1264 return self.getDate(e); 1228 1265 }); 1229 },selectDay:function(_1 82){1230 var _1 83=this.calendar;1231 var th=Event.element(_1 82);1266 },selectDay:function(_190){ 1267 var _191=this.calendar; 1268 var th=Event.element(_190); 1232 1269 if(th.tagName!="TH"){ 1233 1270 th=Element.getParentByTagName("TH",th); … … 1235 1272 this.iterateTable({doCell:function(cell){ 1236 1273 if((cell.cellIndex==th.cellIndex)&&cell.id){ 1237 _1 83.addSelectedClass(cell);1274 _191.addSelectedClass(cell); 1238 1275 } 1239 1276 }}); 1240 },inspectArgument:function(_1 86,time){1277 },inspectArgument:function(_194,time){ 1241 1278 var self=this; 1242 var _1 89=this.calendar.getSelected();1243 var _1 8a=[];1244 self.calendar.recurrence(_1 86,function(o){1279 var _197=this.calendar.getSelected(); 1280 var _198=[]; 1281 self.calendar.recurrence(_194,function(o){ 1245 1282 if(!o.date){ 1246 _1 89.each(function(d){1247 var _1 8d={};1283 _197.each(function(d){ 1284 var _19b={}; 1248 1285 if(!o.date){ 1249 _1 8d={date:self.getDate(d)};1286 _19b={date:self.getDate(d)}; 1250 1287 if(time){ 1251 _1 8d.start={hour:0,min:0};1252 _1 8d.finish={hour:0,min:0};1253 } 1254 } 1255 Object.extend(_1 8d,o);1256 _1 8a.push(_18d);1288 _19b.start={hour:0,min:0}; 1289 _19b.finish={hour:0,min:0}; 1290 } 1291 } 1292 Object.extend(_19b,o); 1293 _198.push(_19b); 1257 1294 }); 1258 1295 }else{ 1259 1296 if(o.date.constructor==Object){ 1260 1297 o.date=new Date(o.date.year,o.date.month,o.date.day); 1261 _1 8a.push(o);1262 }else{ 1263 _1 8a.push(o);1264 } 1265 } 1266 }); 1267 return _1 8a;1298 _198.push(o); 1299 }else{ 1300 _198.push(o); 1301 } 1302 } 1303 }); 1304 return _198; 1268 1305 },inspectDateArgument:function(date){ 1269 1306 if(date){ … … 1278 1315 return map; 1279 1316 }else{ 1280 var _19 0=this;1281 var _19 1=this.calendar.getSelected();1282 if(_19 1.length==0){1317 var _19e=this; 1318 var _19f=this.calendar.getSelected(); 1319 if(_19f.length==0){ 1283 1320 return null; 1284 1321 } 1285 return _19 1.collect(function(d){1286 return _19 0.getDate(d);1287 }); 1288 } 1289 },findClickedElement:function(_1 93){1290 var _1 94=$(this.getScheduleContainerId());1291 var _1 95=Position.cumulativeOffset(_194);1292 var _1 96=Position.realOffset(_194).last();1293 _1 96-=document.documentElement.scrollTop||document.body.scrollTop;1294 var x=Event.pointerX(_1 93)-_195[0];1295 var y=Event.pointerY(_1 93)-_195[1]+_196;1296 var _1 99=Math.floor(y/this.column.height);1297 var _1 9a=Math.floor(x/this.column.width);1298 return $(this.calendarTable.rows[_1 99].cells[_19a]);1299 },multipleSelection:function(_1 9b){1322 return _19f.collect(function(d){ 1323 return _19e.getDate(d); 1324 }); 1325 } 1326 },findClickedElement:function(_1a1){ 1327 var _1a2=$(this.getScheduleContainerId()); 1328 var _1a3=Position.cumulativeOffset(_1a2); 1329 var _1a4=Position.realOffset(_1a2).last(); 1330 _1a4-=document.documentElement.scrollTop||document.body.scrollTop; 1331 var x=Event.pointerX(_1a1)-_1a3[0]; 1332 var y=Event.pointerY(_1a1)-_1a3[1]+_1a4; 1333 var _1a7=Math.floor(y/this.column.height); 1334 var _1a8=Math.floor(x/this.column.width); 1335 return $(this.calendarTable.rows[_1a7].cells[_1a8]); 1336 },multipleSelection:function(_1a9){ 1300 1337 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 1301 1338 return; 1302 1339 } 1303 1340 var self=this; 1304 var _1 9d=this.calendar;1305 var _1 9e=this.calendar.selectedBase;1306 this.abstractSelect(_1 9b,function(date,_1a0){1307 var _1a 1=$(_19e.id);1308 var _1 a2=_19d.createRange(parseInt(_1a1.id.getSuffix()),parseInt(_1a0.id.getSuffix()));1341 var _1ab=this.calendar; 1342 var _1ac=this.calendar.selectedBase; 1343 this.abstractSelect(_1a9,function(date,_1ae){ 1344 var _1af=$(_1ac.id); 1345 var _1b0=_1ab.createRange(parseInt(_1af.id.getSuffix()),parseInt(_1ae.id.getSuffix())); 1309 1346 self.iterateTable({doCell:function(cell){ 1310 1347 if(cell.tagName!="TD"||!cell.id){ … … 1312 1349 } 1313 1350 var id=parseInt(cell.id.getSuffix(),10); 1314 if(_1 a2.include(id)){1315 _1 9d.addSelectedClass(cell);1316 }else{ 1317 _1 9d.removeSelectedClass(cell);1351 if(_1b0.include(id)){ 1352 _1ab.addSelectedClass(cell); 1353 }else{ 1354 _1ab.removeSelectedClass(cell); 1318 1355 } 1319 1356 }}); 1320 1357 }); 1321 1358 },iterateTable:function(){ 1322 var _1 a5=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]);1323 var _1 a6=$(this.getCalendarTableId());1324 if(_1 a5.doTable){1325 _1 a5.doTable(_1a6);1326 } 1327 $A(_1 a6.rows).each(function(row){1328 if(_1 a5.doRow){1329 _1 a5.doRow(row);1359 var _1b3=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]); 1360 var _1b4=$(this.getCalendarTableId()); 1361 if(_1b3.doTable){ 1362 _1b3.doTable(_1b4); 1363 } 1364 $A(_1b4.rows).each(function(row){ 1365 if(_1b3.doRow){ 1366 _1b3.doRow(row); 1330 1367 } 1331 1368 $A(row.cells).each(function(cell){ 1332 if(_1 a5.doCell){1333 _1 a5.doCell(cell);1334 } 1335 }); 1336 }); 1337 },findRow:function(_1 a9){1338 var _1 aa=$(this.getCalendarTableId());1339 return $A(_1 aa.rows).detect(function(row){1340 return row.rowIndex==_1 a9;1341 }); 1342 },findCell:function(_1 ac,_1ad){1343 return $A(this.findRow(_1 ac).cells).detect(function(cell){1344 return cell.cellIndex==_1 ad;1369 if(_1b3.doCell){ 1370 _1b3.doCell(cell); 1371 } 1372 }); 1373 }); 1374 },findRow:function(_1b7){ 1375 var _1b8=$(this.getCalendarTableId()); 1376 return $A(_1b8.rows).detect(function(row){ 1377 return row.rowIndex==_1b7; 1378 }); 1379 },findCell:function(_1ba,_1bb){ 1380 return $A(this.findRow(_1ba).cells).detect(function(cell){ 1381 return cell.cellIndex==_1bb; 1345 1382 }); 1346 1383 },getDateId:function(date){ … … 1360 1397 return {cellIndex:cell.cellIndex,rowIndex:row.rowIndex}; 1361 1398 } 1362 },changeSchedule:function(_1 b5){1363 var _1 b6=_1b5.element;1364 var _1 b7=_1b6.schedule;1365 this.calendar.cacheSchedule(_1 b7);1366 var top=parseInt(Element.getStyle(_1 b6,"top"),10);1367 var _1 b9=Math.floor(top/this.column.height);1368 var left=parseInt(Element.getStyle(_1 b6,"left"),10);1369 var _1 bb=Math.floor(left/this.column.width);1370 var _1 bc=$(this.getCalendarTableId());1371 var _1 bd=_1bc.rows.length-1;1372 var _1 be=this.calendar.options.displayIndexes.length-1;1373 if((_1 bb>=0&&_1b9>=0)&&(_1bb<=_1be&&_1b9<=_1bd)){1374 var cell=this.findCell(_1 b9,_1bb);1399 },changeSchedule:function(_1c3){ 1400
