Changeset 5763
- Timestamp:
- 05/27/08 09:41:39 (6 months ago)
- Files:
-
- spinelz/trunk/compress/javascripts/spinelz/calendar.js (modified) (8 diffs)
- spinelz/trunk/compress/javascripts/spinelz/spinelz_for_rubricks.js (modified) (8 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) (2 diffs)
- spinelz/trunk/src/stylesheets/spinelz/calendar.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinelz/trunk/compress/javascripts/spinelz/calendar.js
r5706 r5763 1785 1785 var _247=Element.getDimensions(item); 1786 1786 var _248=Element.getDimensions(_242); 1787 var _249=(self.column.height/2); 1787 1788 var xy=[x,y].map(function(v,i){ 1788 1789 return Math.floor(v/_243[i])*_243[i]; 1789 1790 }); 1790 xy=[self._constrain(xy[0],0,_248.width-_247.width),self._constrain(xy[1],0 ,_248.height-_247.height)];1791 xy=[self._constrain(xy[0],0,_248.width-_247.width),self._constrain(xy[1],0-(_247.height-_249),_248.height-_249)]; 1791 1792 return xy; 1792 },onEnd:function(_24 c,_24d){1793 self.changeSchedule(_24 c,_24d);1794 },change:function(_24 e){1795 self.changeTimeDisplay(_24 e.element);1793 },onEnd:function(_24d,_24e){ 1794 self.changeSchedule(_24d,_24e); 1795 },change:function(_24f){ 1796 self.changeTimeDisplay(_24f.element); 1796 1797 }}); 1797 1798 },setResize:function(item){ 1798 new CalendarResizeableEx(item,{left:0,right:0,distance:this.column.height/2,restriction:true,resize:function(_25 0){1799 this.updateTirm(_25 0);1800 }.bind(this),change:function(_25 1){1801 this.changeTimeDisplay(_25 1);1799 new CalendarResizeableEx(item,{left:0,right:0,distance:this.column.height/2,restriction:true,resize:function(_251){ 1800 this.updateTirm(_251); 1801 }.bind(this),change:function(_252){ 1802 this.changeTimeDisplay(_252); 1802 1803 }.bind(this)}); 1803 },getDate:function(_25 2){1804 return _25 2.date;1805 },abstractSelect:function(_25 3,_254){1806 var _25 5=this.findClickedElement(_253);1807 if(_25 5){1808 if(Element.hasClassName(_25 5,Calendar.className.columnDate)||Element.hasClassName(_255,Calendar.className.columnDateOdd)||Element.hasClassName(_255,Calendar.className.columnTopDate)){1809 var date=this.getDate(_25 5);1810 _25 4(date,_255);1804 },getDate:function(_253){ 1805 return _253.date; 1806 },abstractSelect:function(_254,_255){ 1807 var _256=this.findClickedElement(_254); 1808 if(_256){ 1809 if(Element.hasClassName(_256,Calendar.className.columnDate)||Element.hasClassName(_256,Calendar.className.columnDateOdd)||Element.hasClassName(_256,Calendar.className.columnTopDate)){ 1810 var date=this.getDate(_256); 1811 _255(date,_256); 1811 1812 } 1812 1813 } 1813 1814 },getSelectedTerm:function(){ 1814 var _25 7=this.calendar.getSelected();1815 if(_25 7.length==0){1815 var _258=this.calendar.getSelected(); 1816 if(_258.length==0){ 1816 1817 return; 1817 1818 } 1818 1819 if(this.calendar.options.build){ 1819 var last=_25 7.last();1820 var last=_258.last(); 1820 1821 if(last){ 1821 1822 last=this.dateMap[last.id]; 1822 1823 }else{ 1823 last=this.dateMap[_25 7.first().id];1824 last=this.dateMap[_258.first().id]; 1824 1825 } 1825 1826 last=new Date(last.getFullYear(),last.getMonth(),last.getDate(),last.getHours(),last.getMinutes(),0); 1826 1827 last.setMinutes(last.getMinutes()+30); 1827 return [this.dateMap[_25 7.first().id],last];1828 }else{ 1829 var last=this._getDateTimeFromElement(_25 7.last());1828 return [this.dateMap[_258.first().id],last]; 1829 }else{ 1830 var last=this._getDateTimeFromElement(_258.last()); 1830 1831 last.setMinutes(last.getMinutes()+30); 1831 return [this._getDateTimeFromElement(_25 7.first()),last];1832 return [this._getDateTimeFromElement(_258.first()),last]; 1832 1833 } 1833 1834 },setWidth:function(node){ 1834 1835 Element.setStyle(node,{width:this.column.width+"px"}); 1835 },inspectArgument:function(_25 a,time){1836 if(_25 a.date){1837 return _25 a;1836 },inspectArgument:function(_25b,time){ 1837 if(_25b.date){ 1838 return _25b; 1838 1839 } 1839 1840 var self=this; 1840 var _25 d=this.calendar.getSelected();1841 var _25 e=[];1842 this.calendar.recurrence(_25 a,function(o){1843 var _26 0={};1841 var _25e=this.calendar.getSelected(); 1842 var _25f=[]; 1843 this.calendar.recurrence(_25b,function(o){ 1844 var _261={}; 1844 1845 if(!o.date){ 1845 _26 0={date:self.getDate(_25d[0])};1846 _261={date:self.getDate(_25e[0])}; 1846 1847 if(!o.start){ 1847 _26 0.start=_25d[0].time;1848 _261.start=_25e[0].time; 1848 1849 } 1849 1850 if(!o.finish){ 1850 _26 0.finish=_25d[_25d.length-1].time;1851 } 1852 } 1853 Object.extend(_26 0,o);1854 _25 e.push(_260);1855 }); 1856 return _25 e;1851 _261.finish=_25e[_25e.length-1].time; 1852 } 1853 } 1854 Object.extend(_261,o); 1855 _25f.push(_261); 1856 }); 1857 return _25f; 1857 1858 },inspectDateArgument:function(date){ 1858 1859 if(date){ 1859 1860 return date; 1860 1861 } 1861 var _26 2=this;1862 var _26 3=this.getSelected();1863 if(_26 3.length==0){1862 var _263=this; 1863 var _264=this.getSelected(); 1864 if(_264.length==0){ 1864 1865 return null; 1865 1866 } 1866 return _26 3.collect(function(d){1867 return _26 2.getDate(d);1868 }); 1869 },addColumnClass:function(_26 5){1867 return _264.collect(function(d){ 1868 return _263.getDate(d); 1869 }); 1870 },addColumnClass:function(_266){ 1870 1871 if(document.all){ 1871 this.calendar.css.addClassNames(_26 5,"columnWin");1872 }else{ 1873 this.calendar.css.addClassNames(_26 5,"column");1872 this.calendar.css.addClassNames(_266,"columnWin"); 1873 }else{ 1874 this.calendar.css.addClassNames(_266,"column"); 1874 1875 } 1875 1876 },getHeaderId:function(){ … … 1877 1878 },getColumnId:function(i){ 1878 1879 return this.calendar.element.id.appendSuffix(CalendarWeek.id.column+"_"+i); 1879 },changeSchedule:function(_267,_268){ 1880 var _269=_267.element; 1881 var _26a=_269.schedule; 1882 var time=this.getTimeByElement(_269); 1883 this.calendar.cacheSchedule(_26a); 1884 var _26c=$(this.getScheduleContainerId()); 1885 var _26d=Element.getDimensions(_26c); 1886 var _26e=Position.cumulativeOffset(_26c); 1887 var x=Event.pointerX(_268); 1888 var y=Event.pointerY(_268); 1889 if(_26e[0]>x||(_26e[0]+_26d.width)<x||_26e[1]>y||(_26e[1]+_26d.height)<y){ 1880 },changeSchedule:function(_268,_269){ 1881 var _26a=_268.element; 1882 var _26b=_26a.schedule; 1883 var time=this.getTimeByElement(_26a); 1884 this.calendar.cacheSchedule(_26b); 1885 var _26d=$(this.getScheduleContainerId()); 1886 var _26e=Element.getDimensions(_26d); 1887 var _26f=Position.cumulativeOffset(_26d); 1888 var x=Event.pointerX(_269); 1889 var y=Event.pointerY(_269); 1890 var left=parseInt(Element.getStyle(_26a,"left")); 1891 var _273=Math.round(left/this.column.width); 1892 var date=this.week[_273]; 1893 if(_26b.start.year==date.getFullYear()&&_26b.start.month==date.getMonth()&&_26b.start.day==date.getDate()&&_26b.start.hour==time[0].hour&&_26b.start.min==time[0].min&&_26b.finish.year==date.getFullYear()&&_26b.finish.month==date.getMonth()&&_26b.finish.day==date.getDate()&&_26b.finish.hour==time[1].hour&&_26b.finish.min==time[1].min){ 1890 1894 this.calendar.refreshSchedule(); 1891 1895 return; 1892 1896 } 1893 var left=parseInt(Element.getStyle(_269,"left")); 1894 var _272=Math.round(left/this.column.width); 1895 var date=this.week[_272]; 1896 if(_26a.start.year==date.getFullYear()&&_26a.start.month==date.getMonth()&&_26a.start.day==date.getDate()&&_26a.start.hour==time[0].hour&&_26a.start.min==time[0].min&&_26a.finish.year==date.getFullYear()&&_26a.finish.month==date.getMonth()&&_26a.finish.day==date.getDate()&&_26a.finish.hour==time[1].hour&&_26a.finish.min==time[1].min){ 1897 if(_26a.originalSchedule){ 1898 _26b=_26a.originalSchedule; 1899 } 1900 var _275={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 1901 var diff=DateUtil.toDate(_275).getTime()-DateUtil.toDate(_26b.start).getTime(); 1902 _26b.start=_275; 1903 _26b.finish=new Date(DateUtil.toDate(_26b.finish).getTime()+diff).toHash(); 1897 1904 this.calendar.refreshSchedule(); 1898 return; 1899 } 1900 if(_269.originalSchedule){ 1901 _26a=_269.originalSchedule; 1902 } 1903 var _274={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 1904 var diff=DateUtil.toDate(_274).getTime()-DateUtil.toDate(_26a.start).getTime(); 1905 _26a.start=_274; 1906 _26a.finish=new Date(DateUtil.toDate(_26a.finish).getTime()+diff).toHash(); 1905 this.calendar.options.changeSchedule(_26b); 1906 },updateTirm:function(_277){ 1907 var _278=_277.schedule; 1908 var time=this.getTimeByElement(_277); 1909 this.calendar.cacheSchedule(_278); 1910 var left=parseInt(Element.getStyle(_277,"left")); 1911 var _27b=Math.floor(left/this.column.width); 1912 var date=this.week[_27b]; 1913 var _27d=this.isChengeSchedule(_277,time); 1914 if(_277.originalSchedule){ 1915 _278=_277.originalSchedule; 1916 } 1917 if(_27d.start){ 1918 _278.start.year=date.getFullYear(); 1919 _278.start.month=date.getMonth(); 1920 _278.start.day=date.getDate(); 1921 _278.start.hour=time[0].hour; 1922 _278.start.min=time[0].min; 1923 } 1924 if(_27d.finish){ 1925 _278.finish.year=date.getFullYear(); 1926 _278.finish.month=date.getMonth(); 1927 _278.finish.day=date.getDate(); 1928 _278.finish.hour=time[1].hour; 1929 _278.finish.min=time[1].min; 1930 } 1907 1931 this.calendar.refreshSchedule(); 1908 this.calendar.options.changeSchedule(_26a); 1909 },updateTirm:function(_276){ 1910 var _277=_276.schedule; 1911 var time=this.getTimeByElement(_276); 1912 this.calendar.cacheSchedule(_277); 1913 var left=parseInt(Element.getStyle(_276,"left")); 1914 var _27a=Math.floor(left/this.column.width); 1915 var date=this.week[_27a]; 1916 var _27c=this.isChengeSchedule(_276,time); 1917 if(_276.originalSchedule){ 1918 _277=_276.originalSchedule; 1919 } 1920 if(_27c.start){ 1921 _277.start.year=date.getFullYear(); 1922 _277.start.month=date.getMonth(); 1923 _277.start.day=date.getDate(); 1924 _277.start.hour=time[0].hour; 1925 _277.start.min=time[0].min; 1926 } 1927 if(_27c.finish){ 1928 _277.finish.year=date.getFullYear(); 1929 _277.finish.month=date.getMonth(); 1930 _277.finish.day=date.getDate(); 1931 _277.finish.hour=time[1].hour; 1932 _277.finish.min=time[1].min; 1933 } 1934 this.calendar.refreshSchedule(); 1935 this.calendar.options.updateTirm(_277); 1936 },changeTimeDisplay:function(_27d){ 1937 var _27e=_27d.schedule; 1938 var time=this.getTimeByElement(_27d); 1939 var _280=Element.getElementsByClassName(_27d,Calendar.className.scheduleTimeArea)[0]; 1932 this.calendar.options.updateTirm(_278); 1933 },changeTimeDisplay:function(_27e){ 1934 var _27f=_27e.schedule; 1935 var time=this.getTimeByElement(_27e); 1936 var _281=Element.getElementsByClassName(_27e,Calendar.className.scheduleTimeArea)[0]; 1940 1937 var text=this.getTimeText(time[0],time[1]); 1941 _28 0.innerHTML=text;1942 },findClickedElement:function(_28 2){1943 var _28 3=$(this.getScheduleContainerId());1944 var _28 4=Position.cumulativeOffset(_283);1945 var _28 5=Position.realOffset(_283).last();1946 _28 5-=document.documentElement.scrollTop||document.body.scrollTop;1947 var x=Event.pointerX(_28 2)-_284[0];1948 var y=Event.pointerY(_28 2)-_284[1]+_285;1949 var _28 8=Math.floor(y/this.column.height);1950 var _28 9=Math.floor(x/this.column.width);1938 _281.innerHTML=text; 1939 },findClickedElement:function(_283){ 1940 var _284=$(this.getScheduleContainerId()); 1941 var _285=Position.cumulativeOffset(_284); 1942 var _286=Position.realOffset(_284).last(); 1943 _286-=document.documentElement.scrollTop||document.body.scrollTop; 1944 var x=Event.pointerX(_283)-_285[0]; 1945 var y=Event.pointerY(_283)-_285[1]+_286; 1946 var _289=Math.floor(y/this.column.height); 1947 var _28a=Math.floor(x/this.column.width); 1951 1948 var row=this.calendarTable.rows[0]; 1952 if(_28 9>=row.cells.length){1953 _28 9--;1954 } 1955 return $(row.cells[_28 9]).down(_288);1956 },multipleSelection:function(_28 b){1949 if(_28a>=row.cells.length){ 1950 _28a--; 1951 } 1952 return $(row.cells[_28a]).down(_289); 1953 },multipleSelection:function(_28c){ 1957 1954 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 1958 1955 return; 1959 1956 } 1960 1957 var self=this; 1961 var _28 d=this.calendar;1962 var _28 e=this.calendar.selectedBase;1963 var _2 8f=this._getDateFromElement(_28e).getDate();1964 this.abstractSelect(_28 b,function(date,_291){1965 var _29 2=$(_28e.id);1966 if(_2 8f!=self._getDateFromElement(_291).getDate()){1958 var _28e=this.calendar; 1959 var _28f=this.calendar.selectedBase; 1960 var _290=this._getDateFromElement(_28f).getDate(); 1961 this.abstractSelect(_28c,function(date,_292){ 1962 var _293=$(_28f.id); 1963 if(_290!=self._getDateFromElement(_292).getDate()){ 1967 1964 return; 1968 1965 } 1969 var _29 3=$A(_292.parentNode.childNodes);1970 var ids=[this._getTime(_28 e),this._getTime(_291)];1966 var _294=$A(_293.parentNode.childNodes); 1967 var ids=[this._getTime(_28f),this._getTime(_292)]; 1971 1968 ids.sort(function(a,b){ 1972 1969 return a-b; 1973 1970 }); 1974 _29 3.each(function(n){1971 _294.each(function(n){ 1975 1972 if(!n.id){ 1976 1973 throw $continue; … … 1978 1975 var id=this._getTime(n); 1979 1976 if((id<ids[0])||(ids[1]<id)){ 1980 _28 d.removeSelectedClass(n);1977 _28e.removeSelectedClass(n); 1981 1978 }else{ 1982 1979 if(!Element.hasClassName(n,Calendar.className.selected)){ 1983 _28 d.addSelectedClass(n);1980 _28e.addSelectedClass(n); 1984 1981 } 1985 1982 } 1986 1983 }.bind(this)); 1987 1984 }.bind(this)); 1988 },getTimeByElement:function(_29 9){1989 var _29 a=_299.schedule;1990 var top=parseInt(Element.getStyle(_29 9,"top"),10);1991 var _29 c=parseInt(Element.getStyle(_299,"height"),10);1992 var _29 d=this.column.height*2;1993 var _29 e=15/60;1994 var _2 9f=top/_29d+this.startTime;1995 _2 9f=Math.round(_29f/_29e)*_29e;1996 var _2a 0={};1997 _2a 0.hour=Math.floor(_29f);1998 _2a 0.min=(_29f-_2a0.hour)*60;1999 var _2a 1=Math.round(_29c/_29d/_29e)*_29e+_29f;2000 var _2a 2={};2001 _2a 2.hour=Math.floor(_2a1);2002 _2a 2.min=Math.round((_2a1-_2a2.hour)*60);2003 if(_2a 2.min==60){2004 _2a 2.hour+=1;2005 _2a 2.min=0;2006 } 2007 return [_2a 0,_2a2];1985 },getTimeByElement:function(_29a){ 1986 var _29b=_29a.schedule; 1987 var top=parseInt(Element.getStyle(_29a,"top"),10); 1988 var _29d=parseInt(Element.getStyle(_29a,"height"),10); 1989 var _29e=this.column.height*2; 1990 var _29f=15/60; 1991 var _2a0=top/_29e+this.startTime; 1992 _2a0=Math.round(_2a0/_29f)*_29f; 1993 var _2a1={}; 1994 _2a1.hour=Math.floor(_2a0); 1995 _2a1.min=(_2a0-_2a1.hour)*60; 1996 var _2a2=Math.round(_29d/_29e/_29f)*_29f+_2a0; 1997 var _2a3={}; 1998 _2a3.hour=Math.floor(_2a2); 1999 _2a3.min=Math.round((_2a2-_2a3.hour)*60); 2000 if(_2a3.min==60){ 2001 _2a3.hour+=1; 2002 _2a3.min=0; 2003 } 2004 return [_2a1,_2a3]; 2008 2005 },getTimeByTop:function(top){ 2009 var _2a 4=this.column.height*2;2010 var _2a 5=15/60;2011 var _2a 6=top/_2a4+this.startTime;2012 _2a 6=Math.round(_2a6/_2a5)*_2a5;2013 var _2a 7={};2014 _2a 7.hour=Math.floor(_2a6);2015 _2a 7.min=(_2a6-_2a7.hour)*60;2016 return _2a 7;2017 },getDateId:function(date,time,_2a a){2018 var id=this.calendar.element.id.appendSuffix(_2a a+"_"+date.getDate());2006 var _2a5=this.column.height*2; 2007 var _2a6=15/60; 2008 var _2a7=top/_2a5+this.startTime; 2009 _2a7=Math.round(_2a7/_2a6)*_2a6; 2010 var _2a8={}; 2011 _2a8.hour=Math.floor(_2a7); 2012 _2a8.min=(_2a7-_2a8.hour)*60; 2013 return _2a8; 2014 },getDateId:function(date,time,_2ab){ 2015 var id=this.calendar.element.id.appendSuffix(_2ab+"_"+date.getDate()); 2019 2016 return id.appendSuffix(time*10); 2020 2017 },dateIdToTime:function(id){ … … 2028 2025 time.pop(); 2029 2026 return time.join(":"); 2030 },includeDisplayTime:function(_2b 0){2031 return (this.startTime<=_2b 0)&&(_2b0<this.finishTime);2032 },convertHours:function(_2b 1){2033 return [_2b 1.start.hour+_2b1.start.min/60,_2b1.finish.hour+_2b1.finish.min/60];2027 },includeDisplayTime:function(_2b1){ 2028 return (this.startTime<=_2b1)&&(_2b1<this.finishTime); 2029 },convertHours:function(_2b2){ 2030 return [_2b2.start.hour+_2b2.start.min/60,_2b2.finish.hour+_2b2.finish.min/60]; 2034 2031 },setDisplayTime:function(){ 2035 2032 this.startTime=this.calendar.options.displayTime.first().hour; 2036 var _2b2=this.calendar.options.displayTime.last(); 2037 this.finishTime=Math.ceil(_2b2.hour+_2b2.min/60); 2038 },getTimeText:function(_2b3,_2b4){ 2039 var _2b5=this.calendar; 2040 return _2b5.formatTime(_2b3)+" - "+_2b5.formatTime(_2b4); 2041 },isChengeSchedule:function(_2b6,_2b7){ 2042 var _2b8=_2b6.schedule; 2043 var _2b9=((_2b8.start.hour!=_2b7[0].hour)||(_2b8.start.min!=_2b7[0].min)); 2044 var _2ba=((_2b8.finish.hour!=_2b7[1].hour)||(_2b8.finish.min!=_2b7[1].min)); 2045 if(_2b6.originalSchedule){ 2046 if(_2b9&&_2ba){ 2047 var _2bb=DateUtil.toDate(_2b8.start).getTime(); 2048 var _2bc=DateUtil.toDate(_2b6.originalSchedule.start).getTime(); 2049 if(_2bb==_2bc){ 2033 var _2b3=this.calendar.options.displayTime.last(); 2034 this.finishTime=Math.ceil(_2b3.hour+_2b3.min/60); 2035 },getTimeText:function(_2b4,_2b5){ 2036 var _2b6=this.calendar; 2037 return _2b6.formatTime(_2b4)+" - "+_2b6.formatTime(_2b5); 2038 },isChengeSchedule:function(_2b7,_2b8){ 2039 var _2b9=_2b7.schedule; 2040 var _2ba=((_2b9.start.hour!=_2b8[0].hour)||(_2b9.start.min!=_2b8[0].min)); 2041 var _2bb=((_2b9.finish.hour!=_2b8[1].hour)||(_2b9.finish.min!=_2b8[1].min)); 2042 if(_2b7.originalSchedule){ 2043 if(_2ba&&_2bb){ 2044 var _2bc=DateUtil.toDate(_2b9.start).getTime(); 2045 var _2bd=DateUtil.toDate(_2b7.originalSchedule.start).getTime(); 2046 if(_2bc==_2bd){ 2047 _2bb=false; 2048 }else{ 2050 2049 _2ba=false; 2051 }else{ 2052 _2b9=false; 2053 } 2054 } 2055 } 2056 return {start:_2b9,finish:_2ba}; 2057 },_getDateFromElement:function(_2bd){ 2058 var arr=_2bd.id.split("_"); 2059 var _2bf=arr[arr.length-3]; 2060 return this.week[_2bf]; 2061 },_getDateTimeFromElement:function(_2c0){ 2062 var id=_2c0.id.split("_"); 2063 var _2c2=id[id.length-3]; 2064 if(this.week[_2c2]){ 2065 var date=new Date(this.week[_2c2].getTime()); 2050 } 2051 } 2052 } 2053 return {start:_2ba,finish:_2bb}; 2054 },_getDateFromElement:function(_2be){ 2055 var arr=_2be.id.split("_"); 2056 var _2c0=arr[arr.length-3]; 2057 return this.week[_2c0]; 2058 },_getDateTimeFromElement:function(_2c1){ 2059 var id=_2c1.id.split("_"); 2060 var _2c3=id[id.length-3]; 2061 if(this.week[_2c3]){ 2062 var date=new Date(this.week[_2c3].getTime()); 2066 2063 date.setMinutes(parseInt(id.pop(),10)); 2067 2064 date.setHours(parseInt(id.pop(),10)); 2068 2065 return date; 2069 2066 }else{ 2070 return this._getDate(_2c 0);2071 } 2072 },_getDate:function(_2c 4){2073 var id=_2c 4.id.split("_");2067 return this._getDate(_2c1); 2068 } 2069 },_getDate:function(_2c5){ 2070 var id=_2c5.id.split("_"); 2074 2071 var date=new Date(this.calendar.date.getTime()); 2075 2072 date.setMinutes(parseInt(id.pop(),10)); 2076 2073 date.setHours(parseInt(id.pop(),10)); 2077 2074 return date; 2078 },_getTimeString:function(_2c 7){2079 var arr=_2c 7.id.split("_");2075 },_getTimeString:function(_2c8){ 2076 var arr=_2c8.id.split("_"); 2080 2077 var min=arr[arr.length-1]; 2081 2078 if(min=="0"){ … … 2087 2084 } 2088 2085 return arr[arr.length-2]+min; 2089 },_getTime:function(_2c a){2090 return parseInt(this._getTimeString(_2c a),10);2086 },_getTime:function(_2cb){ 2087 return parseInt(this._getTimeString(_2cb),10); 2091 2088 }}); 2092 2089 var CalendarDay=Class.create(); 2093 2090 CalendarDay.id=["dayHeader"]; 2094 2091 Object.extend(CalendarDay.prototype,CalendarWeek.prototype); 2095 Object.extend(CalendarDay.prototype,{initialize:function(_2c b){2096 var day=_2c b.date.getDay();2097 this.calendar=_2c b;2092 Object.extend(CalendarDay.prototype,{initialize:function(_2cc){ 2093 var day=_2cc.date.getDay(); 2094 this.calendar=_2cc; 2098 2095 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 2099 2096 this.dayIds=SpinelzUtil.concat(this.calendar.element.id,CalendarDay.id); … … 2110 2107 delete this.calendar.options.weekIndexOld; 2111 2108 },buildHeaderCenter:function(){ 2112 var _2c d=this.calendar.date.toDateString();2109 var _2ce=this.calendar.date.toDateString(); 2113 2110 if(this.calendar.options.dayHeaderFormat){ 2114 2111 var date=this.calendar.date; 2115 _2c d=new Template(this.calendar.options.dayHeaderFormat).evaluate({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),wday:this.calendar.options.dayOfWeek[date.getDay()]});2116 } 2117 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.dayIds.header+"' class='"+this.calendar.classNames.ym+"'>"+_2c d+"</span>"+"</td>";2112 _2ce=new Template(this.calendar.options.dayHeaderFormat).evaluate({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),wday:this.calendar.options.dayOfWeek[date.getDay()]}); 2113 } 2114 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.dayIds.header+"' class='"+this.calendar.classNames.ym+"'>"+_2ce+"</span>"+"</td>"; 2118 2115 },buildTimeLineTop:function(){ 2119 2116 return ""; 2120 2117 },buildCalendarHeader:function(){ 2121 2118 return ""; 2122 },changeCalendar:function(_2 cf){2123 var _2d 0=Event.element(_2cf);2124 var _2d 1=new Date(this.calendar.date.toDateString());2125 if(this.hasClassName(_2d 0,Calendar.className.preWeekMark)){2119 },changeCalendar:function(_2d0){ 2120 var _2d1=Event.element(_2d0); 2121 var _2d2=new Date(this.calendar.date.toDateString()); 2122 if(this.hasClassName(_2d1,Calendar.className.preWeekMark)){ 2126 2123 this.calendar.date.setDate(this.calendar.date.getDate()-1); 2127 2124 }else{ 2128 if(this.hasClassName(_2d 0,Calendar.className.nextWeekMark)){2125 if(this.hasClassName(_2d1,Calendar.className.nextWeekMark)){ 2129 2126 this.calendar.date.setDate(this.calendar.date.getDate()+1); 2130 2127 } 2131 2128 } 2132 this.calendar.options.changeCalendar(this.calendar.date,_2d 1);2129 this.calendar.options.changeCalendar(this.calendar.date,_2d2); 2133 2130 this.calendar.refresh(); 2134 2131 }}); 2135 2132 var CalendarResizeableEx=Class.create(); 2136 2133 Object.extend(CalendarResizeableEx.prototype,Resizeable.prototype); 2137 Object.extend(CalendarResizeableEx.prototype,{initialize:function(_2d 2){2138 var _2d 3=Object.extend({top:6,bottom:6,left:6,right:6,minHeight:0,minWidth:0,zindex:1000,resize:null,distance:1,change:Prototype.emptyFunction,restriction:true},arguments[1]||{});2139 this.element=$(_2d 2);2134 Object.extend(CalendarResizeableEx.prototype,{initialize:function(_2d3){ 2135 var _2d4=Object.extend({top:6,bottom:6,left:6,right:6,minHeight:0,minWidth:0,zindex:1000,resize:null,distance:1,change:Prototype.emptyFunction,restriction:true},arguments[1]||{}); 2136 this.element=$(_2d3); 2140 2137 this.handle=this.element; 2141 2138 Element.makePositioned(this.element); 2142 this.options=_2d 3;2139 this.options=_2d4; 2143 2140 this.active=false; 2144 2141 this.resizing=false; … … 2150 2147 this.eventKeypress=this.keyPress.bindAsEventListener(this); 2151 2148 this.registerEvents(); 2152 },startResize:function(_2d 4){2153 Event.stop(_2d 4);2154 if(Event.isLeftClick(_2d 4)){2155 var src=Event.element(_2d 4);2149 },startResize:function(_2d5){ 2150 Event.stop(_2d5); 2151 if(Event.isLeftClick(_2d5)){ 2152 var src=Event.element(_2d5); 2156 2153 if(src.tagName&&(src.tagName=="INPUT"||src.tagName=="SELECT"||src.tagName=="BUTTON"||src.tagName=="TEXTAREA")){ 2157 2154 return; 2158 2155 } 2159 var dir=this.directions(_2d 4);2156 var dir=this.directions(_2d5); 2160 2157 if(dir.length>0){ 2161 2158 this.active=true; … … 2164 2161 this.startWidth=parseInt(Element.getStyle(this.element,"width"),10); 2165 2162 this.startHeight=parseInt(Element.getStyle(this.element,"height"),10); 2166 this.startX=_2d 4.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;2167 this.startY=_2d 4.clientY+document.body.scrollTop+document.documentElement.scrollTop;2163 this.startX=_2d5.clientX+document.body.scrollLeft+document.documentElement.scrollLeft; 2164 this.startY=_2d5.clientY+document.body.scrollTop+document.documentElement.scrollTop; 2168 2165 this.currentDirection=dir; 2169 2166 if(this.options.restriction){ 2170 var _2d 7=this.element.parentNode;2171 this.restDimensions=Element.getDimensions(_2d 7);2172 this.restOffset=Position.cumulativeOffset(_2d 7);2167 var _2d8=this.element.parentNode; 2168 this.restDimensions=Element.getDimensions(_2d8); 2169 this.restOffset=Position.cumulativeOffset(_2d8); 2173 2170 this.scroll=Position.realOffset(this.element)[1]-(document.documentElement.scrollTop||document.body.scrollTop); 2174 2171 } 2175 2172 } 2176 2173 } 2177 },draw:function(_2d 8){2178 Event.stop(_2d 8);2179 var _2d 9=[Event.pointerX(_2d8),Event.pointerY(_2d8)];2180 var _2d a=this.element.style;2174 },draw:function(_2d9){ 2175 Event.stop(_2d9); 2176 var _2da=[Event.pointerX(_2d9),Event.pointerY(_2d9)]; 2177 var _2db=this.element.style; 2181 2178 if(this.currentDirection.indexOf("n")!=-1){ 2182 if(this.restOffset[1]-this.scroll>=_2d 9[1]){2179 if(this.restOffset[1]-this.scroll>=_2da[1]){ 2183 2180 return; 2184 2181 } 2185 var _2d b=this.startY-_2d9[1];2186 var _2d c=this.map(this.startHeight+_2db);2187 if(_2d c>this.options.minHeight){2188 _2d a.height=(_2dc-4)+"px";2189 _2d a.top=this.map(this.startTop-_2db)+"px";2182 var _2dc=this.startY-_2da[1]; 2183 var _2dd=this.map(this.startHeight+_2dc); 2184 if(_2dd>this.options.minHeight){ 2185 _2db.height=(_2dd-4)+"px"; 2186 _2db.top=this.map(this.startTop-_2dc)+"px"; 2190 2187 } 2191 2188 } 2192 2189 if(this.currentDirection.indexOf("w")!=-1){ 2193 var _2d b=this.map(this.startX-_2d9[0]);2194 var _2d d=Element.getStyle(this.element,"margin-left")||"0";2195 var _2d e=this.startWidth+_2db;2196 if(_2d e>this.options.minWidth){2197 _2d a.left=(this.startLeft-_2db-parseInt(_2dd))+"px";2198 _2d a.width=_2de+"px";2190 var _2dc=this.map(this.startX-_2da[0]); 2191 var _2de=Element.getStyle(this.element,"margin-left")||"0"; 2192 var _2df=this.startWidth+_2dc; 2193 if(_2df>this.options.minWidth){ 2194 _2db.left=(this.startLeft-_2dc-parseInt(_2de))+"px"; 2195 _2db.width=_2df+"px"; 2199 2196 } 2200 2197 } 2201 2198 if(this.currentDirection.indexOf("s")!=-1){ 2202 var _2 df=this.restDimensions.height+this.restOffset[1];2203 var _2d b=_2d9[1]-this.startY;2204 if(_2 df-this.scroll<=_2d9[1]){2199 var _2e0=this.restDimensions.height+this.restOffset[1]; 2200 var _2dc=_2da[1]-this.startY; 2201 if(_2e0-this.scroll<=_2da[1]){ 2205 2202 return; 2206 2203 } 2207 var _2d c=this.map(this.startHeight+_2d9[1]-this.startY);2208 if(_2d c>this.options.minHeight){2209 _2d a.height=(_2dc-4)+"px";2204 var _2dd=this.map(this.startHeight+_2da[1]-this.startY); 2205 if(_2dd>this.options.minHeight){ 2206 _2db.height=(_2dd-4)+"px"; 2210 2207 } 2211 2208 } 2212 2209 if(this.currentDirection.indexOf("e")!=-1){ 2213 var _2d e=this.map(this.startWidth+_2d9[0]-this.startX);2214 if(_2d e>this.options.minWidth){2215 _2d a.width=_2de+"px";2216 } 2217 } 2218 if(_2d a.visibility=="hidden"){2219 _2d a.visibility="";2210 var _2df=this.map(this.startWidth+_2da[0]-this.startX); 2211 if(_2df>this.options.minWidth){ 2212 _2db.width=_2df+"px"; 2213 } 2214 } 2215 if(_2db.visibility=="hidden"){ 2216 _2db.visibility=""; 2220 2217 } 2221 2218 this.options.change(this.element); 2222 },directions:function(_2e 0){2223 var _2e 1=[Event.pointerX(_2e0),Event.pointerY(_2e0)];2224 var _2e 2=Position.cumulativeOffset(this.element);2225 var _2e 3=document.documentElement.scrollTop||document.body.scrollTop;2226 var _2e 4=Position.realOffset(this.element)[1]-_2e3;2227 var _2e 5="";2228 if(this.between(_2e 1[1]-_2e2[1]+_2e4,0,this.options.top)){2229 _2e 5+="n";2230 } 2231 if(this.between((_2e 2[1]+this.element.offsetHeight)-_2e1[1]-_2e4,0,this.options.bottom)){2232 _2e 5+="s";2233 } 2234 if(this.between(_2e 1[0]-_2e2[0],0,this.options.left)){2235 _2e 5+="w";2236 } 2237 if(this.between((_2e 2[0]+this.element.offsetWidth)-_2e1[0],0,this.options.right)){2238 _2e 5+="e";2239 } 2240 return _2e 5;2241 },map:function(_2e 6){2242 return Math.round(_2e 6/this.options.distance)*this.options.distance;2219 },directions:function(_2e1){ 2220 var _2e2=[Event.pointerX(_2e1),Event.pointerY(_2e1)]; 2221 var _2e3=Position.cumulativeOffset(this.element); 2222 var _2e4=document.documentElement.scrollTop||document.body.scrollTop; 2223 var _2e5=Position.realOffset(this.element)[1]-_2e4; 2224 var _2e6=""; 2225 if(this.between(_2e2[1]-_2e3[1]+_2e5,0,this.options.top)){ 2226 _2e6+="n"; 2227 } 2228 if(this.between((_2e3[1]+this.element.offsetHeight)-_2e2[1]-_2e5,0,this.options.bottom)){ 2229 _2e6+="s"; 2230 } 2231 if(this.between(_2e2[0]-_2e3[0],0,this.options.left)){ 2232 _2e6+="w"; 2233 } 2234 if(this.between((_2e3[0]+this.element.offsetWidth)-_2e2[0],0,this.options.right)){ 2235 _2e6+="e"; 2236 } 2237 return _2e6; 2238 },map:function(_2e7){ 2239 return Math.round(_2e7/this.options.distance)*this.options.distance; 2243 2240 }}); 2244 2241 spinelz/trunk/compress/javascripts/spinelz/spinelz_for_rubricks.js
r5754 r5763 2095 2095 var _247=Element.getDimensions(item); 2096 2096 var _248=Element.getDimensions(_242); 2097 var _249=(self.column.height/2); 2097 2098 var xy=[x,y].map(function(v,i){ 2098 2099 return Math.floor(v/_243[i])*_243[i]; 2099 2100 }); 2100 xy=[self._constrain(xy[0],0,_248.width-_247.width),self._constrain(xy[1],0 ,_248.height-_247.height)];2101 xy=[self._constrain(xy[0],0,_248.width-_247.width),self._constrain(xy[1],0-(_247.height-_249),_248.height-_249)]; 2101 2102 return xy; 2102 },onEnd:function(_24 c,_24d){2103 self.changeSchedule(_24 c,_24d);2104 },change:function(_24 e){2105 self.changeTimeDisplay(_24 e.element);2103 },onEnd:function(_24d,_24e){ 2104 self.changeSchedule(_24d,_24e); 2105 },change:function(_24f){ 2106 self.changeTimeDisplay(_24f.element); 2106 2107 }}); 2107 2108 },setResize:function(item){ 2108 new CalendarResizeableEx(item,{left:0,right:0,distance:this.column.height/2,restriction:true,resize:function(_25 0){2109 this.updateTirm(_25 0);2110 }.bind(this),change:function(_25 1){2111 this.changeTimeDisplay(_25 1);2109 new CalendarResizeableEx(item,{left:0,right:0,distance:this.column.height/2,restriction:true,resize:function(_251){ 2110 this.updateTirm(_251); 2111 }.bind(this),change:function(_252){ 2112 this.changeTimeDisplay(_252); 2112 2113 }.bind(this)}); 2113 },getDate:function(_25 2){2114 return _25 2.date;2115 },abstractSelect:function(_25 3,_254){2116 var _25 5=this.findClickedElement(_253);2117 if(_25 5){2118 if(Element.hasClassName(_25 5,Calendar.className.columnDate)||Element.hasClassName(_255,Calendar.className.columnDateOdd)||Element.hasClassName(_255,Calendar.className.columnTopDate)){2119 var date=this.getDate(_25 5);2120 _25 4(date,_255);2114 },getDate:function(_253){ 2115 return _253.date; 2116 },abstractSelect:function(_254,_255){ 2117 var _256=this.findClickedElement(_254); 2118 if(_256){ 2119 if(Element.hasClassName(_256,Calendar.className.columnDate)||Element.hasClassName(_256,Calendar.className.columnDateOdd)||Element.hasClassName(_256,Calendar.className.columnTopDate)){ 2120 var date=this.getDate(_256); 2121 _255(date,_256); 2121 2122 } 2122 2123 } 2123 2124 },getSelectedTerm:function(){ 2124 var _25 7=this.calendar.getSelected();2125 if(_25 7.length==0){2125 var _258=this.calendar.getSelected(); 2126 if(_258.length==0){ 2126 2127 return; 2127 2128 } 2128 2129 if(this.calendar.options.build){ 2129 var last=_25 7.last();2130 var last=_258.last(); 2130 2131 if(last){ 2131 2132 last=this.dateMap[last.id]; 2132 2133 }else{ 2133 last=this.dateMap[_25 7.first().id];2134 last=this.dateMap[_258.first().id]; 2134 2135 } 2135 2136 last=new Date(last.getFullYear(),last.getMonth(),last.getDate(),last.getHours(),last.getMinutes(),0); 2136 2137 last.setMinutes(last.getMinutes()+30); 2137 return [this.dateMap[_25 7.first().id],last];2138 }else{ 2139 var last=this._getDateTimeFromElement(_25 7.last());2138 return [this.dateMap[_258.first().id],last]; 2139 }else{ 2140 var last=this._getDateTimeFromElement(_258.last()); 2140 2141 last.setMinutes(last.getMinutes()+30); 2141 return [this._getDateTimeFromElement(_25 7.first()),last];2142 return [this._getDateTimeFromElement(_258.first()),last]; 2142 2143 } 2143 2144 },setWidth:function(node){ 2144 2145 Element.setStyle(node,{width:this.column.width+"px"}); 2145 },inspectArgument:function(_25 a,time){2146 if(_25 a.date){2147 return _25 a;2146 },inspectArgument:function(_25b,time){ 2147 if(_25b.date){ 2148 return _25b; 2148 2149 } 2149 2150 var self=this; 2150 var _25 d=this.calendar.getSelected();2151 var _25 e=[];2152 this.calendar.recurrence(_25 a,function(o){2153 var _26 0={};2151 var _25e=this.calendar.getSelected(); 2152 var _25f=[]; 2153 this.calendar.recurrence(_25b,function(o){ 2154 var _261={}; 2154 2155 if(!o.date){ 2155 _26 0={date:self.getDate(_25d[0])};2156 _261={date:self.getDate(_25e[0])}; 2156 2157 if(!o.start){ 2157 _26 0.start=_25d[0].time;2158 _261.start=_25e[0].time; 2158 2159 } 2159 2160 if(!o.finish){ 2160 _26 0.finish=_25d[_25d.length-1].time;2161 } 2162 } 2163 Object.extend(_26 0,o);2164 _25 e.push(_260);2165 }); 2166 return _25 e;2161 _261.finish=_25e[_25e.length-1].time; 2162 } 2163 } 2164 Object.extend(_261,o); 2165 _25f.push(_261); 2166 }); 2167 return _25f; 2167 2168 },inspectDateArgument:function(date){ 2168 2169 if(date){ 2169 2170 return date; 2170 2171 } 2171 var _26 2=this;2172 var _26 3=this.getSelected();2173 if(_26 3.length==0){2172 var _263=this; 2173 var _264=this.getSelected(); 2174 if(_264.length==0){ 2174 2175 return null; 2175 2176 } 2176 return _26 3.collect(function(d){2177 return _26 2.getDate(d);2178 }); 2179 },addColumnClass:function(_26 5){2177 return _264.collect(function(d){ 2178 return _263.getDate(d); 2179 }); 2180 },addColumnClass:function(_266){ 2180 2181 if(document.all){ 2181 this.calendar.css.addClassNames(_26 5,"columnWin");2182 }else{ 2183 this.calendar.css.addClassNames(_26 5,"column");2182 this.calendar.css.addClassNames(_266,"columnWin"); 2183 }else{ 2184 this.calendar.css.addClassNames(_266,"column"); 2184 2185 } 2185 2186 },getHeaderId:function(){ … … 2187 2188 },getColumnId:function(i){ 2188 2189 return this.calendar.element.id.appendSuffix(CalendarWeek.id.column+"_"+i); 2189 },changeSchedule:function(_267,_268){ 2190 var _269=_267.element; 2191 var _26a=_269.schedule; 2192 var time=this.getTimeByElement(_269); 2193 this.calendar.cacheSchedule(_26a); 2194 var _26c=$(this.getScheduleContainerId()); 2195 var _26d=Element.getDimensions(_26c); 2196 var _26e=Position.cumulativeOffset(_26c); 2197 var x=Event.pointerX(_268); 2198 var y=Event.pointerY(_268); 2199 if(_26e[0]>x||(_26e[0]+_26d.width)<x||_26e[1]>y||(_26e[1]+_26d.height)<y){ 2190 },changeSchedule:function(_268,_269){ 2191 var _26a=_268.element; 2192 var _26b=_26a.schedule; 2193 var time=this.getTimeByElement(_26a); 2194 this.calendar.cacheSchedule(_26b); 2195 var _26d=$(this.getScheduleContainerId()); 2196 var _26e=Element.getDimensions(_26d); 2197 var _26f=Position.cumulativeOffset(_26d); 2198 var x=Event.pointerX(_269); 2199 var y=Event.pointerY(_269); 2200 var left=parseInt(Element.getStyle(_26a,"left")); 2201 var _273=Math.round(left/this.column.width); 2202 var date=this.week[_273]; 2203 if(_26b.start.year==date.getFullYear()&&_26b.start.month==date.getMonth()&&_26b.start.day==date.getDate()&&_26b.start.hour==time[0].hour&&_26b.start.min==time[0].min&&_26b.finish.year==date.getFullYear()&&_26b.finish.month==date.getMonth()&&_26b.finish.day==date.getDate()&&_26b.finish.hour==time[1].hour&&_26b.finish.min==time[1].min){ 2200 2204 this.calendar.refreshSchedule(); 2201 2205 return; 2202 2206 } 2203 var left=parseInt(Element.getStyle(_269,"left")); 2204 var _272=Math.round(left/this.column.width); 2205 var date=this.week[_272]; 2206 if(_26a.start.year==date.getFullYear()&&_26a.start.month==date.getMonth()&&_26a.start.day==date.getDate()&&_26a.start.hour==time[0].hour&&_26a.start.min==time[0].min&&_26a.finish.year==date.getFullYear()&&_26a.finish.month==date.getMonth()&&_26a.finish.day==date.getDate()&&_26a.finish.hour==time[1].hour&&_26a.finish.min==time[1].min){ 2207 if(_26a.originalSchedule){ 2208 _26b=_26a.originalSchedule; 2209 } 2210 var _275={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 2211 var diff=DateUtil.toDate(_275).getTime()-DateUtil.toDate(_26b.start).getTime(); 2212 _26b.start=_275; 2213 _26b.finish=new Date(DateUtil.toDate(_26b.finish).getTime()+diff).toHash(); 2207 2214 this.calendar.refreshSchedule(); 2208 return; 2209 } 2210 if(_269.originalSchedule){ 2211 _26a=_269.originalSchedule; 2212 } 2213 var _274={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 2214 var diff=DateUtil.toDate(_274).getTime()-DateUtil.toDate(_26a.start).getTime(); 2215 _26a.start=_274; 2216 _26a.finish=new Date(DateUtil.toDate(_26a.finish).getTime()+diff).toHash(); 2215 this.calendar.options.changeSchedule(_26b); 2216 },updateTirm:function(_277){ 2217 var _278=_277.schedule; 2218 var time=this.getTimeByElement(_277); 2219 this.calendar.cacheSchedule(_278); 2220 var left=parseInt(Element.getStyle(_277,"left")); 2221 var _27b=Math.floor(left/this.column.width); 2222 var date=this.week[_27b]; 2223 var _27d=this.isChengeSchedule(_277,time); 2224 if(_277.originalSchedule){ 2225 _278=_277.originalSchedule; 2226 } 2227 if(_27d.start){ 2228 _278.start.year=date.getFullYear(); 2229 _278.start.month=date.getMonth(); 2230 _278.start.day=date.getDate(); 2231 _278.start.hour=time[0].hour; 2232 _278.start.min=time[0].min; 2233 } 2234 if(_27d.finish){ 2235 _278.finish.year=date.getFullYear(); 2236 _278.finish.month=date.getMonth(); 2237 _278.finish.day=date.getDate(); 2238 _278.finish.hour=time[1].hour; 2239 _278.finish.min=time[1].min; 2240 } 2217 2241 this.calendar.refreshSchedule(); 2218 this.calendar.options.changeSchedule(_26a); 2219 },updateTirm:function(_276){ 2220 var _277=_276.schedule; 2221 var time=this.getTimeByElement(_276); 2222 this.calendar.cacheSchedule(_277); 2223 var left=parseInt(Element.getStyle(_276,"left")); 2224 var _27a=Math.floor(left/this.column.width); 2225 var date=this.week[_27a]; 2226 var _27c=this.isChengeSchedule(_276,time); 2227 if(_276.originalSchedule){ 2228 _277=_276.originalSchedule; 2229 } 2230 if(_27c.start){ 2231 _277.start.year=date.getFullYear(); 2232 _277.start.month=date.getMonth(); 2233 _277.start.day=date.getDate(); 2234 _277.start.hour=time[0].hour; 2235 _277.start.min=time[0].min; 2236 } 2237 if(_27c.finish){ 2238 _277.finish.year=date.getFullYear(); 2239 _277.finish.month=date.getMonth(); 2240 _277.finish.day=date.getDate(); 2241 _277.finish.hour=time[1].hour; 2242 _277.finish.min=time[1].min; 2243 } 2244 this.calendar.refreshSchedule(); 2245 this.calendar.options.updateTirm(_277); 2246 },changeTimeDisplay:function(_27d){ 2247 var _27e=_27d.schedule; 2248 var time=this.getTimeByElement(_27d); 2249 var _280=Element.getElementsByClassName(_27d,Calendar.className.scheduleTimeArea)[0]; 2242 this.calendar.options.updateTirm(_278); 2243 },changeTimeDisplay:function(_27e){ 2244 var _27f=_27e.schedule; 2245 var time=this.getTimeByElement(_27e); 2246 var _281=Element.getElementsByClassName(_27e,Calendar.className.scheduleTimeArea)[0]; 2250 2247 var text=this.getTimeText(time[0],time[1]); 2251 _28 0.innerHTML=text;2252 },findClickedElement:function(_28 2){2253 var _28 3=$(this.getScheduleContainerId());2254 var _28 4=Position.cumulativeOffset(_283);2255 var _28 5=Position.realOffset(_283).last();2256 _28 5-=document.documentElement.scrollTop||document.body.scrollTop;2257 var x=Event.pointerX(_28 2)-_284[0];2258 var y=Event.pointerY(_28 2)-_284[1]+_285;2259 var _28 8=Math.floor(y/this.column.height);2260 var _28 9=Math.floor(x/this.column.width);2248 _281.innerHTML=text; 2249 },findClickedElement:function(_283){ 2250 var _284=$(this.getScheduleContainerId()); 2251 var _285=Position.cumulativeOffset(_284); 2252 var _286=Position.realOffset(_284).last(); 2253 _286-=document.documentElement.scrollTop||document.body.scrollTop; 2254 var x=Event.pointerX(_283)-_285[0]; 2255 var y=Event.pointerY(_283)-_285[1]+_286; 2256 var _289=Math.floor(y/this.column.height); 2257 var _28a=Math.floor(x/this.column.width); 2261 2258 var row=this.calendarTable.rows[0]; 2262 if(_28 9>=row.cells.length){2263 _28 9--;2264 } 2265 return $(row.cells[_28 9]).down(_288);2266 },multipleSelection:function(_28 b){2259 if(_28a>=row.cells.length){ 2260 _28a--; 2261 } 2262 return $(row.cells[_28a]).down(_289); 2263 },multipleSelection:function(_28c){ 2267 2264 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 2268 2265 return; 2269 2266 } 2270 2267 var self=this; 2271 var _28 d=this.calendar;2272 var _28 e=this.calendar.selectedBase;2273 var _2 8f=this._getDateFromElement(_28e).getDate();2274 this.abstractSelect(_28 b,function(date,_291){2275 var _29 2=$(_28e.id);2276 if(_2 8f!=self._getDateFromElement(_291).getDate()){2277 return; 2278 } 2279 var _29 3=$A(_292.parentNode.childNodes);2280 var ids=[this._getTime(_28 e),this._getTime(_291)];2268 var _28e=this.calendar; 2269 var _28f=this.calendar.selectedBase; 2270 var _290=this._getDateFromElement(_28f).getDate(); 2271 this.abstractSelect(_28c,function(date,_292){ 2272 var _293=$(_28f.id); 2273 if(_290!=self._getDateFromElement(_292).getDate()){ 2274 return; 2275 } 2276 var _294=$A(_293.parentNode.childNodes); 2277 var ids=[this._getTime(_28f),this._getTime(_292)]; 2281 2278 ids.sort(function(a,b){ 2282 2279 return a-b; 2283 2280 }); 2284 _29 3.each(function(n){2281 _294.each(function(n){ 2285 2282 if(!n.id){ 2286 2283 throw $continue; … … 2288 2285 var id=this._getTime(n); 2289 2286 if((id<ids[0])||(ids[1]<id)){ 2290 _28 d.removeSelectedClass(n);2287 _28e.removeSelectedClass(n); 2291 2288 }else{ 2292 2289 if(!Element.hasClassName(n,Calendar.className.selected)){ 2293 _28 d.addSelectedClass(n);2290 _28e.addSelectedClass(n); 2294 2291 } 2295 2292 } 2296 2293 }.bind(this)); 2297 2294 }.bind(this)); 2298 },getTimeByElement:function(_29 9){2299 var _29 a=_299.schedule;2300 var top=parseInt(Element.getStyle(_29 9,"top"),10);2301 var _29 c=parseInt(Element.getStyle(_299,"height"),10);2302 var _29 d=this.column.height*2;2303 var _29 e=15/60;2304 var _2 9f=top/_29d+this.startTime;2305 _2 9f=Math.round(_29f/_29e)*_29e;2306 var _2a 0={};2307 _2a 0.hour=Math.floor(_29f);2308 _2a 0.min=(_29f-_2a0.hour)*60;2309 var _2a 1=Math.round(_29c/_29d/_29e)*_29e+_29f;2310 var _2a 2={};2311 _2a 2.hour=Math.floor(_2a1);2312 _2a 2.min=Math.round((_2a1-_2a2.hour)*60);2313 if(_2a 2.min==60){2314 _2a 2.hour+=1;2315 _2a 2.min=0;2316 } 2317 return [_2a 0,_2a2];2295 },getTimeByElement:function(_29a){ 2296 var _29b=_29a.schedule; 2297 var top=parseInt(Element.getStyle(_29a,"top"),10); 2298 var _29d=parseInt(Element.getStyle(_29a,"height"),10); 2299 var _29e=this.column.height*2; 2300 var _29f=15/60; 2301 var _2a0=top/_29e+this.startTime; 2302 _2a0=Math.round(_2a0/_29f)*_29f; 2303 var _2a1={}; 2304 _2a1.hour=Math.floor(_2a0); 2305 _2a1.min=(_2a0-_2a1.hour)*60; 2306 var _2a2=Math.round(_29d/_29e/_29f)*_29f+_2a0; 2307 var _2a3={}; 2308 _2a3.hour=Math.floor(_2a2); 2309 _2a3.min=Math.round((_2a2-_2a3.hour)*60); 2310 if(_2a3.min==60){ 2311 _2a3.hour+=1; 2312 _2a3.min=0; 2313 } 2314 return [_2a1,_2a3]; 2318 2315 },getTimeByTop:function(top){ 2319 var _2a 4=this.column.height*2;2320 var _2a 5=15/60;2321 var _2a 6=top/_2a4+this.startTime;2322 _2a 6=Math.round(_2a6/_2a5)*_2a5;2323 var _2a 7={};2324 _2a 7.hour=Math.floor(_2a6);2325 _2a 7.min=(_2a6-_2a7.hour)*60;2326 return _2a 7;2327 },getDateId:function(date,time,_2a a){2328 var id=this.calendar.element.id.appendSuffix(_2a a+"_"+date.getDate());2316 var _2a5=this.column.height*2; 2317 var _2a6=15/60; 2318 var _2a7=top/_2a5+this.startTime; 2319 _2a7=Math.round(_2a7/_2a6)*_2a6; 2320 var _2a8={}; 2321 _2a8.hour=Math.floor(_2a7); 2322 _2a8.min=(_2a7-_2a8.hour)*60; 2323 return _2a8; 2324 },getDateId:function(date,time,_2ab){ 2325 var id=this.calendar.element.id.appendSuffix(_2ab+"_"+date.getDate()); 2329 2326 return id.appendSuffix(time*10); 2330 2327 },dateIdToTime:function(id){ … … 2338 2335 time.pop(); 2339 2336 return time.join(":"); 2340 },includeDisplayTime:function(_2b 0){2341 return (this.startTime<=_2b 0)&&(_2b0<this.finishTime);2342 },convertHours:function(_2b 1){2343 return [_2b 1.start.hour+_2b1.start.min/60,_2b1.finish.hour+_2b1.finish.min/60];2337 },includeDisplayTime:function(_2b1){ 2338
