Changeset 5978
- Timestamp:
- 01/26/09 19:03:36 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinelz/trunk/compress/javascripts/spinelz/calendar.js
r5976 r5978 1749 1749 var same=[]; 1750 1750 var self=this; 1751 if(!_22e.sames){ 1752 _22e.sames=[]; 1753 } 1751 1754 _22e.each(function(h){ 1752 1755 var _236=self.convertHours(h.schedule); … … 1765 1768 Element.setStyle(item,{left:left+"px"}); 1766 1769 }else{ 1770 var _23b=false; 1771 _22e.sames.each(function(_23c){ 1772 if(_23b){ 1773 throw $break; 1774 } 1775 same.each(function(s){ 1776 if(_23c.include(s)){ 1777 same=_23c; 1778 _23b=true; 1779 throw $break; 1780 } 1781 }); 1782 }); 1767 1783 same.push(item); 1768 var _23 b=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1;1784 var _23e=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 1769 1785 same.each(function(s,i){ 1770 var _23e=left+_23b*i+(2*i); 1771 Element.setStyle(s,{width:_23b+"px",left:_23e+"px"}); 1772 }); 1786 var _241=left+_23e*i+(2*i); 1787 Element.setStyle(s,{width:_23e+"px",left:_241+"px"}); 1788 }); 1789 if(!_23b){ 1790 _22e.sames.push(same); 1791 } 1773 1792 } 1774 1793 return left; 1775 1794 },setScheduleBaseStyle:function(item){ 1776 var _24 0=item.schedule;1777 if(!this.calendar.isSameDate(_24 0.start,_240.finish)){1778 _24 0.finish.hour=24;1779 _24 0.finish.min=0;1780 } 1781 var time=this.convertHours(_24 0);1782 var _24 2=time.first();1783 var _24 3=time.last();1784 var _24 4=this.column.height*2;1785 var diff=this.calendar.getTimeDiff(_24 0.start,_240.finish);1795 var _243=item.schedule; 1796 if(!this.calendar.isSameDate(_243.start,_243.finish)){ 1797 _243.finish.hour=24; 1798 _243.finish.min=0; 1799 } 1800 var time=this.convertHours(_243); 1801 var _245=time.first(); 1802 var _246=time.last(); 1803 var _247=this.column.height*2; 1804 var diff=this.calendar.getTimeDiff(_243.start,_243.finish); 1786 1805 var rate=(diff.hour+(diff.min/60))||1; 1787 1806 var over=0; 1788 1807 var top=0; 1789 var _24 9=0;1790 var _24 a=this.includeDisplayTime(_242);1791 var _24 b=this.includeDisplayTime(_243,true);1792 if(!_24 a&&!_24b){1793 if((this.startTime<=_24 2&&this.startTime<=_243)||(_242<this.finishTime&&_243<this.finishTime)){1794 top=_24 9=0;1808 var _24c=0; 1809 var _24d=this.includeDisplayTime(_245); 1810 var _24e=this.includeDisplayTime(_246,true); 1811 if(!_24d&&!_24e){ 1812 if((this.startTime<=_245&&this.startTime<=_246)||(_245<this.finishTime&&_246<this.finishTime)){ 1813 top=_24c=0; 1795 1814 Element.hide(item); 1796 1815 this.hasInvisibleSchedule=true; 1797 1816 }else{ 1798 1817 top=0; 1799 _24 9=_244*(this.finishTime-this.startTime)-3;1800 } 1801 }else{ 1802 if(_24 a){1803 top=_24 4*(_242-this.startTime);1804 _24 9=_244*rate-3;1818 _24c=_247*(this.finishTime-this.startTime)-3; 1819 } 1820 }else{ 1821 if(_24d){ 1822 top=_247*(_245-this.startTime); 1823 _24c=_247*rate-3; 1805 1824 }else{ 1806 1825 top=0; 1807 over=this.startTime-_24 2;1808 _24 9=_244*(rate-over);1809 } 1810 if(_24 b){1811 }else{ 1812 over=_24 3-this.finishTime;1813 _24 9-=_244*over;1826 over=this.startTime-_245; 1827 _24c=_247*(rate-over); 1828 } 1829 if(_24e){ 1830 }else{ 1831 over=_246-this.finishTime; 1832 _24c-=_247*over; 1814 1833 } 1815 1834 } 1816 1835 try{ 1817 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_24 9+"px"});1836 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_24c+"px"}); 1818 1837 } 1819 1838 catch(e){ … … 1827 1846 this.setCover(); 1828 1847 var self=this; 1829 var _2 4d=$(this.getScheduleContainerId());1830 var _2 4e=this.getDragDistance();1848 var _250=$(this.getScheduleContainerId()); 1849 var _251=this.getDragDistance(); 1831 1850 this.scheduleNodes=[]; 1832 var _2 4f=this.week.map(function(){1851 var _252=this.week.map(function(){ 1833 1852 return []; 1834 1853 }); 1835 var _25 0=this.week.legth-1;1836 var _25 1=this.calendar.options.noEvent;1837 this.calendar.options.schedules.each(function(_25 2){1838 var _25 3=[];1839 var sub,_25 5,_256=null;1840 self.week.each(function(date,_25 8){1841 if(self.calendar.betweenDate(_25 2,date)){1842 if(self.isSameStartDate(_25 2,date)&&self.isSameFinishDate(_252,date)){1843 _25 6=self.setSchedule(_252,_258,_24f,_24d,_24e);1844 _25 6.cellDate=date;1845 _25 3.push(_256);1846 }else{ 1847 sub=self.copyOneDaySchedule(_25 2,date);1854 var _253=this.week.legth-1; 1855 var _254=this.calendar.options.noEvent; 1856 this.calendar.options.schedules.each(function(_255){ 1857 var _256=[]; 1858 var sub,_258,_259=null; 1859 self.week.each(function(date,_25b){ 1860 if(self.calendar.betweenDate(_255,date)){ 1861 if(self.isSameStartDate(_255,date)&&self.isSameFinishDate(_255,date)){ 1862 _259=self.setSchedule(_255,_25b,_252,_250,_251); 1863 _259.cellDate=date; 1864 _256.push(_259); 1865 }else{ 1866 sub=self.copyOneDaySchedule(_255,date); 1848 1867 if(sub.finish.hour==0&&sub.finish.min==0){ 1849 1868 throw $continue; 1850 1869 } 1851 _25 5=self.setSchedule(sub,_258,_24f,_24d,_24e);1852 _25 5.originalSchedule=_252;1853 _25 5.cellDate=date;1854 _25 3.push(_255);1870 _258=self.setSchedule(sub,_25b,_252,_250,_251); 1871 _258.originalSchedule=_255; 1872 _258.cellDate=date; 1873 _256.push(_258); 1855 1874 } 1856 1875 }else{ … … 1862 1881 if(!self.hasInvisibleSchedule){ 1863 1882 (self.invisibleWeek||[]).each(function(date){ 1864 if(self.calendar.betweenDate(_25 2,date)){1883 if(self.calendar.betweenDate(_255,date)){ 1865 1884 self.hasInvisibleSchedule=true; 1866 1885 throw $break; … … 1868 1887 }); 1869 1888 } 1870 if(!_25 1){1871 _25 3.each(function(item){1872 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_25 3));1873 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_25 3));1874 }); 1875 } 1876 if(!self.hasInvisibleSchedule&&(_25 3.length==0)){1889 if(!_254){ 1890 _256.each(function(item){ 1891 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_256)); 1892 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_256)); 1893 }); 1894 } 1895 if(!self.hasInvisibleSchedule&&(_256.length==0)){ 1877 1896 self.hasInvisibleSchedule=true; 1878 1897 } … … 1885 1904 new Hover(this.ids.pre); 1886 1905 new Hover(this.ids.next); 1887 var _25 b=this.calendar.options.clickDateText||this.clickDateText;1906 var _25e=this.calendar.options.clickDateText||this.clickDateText; 1888 1907 if(this.headers){ 1889 this.headers.each(function(_25 c){1890 Event.observe(_25 c.id,"mousedown",_25b.bindAsEventListener(this,_25c.wday));1908 this.headers.each(function(_25f){ 1909 Event.observe(_25f.id,"mousedown",_25e.bindAsEventListener(this,_25f.wday)); 1891 1910 }.bind(this)); 1892 1911 } 1893 1912 } 1894 },copyOneDaySchedule:function(_2 5d,date){1913 },copyOneDaySchedule:function(_260,date){ 1895 1914 var sub=null; 1896 if(this.isSameStartDate(_2 5d,date)){1897 sub=this.copySchedule(_2 5d,date);1915 if(this.isSameStartDate(_260,date)){ 1916 sub=this.copySchedule(_260,date); 1898 1917 sub.finish.hour=24; 1899 1918 sub.finish.min=0; 1900 1919 }else{ 1901 if(this.isSameFinishDate(_2 5d,date)){1902 sub=this.copySchedule(_2 5d,date);1920 if(this.isSameFinishDate(_260,date)){ 1921 sub=this.copySchedule(_260,date); 1903 1922 sub.start.hour=0; 1904 1923 sub.start.min=0; 1905 1924 }else{ 1906 sub=this.copySchedule(_2 5d,date);1925 sub=this.copySchedule(_260,date); 1907 1926 sub.start.hour=0; 1908 1927 sub.start.min=0; … … 1912 1931 } 1913 1932 return sub; 1914 },copySchedule:function(_26 0,date){1915 sub=Object.extend({},_26 0);1916 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_26 0.start.hour,min:_260.start.min};1917 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_26 0.finish.hour,min:_260.finish.min};1933 },copySchedule:function(_263,date){ 1934 sub=Object.extend({},_263); 1935 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_263.start.hour,min:_263.start.min}; 1936 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_263.finish.hour,min:_263.finish.min}; 1918 1937 return sub; 1919 },setSchedule:function(_26 2,_263,_264,_265,_266){1920 var _26 7=this.buildSchedule(_262);1921 var item=_26 7.first();1922 _26 5.appendChild(item);1938 },setSchedule:function(_265,_266,_267,_268,_269){ 1939 var _26a=this.buildSchedule(_265); 1940 var item=_26a.first(); 1941 _268.appendChild(item); 1923 1942 this.setScheduleBaseStyle(item); 1924 var left=this.adjustScheduleStyle(item,_26 3,_264[_263]);1925 var _26 a=_263*this.getAdjustSize();1926 var _26 b=this.column.width+_26a+"px";1927 if(!this.calendar.options.noEvent&&((_26 2.edit==undefined)||_262.edit)){1928 this.setDraggable(item,_26 7.last(),_265,_266);1943 var left=this.adjustScheduleStyle(item,_266,_267[_266]); 1944 var _26d=_266*this.getAdjustSize(); 1945 var _26e=this.column.width+_26d+"px"; 1946 if(!this.calendar.options.noEvent&&((_265.edit==undefined)||_265.edit)){ 1947 this.setDraggable(item,_26a.last(),_268,_269); 1929 1948 this.setResize(item); 1930 1949 } 1931 _26 4[_263].push(item);1950 _267[_266].push(item); 1932 1951 this.scheduleNodes.push(item); 1933 1952 return item; 1934 1953 },getDragDistance:function(){ 1935 var _26 c=this.getAdjustSize();1936 return [this.column.width+_26 c,this.column.height/2];1937 },setDraggable:function(item,_2 6e,_26f,_270){1954 var _26f=this.getAdjustSize(); 1955 return [this.column.width+_26f,this.column.height/2]; 1956 },setDraggable:function(item,_271,_272,_273){ 1938 1957 var self=this; 1939 new Draggable(item,{handle:_2 6e,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_274){1940 var _27 5=Element.getDimensions(item);1941 var _27 6=Element.getDimensions(_26f);1942 var _27 7=(self.column.height/2);1943 var _27 8=_274.offset;1944 x=Math.floor((x+_27 8[0])/_270[0])*_270[0];1945 y=Math.round((y)/_27 0[1])*_270[1];1946 xy=[self._constrain(x,0,_27 6.width-_275.width),self._constrain(y,0-(_275.height-_277),_276.height-_277)];1958 new Draggable(item,{handle:_271,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_277){ 1959 var _278=Element.getDimensions(item); 1960 var _279=Element.getDimensions(_272); 1961 var _27a=(self.column.height/2); 1962 var _27b=_277.offset; 1963 x=Math.floor((x+_27b[0])/_273[0])*_273[0]; 1964 y=Math.round((y)/_273[1])*_273[1]; 1965 xy=[self._constrain(x,0,_279.width-_278.width),self._constrain(y,0-(_278.height-_27a),_279.height-_27a)]; 1947 1966 return xy; 1948 },onEnd:function(_27 9,_27a){1949 self.changeSchedule(_27 9,_27a);1950 },change:function(_27 b){1951 self.changeTimeDisplay(_27 b.element);1967 },onEnd:function(_27c,_27d){ 1968 self.changeSchedule(_27c,_27d); 1969 },change:function(_27e){ 1970 self.changeTimeDisplay(_27e.element); 1952 1971 }}); 1953 1972 },setResize:function(item){ 1954 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_2 7d){1955 this.updateTirm(_2 7d);1956 }.bind(this),change:function(_2 7e){1957 this.changeTimeDisplay(_2 7e);1973 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_280){ 1974 this.updateTirm(_280); 1975 }.bind(this),change:function(_281){ 1976 this.changeTimeDisplay(_281); 1958 1977 }.bind(this)}); 1959 },getDate:function(_2 7f){1960 return _2 7f.date;1961 },abstractSelect:function(_28 0,_281){1962 var _28 2=this.findClickedElement(_280);1963 if(_28 2){1964 if(Element.hasClassName(_28 2,Calendar.className.columnDate)||Element.hasClassName(_282,Calendar.className.columnDateOdd)||Element.hasClassName(_282,Calendar.className.columnTopDate)){1965 var date=this.getDate(_28 2);1966 _28 1(date,_282);1978 },getDate:function(_282){ 1979 return _282.date; 1980 },abstractSelect:function(_283,_284){ 1981 var _285=this.findClickedElement(_283); 1982 if(_285){ 1983 if(Element.hasClassName(_285,Calendar.className.columnDate)||Element.hasClassName(_285,Calendar.className.columnDateOdd)||Element.hasClassName(_285,Calendar.className.columnTopDate)){ 1984 var date=this.getDate(_285); 1985 _284(date,_285); 1967 1986 } 1968 1987 } 1969 1988 },getSelectedTerm:function(){ 1970 var _28 4=this.calendar.getSelected();1971 if(_28 4.length==0){1989 var _287=this.calendar.getSelected(); 1990 if(_287.length==0){ 1972 1991 return; 1973 1992 } 1974 1993 if(this.calendar.options.build){ 1975 var last=_28 4.last();1994 var last=_287.last(); 1976 1995 if(last){ 1977 1996 last=this.dateMap[last.id]; 1978 1997 }else{ 1979 last=this.dateMap[_28 4.first().id];1998 last=this.dateMap[_287.first().id]; 1980 1999 } 1981 2000 last=new Date(last.getFullYear(),last.getMonth(),last.getDate(),last.getHours(),last.getMinutes(),0); 1982 2001 last.setMinutes(last.getMinutes()+30); 1983 return [this.dateMap[_28 4.first().id],last];1984 }else{ 1985 var last=this._getDateTimeFromElement(_28 4.last());2002 return [this.dateMap[_287.first().id],last]; 2003 }else{ 2004 var last=this._getDateTimeFromElement(_287.last()); 1986 2005 last.setMinutes(last.getMinutes()+30); 1987 return [this._getDateTimeFromElement(_28 4.first()),last];2006 return [this._getDateTimeFromElement(_287.first()),last]; 1988 2007 } 1989 2008 },setWidth:function(node){ 1990 2009 Element.setStyle(node,{width:this.column.width+"px"}); 1991 },inspectArgument:function(_28 7,time){1992 if(_28 7.date){1993 return _28 7;2010 },inspectArgument:function(_28a,time){ 2011 if(_28a.date){ 2012 return _28a; 1994 2013 } 1995 2014 var self=this; 1996 var _28 a=this.calendar.getSelected();1997 var _28 b=[];1998 this.calendar.recurrence(_28 7,function(o){1999 var _2 8d={};2015 var _28d=this.calendar.getSelected(); 2016 var _28e=[]; 2017 this.calendar.recurrence(_28a,function(o){ 2018 var _290={}; 2000 2019 if(!o.date){ 2001 _2 8d={date:self.getDate(_28a[0])};2020 _290={date:self.getDate(_28d[0])}; 2002 2021 if(!o.start){ 2003 _2 8d.start=_28a[0].time;2022 _290.start=_28d[0].time; 2004 2023 } 2005 2024 if(!o.finish){ 2006 _2 8d.finish=_28a[_28a.length-1].time;2007 } 2008 } 2009 Object.extend(_2 8d,o);2010 _28 b.push(_28d);2011 }); 2012 return _28 b;2025 _290.finish=_28d[_28d.length-1].time; 2026 } 2027 } 2028 Object.extend(_290,o); 2029 _28e.push(_290); 2030 }); 2031 return _28e; 2013 2032 },inspectDateArgument:function(date){ 2014 2033 if(date){ 2015 2034 return date; 2016 2035 } 2017 var _2 8f=this;2018 var _29 0=this.getSelected();2019 if(_29 0.length==0){2036 var _292=this; 2037 var _293=this.getSelected(); 2038 if(_293.length==0){ 2020 2039 return null; 2021 2040 } 2022 return _29 0.collect(function(d){2023 return _2 8f.getDate(d);2024 }); 2025 },addColumnClass:function(_29 2){2041 return _293.collect(function(d){ 2042 return _292.getDate(d); 2043 }); 2044 },addColumnClass:function(_295){ 2026 2045 if(document.all){ 2027 this.calendar.css.addClassNames(_29 2,"columnWin");2028 }else{ 2029 this.calendar.css.addClassNames(_29 2,"column");2046 this.calendar.css.addClassNames(_295,"columnWin"); 2047 }else{ 2048 this.calendar.css.addClassNames(_295,"column"); 2030 2049 } 2031 2050 },getHeaderId:function(){ … … 2033 2052 },getColumnId:function(i){ 2034 2053 return this.calendar.element.id.appendSuffix(CalendarWeek.id.column+"_"+i); 2035 },changeSchedule:function(_29 4,_295){2036 var _29 6=_294.element;2037 var _29 7=_296.schedule;2038 var time=this.getTimeByElement(_29 6);2039 this.calendar.cacheSchedule(_29 7);2040 var _29 9=$(this.getScheduleContainerId());2041 var _29 a=Element.getDimensions(_299);2042 var _29 b=Position.cumulativeOffset(_299);2043 var x=Event.pointerX(_29 5);2044 var y=Event.pointerY(_29 5);2045 var left=parseInt(Element.getStyle(_29 6,"left"));2046 var _2 9f=Math.round(left/this.column.width);2047 var date=this.week[_2 9f];2048 if(_29 7.start.year==date.getFullYear()&&_297.start.month==date.getMonth()&&_297.start.day==date.getDate()&&_297.start.hour==time[0].hour&&_297.start.min==time[0].min&&_297.finish.year==date.getFullYear()&&_297.finish.month==date.getMonth()&&_297.finish.day==date.getDate()&&_297.finish.hour==time[1].hour&&_297.finish.min==time[1].min){2054 },changeSchedule:function(_297,_298){ 2055 var _299=_297.element; 2056 var _29a=_299.schedule; 2057 var time=this.getTimeByElement(_299); 2058 this.calendar.cacheSchedule(_29a); 2059 var _29c=$(this.getScheduleContainerId()); 2060 var _29d=Element.getDimensions(_29c); 2061 var _29e=Position.cumulativeOffset(_29c); 2062 var x=Event.pointerX(_298); 2063 var y=Event.pointerY(_298); 2064 var left=parseInt(Element.getStyle(_299,"left")); 2065 var _2a2=Math.round(left/this.column.width); 2066 var date=this.week[_2a2]; 2067 if(_29a.start.year==date.getFullYear()&&_29a.start.month==date.getMonth()&&_29a.start.day==date.getDate()&&_29a.start.hour==time[0].hour&&_29a.start.min==time[0].min&&_29a.finish.year==date.getFullYear()&&_29a.finish.month==date.getMonth()&&_29a.finish.day==date.getDate()&&_29a.finish.hour==time[1].hour&&_29a.finish.min==time[1].min){ 2049 2068 this.calendar.refreshSchedule(); 2050 2069 return; 2051 2070 } 2052 if(_29 6.originalSchedule){2053 _29 7=_296.originalSchedule;2054 } 2055 var _2a 1={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min};2056 var _2a 2=DateUtil.toDate(_2a1);2057 var _2a 3=_296.cellDate.days()-DateUtil.toDate(_297.start).days();2058 _2a 2.setDate(_2a2.getDate()-_2a3);2059 var diff=_2a 2.getTime()-DateUtil.toDate(_297.start).getTime();2060 _29 7.start=_2a2.toHash();2061 _29 7.finish=new Date(DateUtil.toDate(_297.finish).getTime()+diff).toHash();2071 if(_299.originalSchedule){ 2072 _29a=_299.originalSchedule; 2073 } 2074 var _2a4={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 2075 var _2a5=DateUtil.toDate(_2a4); 2076 var _2a6=_299.cellDate.days()-DateUtil.toDate(_29a.start).days(); 2077 _2a5.setDate(_2a5.getDate()-_2a6); 2078 var diff=_2a5.getTime()-DateUtil.toDate(_29a.start).getTime(); 2079 _29a.start=_2a5.toHash(); 2080 _29a.finish=new Date(DateUtil.toDate(_29a.finish).getTime()+diff).toHash(); 2062 2081 this.calendar.refreshSchedule(); 2063 this.calendar.options.changeSchedule(_29 7);2064 },updateTirm:function(_2a 5){2065 var _2a 6=_2a5.schedule;2066 var time=this.getTimeByElement(_2a 5);2067 this.calendar.cacheSchedule(_2a 6);2068 var left=parseInt(Element.getStyle(_2a 5,"left"));2069 var _2a 9=Math.floor(left/this.column.width);2070 var date=this.week[_2a 9];2071 var _2a b=this.isChengeSchedule(_2a5,time);2072 if(_2a 5.originalSchedule){2073 _2a 6=_2a5.originalSchedule;2074 } 2075 if(_2a b.start){2076 _2a 6.start.year=date.getFullYear();2077 _2a 6.start.month=date.getMonth();2078 _2a 6.start.day=date.getDate();2079 _2a 6.start.hour=time[0].hour;2080 _2a 6.start.min=time[0].min;2081 } 2082 if(_2a b.finish){2083 _2a 6.finish.year=date.getFullYear();2084 _2a 6.finish.month=date.getMonth();2085 _2a 6.finish.day=date.getDate();2086 _2a 6.finish.hour=time[1].hour;2087 _2a 6.finish.min=time[1].min;2082 this.calendar.options.changeSchedule(_29a); 2083 },updateTirm:function(_2a8){ 2084 var _2a9=_2a8.schedule; 2085 var time=this.getTimeByElement(_2a8); 2086 this.calendar.cacheSchedule(_2a9); 2087 var left=parseInt(Element.getStyle(_2a8,"left")); 2088 var _2ac=Math.floor(left/this.column.width); 2089 var date=this.week[_2ac]; 2090 var _2ae=this.isChengeSchedule(_2a8,time); 2091 if(_2a8.originalSchedule){ 2092 _2a9=_2a8.originalSchedule; 2093 } 2094 if(_2ae.start){ 2095 _2a9.start.year=date.getFullYear(); 2096 _2a9.start.month=date.getMonth(); 2097 _2a9.start.day=date.getDate(); 2098 _2a9.start.hour=time[0].hour; 2099 _2a9.start.min=time[0].min; 2100 } 2101 if(_2ae.finish){ 2102 _2a9.finish.year=date.getFullYear(); 2103 _2a9.finish.month=date.getMonth(); 2104 _2a9.finish.day=date.getDate(); 2105 _2a9.finish.hour=time[1].hour; 2106 _2a9.finish.min=time[1].min; 2088 2107 } 2089 2108 this.calendar.refreshSchedule(); 2090 if(_2a b.start||_2ab.finish){2091 this.calendar.options.updateTirm(_2a 6);2092 } 2093 },changeTimeDisplay:function(_2a c){2094 var _2 ad=_2ac.schedule;2095 var time=this.getTimeByElement(_2a c);2096 var _2 af=Element.getElementsByClassName(_2ac,Calendar.className.scheduleTimeArea)[0];2109 if(_2ae.start||_2ae.finish){ 2110 this.calendar.options.updateTirm(_2a9); 2111 } 2112 },changeTimeDisplay:function(_2af){ 2113 var _2b0=_2af.schedule; 2114 var time=this.getTimeByElement(_2af); 2115 var _2b2=Element.getElementsByClassName(_2af,Calendar.className.scheduleTimeArea)[0]; 2097 2116 var text=this.getTimeText(time[0],time[1]); 2098 _2 af.innerHTML=text;2099 },findClickedElement:function(_2b 1){2100 var _2b 2=$(this.getScheduleContainerId());2101 var _2b 3=Position.cumulativeOffset(_2b2);2102 var _2b 4=Position.realOffset(_2b2).last();2103 _2b 4-=document.documentElement.scrollTop||document.body.scrollTop;2104 var x=Event.pointerX(_2b 1)-_2b3[0];2105 var y=Event.pointerY(_2b 1)-_2b3[1]+_2b4;2106 var _2b 7=Math.floor(y/this.column.height);2107 var _2b 8=Math.floor(x/this.column.width);2117 _2b2.innerHTML=text; 2118 },findClickedElement:function(_2b4){ 2119 var _2b5=$(this.getScheduleContainerId()); 2120 var _2b6=Position.cumulativeOffset(_2b5); 2121 var _2b7=Position.realOffset(_2b5).last(); 2122 _2b7-=document.documentElement.scrollTop||document.body.scrollTop; 2123 var x=Event.pointerX(_2b4)-_2b6[0]; 2124 var y=Event.pointerY(_2b4)-_2b6[1]+_2b7; 2125 var _2ba=Math.floor(y/this.column.height); 2126 var _2bb=Math.floor(x/this.column.width); 2108 2127 var row=this.calendarTable.rows[0]; 2109 if(_2b 8>=row.cells.length){2110 _2b 8--;2111 } 2112 return $(row.cells[_2b 8]).down(_2b7);2113 },multipleSelection:function(_2b a){2128 if(_2bb>=row.cells.length){ 2129 _2bb--; 2130 } 2131 return $(row.cells[_2bb]).down(_2ba); 2132 },multipleSelection:function(_2bd){ 2114 2133 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 2115 2134 return; 2116 2135 } 2117 2136 var self=this; 2118 var _2b c=this.calendar;2119 var _2 bd=this.calendar.selectedBase;2120 var _2 be=this._getDateFromElement(_2bd).getDate();2121 this.abstractSelect(_2b a,function(date,_2c0){2122 var _2c 1=$(_2bd.id);2123 if(_2 be!=self._getDateFromElement(_2c0).getDate()){2137 var _2bf=this.calendar; 2138 var _2c0=this.calendar.selectedBase; 2139 var _2c1=this._getDateFromElement(_2c0).getDate(); 2140 this.abstractSelect(_2bd,function(date,_2c3){ 2141 var _2c4=$(_2c0.id); 2142 if(_2c1!=self._getDateFromElement(_2c3).getDate()){ 2124 2143 return; 2125 2144 } 2126 var _2c 2=$A(_2c1.parentNode.childNodes);2127 var ids=[this._getTime(_2 bd),this._getTime(_2c0)];2145 var _2c5=$A(_2c4.parentNode.childNodes); 2146 var ids=[this._getTime(_2c0),this._getTime(_2c3)]; 2128 2147 ids.sort(function(a,b){ 2129 2148 return a-b; 2130 2149 }); 2131 _2c 2.each(function(n){2150 _2c5.each(function(n){ 2132 2151 if(!n.id){ 2133 2152 throw $continue; … … 2135 2154 var id=this._getTime(n); 2136 2155 if((id<ids[0])||(ids[1]<id)){ 2137 _2b c.removeSelectedClass(n);2156 _2bf.removeSelectedClass(n); 2138 2157 }else{ 2139 2158 if(!Element.hasClassName(n,Calendar.className.selected)){ 2140 _2b c.addSelectedClass(n);2159 _2bf.addSelectedClass(n); 2141 2160 } 2142 2161 } 2143 2162 }.bind(this)); 2144 2163 }.bind(this)); 2145 },getTimeByElement:function(_2c 8){2146 var _2c 9=_2c8.schedule;2147 var top=parseInt(Element.getStyle(_2c 8,"top"),10);2148 var _2c b=parseInt(Element.getStyle(_2c8,"height"),10);2149 var _2c c=this.column.height*2;2150 var _2 cd=15/60;2151 var _2 ce=top/_2cc+this.startTime;2152 _2 ce=Math.round(_2ce/_2cd)*_2cd;2153 var _2 cf={};2154 _2 cf.hour=Math.floor(_2ce);2155 _2 cf.min=(_2ce-_2cf.hour)*60;2156 var _2d 0=Math.round(_2cb/_2cc/_2cd)*_2cd+_2ce;2157 var _2d 1={};2158 _2d 1.hour=Math.floor(_2d0);2159 _2d 1.min=Math.round((_2d0-_2d1.hour)*60);2160 if(_2d 1.min==60){2161 _2d 1.hour+=1;2162 _2d 1.min=0;2163 } 2164 return [_2 cf,_2d1];2164 },getTimeByElement:function(_2cb){ 2165 var _2cc=_2cb.schedule; 2166 var top=parseInt(Element.getStyle(_2cb,"top"),10); 2167 var _2ce=parseInt(Element.getStyle(_2cb,"height"),10); 2168 var _2cf=this.column.height*2; 2169 var _2d0=15/60; 2170 var _2d1=top/_2cf+this.startTime; 2171 _2d1=Math.round(_2d1/_2d0)*_2d0; 2172 var _2d2={}; 2173 _2d2.hour=Math.floor(_2d1); 2174 _2d2.min=(_2d1-_2d2.hour)*60; 2175 var _2d3=Math.round(_2ce/_2cf/_2d0)*_2d0+_2d1; 2176 var _2d4={}; 2177 _2d4.hour=Math.floor(_2d3); 2178 _2d4.min=Math.round((_2d3-_2d4.hour)*60); 2179 if(_2d4.min==60){ 2180 _2d4.hour+=1; 2181 _2d4.min=0; 2182 } 2183 return [_2d2,_2d4]; 2165 2184 },getTimeByTop:function(top){ 2166 var _2d 3=this.column.height*2;2167 var _2d 4=15/60;2168 var _2d 5=top/_2d3+this.startTime;2169 _2d 5=Math.round(_2d5/_2d4)*_2d4;2170 var _2d 6={};2171 _2d 6.hour=Math.floor(_2d5);2172 _2d 6.min=(_2d5-_2d6.hour)*60;2173 return _2d 6;2174 },getDateId:function(date,time,_2d 9){2175 var id=this.calendar.element.id.appendSuffix(_2d 9+"_"+date.getDate());2185 var _2d6=this.column.height*2; 2186 var _2d7=15/60; 2187 var _2d8=top/_2d6+this.startTime; 2188 _2d8=Math.round(_2d8/_2d7)*_2d7; 2189 var _2d9={}; 2190 _2d9.hour=Math.floor(_2d8); 2191 _2d9.min=(_2d8-_2d9.hour)*60; 2192 return _2d9; 2193 },getDateId:function(date,time,_2dc){ 2194 var id=this.calendar.element.id.appendSuffix(_2dc+"_"+date.getDate()); 2176 2195 return id.appendSuffix(time*10); 2177 2196 },dateIdToTime:function(id){ … … 2185 2204 time.pop(); 2186 2205 return time.join(":"); 2187 },includeDisplayTime:function(_2 df,_2e0){2188 if(_2e 0){2189 return (this.startTime<_2 df)&&(_2df<this.finishTime);2190 }else{ 2191 return (this.startTime<=_2 df)&&(_2df<this.finishTime);2192 } 2193 },convertHours:function(_2e 1){2194 return [_2e 1.start.hour+_2e1.start.min/60,_2e1.finish.hour+_2e1.finish.min/60];2206 },includeDisplayTime:function(_2e2,_2e3){ 2207 if(_2e3){ 2208 return (this.startTime<_2e2)&&(_2e2<this.finishTime); 2209 }else{ 2210 return (this.startTime<=_2e2)&&(_2e2<this.finishTime); 2211 } 2212 },convertHours:function(_2e4){ 2213 return [_2e4.start.hour+_2e4.start.min/60,_2e4.finish.hour+_2e4.finish.min/60]; 2195 2214 },setDisplayTime:function(){ 2196 2215 this.startTime=this.calendar.options.displayTime.first().hour; 2197 var _2e 2=this.calendar.options.displayTime.last();2198 this.finishTime=Math.ceil(_2e 2.hour+_2e2.min/60);2199 },getTimeText:function(_2e 3,_2e4){2200 var _2e 5=this.calendar;2201 return _2e 5.formatTime(_2e3)+" - "+_2e5.formatTime(_2e4);2202 },isChengeSchedule:function(_2e 6,_2e7){2203 var _2e 8=_2e6.schedule;2204 var _2e 9=((_2e8.start.hour!=_2e7[0].hour)||(_2e8.start.min!=_2e7[0].min));2205 var _2e a=((_2e8.finish.hour!=_2e7[1].hour)||(_2e8.finish.min!=_2e7[1].min));2206 if(_2e 6.originalSchedule){2207 if(_2e 9&&_2ea){2208 var _2e b=DateUtil.toDate(_2e8.start).getTime();2209 var _2e c=DateUtil.toDate(_2e6.originalSchedule.start).getTime();2210 if(_2e b==_2ec){2211 _2e a=false;2212 }else{ 2213 _2e 9=false;2214 } 2215 }else{ 2216 _2e 9=false;2217 } 2218 } 2219 return {start:_2e 9,finish:_2ea};2220 },_getDateFromElement:function(_2 ed){2221 var arr=_2 ed.id.split("_");2222 var _2 ef=arr[arr.length-3];2223 return this.week[_2 ef];2224 },_getDateTimeFromElement:function(_2f 0){2225 var id=_2f 0.id.split("_");2226 var _2f 2=id[id.length-3];2227 if(this.week[_2f 2]){2228 var date=new Date(this.week[_2f 2].getTime());2216 var _2e5=this.calendar.options.displayTime.last(); 2217 this.finishTime=Math.ceil(_2e5.hour+_2e5.min/60); 2218 },getTimeText:function(_2e6,_2e7){ 2219 var _2e8=this.calendar; 2220 return _2e8.formatTime(_2e6)+" - "+_2e8.formatTime(_2e7); 2221 },isChengeSchedule:function(_2e9,_2ea){ 2222 var _2eb=_2e9.schedule; 2223 var _2ec=((_2eb.start.hour!=_2ea[0].hour)||(_2eb.start.min!=_2ea[0].min)); 2224 var _2ed=((_2eb.finish.hour!=_2ea[1].hour)||(_2eb.finish.min!=_2ea[1].min)); 2225 if(_2e9.originalSchedule){ 2226 if(_2ec&&_2ed){ 2227 var _2ee=DateUtil.toDate(_2eb.start).getTime(); 2228 var _2ef=DateUtil.toDate(_2e9.originalSchedule.start).getTime(); 2229 if(_2ee==_2ef){ 2230 _2ed=false; 2231 }else{ 2232 _2ec=false; 2233 } 2234 }else{ 2235 _2ec=false; 2236 } 2237 } 2238 return {start:_2ec,finish:_2ed}; 2239 },_getDateFromElement:function(_2f0){ 2240 var arr=_2f0.id.split("_"); 2241 var _2f2=arr[arr.length-3]; 2242 return this.week[_2f2]; 2243 },_getDateTimeFromElement:function(_2f3){ 2244 var id=_2f3.id.split("_"); 2245 var _2f5=id[id.length-3]; 2246 if(this.week[_2f5]){ 2247 var date=new Date(this.week[_2f5].getTime()); 2229 2248 date.setMinutes(parseInt(id.pop(),10)); 2230 2249 date.setHours(parseInt(id.pop(),10)); 2231 2250 return date; 2232 2251 }else{ 2233 return this._getDate(_2f 0);2234 } 2235 },_getDate:function(_2f 4){2236 var id=_2f 4.id.split("_");2252 return this._getDate(_2f3); 2253 } 2254 },_getDate:function(_2f7){ 2255 var id=_2f7.id.split("_"); 2237 2256 var date=new Date(this.calendar.date.getTime()); 2238 2257 date.setMinutes(parseInt(id.pop(),10)); 2239 2258 date.setHours(parseInt(id.pop(),10)); 2240 2259 return date; 2241 },_getTimeString:function(_2f 7){2242 var arr=_2f 7.id.split("_");2260 },_getTimeString:function(_2fa){ 2261 var arr=_2fa.id.split("_"); 2243 2262 var min=arr[arr.length-1]; 2244 2263 if(min=="0"){ … … 2250 2269 } 2251 2270 return arr[arr.length-2]+min; 2252 },_getTime:function(_2f a){2253 return parseInt(this._getTimeString(_2f a),10);2271 },_getTime:function(_2fd){ 2272 return parseInt(this._getTimeString(_2fd),10); 2254 2273 }}); 2255 2274 var CalendarDay=Class.create(); 2256 2275 CalendarDay.id=["dayHeader"]; 2257 2276 Object.extend(CalendarDay.prototype,CalendarWeek.prototype); 2258 Object.extend(CalendarDay.prototype,{initialize:function(_2f b){2259 var day=_2f b.date.getDay();2260 this.calendar=_2f b;2277 Object.extend(CalendarDay.prototype,{initialize:function(_2fe){ 2278 var day=_2fe.date.getDay(); 2279 this.calendar=_2fe; 2261 2280 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 2262 2281 this.dayIds=SpinelzUtil.concat(this.calendar.element.id,CalendarDay.id); … … 2273 2292 delete this.calendar.options.weekIndexOld; 2274 2293 },buildHeaderCenter:function(){ 2275 var _ 2fd=this.calendar.date.toDateString();2294 var _300=this.calendar.date.toDateString(); 2276 2295 if(this.calendar.options.dayHeaderFormat){ 2277 2296 var date=this.calendar.date; 2278 _ 2fd=new Template(this.calendar.options.dayHeaderFormat).evaluate({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),wday:this.calendar.options.dayOfWeek[date.getDay()]});2279 } 2280 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.dayIds.header+"' class='"+this.calendar.classNames.ym+"'>"+_ 2fd+"</span>"+"</td>";2297 _300=new Template(this.calendar.options.dayHeaderFormat).evaluate({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),wday:this.calendar.options.dayOfWeek[date.getDay()]}); 2298 } 2299 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.dayIds.header+"' class='"+this.calendar.classNames.ym+"'>"+_300+"</span>"+"</td>"; 2281 2300 },buildTimeLineTop:function(){ 2282 2301 return ""; 2283 2302 },buildCalendarHeader:function(){ 2284 2303 return ""; 2285 },changeCalendar:function(_ 2ff){2286 var _30 0=Event.element(_2ff);2287 var _30 1=new Date(this.calendar.date.toDateString());2288 if(this.hasClassName(_30 0,Calendar.className.preWeekMark)){2304 },changeCalendar:function(_302){ 2305 var _303=Event.element(_302); 2306 var _304=new Date(this.calendar.date.toDateString()); 2307 if(this.hasClassName(_303,Calendar.className.preWeekMark)){ 2289 2308 this.calendar.date.setDate(this.calendar.date.getDate()-1); 2290 2309 }else{ 2291 if(this.hasClassName(_30 0,Calendar.className.nextWeekMark)){2310 if(this.hasClassName(_303,Calendar.className.nextWeekMark)){ 2292 2311 this.calendar.date.setDate(this.calendar.date.getDate()+1); 2293 2312 } 2294 2313 } 2295 this.calendar.options.changeCalendar(this.calendar.date,_30 1);2314 this.calendar.options.changeCalendar(this.calendar.date,_304); 2296 2315 this.calendar.refresh(); 2297 2316 }}); 2298 2317 var CalendarResizeableEx=Class.create(); 2299 2318 Object.extend(CalendarResizeableEx.prototype,Resizeable.prototype); 2300 Object.extend(CalendarResizeableEx.prototype,{initialize:function(_30 2){2301 var _30 3=Object.extend({top:3,bottom:3,left:3,right:3,minHeight:0,minWidth:0,zindex:1000,resize:null,distance:1,change:Prototype.emptyFunction,restriction:true},arguments[1]||{});2302 this.element=$(_30 2);2319 Object.extend(CalendarResizeableEx.prototype,{initialize:function(_305){ 2320 var _306=Object.extend({top:3,bottom:3,left:3,right:3,minHeight:0,minWidth:0,zindex:1000,resize:null,distance:1,change:Prototype.emptyFunction,restriction:true},arguments[1]||{}); 2321 this.element=$(_305); 2303 2322 this.handle=this.element; 2304 2323 Element.makePositioned(this.element); 2305 this.options=_30 3;2324 this.options=_306; 2306 2325 this.active=false; 2307 2326 this.resizing=false; … … 2313 2332 this.eventKeypress=this.keyPress.bindAsEventListener(this); 2314 2333 this.registerEvents(); 2315 },startResize:function(_30 4){2316 Event.stop(_30 4);2317 if(Event.isLeftClick(_30 4)){2318 var src=Event.element(_30 4);2334 },startResize:function(_307){ 2335 Event.stop(_307); 2336 if(Event.isLeftClick(_307)){ 2337 var src=Event.element(_307); 2319 2338 if(src.tagName&&(src.tagName=="INPUT"||src.tagName=="SELECT"||src.tagName=="BUTTON"||src.tagName=="TEXTAREA")){ 2320 2339 return; 2321 2340 } 2322 var dir=this.directions(_30 4);2341 var dir=this.directions(_307); 2323 2342 if(dir.length>0){ 2324 2343 this.active=true; … … 2327 2346 this.startWidth=parseInt(Element.getStyle(this.element,"width"),10); 2328 2347 this.startHeight=parseInt(Element.getStyle(this.element,"height"),10); 2329 this.startX=_30 4.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;2330 this.startY=_30 4.clientY+document.body.scrollTop+document.documentElement.scrollTop;2348 this.startX=_307.clientX+document.body.scrollLeft+document.documentElement.scrollLeft; 2349 this.startY=_307.clientY+document.body.scrollTop+document.documentElement.scrollTop; 2331 2350 this.currentDirection=dir; 2332 2351 if(this.options.restriction){ 2333 var _30 7=this.element.parentNode;2334 this.restDimensions=Element.getDimensions(_30 7);2335 this.restOffset=Position.cumulativeOffset(_30 7);2352 var _30a=this.element.parentNode; 2353 this.restDimensions=Element.getDimensions(_30a); 2354 this.restOffset=Position.cumulativeOffset(_30a); 2336 2355 this.scroll=Position.realOffset(this.element)[1]-(document.documentElement.scrollTop||document.body.scrollTop); 2337 2356 } 2338 2357 } 2339 2358 } 2340 },draw:function(_30 8){2341 Event.stop(_30 8);2342 var _30 9=[Event.pointerX(_308),Event.pointerY(_308)];2343 var _30 a=this.element.style;2359 },draw:function(_30b){ 2360 Event.stop(_30b); 2361 var _30c=[Event.pointerX(_30b),Event.pointerY(_30b)]; 2362 var _30d=this.element.style; 2344 2363 if(this.currentDirection.indexOf("n")!=-1){ 2345 if(this.restOffset[1]-this.scroll>=_30 9[1]){2364 if(this.restOffset[1]-this.scroll>=_30c[1]){ 2346 2365 return; 2347 2366 } 2348 var _30 b=this.startY-_309[1];2349 var _30 c=this.map(this.startHeight+_30b);2350 if(_30 c>this.options.minHeight){2351 _30 a.height=(_30c-4)+"px";2352 _30 a.top=this.map(this.startTop-_30b)+"px";2367 var _30e=this.startY-_30c[1]; 2368 var _30f=this.map(this.startHeight+_30e); 2369 if(_30f>this.options.minHeight){ 2370 _30d.height=(_30f-4)+"px"; 2371 _30d.top=this.map(this.startTop-_30e)+"px"; 2353 2372 } 2354 2373 } 2355 2374 if(this.currentDirection.indexOf("w")!=-1){ 2356 var _30 b=this.map(this.startX-_309[0]);2357 var _3 0d=Element.getStyle(this.element,"margin-left")||"0";2358 var _3 0e=this.startWidth+_30b;2359 if(_3 0e>this.options.minWidth){2360 _30 a.left=(this.startLeft-_30b-parseInt(_30d))+"px";2361 _30 a.width=_30e+"px";2375 var _30e=this.map(this.startX-_30c[0]); 2376 var _310=Element.getStyle(this.element,"margin-left")||"0"; 2377 var _311=this.startWidth+_30e; 2378 if(_311>this.options.minWidth){ 2379 _30d.left=(this.startLeft-_30e-parseInt(_310))+"px"; 2380 _30d.width=_311+"px"; 2362 2381 } 2363 2382 } 2364 2383 if(this.currentDirection.indexOf("s")!=-1){ 2365 var _3 0f=this.restDimensions.height+this.restOffset[1];2366 var _30 b=_309[1]-this.startY;2367 if(_3 0f-this.scroll<=_309[1]){2384 var _312=this.restDimensions.height+this.restOffset[1]; 2385 var _30e=_30c[1]-this.startY; 2386 if(_312-this.scroll<=_30c[1]){ 2368 2387 return; 2369 2388 } 2370 var _30 c=this.map(this.startHeight+_309[1]-this.startY);2371 if(_30 c>this.options.minHeight){2372 _30 a.height=(_30c-4)+"px";2389 var _30f=this.map(this.startHeight+_30c[1]-this.startY); 2390 if(_30f>this.options.minHeight){ 2391 _30d.height=(_30f-4)+"px"; 2373 2392 } 2374 2393 } 2375 2394 if(this.currentDirection.indexOf("e")!=-1){ 2376 var _3 0e=this.map(this.startWidth+_309[0]-this.startX);2377 if(_3 0e>this.options.minWidth){2378 _30 a.width=_30e+"px";2379 } 2380 } 2381 if(_30 a.visibility=="hidden"){2382 _30 a.visibility="";2395 var _311=this.map(this.startWidth+_30c[0]-this.startX); 2396 if(_311>this.options.minWidth){ 2397 _30d.width=_311+"px"; 2398 } 2399 } 2400 if(_30d.visibility=="hidden"){ 2401 _30d.visibility=""; 2383 2402 } 2384 2403 this.options.change(this.element); 2385 },directions:function(_31 0){2386 var _31 1=[Event.pointerX(_310),Event.pointerY(_310)];2387 var _31 2=Position.cumulativeOffset(this.element);2388 var _31 3=document.documentElement.scrollTop||document.body.scrollTop;2389 var _31 4=Position.realOffset(this.element)[1]-_313;2390 var _31 5="";2391 if(this.between(_31 1[1]-_312[1]+_314,0,this.options.top)){2392 _31 5+="n";2393 } 2394 if(this.between((_31 2[1]+this.element.offsetHeight)-_311[1]-_314,0,this.options.bottom)){2395 _31 5+="s";2396 } 2397 if(this.between(_31 1[0]-_312[0],0,this.options.left)){2398 _31 5+="w";2399 } 2400 if(this.between((_31 2[0]+this.element.offsetWidth)-_311[0],0,this.options.right)){2401 _31 5+="e";2402 } 2403 return _31 5;2404 },map:function(_31 6){2405 return Math.round(_31 6/this.options.distance)*this.options.distance;2404 },directions:function(_313){ 2405 var _314=[Event.pointerX(_313),Event.pointerY(_313)]; 2406 var _315=Position.cumulativeOffset(this.element); 2407 var _316=document.documentElement.scrollTop||document.body.scrollTop; 2408 var _317=Position.realOffset(this.element)[1]-_316; 2409 var _318=""; 2410 if(this.between(_314[1]-_315[1]+_317,0,this.options.top)){ 2411 _318+="n"; 2412 } 2413 if(this.between((_315[1]+this.element.offsetHeight)-_314[1]-_317,0,this.options.bottom)){ 2414 _318+="s"; 2415 } 2416 if(this.between(_314[0]-_315[0],0,this.options.left)){ 2417 _318+="w"; 2418 } 2419 if(this.between((_315[0]+this.element.offsetWidth)-_314[0],0,this.options.right)){ 2420 _318+="e"; 2421 } 2422 return _318; 2423 },map:function(_319){ 2424 return Math.round(_319/this.options.distance)*this.options.distance; 2406 2425 }}); 2407 2426 spinelz/trunk/compress/javascripts/spinelz/spinelz_for_rubricks.js
r5977 r5978 2227 2227 var same=[]; 2228 2228 var self=this; 2229 if(!_22e.sames){ 2230 _22e.sames=[]; 2231 } 2229 2232 _22e.each(function(h){ 2230 2233 var _236=self.convertHours(h.schedule); … … 2243 2246 Element.setStyle(item,{left:left+"px"}); 2244 2247 }else{ 2248 var _23b=false; 2249 _22e.sames.each(function(_23c){ 2250 if(_23b){ 2251 throw $break; 2252 } 2253 same.each(function(s){ 2254 if(_23c.include(s)){ 2255 same=_23c; 2256 _23b=true; 2257 throw $break; 2258 } 2259 }); 2260 }); 2245 2261 same.push(item); 2246 var _23 b=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1;2262 var _23e=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 2247 2263 same.each(function(s,i){ 2248 var _23e=left+_23b*i+(2*i); 2249 Element.setStyle(s,{width:_23b+"px",left:_23e+"px"}); 2250 }); 2264 var _241=left+_23e*i+(2*i); 2265 Element.setStyle(s,{width:_23e+"px",left:_241+"px"}); 2266 }); 2267 if(!_23b){ 2268 _22e.sames.push(same); 2269 } 2251 2270 } 2252 2271 return left; 2253 2272 },setScheduleBaseStyle:function(item){ 2254 var _24 0=item.schedule;2255 if(!this.calendar.isSameDate(_24 0.start,_240.finish)){2256 _24 0.finish.hour=24;2257 _24 0.finish.min=0;2258 } 2259 var time=this.convertHours(_24 0);2260 var _24 2=time.first();2261 var _24 3=time.last();2262 var _24 4=this.column.height*2;2263 var diff=this.calendar.getTimeDiff(_24 0.start,_240.finish);2273 var _243=item.schedule; 2274 if(!this.calendar.isSameDate(_243.start,_243.finish)){ 2275 _243.finish.hour=24; 2276 _243.finish.min=0; 2277 } 2278 var time=this.convertHours(_243); 2279 var _245=time.first(); 2280 var _246=time.last(); 2281 var _247=this.column.height*2; 2282 var diff=this.calendar.getTimeDiff(_243.start,_243.finish); 2264 2283 var rate=(diff.hour+(diff.min/60))||1; 2265 2284 var over=0; 2266 2285 var top=0; 2267 var _24 9=0;2268 var _24 a=this.includeDisplayTime(_242);2269 var _24 b=this.includeDisplayTime(_243,true);2270 if(!_24 a&&!_24b){2271 if((this.startTime<=_24 2&&this.startTime<=_243)||(_242<this.finishTime&&_243<this.finishTime)){2272 top=_24 9=0;2286 var _24c=0; 2287 var _24d=this.includeDisplayTime(_245); 2288 var _24e=this.includeDisplayTime(_246,true); 2289 if(!_24d&&!_24e){ 2290 if((this.startTime<=_245&&this.startTime<=_246)||(_245<this.finishTime&&_246<this.finishTime)){ 2291 top=_24c=0; 2273 2292 Element.hide(item); 2274 2293 this.hasInvisibleSchedule=true; 2275 2294 }else{ 2276 2295 top=0; 2277 _24 9=_244*(this.finishTime-this.startTime)-3;2278 } 2279 }else{ 2280 if(_24 a){2281 top=_24 4*(_242-this.startTime);2282 _24 9=_244*rate-3;2296 _24c=_247*(this.finishTime-this.startTime)-3; 2297 } 2298 }else{ 2299 if(_24d){ 2300 top=_247*(_245-this.startTime); 2301 _24c=_247*rate-3; 2283 2302 }else{ 2284 2303 top=0; 2285 over=this.startTime-_24 2;2286 _24 9=_244*(rate-over);2287 } 2288 if(_24 b){2289 }else{ 2290 over=_24 3-this.finishTime;2291 _24 9-=_244*over;2304 over=this.startTime-_245; 2305 _24c=_247*(rate-over); 2306 } 2307 if(_24e){ 2308 }else{ 2309 over=_246-this.finishTime; 2310 _24c-=_247*over; 2292 2311 } 2293 2312 } 2294 2313 try{ 2295 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_24 9+"px"});2314 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_24c+"px"}); 2296 2315 } 2297 2316 catch(e){ … … 2305 2324 this.setCover(); 2306 2325 var self=this; 2307 var _2 4d=$(this.getScheduleContainerId());2308 var _2 4e=this.getDragDistance();2326 var _250=$(this.getScheduleContainerId()); 2327 var _251=this.getDragDistance(); 2309 2328 this.scheduleNodes=[]; 2310 var _2 4f=this.week.map(function(){2329 var _252=this.week.map(function(){ 2311 2330 return []; 2312 2331 }); 2313 var _25 0=this.week.legth-1;2314 var _25 1=this.calendar.options.noEvent;2315 this.calendar.options.schedules.each(function(_25 2){2316 var _25 3=[];2317 var sub,_25 5,_256=null;2318 self.week.each(function(date,_25 8){2319 if(self.calendar.betweenDate(_25 2,date)){2320 if(self.isSameStartDate(_25 2,date)&&self.isSameFinishDate(_252,date)){2321 _25 6=self.setSchedule(_252,_258,_24f,_24d,_24e);2322 _25 6.cellDate=date;2323 _25 3.push(_256);2324 }else{ 2325 sub=self.copyOneDaySchedule(_25 2,date);2332 var _253=this.week.legth-1; 2333 var _254=this.calendar.options.noEvent; 2334 this.calendar.options.schedules.each(function(_255){ 2335 var _256=[]; 2336 var sub,_258,_259=null; 2337 self.week.each(function(date,_25b){ 2338 if(self.calendar.betweenDate(_255,date)){ 2339 if(self.isSameStartDate(_255,date)&&self.isSameFinishDate(_255,date)){ 2340 _259=self.setSchedule(_255,_25b,_252,_250,_251); 2341 _259.cellDate=date; 2342 _256.push(_259); 2343 }else{ 2344 sub=self.copyOneDaySchedule(_255,date); 2326 2345 if(sub.finish.hour==0&&sub.finish.min==0){ 2327 2346 throw $continue; 2328 2347 } 2329 _25 5=self.setSchedule(sub,_258,_24f,_24d,_24e);2330 _25 5.originalSchedule=_252;2331 _25 5.cellDate=date;2332 _25 3.push(_255);2348 _258=self.setSchedule(sub,_25b,_252,_250,_251); 2349 _258.originalSchedule=_255; 2350 _258.cellDate=date; 2351 _256.push(_258); 2333 2352 } 2334 2353 }else{ … … 2340 2359 if(!self.hasInvisibleSchedule){ 2341 2360 (self.invisibleWeek||[]).each(function(date){ 2342 if(self.calendar.betweenDate(_25 2,date)){2361 if(self.calendar.betweenDate(_255,date)){ 2343 2362 self.hasInvisibleSchedule=true; 2344 2363 throw $break; … … 2346 2365 }); 2347 2366 } 2348 if(!_25 1){2349 _25 3.each(function(item){2350 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_25 3));2351 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_25 3));2352 }); 2353 } 2354 if(!self.hasInvisibleSchedule&&(_25 3.length==0)){2367 if(!_254){ 2368 _256.each(function(item){ 2369 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_256)); 2370 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_256)); 2371 }); 2372 } 2373 if(!self.hasInvisibleSchedule&&(_256.length==0)){ 2355 2374 self.hasInvisibleSchedule=true; 2356 2375 } … … 2363 2382 new Hover(this.ids.pre); 2364 2383 new Hover(this.ids.next); 2365 var _25 b=this.calendar.options.clickDateText||this.clickDateText;2384 var _25e=this.calendar.options.clickDateText||this.clickDateText; 2366 2385 if(this.headers){ 2367 this.headers.each(function(_25 c){2368 Event.observe(_25 c.id,"mousedown",_25b.bindAsEventListener(this,_25c.wday));2386 this.headers.each(function(_25f){ 2387 Event.observe(_25f.id,"mousedown",_25e.bindAsEventListener(this,_25f.wday)); 2369 2388 }.bind(this)); 2370 2389 } 2371 2390 } 2372 },copyOneDaySchedule:function(_2 5d,date){2391 },copyOneDaySchedule:function(_260,date){ 2373 2392 var sub=null; 2374 if(this.isSameStartDate(_2 5d,date)){2375 sub=this.copySchedule(_2 5d,date);2393 if(this.isSameStartDate(_260,date)){ 2394 sub=this.copySchedule(_260,date); 2376 2395 sub.finish.hour=24; 2377 2396 sub.finish.min=0; 2378 2397 }else{ 2379 if(this.isSameFinishDate(_2 5d,date)){2380 sub=this.copySchedule(_2 5d,date);2398 if(this.isSameFinishDate(_260,date)){ 2399 sub=this.copySchedule(_260,date); 2381 2400 sub.start.hour=0; 2382 2401 sub.start.min=0; 2383 2402 }else{ 2384 sub=this.copySchedule(_2 5d,date);2403 sub=this.copySchedule(_260,date); 2385 2404 sub.start.hour=0; 2386 2405 sub.start.min=0; … … 2390 2409 } 2391 2410 return sub; 2392 },copySchedule:function(_26 0,date){2393 sub=Object.extend({},_26 0);2394 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_26 0.start.hour,min:_260.start.min};2395 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_26 0.finish.hour,min:_260.finish.min};2411 },copySchedule:function(_263,date){ 2412 sub=Object.extend({},_263); 2413 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_263.start.hour,min:_263.start.min}; 2414 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_263.finish.hour,min:_263.finish.min}; 2396 2415 return sub; 2397 },setSchedule:function(_26 2,_263,_264,_265,_266){2398 var _26 7=this.buildSchedule(_262);2399 var item=_26 7.first();2400 _26 5.appendChild(item);2416 },setSchedule:function(_265,_266,_267,_268,_269){ 2417 var _26a=this.buildSchedule(_265); 2418 var item=_26a.first(); 2419 _268.appendChild(item); 2401 2420 this.setScheduleBaseStyle(item); 2402 var left=this.adjustScheduleStyle(item,_26 3,_264[_263]);2403 var _26 a=_263*this.getAdjustSize();2404 var _26 b=this.column.width+_26a+"px";2405 if(!this.calendar.options.noEvent&&((_26 2.edit==undefined)||_262.edit)){2406 this.setDraggable(item,_26 7.last(),_265,_266);2421 var left=this.adjustScheduleStyle(item,_266,_267[_266]); 2422 var _26d=_266*this.getAdjustSize(); 2423 var _26e=this.column.width+_26d+"px"; 2424 if(!this.calendar.options.noEvent&&((_265.edit==undefined)||_265.edit)){ 2425 this.setDraggable(item,_26a.last(),_268,_269); 2407 2426 this.setResize(item); 2408 2427 } 2409 _26 4[_263].push(item);2428 _267[_266].push(item); 2410 2429 this.scheduleNodes.push(item); 2411 2430 return item; 2412 2431 },getDragDistance:function(){ 2413 var _26 c=this.getAdjustSize();2414 return [this.column.width+_26 c,this.column.height/2];2415 },setDraggable:function(item,_2 6e,_26f,_270){2432 var _26f=this.getAdjustSize(); 2433 return [this.column.width+_26f,this.column.height/2]; 2434 },setDraggable:function(item,_271,_272,_273){ 2416 2435 var self=this; 2417 new Draggable(item,{handle:_2 6e,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_274){2418 var _27 5=Element.getDimensions(item);2419 var _27 6=Element.getDimensions(_26f);2420 var _27 7=(self.column.height/2);2421 var _27 8=_274.offset;2422 x=Math.floor((x+_27 8[0])/_270[0])*_270[0];2423 y=Math.round((y)/_27 0[1])*_270[1];2424 xy=[self._constrain(x,0,_27 6.width-_275.width),self._constrain(y,0-(_275.height-_277),_276.height-_277)];2436 new Draggable(item,{handle:_271,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_277){ 2437 var _278=Element.getDimensions(item); 2438 var _279=Element.getDimensions(_272); 2439 var _27a=(self.column.height/2); 2440 var _27b=_277.offset; 2441 x=Math.floor((x+_27b[0])/_273[0])*_273[0]; 2442 y=Math.round((y)/_273[1])*_273[1]; 2443 xy=[self._constrain(x,0,_279.width-_278.width),self._constrain(y,0-(_278.height-_27a),_279.height-_27a)]; 2425 2444 return xy; 2426 },onEnd:function(_27 9,_27a){2427 self.changeSchedule(_27 9,_27a);2428 },change:function(_27 b){2429 self.changeTimeDisplay(_27 b.element);2445 },onEnd:function(_27c,_27d){ 2446 self.changeSchedule(_27c,_27d); 2447 },change:function(_27e){ 2448 self.changeTimeDisplay(_27e.element); 2430 2449 }}); 2431 2450 },setResize:function(item){ 2432 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_2 7d){2433 this.updateTirm(_2 7d);2434 }.bind(this),change:function(_2 7e){2435 this.changeTimeDisplay(_2 7e);2451 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_280){ 2452 this.updateTirm(_280); 2453 }.bind(this),change:function(_281){ 2454 this.changeTimeDisplay(_281); 2436 2455 }.bind(this)}); 2437 },getDate:function(_2 7f){2438 return _2 7f.date;2439 },abstractSelect:function(_28 0,_281){2440 var _28 2=this.findClickedElement(_280);2441 if(_28 2){2442 if(Element.hasClassName(_28 2,Calendar.className.columnDate)||Element.hasClassName(_282,Calendar.className.columnDateOdd)||Element.hasClassName(_282,Calendar.className.columnTopDate)){2443 var date=this.getDate(_28 2);2444 _28 1(date,_282);2456 },getDate:function(_282){ 2457 return _282.date; 2458 },abstractSelect:function(_283,_284){ 2459 var _285=this.findClickedElement(_283); 2460 if(_285){ 2461 if(Element.hasClassName(_285,Calendar.className.columnDate)||Element.hasClassName(_285,Calendar.className.columnDateOdd)||Element.hasClassName(_285,Calendar.className.columnTopDate)){ 2462 var date=this.getDate(_285); 2463 _284(date,_285); 2445 2464 } 2446 2465 } 2447 2466 },getSelectedTerm:function(){ 2448 var _28 4=this.calendar.getSelected();2449 if(_28 4.length==0){2467 var _287=this.calendar.getSelected(); 2468 if(_287.length==0){ 2450 2469 return; 2451 2470 } 2452 2471 if(this.calendar.options.build){ 2453 var last=_28 4.last();2472 var last=_287.last(); 2454 2473 if(last){ 2455 2474 last=this.dateMap[last.id]; 2456 2475 }else{ 2457 last=this.dateMap[_28 4.first().id];2476 last=this.dateMap[_287.first().id]; 2458 2477 } 2459 2478 last=new Date(last.getFullYear(),last.getMonth(),last.getDate(),last.getHours(),last.getMinutes(),0); 2460 2479 last.setMinutes(last.getMinutes()+30); 2461 return [this.dateMap[_28 4.first().id],last];2462 }else{ 2463 var last=this._getDateTimeFromElement(_28 4.last());2480 return [this.dateMap[_287.first().id],last]; 2481 }else{ 2482 var last=this._getDateTimeFromElement(_287.last()); 2464 2483 last.setMinutes(last.getMinutes()+30); 2465 return [this._getDateTimeFromElement(_28 4.first()),last];2484 return [this._getDateTimeFromElement(_287.first()),last]; 2466 2485 } 2467 2486 },setWidth:function(node){ 2468 2487 Element.setStyle(node,{width:this.column.width+"px"}); 2469 },inspectArgument:function(_28 7,time){2470 if(_28 7.date){2471 return _28 7;2488 },inspectArgument:function(_28a,time){ 2489 if(_28a.date){ 2490 return _28a; 2472 2491 } 2473 2492 var self=this; 2474 var _28 a=this.calendar.getSelected();2475 var _28 b=[];2476 this.calendar.recurrence(_28 7,function(o){2477 var _2 8d={};2493 var _28d=this.calendar.getSelected(); 2494 var _28e=[]; 2495 this.calendar.recurrence(_28a,function(o){ 2496 var _290={}; 2478 2497 if(!o.date){ 2479 _2 8d={date:self.getDate(_28a[0])};2498 _290={date:self.getDate(_28d[0])}; 2480 2499 if(!o.start){ 2481 _2 8d.start=_28a[0].time;2500 _290.start=_28d[0].time; 2482 2501 } 2483 2502 if(!o.finish){ 2484 _2 8d.finish=_28a[_28a.length-1].time;2485 } 2486 } 2487 Object.extend(_2 8d,o);2488 _28 b.push(_28d);2489 }); 2490 return _28 b;2503 _290.finish=_28d[_28d.length-1].time; 2504 } 2505 } 2506 Object.extend(_290,o); 2507 _28e.push(_290); 2508 }); 2509 return _28e; 2491 2510 },inspectDateArgument:function(date){ 2492 2511 if(date){ 2493 2512 return date; 2494 2513 } 2495 var _2 8f=this;2496 var _29 0=this.getSelected();2497 if(_29 0.length==0){2514 var _292=this; 2515 var _293=this.getSelected(); 2516 if(_293.length==0){ 2498 2517 return null; 2499 2518 } 2500 return _29 0.collect(function(d){2501 return _2 8f.getDate(d);2502 }); 2503 },addColumnClass:function(_29 2){2519 return _293.collect(function(d){ 2520 return _292.getDate(d); 2521 }); 2522 },addColumnClass:function(_295){ 2504 2523 if(document.all){ 2505 this.calendar.css.addClassNames(_29 2,"columnWin");2506 }else{ 2507 this.calendar.css.addClassNames(_29 2,"column");2524 this.calendar.css.addClassNames(_295,"columnWin"); 2525 }else{ 2526 this.calendar.css.addClassNames(_295,"column"); 2508 2527 } 2509 2528 },getHeaderId:function(){ … … 2511 2530 },getColumnId:function(i){ 2512 2531 return this.calendar.element.id.appendSuffix(CalendarWeek.id.column+"_"+i); 2513 },changeSchedule:function(_29 4,_295){2514 var _29 6=_294.element;2515 var _29 7=_296.schedule;2516 var time=this.getTimeByElement(_29 6);2517 this.calendar.cacheSchedule(_29 7);2518 var _29 9=$(this.getScheduleContainerId());2519 var _29 a=Element.getDimensions(_299);2520 var _29 b=Position.cumulativeOffset(_299);2521 var x=Event.pointerX(_29 5);2522 var y=Event.pointerY(_29 5);2523 var left=parseInt(Element.getStyle(_29 6,"left"));2524 var _2 9f=Math.round(left/this.column.width);2525 var date=this.week[_2 9f];2526 if(_29 7.start.year==date.getFullYear()&&_297.start.month==date.getMonth()&&_297.start.day==date.getDate()&&_297.start.hour==time[0].hour&&_297.start.min==time[0].min&&_297.finish.year==date.getFullYear()&&_297.finish.month==date.getMonth()&&_297.finish.day==date.getDate()&&_297.finish.hour==time[1].hour&&_297.finish.min==time[1].min){2532 },changeSchedule:function(_297,_298){ 2533 var _299=_297.element; 2534 var _29a=_299.schedule; 2535 var time=this.getTimeByElement(_299); 2536 this.calendar.cacheSchedule(_29a); 2537 var _29c=$(this.getScheduleContainerId()); 2538 var _29d=Element.getDimensions(_29c); 2539 var _29e=Position.cumulativeOffset(_29c); 2540 var x=Event.pointerX(_298); 2541 var y=Event.pointerY(_298); 2542 var left=parseInt(Element.getStyle(_299,"left")); 2543 var _2a2=Math.round(left/this.column.width); 2544 var date=this.week[_2a2]; 2545 if(_29a.start.year==date.getFullYear()&&_29a.start.month==date.getMonth()&&_29a.start.day==date.getDate()&&_29a.start.hour==time[0].hour&&_29a.start.min==time[0].min&&_29a.finish.year==date.getFullYear()&&_29a.finish.month==date.getMonth()&&_29a.finish.day==date.getDate()&&_29a.finish.hour==time[1].hour&&_29a.finish.min==time[1].min){ 2527 2546 this.calendar.refreshSchedule(); 2528 2547 return; 2529 2548 } 2530 if(_29 6.originalSchedule){2531 _29 7=_296.originalSchedule;2532 } 2533 var _2a 1={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min};2534 var _2a 2=DateUtil.toDate(_2a1);2535 var _2a 3=_296.cellDate.days()-DateUtil.toDate(_297.start).days();2536 _2a 2.setDate(_2a2.getDate()-_2a3);2537 var diff=_2a 2.getTime()-DateUtil.toDate(_297.start).getTime();2538 _29 7.start=_2a2.toHash();2539 _29 7.finish=new Date(DateUtil.toDate(_297.finish).getTime()+diff).toHash();2549 if(_299.originalSchedule){ 2550 _29a=_299.originalSchedule; 2551 } 2552 var _2a4={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 2553 var _2a5=DateUtil.toDate(_2a4); 2554 var _2a6=_299.cellDate.days()-DateUtil.toDate(_29a.start).days(); 2555 _2a5.setDate(_2a5.getDate()-_2a6); 2556 var diff=_2a5.getTime()-DateUtil.toDate(_29a.start).getTime(); 2557 _29a.start=_2a5.toHash(); 2558 _29a.finish=new Date(DateUtil.toDate(_29a.finish).getTime()+diff).toHash(); 2540 2559 this.calendar.refreshSchedule(); 2541 this.calendar.options.changeSchedule(_29 7);2542 },updateTirm:function(_2a 5){2543 var _2a 6=_2a5.schedule;2544 var time=this.getTimeByElement(_2a 5);2545 this.calendar.cacheSchedule(_2a 6);2546 var left=parseInt(Element.getStyle(_2a 5,"left"));2547 var _2a 9=Math.floor(left/this.column.width);2548 var date=this.week[_2a 9];2549 var _2a b=this.isChengeSchedule(_2a5,time);2550 if(_2a 5.originalSchedule){2551 _2a 6=_2a5.originalSchedule;2552 } 2553 if(_2a b.start){2554 _2a 6.start.year=date.getFullYear();2555 _2a 6.start.month=date.getMonth();2556 _2a 6.start.day=date.getDate();2557 _2a 6.start.hour=time[0].hour;2558 _2a 6.start.min=time[0].min;2559 } 2560 if(_2a b.finish){2561 _2a 6.finish.year=date.getFullYear();2562 _2a 6.finish.month=date.getMonth();2563 _2a 6.finish.day=date.getDate();2564 _2a 6.finish.hour=time[1].hour;2565 _2a 6.finish.min=time[1].min;2560 this.calendar.options.changeSchedule(_29a); 2561 },updateTirm:function(_2a8){ 2562 var _2a9=_2a8.schedule; 2563 var time=this.getTimeByElement(_2a8); 2564 this.calendar.cacheSchedule(_2a9); 2565 var left=parseInt(Element.getStyle(_2a8,"left")); 2566 var _2ac=Math.floor(left/this.column.width); 2567 var date=this.week[_2ac]; 2568 var _2ae=this.isChengeSchedule(_2a8,time); 2569 if(_2a8.originalSchedule){ 2570 _2a9=_2a8.originalSchedule; 2571 } 2572 if(_2ae.start){ 2573 _2a9.start.year=date.getFullYear(); 2574 _2a9.start.month=date.getMonth(); 2575 _2a9.start.day=date.getDate(); 2576 _2a9.start.hour=time[0].hour; 2577 _2a9.start.min=time[0].min; 2578 } 2579 if(_2ae.finish){ 2580 _2a9.finish.year=date.getFullYear(); 2581 _2a9.finish.month=date.getMonth(); 2582 _2a9.finish.day=date.getDate(); 2583 _2a9.finish.hour=time[1].hour; 2584 _2a9.finish.min=time[1].min; 2566 2585 } 2567 2586 this.calendar.refreshSchedule(); 2568 if(_2a b.start||_2ab.finish){2569 this.calendar.options.updateTirm(_2a 6);2570 } 2571 },changeTimeDisplay:function(_2a c){2572 var _2 ad=_2ac.schedule;2573 var time=this.getTimeByElement(_2a c);2574 var _2 af=Element.getElementsByClassName(_2ac,Calendar.className.scheduleTimeArea)[0];2587 if(_2ae.start||_2ae.finish){ 2588 this.calendar.options.updateTirm(_2a9); 2589 } 2590 },changeTimeDisplay:function(_2af){ 2591 var _2b0=_2af.schedule; 2592 var time=this.getTimeByElement(_2af); 2593 var _2b2=Element.getElementsByClassName(_2af,Calendar.className.scheduleTimeArea)[0]; 2575 2594 var text=this.getTimeText(time[0],time[1]); 2576 _2 af.innerHTML=text;2577 },findClickedElement:function(_2b 1){2578 var _2b 2=$(this.getScheduleContainerId());2579 var _2b 3=Position.cumulativeOffset(_2b2);2580 var _2b 4=Position.realOffset(_2b2).last();2581 _2b 4-=document.documentElement.scrollTop||document.body.scrollTop;2582 var x=Event.pointerX(_2b 1)-_2b3[0];2583 var y=Event.pointerY(_2b 1)-_2b3[1]+_2b4;2584 var _2b 7=Math.floor(y/this.column.height);2585 var _2b 8=Math.floor(x/this.column.width);2595 _2b2.innerHTML=text; 2596 },findClickedElement:function(_2b4){ 2597 var _2b5=$(this.getScheduleContainerId()); 2598 var _2b6=Position.cumulativeOffset(_2b5); 2599 var _2b7=Position.realOffset(_2b5).last(); 2600 _2b7-=document.documentElement.scrollTop||document.body.scrollTop; 2601 var x=Event.pointerX(_2b4)-_2b6[0]; 2602 var y=Event.pointerY(_2b4)-_2b6[1]+_2b7; 2603 var _2ba=Math.floor(y/this.column.height); 2604 var _2bb=Math.floor(x/this.column.width); 2586 2605 var row=this.calendarTable.rows[0]; 2587 if(_2b 8>=row.cells.length){2588 _2b 8--;2589 } 2590 return $(row.cells[_2b 8]).down(_2b7);2591 },multipleSelection:function(_2b a){2606 if(_2bb>=row.cells.length){ 2607 _2bb--; 2608 } 2609 return $(row.cells[_2bb]).down(_2ba); 2610 },multipleSelection:function(_2bd){ 2592 2611 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 2593 2612 return; 2594 2613 } 2595 2614 var self=this; 2596 var _2b c=this.calendar;2597 var _2 bd=this.calendar.selectedBase;2598 var _2 be=this._getDateFromElement(_2bd).getDate();2599 this.abstractSelect(_2b a,function(date,_2c0){2600 var _2c 1=$(_2bd.id);2601 if(_2 be!=self._getDateFromElement(_2c0).getDate()){2602 return; 2603 } 2604 var _2c 2=$A(_2c1.parentNode.childNodes);2605 var ids=[this._getTime(_2 bd),this._getTime(_2c0)];2615 var _2bf=this.calendar; 2616 var _2c0=this.calendar.selectedBase; 2617 var _2c1=this._getDateFromElement(_2c0).getDate(); 2618 this.abstractSelect(_2bd,function(date,_2c3){ 2619 var _2c4=$(_2c0.id); 2620 if(_2c1!=self._getDateFromElement(_2c3).getDate()){ 2621 return; 2622 } 2623 var _2c5=$A(_2c4.parentNode.childNodes); 2624 var ids=[this._getTime(_2c0),this._getTime(_2c3)]; 2606 2625 ids.sort(function(a,b){ 2607 2626 return a-b; 2608 2627 }); 2609 _2c 2.each(function(n){2628 _2c5.each(function(n){ 2610 2629 if(!n.id){ 2611 2630 throw $continue; … … 2613 2632 var id=this._getTime(n); 2614 2633 if((id<ids[0])||(ids[1]<id)){ 2615 _2b c.removeSelectedClass(n);2634 _2bf.removeSelectedClass(n); 2616 2635 }else{ 2617 2636 if(!Element.hasClassName(n,Calendar.className.selected)){ 2618 _2b c.addSelectedClass(n);2637 _2bf.addSelectedClass(n); 2619 2638 } 2620 2639 } 2621 2640 }.bind(this)); 2622 2641 }.bind(this)); 2623 },getTimeByElement:function(_2c 8){2624 var _2c 9=_2c8.schedule;2625 var top=parseInt(Element.getStyle(_2c 8,"top"),10);2626 var _2c b=parseInt(Element.getStyle(_2c8,"height"),10);2627 var _2c c=this.column.height*2;2628 var _2 cd=15/60;2629 var _2 ce=top/_2cc+this.startTime;2630 _2 ce=Math.round(_2ce/_2cd)*_2cd;2631 var _2 cf={};2632 _2 cf.hour=Math.floor(_2ce);2633 _2 cf.min=(_2ce-_2cf.hour)*60;2634 var _2d 0=Math.round(_2cb/_2cc/_2cd)*_2cd+_2ce;2635 var _2d 1={};2636 _2d 1.hour=Math.floor(_2d0);2637 _2d 1.min=Math.round((_2d0-_2d1.hour)*60);2638 if(_2d 1.min==60){2639 _2d 1.hour+=1;2640 _2d 1.min=0;2641 } 2642 return [_2 cf,_2d1];2642 },getTimeByElement:function(_2cb){ 2643 var _2cc=_2cb.schedule; 2644 var top=parseInt(Element.getStyle(_2cb,"top"),10); 2645 var _2ce=parseInt(Element.getStyle(_2cb,"height"),10); 2646 var _2cf=this.column.height*2; 2647 var _2d0=15/60; 2648 var _2d1=top/_2cf+this.startTime; 2649 _2d1=Math.round(_2d1/_2d0)*_2d0; 2650 var _2d2={}; 2651 _2d2.hour=Math.floor(_2d1); 2652 _2d2.min=(_2d1-_2d2.hour)*60; 2653 var _2d3=Math.round(_2ce/_2cf/_2d0)*_2d0+_2d1; 2654 var _2d4={}; 2655 _2d4.hour=Math.floor(_2d3); 2656 _2d4.min=Math.round((_2d3-_2d4.hour)*60); 2657 if(_2d4.min==60){ 2658 _2d4.hour+=1; 2659 _2d4.min=0; 2660 } 2661 return [_2d2,_2d4]; 2643 2662 },getTimeByTop:function(top){ 2644 var _2d 3=this.column.height*2;2645 var _2d 4=15/60;2646 var _2d 5=top/_2d3+this.startTime;2647 _2d 5=Math.round(_2d5/_2d4)*_2d4;2648 var _2d 6={};2649 _2d 6.hour=Math.floor(_2d5);2650 _2d 6.min=(_2d5-_2d6.hour)*60;2651 return _2d 6;2652 },getDateId:function(date,time,_2d 9){2653 var id=this.calendar.element.id.appendSuffix(_2d 9+"_"+date.getDate());2663 var _2d6=this.column.height*2; 2664 var _2d7=15/60; 2665 var _2d8=top/_2d6+this.startTime; 2666 _2d8=Math.round(_2d8/_2d7)*_2d7; 2667 var _2d9={}; 2668 _2d9.hour=Math.floor(_2d8); 2669 _2d9.min=(_2d8-_2d9.hour)*60; 2670 return _2d9; 2671 },getDateId:function(date,time,_2dc){ 2672 var id=this.calendar.element.id.appendSuffix(_2dc+"_"+date.getDate()); 2654 2673 return id.appendSuffix(time*10); 2655 2674 },dateIdToTime:function(id){ … … 2663 2682 time.pop(); 2664 2683 return time.join(":"); 2665 },includeDisplayTime:function(_2 df,_2e0){2666 if(_2e 0){2667 return (this.startTime<_2 df)&&(_2df<this.finishTime);2668 }else{ 2669 return (this.startTime<=_2 df)&&(_2df<this.finishTime);2670 } 2671 },convertHours:function(_2e 1){2672 return [_2e 1.start.hour+_2e1.start.min/60,_2e1.finish.hour+_2e1.finish.min/60];2684 },includeDisplayTime:function(_2e2,_2e3){ 2685 if(_2e3){ 2686 return (this.startTime<_2e2)&&(_2e2<this.finishTime); 2687 }else{ 2688 return (this.startTime<=_2e2)&&(_2e2<this.finishTime); 2689 } 2690 },convertHours:function(_2e4){ 2691 return [_2e4.start.hour+_2e4.start.min/60,_2e4.finish.hour+_2e4.finish.min/60]; 2673 2692 },setDisplayTime:function(){ 2674 2693 this.startTime=this.calendar.options.displayTime.first().hour; 2675 var _2e 2=this.calendar.options.displayTime.last();2676 this.finishTime=Math.ceil(_2e 2.hour+_2e2.min/60);2677 },getTimeText:function(_2e 3,_2e4){2678 var _2e 5=this.calendar;2679 return _2e 5.formatTime(_2e3)+" - "+_2e5.formatTime(_2e4);2680 },isChengeSchedule:function(_2e 6,_2e7){2681 var _2e 8=_2e6.schedule;2682 var _2e 9=((_2e8.start.hour!=_2e7[0].hour)||(_2e8.start.min!=_2e7[0].min));2683 var _2e a=((_2e8.finish.hour!=_2e7[1].hour)||(_2e8.finish.min!=_2e7[1].min));2684 if(_2e 6.originalSchedule){2685 if(_2e 9&&_2ea){2686 var _2e b=DateUtil.toDate(_2e8.start).getTime();2687 var _2e c=DateUtil.toDate(_2e6.originalSchedule.start).getTime();2688 if(_2e b==_2ec){2689 _2e a=false;2690 }else{ 2691 _2e 9=false;2692 } 2693 }else{ 2694 _2e 9=false;2695 } 2696 } 2697 return {start:_2e 9,finish:_2ea};2698 },_getDateFromElement:function(_2 ed){2699 var arr=_2 ed.id.split("_");2700 var _2 ef=arr[arr.length-3];2701 return this.week[_2 ef];2702 },_getDateTimeFromElement:function(_2f 0){2703 var id=_2f 0.id.split("_");2704 var _2f 2=id[id.length-3];2705 if(this.week[_2f 2]){2706 var date=new Date(this.week[_2f 2].getTime());2694 var _2e5=this.calendar.options.displayTime.last(); 2695 this.finishTime=Math.ceil(_2e5.hour+_2e5.min/60); 2696 },getTimeText:function(_2e6,_2e7){ 2697 var _2e8=this.calendar; 2698 return _2e8.formatTime(_2e6)+" - "+_2e8.formatTime(_2e7); 2699 },isChengeSchedule:function(_2e9,_2ea){ 2700 var _2eb=_2e9.schedule; 2701 var _2ec=((_2eb.start.hour!=_2ea[0].hour)||(_2eb.start.min!=_2ea[0].min)); 2702 var _2ed=((_2eb.finish.hour!=_2ea[1].hour)||(_2eb.finish.min!=_2ea[1].min)); 2703 if(_2e9.originalSchedule){ 2704 if(_2ec&&_2ed){ 2705 var _2ee=DateUtil.toDate(_2eb.start).getTime(); 2706 var _2ef=DateUtil.toDate(_2e9.originalSchedule.start).getTime(); 2707 if(_2ee==_2ef){ 2708 _2ed=false; 2709 }else{ 2710 _2ec=false; 2711 } 2712 }else{ 2713 _2ec=false; 2714 } 2715 } 2716 return {start:_2ec,finish:_2ed}; 2717 },_getDateFromElement:function(_2f0){ 2718 var arr=_2f0.id.split("_"); 2719 var _2f2=arr[arr.length-3]; 2720 return this.week[_2f2]; 2721 },_getDateTimeFromElement:function(_2f3){ 2722 var id=_2f3.id.split("_"); 2723 var _2f5=id[id.length-3]; 2724 if(this.week[_2f5]){ 2725 var date=new Date(this.week[_2f5].getTime()); 2707 2726 date.setMinutes(parseInt(id.pop(),10)); 2708 2727 date.setHours(parseInt(id.pop(),10)); 2709 2728 return date; 2710 2729 }else{ 2711 return this._getDate(_2f 0);2712 } 2713 },_getDate:function(_2f 4){2714 var id=_2f 4.id.split("_");2730 return this._getDate(_2f3); 2731 } 2732 },_getDate:function(_2f7){ 2733 var id=_2f7.id.split("_"); 2715 2734 var date=new Date(this.calendar.date.getTime()); 2716 2735 date.setMinutes(parseInt(id.pop(),10)); 2717 2736 date.setHours(parseInt(id.pop(),10)); 2718 2737 return date; 2719 },_getTimeString:function(_2f 7){2720 var arr=_2f 7.id.split("_");2738 },_getTimeString:function(_2fa){ 2739 var arr=_2fa.id.split("_"); 2721 2740 var min=arr[arr.length-1]; 2722 2741 if(min=="0"){ … … 2728 2747 } 2729 2748 return arr[arr.length-2]+min; 2730 },_getTime:function(_2f a){2731 return parseInt(this._getTimeString(_2f a),10);2749 },_getTime:function(_2fd){ 2750 return parseInt(this._getTimeString(_2fd),10); 2732 2751 }}); 2733 2752 var CalendarDay=Class.create(); 2734 2753 CalendarDay.id=["dayHeader"]; 2735 2754 Object.extend(CalendarDay.prototype,CalendarWeek.prototype); 2736 Object.extend(CalendarDay.prototype,{initialize:function(_2f b){2737 var day=_2f b.date.getDay();2738 this.calendar=_2f b;2755 Object.extend(CalendarDay.prototype,{initialize:function(_2fe){ 2756 var day=_2fe.date.getDay(); 2757 this.calendar=_2fe; 2739 2758 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 2740 2759 this.dayIds=SpinelzUtil.concat(this.calendar.element.id,CalendarDay.id); … … 2751 2770 delete this.calendar.options.weekIndexOld; 2752 2771 },buildHeaderCenter:function(){ 2753 var _ 2fd=this.calendar.date.toDateString();2772 var _300=this.calendar.date.toDateString(); 2754 2773 if(this.calendar.options.dayHeaderFormat){ 2755 2774 var date=this.calendar.date; 2756 _ 2fd=new Template(this.calendar.options.dayHeaderFormat).evaluate({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),wday:this.calendar.options.dayOfWeek[date.getDay()]});2757 } 2758 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.dayIds.header+"' class='"+this.calendar.classNames.ym+"'>"+_ 2fd+"</span>"+"</td>";2775 _300=new Template(this.calendar.options.dayHeaderFormat).evaluate({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),wday:this.calendar.options.dayOfWeek[date.getDay()]}); 2776 } 2777 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.dayIds.header+"' class='"+this.calendar.classNames.ym+"'>"+_300+"</span>"+"</td>"; 2759 2778 },buildTimeLineTop:function(){ 2760 2779 return ""; 2761 2780 },buildCalendarHeader:function(){ 2762 2781 return ""; 2763 },changeCalendar:function(_ 2ff){2764 var _30 0=Event.element(_2ff);2765 var _30 1=new Date(this.calendar.date.toDateString());2766 if(this.hasClassName(_30 0,Calendar.className.preWeekMark)){2782 },changeCalendar:function(_302){ 2783 var _303=Event.element(_302); 2784 var _304=new Date(this.calendar.date.toDateString()); 2785 if(this.hasClassName(_303,Calendar.className.preWeekMark)){ 2767 2786 this.calendar.date.setDate(this.calendar.date.getDate()-1); 2768 2787 }else{ 2769 if(this.hasClassName(_30 0,Calendar.className.nextWeekMark)){2788 if(this.hasClassName(_303,Calendar.className.nextWeekMark)){ 2770 2789 this.calendar.date.setDate(this.calendar.date.getDate()+1); 2771 2790 } 2772 2791 } 2773 this.calendar.options.changeCalendar(this.calendar.date,_30 1);2792 this.calendar.options.changeCalendar(this.calendar.date,_304); 2774 2793 this.calendar.refresh(); 2775 2794 }}); 2776 2795 var CalendarResizeableEx=Class.create(); 2777 2796 Object.extend(CalendarResizeableEx.prototype,Resizeable.prototype); 2778 Object.extend(CalendarResizeableEx.prototype,{initialize:function(_30 2){2779 var _30 3=Object.extend({top:3,bottom:3,left:3,right:3,minHeight:0,minWidth:0,zindex:1000,resize:null,distance:1,change:Prototype.emptyFunction,restriction:true},arguments[1]||{});2780 this.element=$(_30 2);2797 Object.extend(CalendarResizeableEx.prototype,{initialize:function(_305){ 2798 var _306=Object.extend({top:3,bottom:3,left:3,right:3,minHeight:0,minWidth:0,zindex:1000,resize:null,distance:1,change:Prototype.emptyFunction,restriction:true},arguments[1]||{}); 2799 this.element=$(_305); 2781 2800 this.handle=this.element; 2782 2801 Element.makePositioned(this.element); 2783 this.options=_30 3;2802 this.options=_306; 2784 2803 this.active=false; 2785 2804 this.resizing=false; … … 2791 2810 this.eventKeypress=this.keyPress.bindAsEventListener(this); 2792 2811 this.registerEvents(); 2793 },startResize:function(_30 4){2794 Event.stop(_30 4);2795 if(Event.isLeftClick(_30 4)){2796 var src=Event.element(_30 4);2812 },startResize:function(_307){ 2813 Event.stop(_307); 2814 if(Event.isLeftClick(_307)){ 2815 var src=Event.element(_307); 2797 2816 if(src.tagName&&(src.tagName=="INPUT"||src.tagName=="SELECT"||src.tagName=="BUTTON"||src.tagName=="TEXTAREA")){ 2798 2817 return; 2799 2818 } 2800 var dir=this.directions(_30 4);2819 var dir=this.directions(_307); 2801 2820 if(dir.length>0){ 2802 2821 this.active=true; … … 2805 2824 this.startWidth=parseInt(Element.getStyle(this.element,"width"),10); 2806 2825 this.startHeight=parseInt(Element.getStyle(this.element,"height"),10); 2807 this.startX=_30 4.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;2808 this.startY=_30 4.clientY+document.body.scrollTop+document.documentElement.scrollTop;2826 this.startX=_307.clientX+document.body.scrollLeft+document.documentElement.scrollLeft; 2827 this.startY=_307.clientY+document.body.scrollTop+document.documentElement.scrollTop; 2809 2828 this.currentDirection=dir; 2810 2829 if(this.options.restriction){ 2811 var _30 7=this.element.parentNode;2812 this.restDimensions=Element.getDimensions(_30 7);2813 this.restOffset=Position.cumulativeOffset(_30 7);2830 var _30a=this.element.parentNode; 2831 this.restDimensions=Element.getDimensions(_30a); 2832 this.restOffset=Position.cumulativeOffset(_30a); 2814 2833 this.scroll=Position.realOffset(this.element)[1]-(document.documentElement.scrollTop||document.body.scrollTop); 2815 2834 } 2816 2835 } 2817 2836 } 2818 },draw:function(_30 8){2819 Event.stop(_30 8);2820 var _30 9=[Event.pointerX(_308),Event.pointerY(_308)];2821 var _30 a=this.element.style;2837 },draw:function(_30b){ 2838 Event.stop(_30b); 2839 var _30c=[Event.pointerX(_30b),Event.pointerY(_30b)]; 2840 var _30d=this.element.style; 2822 2841 if(this.currentDirection.indexOf("n")!=-1){ 2823 if(this.restOffset[1]-this.scroll>=_30 9[1]){2824 return; 2825 } 2826 var _30 b=this.startY-_309[1];2827 var _30 c=this.map(this.startHeight+_30b);2828 if(_30 c>this.options.minHeight){2829 _30 a.height=(_30c-4)+"px";2830 _30 a.top=this.map(this.startTop-_30b)+"px";2842 if(this.restOffset[1]-this.scroll>=_30c[1]){ 2843 return; 2844 } 2845 var _30e=this.startY-_30c[1]; 2846 var _30f=this.map(this.startHeight+_30e); 2847 if(_30f>this.options.minHeight){ 2848 _30d.height=(_30f-4)+"px"; 2849 _30d.top=this.map(this.startTop-_30e)+"px"; 2831 2850 } 2832 2851 } 2833 2852 if(this.currentDirection.indexOf("w")!=-1){ 2834 var _30 b=this.map(this.startX-_309[0]);2835 var _3 0d=Element.getStyle(this.element,"margin-left")||"0";2836 var _3 0e=this.startWidth+_30b;2837 if(_3 0e>this.options.minWidth){2838 _30 a.left=(this.startLeft-_30b-parseInt(_30d))+"px";2839 _30 a.width=_30e+"px";2853 var _30e=this.map(this.startX-_30c[0]); 2854 var _310=Element.getStyle(this.element,"margin-left")||"0"; 2855 var _311=this.startWidth+_30e; 2856 if(_311>this.options.minWidth){ 2857 _30d.left=(this.startLeft-_30e-parseInt(_310))+"px"; 2858 _30d.width=_311+"px"; 2840 2859 } 2841 2860 } 2842 2861 if(this.currentDirection.indexOf("s")!=-1){ 2843 var _3 0f=this.restDimensions.height+this.restOffset[1];2844 var _30 b=_309[1]-this.startY;2845 if(_3 0f-this.scroll<=_309[1]){2846 return; 2847 } 2848 var _30 c=this.map(this.startHeight+_309[1]-this.startY);2849 if(_30 c>this.options.minHeight){2850 _30 a.height=(_30c-4)+"px";2862 var _312=this.restDimensions.height+this.restOffset[1]; 2863 var _30e=_30c[1]-this.startY; 2864 if(_312-this.scroll<=_30c[1]){ 2865 return; 2866 } 2867 var _30f=this.map(this.startHeight+_30c[1]-this.startY); 2868 if(_30f>this.options.minHeight){ 2869 _30d.height=(_30f-4)+"px"; 2851 2870 } 2852 2871 } 2853 2872 if(this.currentDirection.indexOf("e")!=-1){ 2854 var _3 0e=this.map(this.startWidth+_309[0]-this.startX);2855 if(_3 0e>this.options.minWidth){2856 _30 a.width=_30e+"px";2857 } 2858 } 2859 if(_30 a.visibility=="hidden"){2860 _30 a.visibility="";2873 var _311=this.map(this.startWidth+_30c[0]-this.startX); 2874 if(_311>this.options.minWidth){ 2875 _30d.width=_311+"px"; 2876 } 2877 } 2878 if(_30d.visibility=="hidden"){ 2879 _30d.visibility=""; 2861 2880 } 2862 2881 this.options.change(this.element); 2863 },directions:function(_31 0){2864 var _31 1=[Event.pointerX(_310),Event.pointerY(_310)];2865 var _31 2=Position.cumulativeOffset(this.element);2866 var _31 3=document.documentElement.scrollTop||document.body.scrollTop;2867 var _31 4=Position.realOffset(this.element)[1]-_313;2868 var _31 5="";2869 if(this.between(_31 1[1]-_312[1]+_314,0,this.options.top)){2870 _31 5+="n";2871 } 2872 if(this.between((_31 2[1]+this.element.offsetHeight)-_311[1]-_314,0,this.options.bottom)){2873 _31 5+="s";2874 } 2875 if(this.between(_31 1[0]-_312[0],0,this.options.left)){2876 _31 5+="w";2877 } 2878 if(this.between((_31 2[0]+this.element.offsetWidth)-_311[0],0,this.options.right)){2879 _31 5+="e";2880 } 2881 return _31 5;2882 },map:function(_31 6){2883 return Math.round(_31 6/this.options.distance)*this.options.distance;2882 },directions:function(_313){ 2883 var _314=[Event.pointerX(_313),Event.pointerY(_313)]; 2884 var _315=Position.cumulativeOffset(this.element); 2885 var _316=document.documentElement.scrollTop||document.body.scrollTop; 2886 var _317=Position.realOffset(this.element)[1]-_316; 2887 var _318=""; 2888 if(this.between(_314[1]-_315[1]+_317,0,this.options.top)){ 2889 _318+="n"; 2890 } 2891 if(this.between((_315[1]+this.element.offsetHeight)-_314[1]-_317,0,this.options.bottom)){ 2892 _318+="s"; 2893 } 2894 if(this.between(_314[0]-_315[0],0,this.options.left)){ 2895 _318+="w"; 2896 } 2897 if(this.between((_315[0]+this.element.offsetWidth)-_314[0],0,this.options.right)){ 2898 _318+="e"; 2899 } 2900 return _318; 2901 },map:function(_319){ 2902 return Math.round(_319/this.options.distance)*this.options.distance; 2884 2903 }}); 2885 2904 spinelz/trunk/src/javascripts/spinelz/calendar.js
r5976 r5978 2363 2363 var same = []; 2364 2364 var self = this; 2365 if (!holder.sames) holder.sames = []; 2365 2366 2366 2367 holder.each(function(h) { … … 2383 2384 Element.setStyle(item, {left: left + 'px'}); 2384 2385 } else { 2386 var exist = false; 2387 holder.sames.each(function(items) { 2388 if (exist) throw $break; 2389 same.each(function(s) { 2390 if (items.include(s)) { 2391 same = items; 2392 exist = true; 2393 throw $break; 2394 } 2395 }); 2396 }); 2385 2397 same.push(item); 2386 2398 var width = parseInt(Element.getStyle(item, 'width'), 10) / (same.length) - (UserAgent.isIE() ? 1: 2) + 1; … … 2392 2404 }); 2393 2405 }); 2406 if (!exist) holder.sames.push(same); 2394 2407 } 2395 2408 return left;
