Changeset 5978

Show
Ignore:
Timestamp:
01/26/09 19:03:36 (2 years ago)
Author:
kinoshita
Message:

6770

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinelz/trunk/compress/javascripts/spinelz/calendar.js

    r5976 r5978  
    17491749var same=[]; 
    17501750var self=this; 
     1751if(!_22e.sames){ 
     1752_22e.sames=[]; 
     1753} 
    17511754_22e.each(function(h){ 
    17521755var _236=self.convertHours(h.schedule); 
     
    17651768Element.setStyle(item,{left:left+"px"}); 
    17661769}else{ 
     1770var _23b=false; 
     1771_22e.sames.each(function(_23c){ 
     1772if(_23b){ 
     1773throw $break; 
     1774} 
     1775same.each(function(s){ 
     1776if(_23c.include(s)){ 
     1777same=_23c; 
     1778_23b=true; 
     1779throw $break; 
     1780} 
     1781}); 
     1782}); 
    17671783same.push(item); 
    1768 var _23b=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 
     1784var _23e=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 
    17691785same.each(function(s,i){ 
    1770 var _23e=left+_23b*i+(2*i); 
    1771 Element.setStyle(s,{width:_23b+"px",left:_23e+"px"}); 
    1772 }); 
     1786var _241=left+_23e*i+(2*i); 
     1787Element.setStyle(s,{width:_23e+"px",left:_241+"px"}); 
     1788}); 
     1789if(!_23b){ 
     1790_22e.sames.push(same); 
     1791
    17731792} 
    17741793return left; 
    17751794},setScheduleBaseStyle:function(item){ 
    1776 var _240=item.schedule; 
    1777 if(!this.calendar.isSameDate(_240.start,_240.finish)){ 
    1778 _240.finish.hour=24; 
    1779 _240.finish.min=0; 
    1780 } 
    1781 var time=this.convertHours(_240); 
    1782 var _242=time.first(); 
    1783 var _243=time.last(); 
    1784 var _244=this.column.height*2; 
    1785 var diff=this.calendar.getTimeDiff(_240.start,_240.finish); 
     1795var _243=item.schedule; 
     1796if(!this.calendar.isSameDate(_243.start,_243.finish)){ 
     1797_243.finish.hour=24; 
     1798_243.finish.min=0; 
     1799} 
     1800var time=this.convertHours(_243); 
     1801var _245=time.first(); 
     1802var _246=time.last(); 
     1803var _247=this.column.height*2; 
     1804var diff=this.calendar.getTimeDiff(_243.start,_243.finish); 
    17861805var rate=(diff.hour+(diff.min/60))||1; 
    17871806var over=0; 
    17881807var top=0; 
    1789 var _249=0; 
    1790 var _24a=this.includeDisplayTime(_242); 
    1791 var _24b=this.includeDisplayTime(_243,true); 
    1792 if(!_24a&&!_24b){ 
    1793 if((this.startTime<=_242&&this.startTime<=_243)||(_242<this.finishTime&&_243<this.finishTime)){ 
    1794 top=_249=0; 
     1808var _24c=0; 
     1809var _24d=this.includeDisplayTime(_245); 
     1810var _24e=this.includeDisplayTime(_246,true); 
     1811if(!_24d&&!_24e){ 
     1812if((this.startTime<=_245&&this.startTime<=_246)||(_245<this.finishTime&&_246<this.finishTime)){ 
     1813top=_24c=0; 
    17951814Element.hide(item); 
    17961815this.hasInvisibleSchedule=true; 
    17971816}else{ 
    17981817top=0; 
    1799 _249=_244*(this.finishTime-this.startTime)-3; 
    1800 } 
    1801 }else{ 
    1802 if(_24a){ 
    1803 top=_244*(_242-this.startTime); 
    1804 _249=_244*rate-3; 
     1818_24c=_247*(this.finishTime-this.startTime)-3; 
     1819} 
     1820}else{ 
     1821if(_24d){ 
     1822top=_247*(_245-this.startTime); 
     1823_24c=_247*rate-3; 
    18051824}else{ 
    18061825top=0; 
    1807 over=this.startTime-_242
    1808 _249=_244*(rate-over); 
    1809 } 
    1810 if(_24b){ 
    1811 }else{ 
    1812 over=_243-this.finishTime; 
    1813 _249-=_244*over; 
     1826over=this.startTime-_245
     1827_24c=_247*(rate-over); 
     1828} 
     1829if(_24e){ 
     1830}else{ 
     1831over=_246-this.finishTime; 
     1832_24c-=_247*over; 
    18141833} 
    18151834} 
    18161835try{ 
    1817 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_249+"px"}); 
     1836Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_24c+"px"}); 
    18181837} 
    18191838catch(e){ 
     
    18271846this.setCover(); 
    18281847var self=this; 
    1829 var _24d=$(this.getScheduleContainerId()); 
    1830 var _24e=this.getDragDistance(); 
     1848var _250=$(this.getScheduleContainerId()); 
     1849var _251=this.getDragDistance(); 
    18311850this.scheduleNodes=[]; 
    1832 var _24f=this.week.map(function(){ 
     1851var _252=this.week.map(function(){ 
    18331852return []; 
    18341853}); 
    1835 var _250=this.week.legth-1; 
    1836 var _251=this.calendar.options.noEvent; 
    1837 this.calendar.options.schedules.each(function(_252){ 
    1838 var _253=[]; 
    1839 var sub,_255,_256=null; 
    1840 self.week.each(function(date,_258){ 
    1841 if(self.calendar.betweenDate(_252,date)){ 
    1842 if(self.isSameStartDate(_252,date)&&self.isSameFinishDate(_252,date)){ 
    1843 _256=self.setSchedule(_252,_258,_24f,_24d,_24e); 
    1844 _256.cellDate=date; 
    1845 _253.push(_256); 
    1846 }else{ 
    1847 sub=self.copyOneDaySchedule(_252,date); 
     1854var _253=this.week.legth-1; 
     1855var _254=this.calendar.options.noEvent; 
     1856this.calendar.options.schedules.each(function(_255){ 
     1857var _256=[]; 
     1858var sub,_258,_259=null; 
     1859self.week.each(function(date,_25b){ 
     1860if(self.calendar.betweenDate(_255,date)){ 
     1861if(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{ 
     1866sub=self.copyOneDaySchedule(_255,date); 
    18481867if(sub.finish.hour==0&&sub.finish.min==0){ 
    18491868throw $continue; 
    18501869} 
    1851 _255=self.setSchedule(sub,_258,_24f,_24d,_24e); 
    1852 _255.originalSchedule=_252
    1853 _255.cellDate=date; 
    1854 _253.push(_255); 
     1870_258=self.setSchedule(sub,_25b,_252,_250,_251); 
     1871_258.originalSchedule=_255
     1872_258.cellDate=date; 
     1873_256.push(_258); 
    18551874} 
    18561875}else{ 
     
    18621881if(!self.hasInvisibleSchedule){ 
    18631882(self.invisibleWeek||[]).each(function(date){ 
    1864 if(self.calendar.betweenDate(_252,date)){ 
     1883if(self.calendar.betweenDate(_255,date)){ 
    18651884self.hasInvisibleSchedule=true; 
    18661885throw $break; 
     
    18681887}); 
    18691888} 
    1870 if(!_251){ 
    1871 _253.each(function(item){ 
    1872 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_253)); 
    1873 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_253)); 
    1874 }); 
    1875 } 
    1876 if(!self.hasInvisibleSchedule&&(_253.length==0)){ 
     1889if(!_254){ 
     1890_256.each(function(item){ 
     1891Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_256)); 
     1892Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_256)); 
     1893}); 
     1894} 
     1895if(!self.hasInvisibleSchedule&&(_256.length==0)){ 
    18771896self.hasInvisibleSchedule=true; 
    18781897} 
     
    18851904new Hover(this.ids.pre); 
    18861905new Hover(this.ids.next); 
    1887 var _25b=this.calendar.options.clickDateText||this.clickDateText; 
     1906var _25e=this.calendar.options.clickDateText||this.clickDateText; 
    18881907if(this.headers){ 
    1889 this.headers.each(function(_25c){ 
    1890 Event.observe(_25c.id,"mousedown",_25b.bindAsEventListener(this,_25c.wday)); 
     1908this.headers.each(function(_25f){ 
     1909Event.observe(_25f.id,"mousedown",_25e.bindAsEventListener(this,_25f.wday)); 
    18911910}.bind(this)); 
    18921911} 
    18931912} 
    1894 },copyOneDaySchedule:function(_25d,date){ 
     1913},copyOneDaySchedule:function(_260,date){ 
    18951914var sub=null; 
    1896 if(this.isSameStartDate(_25d,date)){ 
    1897 sub=this.copySchedule(_25d,date); 
     1915if(this.isSameStartDate(_260,date)){ 
     1916sub=this.copySchedule(_260,date); 
    18981917sub.finish.hour=24; 
    18991918sub.finish.min=0; 
    19001919}else{ 
    1901 if(this.isSameFinishDate(_25d,date)){ 
    1902 sub=this.copySchedule(_25d,date); 
     1920if(this.isSameFinishDate(_260,date)){ 
     1921sub=this.copySchedule(_260,date); 
    19031922sub.start.hour=0; 
    19041923sub.start.min=0; 
    19051924}else{ 
    1906 sub=this.copySchedule(_25d,date); 
     1925sub=this.copySchedule(_260,date); 
    19071926sub.start.hour=0; 
    19081927sub.start.min=0; 
     
    19121931} 
    19131932return sub; 
    1914 },copySchedule:function(_260,date){ 
    1915 sub=Object.extend({},_260); 
    1916 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_260.start.hour,min:_260.start.min}; 
    1917 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_260.finish.hour,min:_260.finish.min}; 
     1933},copySchedule:function(_263,date){ 
     1934sub=Object.extend({},_263); 
     1935sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_263.start.hour,min:_263.start.min}; 
     1936sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_263.finish.hour,min:_263.finish.min}; 
    19181937return sub; 
    1919 },setSchedule:function(_262,_263,_264,_265,_266){ 
    1920 var _267=this.buildSchedule(_262); 
    1921 var item=_267.first(); 
    1922 _265.appendChild(item); 
     1938},setSchedule:function(_265,_266,_267,_268,_269){ 
     1939var _26a=this.buildSchedule(_265); 
     1940var item=_26a.first(); 
     1941_268.appendChild(item); 
    19231942this.setScheduleBaseStyle(item); 
    1924 var left=this.adjustScheduleStyle(item,_263,_264[_263]); 
    1925 var _26a=_263*this.getAdjustSize(); 
    1926 var _26b=this.column.width+_26a+"px"; 
    1927 if(!this.calendar.options.noEvent&&((_262.edit==undefined)||_262.edit)){ 
    1928 this.setDraggable(item,_267.last(),_265,_266); 
     1943var left=this.adjustScheduleStyle(item,_266,_267[_266]); 
     1944var _26d=_266*this.getAdjustSize(); 
     1945var _26e=this.column.width+_26d+"px"; 
     1946if(!this.calendar.options.noEvent&&((_265.edit==undefined)||_265.edit)){ 
     1947this.setDraggable(item,_26a.last(),_268,_269); 
    19291948this.setResize(item); 
    19301949} 
    1931 _264[_263].push(item); 
     1950_267[_266].push(item); 
    19321951this.scheduleNodes.push(item); 
    19331952return item; 
    19341953},getDragDistance:function(){ 
    1935 var _26c=this.getAdjustSize(); 
    1936 return [this.column.width+_26c,this.column.height/2]; 
    1937 },setDraggable:function(item,_26e,_26f,_270){ 
     1954var _26f=this.getAdjustSize(); 
     1955return [this.column.width+_26f,this.column.height/2]; 
     1956},setDraggable:function(item,_271,_272,_273){ 
    19381957var self=this; 
    1939 new Draggable(item,{handle:_26e,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_274){ 
    1940 var _275=Element.getDimensions(item); 
    1941 var _276=Element.getDimensions(_26f); 
    1942 var _277=(self.column.height/2); 
    1943 var _278=_274.offset; 
    1944 x=Math.floor((x+_278[0])/_270[0])*_270[0]; 
    1945 y=Math.round((y)/_270[1])*_270[1]; 
    1946 xy=[self._constrain(x,0,_276.width-_275.width),self._constrain(y,0-(_275.height-_277),_276.height-_277)]; 
     1958new Draggable(item,{handle:_271,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_277){ 
     1959var _278=Element.getDimensions(item); 
     1960var _279=Element.getDimensions(_272); 
     1961var _27a=(self.column.height/2); 
     1962var _27b=_277.offset; 
     1963x=Math.floor((x+_27b[0])/_273[0])*_273[0]; 
     1964y=Math.round((y)/_273[1])*_273[1]; 
     1965xy=[self._constrain(x,0,_279.width-_278.width),self._constrain(y,0-(_278.height-_27a),_279.height-_27a)]; 
    19471966return xy; 
    1948 },onEnd:function(_279,_27a){ 
    1949 self.changeSchedule(_279,_27a); 
    1950 },change:function(_27b){ 
    1951 self.changeTimeDisplay(_27b.element); 
     1967},onEnd:function(_27c,_27d){ 
     1968self.changeSchedule(_27c,_27d); 
     1969},change:function(_27e){ 
     1970self.changeTimeDisplay(_27e.element); 
    19521971}}); 
    19531972},setResize:function(item){ 
    1954 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_27d){ 
    1955 this.updateTirm(_27d); 
    1956 }.bind(this),change:function(_27e){ 
    1957 this.changeTimeDisplay(_27e); 
     1973new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_280){ 
     1974this.updateTirm(_280); 
     1975}.bind(this),change:function(_281){ 
     1976this.changeTimeDisplay(_281); 
    19581977}.bind(this)}); 
    1959 },getDate:function(_27f){ 
    1960 return _27f.date; 
    1961 },abstractSelect:function(_280,_281){ 
    1962 var _282=this.findClickedElement(_280); 
    1963 if(_282){ 
    1964 if(Element.hasClassName(_282,Calendar.className.columnDate)||Element.hasClassName(_282,Calendar.className.columnDateOdd)||Element.hasClassName(_282,Calendar.className.columnTopDate)){ 
    1965 var date=this.getDate(_282); 
    1966 _281(date,_282); 
     1978},getDate:function(_282){ 
     1979return _282.date; 
     1980},abstractSelect:function(_283,_284){ 
     1981var _285=this.findClickedElement(_283); 
     1982if(_285){ 
     1983if(Element.hasClassName(_285,Calendar.className.columnDate)||Element.hasClassName(_285,Calendar.className.columnDateOdd)||Element.hasClassName(_285,Calendar.className.columnTopDate)){ 
     1984var date=this.getDate(_285); 
     1985_284(date,_285); 
    19671986} 
    19681987} 
    19691988},getSelectedTerm:function(){ 
    1970 var _284=this.calendar.getSelected(); 
    1971 if(_284.length==0){ 
     1989var _287=this.calendar.getSelected(); 
     1990if(_287.length==0){ 
    19721991return; 
    19731992} 
    19741993if(this.calendar.options.build){ 
    1975 var last=_284.last(); 
     1994var last=_287.last(); 
    19761995if(last){ 
    19771996last=this.dateMap[last.id]; 
    19781997}else{ 
    1979 last=this.dateMap[_284.first().id]; 
     1998last=this.dateMap[_287.first().id]; 
    19801999} 
    19812000last=new Date(last.getFullYear(),last.getMonth(),last.getDate(),last.getHours(),last.getMinutes(),0); 
    19822001last.setMinutes(last.getMinutes()+30); 
    1983 return [this.dateMap[_284.first().id],last]; 
    1984 }else{ 
    1985 var last=this._getDateTimeFromElement(_284.last()); 
     2002return [this.dateMap[_287.first().id],last]; 
     2003}else{ 
     2004var last=this._getDateTimeFromElement(_287.last()); 
    19862005last.setMinutes(last.getMinutes()+30); 
    1987 return [this._getDateTimeFromElement(_284.first()),last]; 
     2006return [this._getDateTimeFromElement(_287.first()),last]; 
    19882007} 
    19892008},setWidth:function(node){ 
    19902009Element.setStyle(node,{width:this.column.width+"px"}); 
    1991 },inspectArgument:function(_287,time){ 
    1992 if(_287.date){ 
    1993 return _287
     2010},inspectArgument:function(_28a,time){ 
     2011if(_28a.date){ 
     2012return _28a
    19942013} 
    19952014var self=this; 
    1996 var _28a=this.calendar.getSelected(); 
    1997 var _28b=[]; 
    1998 this.calendar.recurrence(_287,function(o){ 
    1999 var _28d={}; 
     2015var _28d=this.calendar.getSelected(); 
     2016var _28e=[]; 
     2017this.calendar.recurrence(_28a,function(o){ 
     2018var _290={}; 
    20002019if(!o.date){ 
    2001 _28d={date:self.getDate(_28a[0])}; 
     2020_290={date:self.getDate(_28d[0])}; 
    20022021if(!o.start){ 
    2003 _28d.start=_28a[0].time; 
     2022_290.start=_28d[0].time; 
    20042023} 
    20052024if(!o.finish){ 
    2006 _28d.finish=_28a[_28a.length-1].time; 
    2007 } 
    2008 } 
    2009 Object.extend(_28d,o); 
    2010 _28b.push(_28d); 
    2011 }); 
    2012 return _28b
     2025_290.finish=_28d[_28d.length-1].time; 
     2026} 
     2027} 
     2028Object.extend(_290,o); 
     2029_28e.push(_290); 
     2030}); 
     2031return _28e
    20132032},inspectDateArgument:function(date){ 
    20142033if(date){ 
    20152034return date; 
    20162035} 
    2017 var _28f=this; 
    2018 var _290=this.getSelected(); 
    2019 if(_290.length==0){ 
     2036var _292=this; 
     2037var _293=this.getSelected(); 
     2038if(_293.length==0){ 
    20202039return null; 
    20212040} 
    2022 return _290.collect(function(d){ 
    2023 return _28f.getDate(d); 
    2024 }); 
    2025 },addColumnClass:function(_292){ 
     2041return _293.collect(function(d){ 
     2042return _292.getDate(d); 
     2043}); 
     2044},addColumnClass:function(_295){ 
    20262045if(document.all){ 
    2027 this.calendar.css.addClassNames(_292,"columnWin"); 
    2028 }else{ 
    2029 this.calendar.css.addClassNames(_292,"column"); 
     2046this.calendar.css.addClassNames(_295,"columnWin"); 
     2047}else{ 
     2048this.calendar.css.addClassNames(_295,"column"); 
    20302049} 
    20312050},getHeaderId:function(){ 
     
    20332052},getColumnId:function(i){ 
    20342053return this.calendar.element.id.appendSuffix(CalendarWeek.id.column+"_"+i); 
    2035 },changeSchedule:function(_294,_295){ 
    2036 var _296=_294.element; 
    2037 var _297=_296.schedule; 
    2038 var time=this.getTimeByElement(_296); 
    2039 this.calendar.cacheSchedule(_297); 
    2040 var _299=$(this.getScheduleContainerId()); 
    2041 var _29a=Element.getDimensions(_299); 
    2042 var _29b=Position.cumulativeOffset(_299); 
    2043 var x=Event.pointerX(_295); 
    2044 var y=Event.pointerY(_295); 
    2045 var left=parseInt(Element.getStyle(_296,"left")); 
    2046 var _29f=Math.round(left/this.column.width); 
    2047 var date=this.week[_29f]; 
    2048 if(_297.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){ 
     2055var _299=_297.element; 
     2056var _29a=_299.schedule; 
     2057var time=this.getTimeByElement(_299); 
     2058this.calendar.cacheSchedule(_29a); 
     2059var _29c=$(this.getScheduleContainerId()); 
     2060var _29d=Element.getDimensions(_29c); 
     2061var _29e=Position.cumulativeOffset(_29c); 
     2062var x=Event.pointerX(_298); 
     2063var y=Event.pointerY(_298); 
     2064var left=parseInt(Element.getStyle(_299,"left")); 
     2065var _2a2=Math.round(left/this.column.width); 
     2066var date=this.week[_2a2]; 
     2067if(_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){ 
    20492068this.calendar.refreshSchedule(); 
    20502069return; 
    20512070} 
    2052 if(_296.originalSchedule){ 
    2053 _297=_296.originalSchedule; 
    2054 } 
    2055 var _2a1={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 
    2056 var _2a2=DateUtil.toDate(_2a1); 
    2057 var _2a3=_296.cellDate.days()-DateUtil.toDate(_297.start).days(); 
    2058 _2a2.setDate(_2a2.getDate()-_2a3); 
    2059 var diff=_2a2.getTime()-DateUtil.toDate(_297.start).getTime(); 
    2060 _297.start=_2a2.toHash(); 
    2061 _297.finish=new Date(DateUtil.toDate(_297.finish).getTime()+diff).toHash(); 
     2071if(_299.originalSchedule){ 
     2072_29a=_299.originalSchedule; 
     2073} 
     2074var _2a4={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 
     2075var _2a5=DateUtil.toDate(_2a4); 
     2076var _2a6=_299.cellDate.days()-DateUtil.toDate(_29a.start).days(); 
     2077_2a5.setDate(_2a5.getDate()-_2a6); 
     2078var 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(); 
    20622081this.calendar.refreshSchedule(); 
    2063 this.calendar.options.changeSchedule(_297); 
    2064 },updateTirm:function(_2a5){ 
    2065 var _2a6=_2a5.schedule; 
    2066 var time=this.getTimeByElement(_2a5); 
    2067 this.calendar.cacheSchedule(_2a6); 
    2068 var left=parseInt(Element.getStyle(_2a5,"left")); 
    2069 var _2a9=Math.floor(left/this.column.width); 
    2070 var date=this.week[_2a9]; 
    2071 var _2ab=this.isChengeSchedule(_2a5,time); 
    2072 if(_2a5.originalSchedule){ 
    2073 _2a6=_2a5.originalSchedule; 
    2074 } 
    2075 if(_2ab.start){ 
    2076 _2a6.start.year=date.getFullYear(); 
    2077 _2a6.start.month=date.getMonth(); 
    2078 _2a6.start.day=date.getDate(); 
    2079 _2a6.start.hour=time[0].hour; 
    2080 _2a6.start.min=time[0].min; 
    2081 } 
    2082 if(_2ab.finish){ 
    2083 _2a6.finish.year=date.getFullYear(); 
    2084 _2a6.finish.month=date.getMonth(); 
    2085 _2a6.finish.day=date.getDate(); 
    2086 _2a6.finish.hour=time[1].hour; 
    2087 _2a6.finish.min=time[1].min; 
     2082this.calendar.options.changeSchedule(_29a); 
     2083},updateTirm:function(_2a8){ 
     2084var _2a9=_2a8.schedule; 
     2085var time=this.getTimeByElement(_2a8); 
     2086this.calendar.cacheSchedule(_2a9); 
     2087var left=parseInt(Element.getStyle(_2a8,"left")); 
     2088var _2ac=Math.floor(left/this.column.width); 
     2089var date=this.week[_2ac]; 
     2090var _2ae=this.isChengeSchedule(_2a8,time); 
     2091if(_2a8.originalSchedule){ 
     2092_2a9=_2a8.originalSchedule; 
     2093} 
     2094if(_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} 
     2101if(_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; 
    20882107} 
    20892108this.calendar.refreshSchedule(); 
    2090 if(_2ab.start||_2ab.finish){ 
    2091 this.calendar.options.updateTirm(_2a6); 
    2092 } 
    2093 },changeTimeDisplay:function(_2ac){ 
    2094 var _2ad=_2ac.schedule; 
    2095 var time=this.getTimeByElement(_2ac); 
    2096 var _2af=Element.getElementsByClassName(_2ac,Calendar.className.scheduleTimeArea)[0]; 
     2109if(_2ae.start||_2ae.finish){ 
     2110this.calendar.options.updateTirm(_2a9); 
     2111} 
     2112},changeTimeDisplay:function(_2af){ 
     2113var _2b0=_2af.schedule; 
     2114var time=this.getTimeByElement(_2af); 
     2115var _2b2=Element.getElementsByClassName(_2af,Calendar.className.scheduleTimeArea)[0]; 
    20972116var text=this.getTimeText(time[0],time[1]); 
    2098 _2af.innerHTML=text; 
    2099 },findClickedElement:function(_2b1){ 
    2100 var _2b2=$(this.getScheduleContainerId()); 
    2101 var _2b3=Position.cumulativeOffset(_2b2); 
    2102 var _2b4=Position.realOffset(_2b2).last(); 
    2103 _2b4-=document.documentElement.scrollTop||document.body.scrollTop; 
    2104 var x=Event.pointerX(_2b1)-_2b3[0]; 
    2105 var y=Event.pointerY(_2b1)-_2b3[1]+_2b4
    2106 var _2b7=Math.floor(y/this.column.height); 
    2107 var _2b8=Math.floor(x/this.column.width); 
     2117_2b2.innerHTML=text; 
     2118},findClickedElement:function(_2b4){ 
     2119var _2b5=$(this.getScheduleContainerId()); 
     2120var _2b6=Position.cumulativeOffset(_2b5); 
     2121var _2b7=Position.realOffset(_2b5).last(); 
     2122_2b7-=document.documentElement.scrollTop||document.body.scrollTop; 
     2123var x=Event.pointerX(_2b4)-_2b6[0]; 
     2124var y=Event.pointerY(_2b4)-_2b6[1]+_2b7
     2125var _2ba=Math.floor(y/this.column.height); 
     2126var _2bb=Math.floor(x/this.column.width); 
    21082127var row=this.calendarTable.rows[0]; 
    2109 if(_2b8>=row.cells.length){ 
    2110 _2b8--; 
    2111 } 
    2112 return $(row.cells[_2b8]).down(_2b7); 
    2113 },multipleSelection:function(_2ba){ 
     2128if(_2bb>=row.cells.length){ 
     2129_2bb--; 
     2130} 
     2131return $(row.cells[_2bb]).down(_2ba); 
     2132},multipleSelection:function(_2bd){ 
    21142133if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 
    21152134return; 
    21162135} 
    21172136var self=this; 
    2118 var _2bc=this.calendar; 
    2119 var _2bd=this.calendar.selectedBase; 
    2120 var _2be=this._getDateFromElement(_2bd).getDate(); 
    2121 this.abstractSelect(_2ba,function(date,_2c0){ 
    2122 var _2c1=$(_2bd.id); 
    2123 if(_2be!=self._getDateFromElement(_2c0).getDate()){ 
     2137var _2bf=this.calendar; 
     2138var _2c0=this.calendar.selectedBase; 
     2139var _2c1=this._getDateFromElement(_2c0).getDate(); 
     2140this.abstractSelect(_2bd,function(date,_2c3){ 
     2141var _2c4=$(_2c0.id); 
     2142if(_2c1!=self._getDateFromElement(_2c3).getDate()){ 
    21242143return; 
    21252144} 
    2126 var _2c2=$A(_2c1.parentNode.childNodes); 
    2127 var ids=[this._getTime(_2bd),this._getTime(_2c0)]; 
     2145var _2c5=$A(_2c4.parentNode.childNodes); 
     2146var ids=[this._getTime(_2c0),this._getTime(_2c3)]; 
    21282147ids.sort(function(a,b){ 
    21292148return a-b; 
    21302149}); 
    2131 _2c2.each(function(n){ 
     2150_2c5.each(function(n){ 
    21322151if(!n.id){ 
    21332152throw $continue; 
     
    21352154var id=this._getTime(n); 
    21362155if((id<ids[0])||(ids[1]<id)){ 
    2137 _2bc.removeSelectedClass(n); 
     2156_2bf.removeSelectedClass(n); 
    21382157}else{ 
    21392158if(!Element.hasClassName(n,Calendar.className.selected)){ 
    2140 _2bc.addSelectedClass(n); 
     2159_2bf.addSelectedClass(n); 
    21412160} 
    21422161} 
    21432162}.bind(this)); 
    21442163}.bind(this)); 
    2145 },getTimeByElement:function(_2c8){ 
    2146 var _2c9=_2c8.schedule; 
    2147 var top=parseInt(Element.getStyle(_2c8,"top"),10); 
    2148 var _2cb=parseInt(Element.getStyle(_2c8,"height"),10); 
    2149 var _2cc=this.column.height*2; 
    2150 var _2cd=15/60; 
    2151 var _2ce=top/_2cc+this.startTime; 
    2152 _2ce=Math.round(_2ce/_2cd)*_2cd
    2153 var _2cf={}; 
    2154 _2cf.hour=Math.floor(_2ce); 
    2155 _2cf.min=(_2ce-_2cf.hour)*60; 
    2156 var _2d0=Math.round(_2cb/_2cc/_2cd)*_2cd+_2ce
    2157 var _2d1={}; 
    2158 _2d1.hour=Math.floor(_2d0); 
    2159 _2d1.min=Math.round((_2d0-_2d1.hour)*60); 
    2160 if(_2d1.min==60){ 
    2161 _2d1.hour+=1; 
    2162 _2d1.min=0; 
    2163 } 
    2164 return [_2cf,_2d1]; 
     2164},getTimeByElement:function(_2cb){ 
     2165var _2cc=_2cb.schedule; 
     2166var top=parseInt(Element.getStyle(_2cb,"top"),10); 
     2167var _2ce=parseInt(Element.getStyle(_2cb,"height"),10); 
     2168var _2cf=this.column.height*2; 
     2169var _2d0=15/60; 
     2170var _2d1=top/_2cf+this.startTime; 
     2171_2d1=Math.round(_2d1/_2d0)*_2d0
     2172var _2d2={}; 
     2173_2d2.hour=Math.floor(_2d1); 
     2174_2d2.min=(_2d1-_2d2.hour)*60; 
     2175var _2d3=Math.round(_2ce/_2cf/_2d0)*_2d0+_2d1
     2176var _2d4={}; 
     2177_2d4.hour=Math.floor(_2d3); 
     2178_2d4.min=Math.round((_2d3-_2d4.hour)*60); 
     2179if(_2d4.min==60){ 
     2180_2d4.hour+=1; 
     2181_2d4.min=0; 
     2182} 
     2183return [_2d2,_2d4]; 
    21652184},getTimeByTop:function(top){ 
    2166 var _2d3=this.column.height*2; 
    2167 var _2d4=15/60; 
    2168 var _2d5=top/_2d3+this.startTime; 
    2169 _2d5=Math.round(_2d5/_2d4)*_2d4
    2170 var _2d6={}; 
    2171 _2d6.hour=Math.floor(_2d5); 
    2172 _2d6.min=(_2d5-_2d6.hour)*60; 
    2173 return _2d6
    2174 },getDateId:function(date,time,_2d9){ 
    2175 var id=this.calendar.element.id.appendSuffix(_2d9+"_"+date.getDate()); 
     2185var _2d6=this.column.height*2; 
     2186var _2d7=15/60; 
     2187var _2d8=top/_2d6+this.startTime; 
     2188_2d8=Math.round(_2d8/_2d7)*_2d7
     2189var _2d9={}; 
     2190_2d9.hour=Math.floor(_2d8); 
     2191_2d9.min=(_2d8-_2d9.hour)*60; 
     2192return _2d9
     2193},getDateId:function(date,time,_2dc){ 
     2194var id=this.calendar.element.id.appendSuffix(_2dc+"_"+date.getDate()); 
    21762195return id.appendSuffix(time*10); 
    21772196},dateIdToTime:function(id){ 
     
    21852204time.pop(); 
    21862205return time.join(":"); 
    2187 },includeDisplayTime:function(_2df,_2e0){ 
    2188 if(_2e0){ 
    2189 return (this.startTime<_2df)&&(_2df<this.finishTime); 
    2190 }else{ 
    2191 return (this.startTime<=_2df)&&(_2df<this.finishTime); 
    2192 } 
    2193 },convertHours:function(_2e1){ 
    2194 return [_2e1.start.hour+_2e1.start.min/60,_2e1.finish.hour+_2e1.finish.min/60]; 
     2206},includeDisplayTime:function(_2e2,_2e3){ 
     2207if(_2e3){ 
     2208return (this.startTime<_2e2)&&(_2e2<this.finishTime); 
     2209}else{ 
     2210return (this.startTime<=_2e2)&&(_2e2<this.finishTime); 
     2211} 
     2212},convertHours:function(_2e4){ 
     2213return [_2e4.start.hour+_2e4.start.min/60,_2e4.finish.hour+_2e4.finish.min/60]; 
    21952214},setDisplayTime:function(){ 
    21962215this.startTime=this.calendar.options.displayTime.first().hour; 
    2197 var _2e2=this.calendar.options.displayTime.last(); 
    2198 this.finishTime=Math.ceil(_2e2.hour+_2e2.min/60); 
    2199 },getTimeText:function(_2e3,_2e4){ 
    2200 var _2e5=this.calendar; 
    2201 return _2e5.formatTime(_2e3)+" - "+_2e5.formatTime(_2e4); 
    2202 },isChengeSchedule:function(_2e6,_2e7){ 
    2203 var _2e8=_2e6.schedule; 
    2204 var _2e9=((_2e8.start.hour!=_2e7[0].hour)||(_2e8.start.min!=_2e7[0].min)); 
    2205 var _2ea=((_2e8.finish.hour!=_2e7[1].hour)||(_2e8.finish.min!=_2e7[1].min)); 
    2206 if(_2e6.originalSchedule){ 
    2207 if(_2e9&&_2ea){ 
    2208 var _2eb=DateUtil.toDate(_2e8.start).getTime(); 
    2209 var _2ec=DateUtil.toDate(_2e6.originalSchedule.start).getTime(); 
    2210 if(_2eb==_2ec){ 
    2211 _2ea=false; 
    2212 }else{ 
    2213 _2e9=false; 
    2214 } 
    2215 }else{ 
    2216 _2e9=false; 
    2217 } 
    2218 } 
    2219 return {start:_2e9,finish:_2ea}; 
    2220 },_getDateFromElement:function(_2ed){ 
    2221 var arr=_2ed.id.split("_"); 
    2222 var _2ef=arr[arr.length-3]; 
    2223 return this.week[_2ef]; 
    2224 },_getDateTimeFromElement:function(_2f0){ 
    2225 var id=_2f0.id.split("_"); 
    2226 var _2f2=id[id.length-3]; 
    2227 if(this.week[_2f2]){ 
    2228 var date=new Date(this.week[_2f2].getTime()); 
     2216var _2e5=this.calendar.options.displayTime.last(); 
     2217this.finishTime=Math.ceil(_2e5.hour+_2e5.min/60); 
     2218},getTimeText:function(_2e6,_2e7){ 
     2219var _2e8=this.calendar; 
     2220return _2e8.formatTime(_2e6)+" - "+_2e8.formatTime(_2e7); 
     2221},isChengeSchedule:function(_2e9,_2ea){ 
     2222var _2eb=_2e9.schedule; 
     2223var _2ec=((_2eb.start.hour!=_2ea[0].hour)||(_2eb.start.min!=_2ea[0].min)); 
     2224var _2ed=((_2eb.finish.hour!=_2ea[1].hour)||(_2eb.finish.min!=_2ea[1].min)); 
     2225if(_2e9.originalSchedule){ 
     2226if(_2ec&&_2ed){ 
     2227var _2ee=DateUtil.toDate(_2eb.start).getTime(); 
     2228var _2ef=DateUtil.toDate(_2e9.originalSchedule.start).getTime(); 
     2229if(_2ee==_2ef){ 
     2230_2ed=false; 
     2231}else{ 
     2232_2ec=false; 
     2233} 
     2234}else{ 
     2235_2ec=false; 
     2236} 
     2237} 
     2238return {start:_2ec,finish:_2ed}; 
     2239},_getDateFromElement:function(_2f0){ 
     2240var arr=_2f0.id.split("_"); 
     2241var _2f2=arr[arr.length-3]; 
     2242return this.week[_2f2]; 
     2243},_getDateTimeFromElement:function(_2f3){ 
     2244var id=_2f3.id.split("_"); 
     2245var _2f5=id[id.length-3]; 
     2246if(this.week[_2f5]){ 
     2247var date=new Date(this.week[_2f5].getTime()); 
    22292248date.setMinutes(parseInt(id.pop(),10)); 
    22302249date.setHours(parseInt(id.pop(),10)); 
    22312250return date; 
    22322251}else{ 
    2233 return this._getDate(_2f0); 
    2234 } 
    2235 },_getDate:function(_2f4){ 
    2236 var id=_2f4.id.split("_"); 
     2252return this._getDate(_2f3); 
     2253} 
     2254},_getDate:function(_2f7){ 
     2255var id=_2f7.id.split("_"); 
    22372256var date=new Date(this.calendar.date.getTime()); 
    22382257date.setMinutes(parseInt(id.pop(),10)); 
    22392258date.setHours(parseInt(id.pop(),10)); 
    22402259return date; 
    2241 },_getTimeString:function(_2f7){ 
    2242 var arr=_2f7.id.split("_"); 
     2260},_getTimeString:function(_2fa){ 
     2261var arr=_2fa.id.split("_"); 
    22432262var min=arr[arr.length-1]; 
    22442263if(min=="0"){ 
     
    22502269} 
    22512270return arr[arr.length-2]+min; 
    2252 },_getTime:function(_2fa){ 
    2253 return parseInt(this._getTimeString(_2fa),10); 
     2271},_getTime:function(_2fd){ 
     2272return parseInt(this._getTimeString(_2fd),10); 
    22542273}}); 
    22552274var CalendarDay=Class.create(); 
    22562275CalendarDay.id=["dayHeader"]; 
    22572276Object.extend(CalendarDay.prototype,CalendarWeek.prototype); 
    2258 Object.extend(CalendarDay.prototype,{initialize:function(_2fb){ 
    2259 var day=_2fb.date.getDay(); 
    2260 this.calendar=_2fb
     2277Object.extend(CalendarDay.prototype,{initialize:function(_2fe){ 
     2278var day=_2fe.date.getDay(); 
     2279this.calendar=_2fe
    22612280this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 
    22622281this.dayIds=SpinelzUtil.concat(this.calendar.element.id,CalendarDay.id); 
     
    22732292delete this.calendar.options.weekIndexOld; 
    22742293},buildHeaderCenter:function(){ 
    2275 var _2fd=this.calendar.date.toDateString(); 
     2294var _300=this.calendar.date.toDateString(); 
    22762295if(this.calendar.options.dayHeaderFormat){ 
    22772296var 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} 
     2299return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.dayIds.header+"' class='"+this.calendar.classNames.ym+"'>"+_300+"</span>"+"</td>"; 
    22812300},buildTimeLineTop:function(){ 
    22822301return ""; 
    22832302},buildCalendarHeader:function(){ 
    22842303return ""; 
    2285 },changeCalendar:function(_2ff){ 
    2286 var _300=Event.element(_2ff); 
    2287 var _301=new Date(this.calendar.date.toDateString()); 
    2288 if(this.hasClassName(_300,Calendar.className.preWeekMark)){ 
     2304},changeCalendar:function(_302){ 
     2305var _303=Event.element(_302); 
     2306var _304=new Date(this.calendar.date.toDateString()); 
     2307if(this.hasClassName(_303,Calendar.className.preWeekMark)){ 
    22892308this.calendar.date.setDate(this.calendar.date.getDate()-1); 
    22902309}else{ 
    2291 if(this.hasClassName(_300,Calendar.className.nextWeekMark)){ 
     2310if(this.hasClassName(_303,Calendar.className.nextWeekMark)){ 
    22922311this.calendar.date.setDate(this.calendar.date.getDate()+1); 
    22932312} 
    22942313} 
    2295 this.calendar.options.changeCalendar(this.calendar.date,_301); 
     2314this.calendar.options.changeCalendar(this.calendar.date,_304); 
    22962315this.calendar.refresh(); 
    22972316}}); 
    22982317var CalendarResizeableEx=Class.create(); 
    22992318Object.extend(CalendarResizeableEx.prototype,Resizeable.prototype); 
    2300 Object.extend(CalendarResizeableEx.prototype,{initialize:function(_302){ 
    2301 var _303=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=$(_302); 
     2319Object.extend(CalendarResizeableEx.prototype,{initialize:function(_305){ 
     2320var _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]||{}); 
     2321this.element=$(_305); 
    23032322this.handle=this.element; 
    23042323Element.makePositioned(this.element); 
    2305 this.options=_303
     2324this.options=_306
    23062325this.active=false; 
    23072326this.resizing=false; 
     
    23132332this.eventKeypress=this.keyPress.bindAsEventListener(this); 
    23142333this.registerEvents(); 
    2315 },startResize:function(_304){ 
    2316 Event.stop(_304); 
    2317 if(Event.isLeftClick(_304)){ 
    2318 var src=Event.element(_304); 
     2334},startResize:function(_307){ 
     2335Event.stop(_307); 
     2336if(Event.isLeftClick(_307)){ 
     2337var src=Event.element(_307); 
    23192338if(src.tagName&&(src.tagName=="INPUT"||src.tagName=="SELECT"||src.tagName=="BUTTON"||src.tagName=="TEXTAREA")){ 
    23202339return; 
    23212340} 
    2322 var dir=this.directions(_304); 
     2341var dir=this.directions(_307); 
    23232342if(dir.length>0){ 
    23242343this.active=true; 
     
    23272346this.startWidth=parseInt(Element.getStyle(this.element,"width"),10); 
    23282347this.startHeight=parseInt(Element.getStyle(this.element,"height"),10); 
    2329 this.startX=_304.clientX+document.body.scrollLeft+document.documentElement.scrollLeft; 
    2330 this.startY=_304.clientY+document.body.scrollTop+document.documentElement.scrollTop; 
     2348this.startX=_307.clientX+document.body.scrollLeft+document.documentElement.scrollLeft; 
     2349this.startY=_307.clientY+document.body.scrollTop+document.documentElement.scrollTop; 
    23312350this.currentDirection=dir; 
    23322351if(this.options.restriction){ 
    2333 var _307=this.element.parentNode; 
    2334 this.restDimensions=Element.getDimensions(_307); 
    2335 this.restOffset=Position.cumulativeOffset(_307); 
     2352var _30a=this.element.parentNode; 
     2353this.restDimensions=Element.getDimensions(_30a); 
     2354this.restOffset=Position.cumulativeOffset(_30a); 
    23362355this.scroll=Position.realOffset(this.element)[1]-(document.documentElement.scrollTop||document.body.scrollTop); 
    23372356} 
    23382357} 
    23392358} 
    2340 },draw:function(_308){ 
    2341 Event.stop(_308); 
    2342 var _309=[Event.pointerX(_308),Event.pointerY(_308)]; 
    2343 var _30a=this.element.style; 
     2359},draw:function(_30b){ 
     2360Event.stop(_30b); 
     2361var _30c=[Event.pointerX(_30b),Event.pointerY(_30b)]; 
     2362var _30d=this.element.style; 
    23442363if(this.currentDirection.indexOf("n")!=-1){ 
    2345 if(this.restOffset[1]-this.scroll>=_309[1]){ 
     2364if(this.restOffset[1]-this.scroll>=_30c[1]){ 
    23462365return; 
    23472366} 
    2348 var _30b=this.startY-_309[1]; 
    2349 var _30c=this.map(this.startHeight+_30b); 
    2350 if(_30c>this.options.minHeight){ 
    2351 _30a.height=(_30c-4)+"px"; 
    2352 _30a.top=this.map(this.startTop-_30b)+"px"; 
     2367var _30e=this.startY-_30c[1]; 
     2368var _30f=this.map(this.startHeight+_30e); 
     2369if(_30f>this.options.minHeight){ 
     2370_30d.height=(_30f-4)+"px"; 
     2371_30d.top=this.map(this.startTop-_30e)+"px"; 
    23532372} 
    23542373} 
    23552374if(this.currentDirection.indexOf("w")!=-1){ 
    2356 var _30b=this.map(this.startX-_309[0]); 
    2357 var _30d=Element.getStyle(this.element,"margin-left")||"0"; 
    2358 var _30e=this.startWidth+_30b
    2359 if(_30e>this.options.minWidth){ 
    2360 _30a.left=(this.startLeft-_30b-parseInt(_30d))+"px"; 
    2361 _30a.width=_30e+"px"; 
     2375var _30e=this.map(this.startX-_30c[0]); 
     2376var _310=Element.getStyle(this.element,"margin-left")||"0"; 
     2377var _311=this.startWidth+_30e
     2378if(_311>this.options.minWidth){ 
     2379_30d.left=(this.startLeft-_30e-parseInt(_310))+"px"; 
     2380_30d.width=_311+"px"; 
    23622381} 
    23632382} 
    23642383if(this.currentDirection.indexOf("s")!=-1){ 
    2365 var _30f=this.restDimensions.height+this.restOffset[1]; 
    2366 var _30b=_309[1]-this.startY; 
    2367 if(_30f-this.scroll<=_309[1]){ 
     2384var _312=this.restDimensions.height+this.restOffset[1]; 
     2385var _30e=_30c[1]-this.startY; 
     2386if(_312-this.scroll<=_30c[1]){ 
    23682387return; 
    23692388} 
    2370 var _30c=this.map(this.startHeight+_309[1]-this.startY); 
    2371 if(_30c>this.options.minHeight){ 
    2372 _30a.height=(_30c-4)+"px"; 
     2389var _30f=this.map(this.startHeight+_30c[1]-this.startY); 
     2390if(_30f>this.options.minHeight){ 
     2391_30d.height=(_30f-4)+"px"; 
    23732392} 
    23742393} 
    23752394if(this.currentDirection.indexOf("e")!=-1){ 
    2376 var _30e=this.map(this.startWidth+_309[0]-this.startX); 
    2377 if(_30e>this.options.minWidth){ 
    2378 _30a.width=_30e+"px"; 
    2379 } 
    2380 } 
    2381 if(_30a.visibility=="hidden"){ 
    2382 _30a.visibility=""; 
     2395var _311=this.map(this.startWidth+_30c[0]-this.startX); 
     2396if(_311>this.options.minWidth){ 
     2397_30d.width=_311+"px"; 
     2398} 
     2399} 
     2400if(_30d.visibility=="hidden"){ 
     2401_30d.visibility=""; 
    23832402} 
    23842403this.options.change(this.element); 
    2385 },directions:function(_310){ 
    2386 var _311=[Event.pointerX(_310),Event.pointerY(_310)]; 
    2387 var _312=Position.cumulativeOffset(this.element); 
    2388 var _313=document.documentElement.scrollTop||document.body.scrollTop; 
    2389 var _314=Position.realOffset(this.element)[1]-_313
    2390 var _315=""; 
    2391 if(this.between(_311[1]-_312[1]+_314,0,this.options.top)){ 
    2392 _315+="n"; 
    2393 } 
    2394 if(this.between((_312[1]+this.element.offsetHeight)-_311[1]-_314,0,this.options.bottom)){ 
    2395 _315+="s"; 
    2396 } 
    2397 if(this.between(_311[0]-_312[0],0,this.options.left)){ 
    2398 _315+="w"; 
    2399 } 
    2400 if(this.between((_312[0]+this.element.offsetWidth)-_311[0],0,this.options.right)){ 
    2401 _315+="e"; 
    2402 } 
    2403 return _315
    2404 },map:function(_316){ 
    2405 return Math.round(_316/this.options.distance)*this.options.distance; 
     2404},directions:function(_313){ 
     2405var _314=[Event.pointerX(_313),Event.pointerY(_313)]; 
     2406var _315=Position.cumulativeOffset(this.element); 
     2407var _316=document.documentElement.scrollTop||document.body.scrollTop; 
     2408var _317=Position.realOffset(this.element)[1]-_316
     2409var _318=""; 
     2410if(this.between(_314[1]-_315[1]+_317,0,this.options.top)){ 
     2411_318+="n"; 
     2412} 
     2413if(this.between((_315[1]+this.element.offsetHeight)-_314[1]-_317,0,this.options.bottom)){ 
     2414_318+="s"; 
     2415} 
     2416if(this.between(_314[0]-_315[0],0,this.options.left)){ 
     2417_318+="w"; 
     2418} 
     2419if(this.between((_315[0]+this.element.offsetWidth)-_314[0],0,this.options.right)){ 
     2420_318+="e"; 
     2421} 
     2422return _318
     2423},map:function(_319){ 
     2424return Math.round(_319/this.options.distance)*this.options.distance; 
    24062425}}); 
    24072426 
  • spinelz/trunk/compress/javascripts/spinelz/spinelz_for_rubricks.js

    r5977 r5978  
    22272227var same=[]; 
    22282228var self=this; 
     2229if(!_22e.sames){ 
     2230_22e.sames=[]; 
     2231} 
    22292232_22e.each(function(h){ 
    22302233var _236=self.convertHours(h.schedule); 
     
    22432246Element.setStyle(item,{left:left+"px"}); 
    22442247}else{ 
     2248var _23b=false; 
     2249_22e.sames.each(function(_23c){ 
     2250if(_23b){ 
     2251throw $break; 
     2252} 
     2253same.each(function(s){ 
     2254if(_23c.include(s)){ 
     2255same=_23c; 
     2256_23b=true; 
     2257throw $break; 
     2258} 
     2259}); 
     2260}); 
    22452261same.push(item); 
    2246 var _23b=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 
     2262var _23e=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 
    22472263same.each(function(s,i){ 
    2248 var _23e=left+_23b*i+(2*i); 
    2249 Element.setStyle(s,{width:_23b+"px",left:_23e+"px"}); 
    2250 }); 
     2264var _241=left+_23e*i+(2*i); 
     2265Element.setStyle(s,{width:_23e+"px",left:_241+"px"}); 
     2266}); 
     2267if(!_23b){ 
     2268_22e.sames.push(same); 
     2269
    22512270} 
    22522271return left; 
    22532272},setScheduleBaseStyle:function(item){ 
    2254 var _240=item.schedule; 
    2255 if(!this.calendar.isSameDate(_240.start,_240.finish)){ 
    2256 _240.finish.hour=24; 
    2257 _240.finish.min=0; 
    2258 } 
    2259 var time=this.convertHours(_240); 
    2260 var _242=time.first(); 
    2261 var _243=time.last(); 
    2262 var _244=this.column.height*2; 
    2263 var diff=this.calendar.getTimeDiff(_240.start,_240.finish); 
     2273var _243=item.schedule; 
     2274if(!this.calendar.isSameDate(_243.start,_243.finish)){ 
     2275_243.finish.hour=24; 
     2276_243.finish.min=0; 
     2277} 
     2278var time=this.convertHours(_243); 
     2279var _245=time.first(); 
     2280var _246=time.last(); 
     2281var _247=this.column.height*2; 
     2282var diff=this.calendar.getTimeDiff(_243.start,_243.finish); 
    22642283var rate=(diff.hour+(diff.min/60))||1; 
    22652284var over=0; 
    22662285var top=0; 
    2267 var _249=0; 
    2268 var _24a=this.includeDisplayTime(_242); 
    2269 var _24b=this.includeDisplayTime(_243,true); 
    2270 if(!_24a&&!_24b){ 
    2271 if((this.startTime<=_242&&this.startTime<=_243)||(_242<this.finishTime&&_243<this.finishTime)){ 
    2272 top=_249=0; 
     2286var _24c=0; 
     2287var _24d=this.includeDisplayTime(_245); 
     2288var _24e=this.includeDisplayTime(_246,true); 
     2289if(!_24d&&!_24e){ 
     2290if((this.startTime<=_245&&this.startTime<=_246)||(_245<this.finishTime&&_246<this.finishTime)){ 
     2291top=_24c=0; 
    22732292Element.hide(item); 
    22742293this.hasInvisibleSchedule=true; 
    22752294}else{ 
    22762295top=0; 
    2277 _249=_244*(this.finishTime-this.startTime)-3; 
    2278 } 
    2279 }else{ 
    2280 if(_24a){ 
    2281 top=_244*(_242-this.startTime); 
    2282 _249=_244*rate-3; 
     2296_24c=_247*(this.finishTime-this.startTime)-3; 
     2297} 
     2298}else{ 
     2299if(_24d){ 
     2300top=_247*(_245-this.startTime); 
     2301_24c=_247*rate-3; 
    22832302}else{ 
    22842303top=0; 
    2285 over=this.startTime-_242
    2286 _249=_244*(rate-over); 
    2287 } 
    2288 if(_24b){ 
    2289 }else{ 
    2290 over=_243-this.finishTime; 
    2291 _249-=_244*over; 
     2304over=this.startTime-_245
     2305_24c=_247*(rate-over); 
     2306} 
     2307if(_24e){ 
     2308}else{ 
     2309over=_246-this.finishTime; 
     2310_24c-=_247*over; 
    22922311} 
    22932312} 
    22942313try{ 
    2295 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_249+"px"}); 
     2314Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_24c+"px"}); 
    22962315} 
    22972316catch(e){ 
     
    23052324this.setCover(); 
    23062325var self=this; 
    2307 var _24d=$(this.getScheduleContainerId()); 
    2308 var _24e=this.getDragDistance(); 
     2326var _250=$(this.getScheduleContainerId()); 
     2327var _251=this.getDragDistance(); 
    23092328this.scheduleNodes=[]; 
    2310 var _24f=this.week.map(function(){ 
     2329var _252=this.week.map(function(){ 
    23112330return []; 
    23122331}); 
    2313 var _250=this.week.legth-1; 
    2314 var _251=this.calendar.options.noEvent; 
    2315 this.calendar.options.schedules.each(function(_252){ 
    2316 var _253=[]; 
    2317 var sub,_255,_256=null; 
    2318 self.week.each(function(date,_258){ 
    2319 if(self.calendar.betweenDate(_252,date)){ 
    2320 if(self.isSameStartDate(_252,date)&&self.isSameFinishDate(_252,date)){ 
    2321 _256=self.setSchedule(_252,_258,_24f,_24d,_24e); 
    2322 _256.cellDate=date; 
    2323 _253.push(_256); 
    2324 }else{ 
    2325 sub=self.copyOneDaySchedule(_252,date); 
     2332var _253=this.week.legth-1; 
     2333var _254=this.calendar.options.noEvent; 
     2334this.calendar.options.schedules.each(function(_255){ 
     2335var _256=[]; 
     2336var sub,_258,_259=null; 
     2337self.week.each(function(date,_25b){ 
     2338if(self.calendar.betweenDate(_255,date)){ 
     2339if(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{ 
     2344sub=self.copyOneDaySchedule(_255,date); 
    23262345if(sub.finish.hour==0&&sub.finish.min==0){ 
    23272346throw $continue; 
    23282347} 
    2329 _255=self.setSchedule(sub,_258,_24f,_24d,_24e); 
    2330 _255.originalSchedule=_252
    2331 _255.cellDate=date; 
    2332 _253.push(_255); 
     2348_258=self.setSchedule(sub,_25b,_252,_250,_251); 
     2349_258.originalSchedule=_255
     2350_258.cellDate=date; 
     2351_256.push(_258); 
    23332352} 
    23342353}else{ 
     
    23402359if(!self.hasInvisibleSchedule){ 
    23412360(self.invisibleWeek||[]).each(function(date){ 
    2342 if(self.calendar.betweenDate(_252,date)){ 
     2361if(self.calendar.betweenDate(_255,date)){ 
    23432362self.hasInvisibleSchedule=true; 
    23442363throw $break; 
     
    23462365}); 
    23472366} 
    2348 if(!_251){ 
    2349 _253.each(function(item){ 
    2350 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_253)); 
    2351 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_253)); 
    2352 }); 
    2353 } 
    2354 if(!self.hasInvisibleSchedule&&(_253.length==0)){ 
     2367if(!_254){ 
     2368_256.each(function(item){ 
     2369Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_256)); 
     2370Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_256)); 
     2371}); 
     2372} 
     2373if(!self.hasInvisibleSchedule&&(_256.length==0)){ 
    23552374self.hasInvisibleSchedule=true; 
    23562375} 
     
    23632382new Hover(this.ids.pre); 
    23642383new Hover(this.ids.next); 
    2365 var _25b=this.calendar.options.clickDateText||this.clickDateText; 
     2384var _25e=this.calendar.options.clickDateText||this.clickDateText; 
    23662385if(this.headers){ 
    2367 this.headers.each(function(_25c){ 
    2368 Event.observe(_25c.id,"mousedown",_25b.bindAsEventListener(this,_25c.wday)); 
     2386this.headers.each(function(_25f){ 
     2387Event.observe(_25f.id,"mousedown",_25e.bindAsEventListener(this,_25f.wday)); 
    23692388}.bind(this)); 
    23702389} 
    23712390} 
    2372 },copyOneDaySchedule:function(_25d,date){ 
     2391},copyOneDaySchedule:function(_260,date){ 
    23732392var sub=null; 
    2374 if(this.isSameStartDate(_25d,date)){ 
    2375 sub=this.copySchedule(_25d,date); 
     2393if(this.isSameStartDate(_260,date)){ 
     2394sub=this.copySchedule(_260,date); 
    23762395sub.finish.hour=24; 
    23772396sub.finish.min=0; 
    23782397}else{ 
    2379 if(this.isSameFinishDate(_25d,date)){ 
    2380 sub=this.copySchedule(_25d,date); 
     2398if(this.isSameFinishDate(_260,date)){ 
     2399sub=this.copySchedule(_260,date); 
    23812400sub.start.hour=0; 
    23822401sub.start.min=0; 
    23832402}else{ 
    2384 sub=this.copySchedule(_25d,date); 
     2403sub=this.copySchedule(_260,date); 
    23852404sub.start.hour=0; 
    23862405sub.start.min=0; 
     
    23902409} 
    23912410return sub; 
    2392 },copySchedule:function(_260,date){ 
    2393 sub=Object.extend({},_260); 
    2394 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_260.start.hour,min:_260.start.min}; 
    2395 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_260.finish.hour,min:_260.finish.min}; 
     2411},copySchedule:function(_263,date){ 
     2412sub=Object.extend({},_263); 
     2413sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_263.start.hour,min:_263.start.min}; 
     2414sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_263.finish.hour,min:_263.finish.min}; 
    23962415return sub; 
    2397 },setSchedule:function(_262,_263,_264,_265,_266){ 
    2398 var _267=this.buildSchedule(_262); 
    2399 var item=_267.first(); 
    2400 _265.appendChild(item); 
     2416},setSchedule:function(_265,_266,_267,_268,_269){ 
     2417var _26a=this.buildSchedule(_265); 
     2418var item=_26a.first(); 
     2419_268.appendChild(item); 
    24012420this.setScheduleBaseStyle(item); 
    2402 var left=this.adjustScheduleStyle(item,_263,_264[_263]); 
    2403 var _26a=_263*this.getAdjustSize(); 
    2404 var _26b=this.column.width+_26a+"px"; 
    2405 if(!this.calendar.options.noEvent&&((_262.edit==undefined)||_262.edit)){ 
    2406 this.setDraggable(item,_267.last(),_265,_266); 
     2421var left=this.adjustScheduleStyle(item,_266,_267[_266]); 
     2422var _26d=_266*this.getAdjustSize(); 
     2423var _26e=this.column.width+_26d+"px"; 
     2424if(!this.calendar.options.noEvent&&((_265.edit==undefined)||_265.edit)){ 
     2425this.setDraggable(item,_26a.last(),_268,_269); 
    24072426this.setResize(item); 
    24082427} 
    2409 _264[_263].push(item); 
     2428_267[_266].push(item); 
    24102429this.scheduleNodes.push(item); 
    24112430return item; 
    24122431},getDragDistance:function(){ 
    2413 var _26c=this.getAdjustSize(); 
    2414 return [this.column.width+_26c,this.column.height/2]; 
    2415 },setDraggable:function(item,_26e,_26f,_270){ 
     2432var _26f=this.getAdjustSize(); 
     2433return [this.column.width+_26f,this.column.height/2]; 
     2434},setDraggable:function(item,_271,_272,_273){ 
    24162435var self=this; 
    2417 new Draggable(item,{handle:_26e,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_274){ 
    2418 var _275=Element.getDimensions(item); 
    2419 var _276=Element.getDimensions(_26f); 
    2420 var _277=(self.column.height/2); 
    2421 var _278=_274.offset; 
    2422 x=Math.floor((x+_278[0])/_270[0])*_270[0]; 
    2423 y=Math.round((y)/_270[1])*_270[1]; 
    2424 xy=[self._constrain(x,0,_276.width-_275.width),self._constrain(y,0-(_275.height-_277),_276.height-_277)]; 
     2436new Draggable(item,{handle:_271,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_277){ 
     2437var _278=Element.getDimensions(item); 
     2438var _279=Element.getDimensions(_272); 
     2439var _27a=(self.column.height/2); 
     2440var _27b=_277.offset; 
     2441x=Math.floor((x+_27b[0])/_273[0])*_273[0]; 
     2442y=Math.round((y)/_273[1])*_273[1]; 
     2443xy=[self._constrain(x,0,_279.width-_278.width),self._constrain(y,0-(_278.height-_27a),_279.height-_27a)]; 
    24252444return xy; 
    2426 },onEnd:function(_279,_27a){ 
    2427 self.changeSchedule(_279,_27a); 
    2428 },change:function(_27b){ 
    2429 self.changeTimeDisplay(_27b.element); 
     2445},onEnd:function(_27c,_27d){ 
     2446self.changeSchedule(_27c,_27d); 
     2447},change:function(_27e){ 
     2448self.changeTimeDisplay(_27e.element); 
    24302449}}); 
    24312450},setResize:function(item){ 
    2432 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_27d){ 
    2433 this.updateTirm(_27d); 
    2434 }.bind(this),change:function(_27e){ 
    2435 this.changeTimeDisplay(_27e); 
     2451new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_280){ 
     2452this.updateTirm(_280); 
     2453}.bind(this),change:function(_281){ 
     2454this.changeTimeDisplay(_281); 
    24362455}.bind(this)}); 
    2437 },getDate:function(_27f){ 
    2438 return _27f.date; 
    2439 },abstractSelect:function(_280,_281){ 
    2440 var _282=this.findClickedElement(_280); 
    2441 if(_282){ 
    2442 if(Element.hasClassName(_282,Calendar.className.columnDate)||Element.hasClassName(_282,Calendar.className.columnDateOdd)||Element.hasClassName(_282,Calendar.className.columnTopDate)){ 
    2443 var date=this.getDate(_282); 
    2444 _281(date,_282); 
     2456},getDate:function(_282){ 
     2457return _282.date; 
     2458},abstractSelect:function(_283,_284){ 
     2459var _285=this.findClickedElement(_283); 
     2460if(_285){ 
     2461if(Element.hasClassName(_285,Calendar.className.columnDate)||Element.hasClassName(_285,Calendar.className.columnDateOdd)||Element.hasClassName(_285,Calendar.className.columnTopDate)){ 
     2462var date=this.getDate(_285); 
     2463_284(date,_285); 
    24452464} 
    24462465} 
    24472466},getSelectedTerm:function(){ 
    2448 var _284=this.calendar.getSelected(); 
    2449 if(_284.length==0){ 
     2467var _287=this.calendar.getSelected(); 
     2468if(_287.length==0){ 
    24502469return; 
    24512470} 
    24522471if(this.calendar.options.build){ 
    2453 var last=_284.last(); 
     2472var last=_287.last(); 
    24542473if(last){ 
    24552474last=this.dateMap[last.id]; 
    24562475}else{ 
    2457 last=this.dateMap[_284.first().id]; 
     2476last=this.dateMap[_287.first().id]; 
    24582477} 
    24592478last=new Date(last.getFullYear(),last.getMonth(),last.getDate(),last.getHours(),last.getMinutes(),0); 
    24602479last.setMinutes(last.getMinutes()+30); 
    2461 return [this.dateMap[_284.first().id],last]; 
    2462 }else{ 
    2463 var last=this._getDateTimeFromElement(_284.last()); 
     2480return [this.dateMap[_287.first().id],last]; 
     2481}else{ 
     2482var last=this._getDateTimeFromElement(_287.last()); 
    24642483last.setMinutes(last.getMinutes()+30); 
    2465 return [this._getDateTimeFromElement(_284.first()),last]; 
     2484return [this._getDateTimeFromElement(_287.first()),last]; 
    24662485} 
    24672486},setWidth:function(node){ 
    24682487Element.setStyle(node,{width:this.column.width+"px"}); 
    2469 },inspectArgument:function(_287,time){ 
    2470 if(_287.date){ 
    2471 return _287
     2488},inspectArgument:function(_28a,time){ 
     2489if(_28a.date){ 
     2490return _28a
    24722491} 
    24732492var self=this; 
    2474 var _28a=this.calendar.getSelected(); 
    2475 var _28b=[]; 
    2476 this.calendar.recurrence(_287,function(o){ 
    2477 var _28d={}; 
     2493var _28d=this.calendar.getSelected(); 
     2494var _28e=[]; 
     2495this.calendar.recurrence(_28a,function(o){ 
     2496var _290={}; 
    24782497if(!o.date){ 
    2479 _28d={date:self.getDate(_28a[0])}; 
     2498_290={date:self.getDate(_28d[0])}; 
    24802499if(!o.start){ 
    2481 _28d.start=_28a[0].time; 
     2500_290.start=_28d[0].time; 
    24822501} 
    24832502if(!o.finish){ 
    2484 _28d.finish=_28a[_28a.length-1].time; 
    2485 } 
    2486 } 
    2487 Object.extend(_28d,o); 
    2488 _28b.push(_28d); 
    2489 }); 
    2490 return _28b
     2503_290.finish=_28d[_28d.length-1].time; 
     2504} 
     2505} 
     2506Object.extend(_290,o); 
     2507_28e.push(_290); 
     2508}); 
     2509return _28e
    24912510},inspectDateArgument:function(date){ 
    24922511if(date){ 
    24932512return date; 
    24942513} 
    2495 var _28f=this; 
    2496 var _290=this.getSelected(); 
    2497 if(_290.length==0){ 
     2514var _292=this; 
     2515var _293=this.getSelected(); 
     2516if(_293.length==0){ 
    24982517return null; 
    24992518} 
    2500 return _290.collect(function(d){ 
    2501 return _28f.getDate(d); 
    2502 }); 
    2503 },addColumnClass:function(_292){ 
     2519return _293.collect(function(d){ 
     2520return _292.getDate(d); 
     2521}); 
     2522},addColumnClass:function(_295){ 
    25042523if(document.all){ 
    2505 this.calendar.css.addClassNames(_292,"columnWin"); 
    2506 }else{ 
    2507 this.calendar.css.addClassNames(_292,"column"); 
     2524this.calendar.css.addClassNames(_295,"columnWin"); 
     2525}else{ 
     2526this.calendar.css.addClassNames(_295,"column"); 
    25082527} 
    25092528},getHeaderId:function(){ 
     
    25112530},getColumnId:function(i){ 
    25122531return this.calendar.element.id.appendSuffix(CalendarWeek.id.column+"_"+i); 
    2513 },changeSchedule:function(_294,_295){ 
    2514 var _296=_294.element; 
    2515 var _297=_296.schedule; 
    2516 var time=this.getTimeByElement(_296); 
    2517 this.calendar.cacheSchedule(_297); 
    2518 var _299=$(this.getScheduleContainerId()); 
    2519 var _29a=Element.getDimensions(_299); 
    2520 var _29b=Position.cumulativeOffset(_299); 
    2521 var x=Event.pointerX(_295); 
    2522 var y=Event.pointerY(_295); 
    2523 var left=parseInt(Element.getStyle(_296,"left")); 
    2524 var _29f=Math.round(left/this.column.width); 
    2525 var date=this.week[_29f]; 
    2526 if(_297.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){ 
     2533var _299=_297.element; 
     2534var _29a=_299.schedule; 
     2535var time=this.getTimeByElement(_299); 
     2536this.calendar.cacheSchedule(_29a); 
     2537var _29c=$(this.getScheduleContainerId()); 
     2538var _29d=Element.getDimensions(_29c); 
     2539var _29e=Position.cumulativeOffset(_29c); 
     2540var x=Event.pointerX(_298); 
     2541var y=Event.pointerY(_298); 
     2542var left=parseInt(Element.getStyle(_299,"left")); 
     2543var _2a2=Math.round(left/this.column.width); 
     2544var date=this.week[_2a2]; 
     2545if(_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){ 
    25272546this.calendar.refreshSchedule(); 
    25282547return; 
    25292548} 
    2530 if(_296.originalSchedule){ 
    2531 _297=_296.originalSchedule; 
    2532 } 
    2533 var _2a1={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 
    2534 var _2a2=DateUtil.toDate(_2a1); 
    2535 var _2a3=_296.cellDate.days()-DateUtil.toDate(_297.start).days(); 
    2536 _2a2.setDate(_2a2.getDate()-_2a3); 
    2537 var diff=_2a2.getTime()-DateUtil.toDate(_297.start).getTime(); 
    2538 _297.start=_2a2.toHash(); 
    2539 _297.finish=new Date(DateUtil.toDate(_297.finish).getTime()+diff).toHash(); 
     2549if(_299.originalSchedule){ 
     2550_29a=_299.originalSchedule; 
     2551} 
     2552var _2a4={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 
     2553var _2a5=DateUtil.toDate(_2a4); 
     2554var _2a6=_299.cellDate.days()-DateUtil.toDate(_29a.start).days(); 
     2555_2a5.setDate(_2a5.getDate()-_2a6); 
     2556var 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(); 
    25402559this.calendar.refreshSchedule(); 
    2541 this.calendar.options.changeSchedule(_297); 
    2542 },updateTirm:function(_2a5){ 
    2543 var _2a6=_2a5.schedule; 
    2544 var time=this.getTimeByElement(_2a5); 
    2545 this.calendar.cacheSchedule(_2a6); 
    2546 var left=parseInt(Element.getStyle(_2a5,"left")); 
    2547 var _2a9=Math.floor(left/this.column.width); 
    2548 var date=this.week[_2a9]; 
    2549 var _2ab=this.isChengeSchedule(_2a5,time); 
    2550 if(_2a5.originalSchedule){ 
    2551 _2a6=_2a5.originalSchedule; 
    2552 } 
    2553 if(_2ab.start){ 
    2554 _2a6.start.year=date.getFullYear(); 
    2555 _2a6.start.month=date.getMonth(); 
    2556 _2a6.start.day=date.getDate(); 
    2557 _2a6.start.hour=time[0].hour; 
    2558 _2a6.start.min=time[0].min; 
    2559 } 
    2560 if(_2ab.finish){ 
    2561 _2a6.finish.year=date.getFullYear(); 
    2562 _2a6.finish.month=date.getMonth(); 
    2563 _2a6.finish.day=date.getDate(); 
    2564 _2a6.finish.hour=time[1].hour; 
    2565 _2a6.finish.min=time[1].min; 
     2560this.calendar.options.changeSchedule(_29a); 
     2561},updateTirm:function(_2a8){ 
     2562var _2a9=_2a8.schedule; 
     2563var time=this.getTimeByElement(_2a8); 
     2564this.calendar.cacheSchedule(_2a9); 
     2565var left=parseInt(Element.getStyle(_2a8,"left")); 
     2566var _2ac=Math.floor(left/this.column.width); 
     2567var date=this.week[_2ac]; 
     2568var _2ae=this.isChengeSchedule(_2a8,time); 
     2569if(_2a8.originalSchedule){ 
     2570_2a9=_2a8.originalSchedule; 
     2571} 
     2572if(_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} 
     2579if(_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; 
    25662585} 
    25672586this.calendar.refreshSchedule(); 
    2568 if(_2ab.start||_2ab.finish){ 
    2569 this.calendar.options.updateTirm(_2a6); 
    2570 } 
    2571 },changeTimeDisplay:function(_2ac){ 
    2572 var _2ad=_2ac.schedule; 
    2573 var time=this.getTimeByElement(_2ac); 
    2574 var _2af=Element.getElementsByClassName(_2ac,Calendar.className.scheduleTimeArea)[0]; 
     2587if(_2ae.start||_2ae.finish){ 
     2588this.calendar.options.updateTirm(_2a9); 
     2589} 
     2590},changeTimeDisplay:function(_2af){ 
     2591var _2b0=_2af.schedule; 
     2592var time=this.getTimeByElement(_2af); 
     2593var _2b2=Element.getElementsByClassName(_2af,Calendar.className.scheduleTimeArea)[0]; 
    25752594var text=this.getTimeText(time[0],time[1]); 
    2576 _2af.innerHTML=text; 
    2577 },findClickedElement:function(_2b1){ 
    2578 var _2b2=$(this.getScheduleContainerId()); 
    2579 var _2b3=Position.cumulativeOffset(_2b2); 
    2580 var _2b4=Position.realOffset(_2b2).last(); 
    2581 _2b4-=document.documentElement.scrollTop||document.body.scrollTop; 
    2582 var x=Event.pointerX(_2b1)-_2b3[0]; 
    2583 var y=Event.pointerY(_2b1)-_2b3[1]+_2b4
    2584 var _2b7=Math.floor(y/this.column.height); 
    2585 var _2b8=Math.floor(x/this.column.width); 
     2595_2b2.innerHTML=text; 
     2596},findClickedElement:function(_2b4){ 
     2597var _2b5=$(this.getScheduleContainerId()); 
     2598var _2b6=Position.cumulativeOffset(_2b5); 
     2599var _2b7=Position.realOffset(_2b5).last(); 
     2600_2b7-=document.documentElement.scrollTop||document.body.scrollTop; 
     2601var x=Event.pointerX(_2b4)-_2b6[0]; 
     2602var y=Event.pointerY(_2b4)-_2b6[1]+_2b7
     2603var _2ba=Math.floor(y/this.column.height); 
     2604var _2bb=Math.floor(x/this.column.width); 
    25862605var row=this.calendarTable.rows[0]; 
    2587 if(_2b8>=row.cells.length){ 
    2588 _2b8--; 
    2589 } 
    2590 return $(row.cells[_2b8]).down(_2b7); 
    2591 },multipleSelection:function(_2ba){ 
     2606if(_2bb>=row.cells.length){ 
     2607_2bb--; 
     2608} 
     2609return $(row.cells[_2bb]).down(_2ba); 
     2610},multipleSelection:function(_2bd){ 
    25922611if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 
    25932612return; 
    25942613} 
    25952614var self=this; 
    2596 var _2bc=this.calendar; 
    2597 var _2bd=this.calendar.selectedBase; 
    2598 var _2be=this._getDateFromElement(_2bd).getDate(); 
    2599 this.abstractSelect(_2ba,function(date,_2c0){ 
    2600 var _2c1=$(_2bd.id); 
    2601 if(_2be!=self._getDateFromElement(_2c0).getDate()){ 
    2602 return; 
    2603 } 
    2604 var _2c2=$A(_2c1.parentNode.childNodes); 
    2605 var ids=[this._getTime(_2bd),this._getTime(_2c0)]; 
     2615var _2bf=this.calendar; 
     2616var _2c0=this.calendar.selectedBase; 
     2617var _2c1=this._getDateFromElement(_2c0).getDate(); 
     2618this.abstractSelect(_2bd,function(date,_2c3){ 
     2619var _2c4=$(_2c0.id); 
     2620if(_2c1!=self._getDateFromElement(_2c3).getDate()){ 
     2621return; 
     2622} 
     2623var _2c5=$A(_2c4.parentNode.childNodes); 
     2624var ids=[this._getTime(_2c0),this._getTime(_2c3)]; 
    26062625ids.sort(function(a,b){ 
    26072626return a-b; 
    26082627}); 
    2609 _2c2.each(function(n){ 
     2628_2c5.each(function(n){ 
    26102629if(!n.id){ 
    26112630throw $continue; 
     
    26132632var id=this._getTime(n); 
    26142633if((id<ids[0])||(ids[1]<id)){ 
    2615 _2bc.removeSelectedClass(n); 
     2634_2bf.removeSelectedClass(n); 
    26162635}else{ 
    26172636if(!Element.hasClassName(n,Calendar.className.selected)){ 
    2618 _2bc.addSelectedClass(n); 
     2637_2bf.addSelectedClass(n); 
    26192638} 
    26202639} 
    26212640}.bind(this)); 
    26222641}.bind(this)); 
    2623 },getTimeByElement:function(_2c8){ 
    2624 var _2c9=_2c8.schedule; 
    2625 var top=parseInt(Element.getStyle(_2c8,"top"),10); 
    2626 var _2cb=parseInt(Element.getStyle(_2c8,"height"),10); 
    2627 var _2cc=this.column.height*2; 
    2628 var _2cd=15/60; 
    2629 var _2ce=top/_2cc+this.startTime; 
    2630 _2ce=Math.round(_2ce/_2cd)*_2cd
    2631 var _2cf={}; 
    2632 _2cf.hour=Math.floor(_2ce); 
    2633 _2cf.min=(_2ce-_2cf.hour)*60; 
    2634 var _2d0=Math.round(_2cb/_2cc/_2cd)*_2cd+_2ce
    2635 var _2d1={}; 
    2636 _2d1.hour=Math.floor(_2d0); 
    2637 _2d1.min=Math.round((_2d0-_2d1.hour)*60); 
    2638 if(_2d1.min==60){ 
    2639 _2d1.hour+=1; 
    2640 _2d1.min=0; 
    2641 } 
    2642 return [_2cf,_2d1]; 
     2642},getTimeByElement:function(_2cb){ 
     2643var _2cc=_2cb.schedule; 
     2644var top=parseInt(Element.getStyle(_2cb,"top"),10); 
     2645var _2ce=parseInt(Element.getStyle(_2cb,"height"),10); 
     2646var _2cf=this.column.height*2; 
     2647var _2d0=15/60; 
     2648var _2d1=top/_2cf+this.startTime; 
     2649_2d1=Math.round(_2d1/_2d0)*_2d0
     2650var _2d2={}; 
     2651_2d2.hour=Math.floor(_2d1); 
     2652_2d2.min=(_2d1-_2d2.hour)*60; 
     2653var _2d3=Math.round(_2ce/_2cf/_2d0)*_2d0+_2d1
     2654var _2d4={}; 
     2655_2d4.hour=Math.floor(_2d3); 
     2656_2d4.min=Math.round((_2d3-_2d4.hour)*60); 
     2657if(_2d4.min==60){ 
     2658_2d4.hour+=1; 
     2659_2d4.min=0; 
     2660} 
     2661return [_2d2,_2d4]; 
    26432662},getTimeByTop:function(top){ 
    2644 var _2d3=this.column.height*2; 
    2645 var _2d4=15/60; 
    2646 var _2d5=top/_2d3+this.startTime; 
    2647 _2d5=Math.round(_2d5/_2d4)*_2d4
    2648 var _2d6={}; 
    2649 _2d6.hour=Math.floor(_2d5); 
    2650 _2d6.min=(_2d5-_2d6.hour)*60; 
    2651 return _2d6
    2652 },getDateId:function(date,time,_2d9){ 
    2653 var id=this.calendar.element.id.appendSuffix(_2d9+"_"+date.getDate()); 
     2663var _2d6=this.column.height*2; 
     2664var _2d7=15/60; 
     2665var _2d8=top/_2d6+this.startTime; 
     2666_2d8=Math.round(_2d8/_2d7)*_2d7
     2667var _2d9={}; 
     2668_2d9.hour=Math.floor(_2d8); 
     2669_2d9.min=(_2d8-_2d9.hour)*60; 
     2670return _2d9
     2671},getDateId:function(date,time,_2dc){ 
     2672var id=this.calendar.element.id.appendSuffix(_2dc+"_"+date.getDate()); 
    26542673return id.appendSuffix(time*10); 
    26552674},dateIdToTime:function(id){ 
     
    26632682time.pop(); 
    26642683return time.join(":"); 
    2665 },includeDisplayTime:function(_2df,_2e0){ 
    2666 if(_2e0){ 
    2667 return (this.startTime<_2df)&&(_2df<this.finishTime); 
    2668 }else{ 
    2669 return (this.startTime<=_2df)&&(_2df<this.finishTime); 
    2670 } 
    2671 },convertHours:function(_2e1){ 
    2672 return [_2e1.start.hour+_2e1.start.min/60,_2e1.finish.hour+_2e1.finish.min/60]; 
     2684},includeDisplayTime:function(_2e2,_2e3){ 
     2685if(_2e3){ 
     2686return (this.startTime<_2e2)&&(_2e2<this.finishTime); 
     2687}else{ 
     2688return (this.startTime<=_2e2)&&(_2e2<this.finishTime); 
     2689} 
     2690},convertHours:function(_2e4){ 
     2691return [_2e4.start.hour+_2e4.start.min/60,_2e4.finish.hour+_2e4.finish.min/60]; 
    26732692},setDisplayTime:function(){ 
    26742693this.startTime=this.calendar.options.displayTime.first().hour; 
    2675 var _2e2=this.calendar.options.displayTime.last(); 
    2676 this.finishTime=Math.ceil(_2e2.hour+_2e2.min/60); 
    2677 },getTimeText:function(_2e3,_2e4){ 
    2678 var _2e5=this.calendar; 
    2679 return _2e5.formatTime(_2e3)+" - "+_2e5.formatTime(_2e4); 
    2680 },isChengeSchedule:function(_2e6,_2e7){ 
    2681 var _2e8=_2e6.schedule; 
    2682 var _2e9=((_2e8.start.hour!=_2e7[0].hour)||(_2e8.start.min!=_2e7[0].min)); 
    2683 var _2ea=((_2e8.finish.hour!=_2e7[1].hour)||(_2e8.finish.min!=_2e7[1].min)); 
    2684 if(_2e6.originalSchedule){ 
    2685 if(_2e9&&_2ea){ 
    2686 var _2eb=DateUtil.toDate(_2e8.start).getTime(); 
    2687 var _2ec=DateUtil.toDate(_2e6.originalSchedule.start).getTime(); 
    2688 if(_2eb==_2ec){ 
    2689 _2ea=false; 
    2690 }else{ 
    2691 _2e9=false; 
    2692 } 
    2693 }else{ 
    2694 _2e9=false; 
    2695 } 
    2696 } 
    2697 return {start:_2e9,finish:_2ea}; 
    2698 },_getDateFromElement:function(_2ed){ 
    2699 var arr=_2ed.id.split("_"); 
    2700 var _2ef=arr[arr.length-3]; 
    2701 return this.week[_2ef]; 
    2702 },_getDateTimeFromElement:function(_2f0){ 
    2703 var id=_2f0.id.split("_"); 
    2704 var _2f2=id[id.length-3]; 
    2705 if(this.week[_2f2]){ 
    2706 var date=new Date(this.week[_2f2].getTime()); 
     2694var _2e5=this.calendar.options.displayTime.last(); 
     2695this.finishTime=Math.ceil(_2e5.hour+_2e5.min/60); 
     2696},getTimeText:function(_2e6,_2e7){ 
     2697var _2e8=this.calendar; 
     2698return _2e8.formatTime(_2e6)+" - "+_2e8.formatTime(_2e7); 
     2699},isChengeSchedule:function(_2e9,_2ea){ 
     2700var _2eb=_2e9.schedule; 
     2701var _2ec=((_2eb.start.hour!=_2ea[0].hour)||(_2eb.start.min!=_2ea[0].min)); 
     2702var _2ed=((_2eb.finish.hour!=_2ea[1].hour)||(_2eb.finish.min!=_2ea[1].min)); 
     2703if(_2e9.originalSchedule){ 
     2704if(_2ec&&_2ed){ 
     2705var _2ee=DateUtil.toDate(_2eb.start).getTime(); 
     2706var _2ef=DateUtil.toDate(_2e9.originalSchedule.start).getTime(); 
     2707if(_2ee==_2ef){ 
     2708_2ed=false; 
     2709}else{ 
     2710_2ec=false; 
     2711} 
     2712}else{ 
     2713_2ec=false; 
     2714} 
     2715} 
     2716return {start:_2ec,finish:_2ed}; 
     2717},_getDateFromElement:function(_2f0){ 
     2718var arr=_2f0.id.split("_"); 
     2719var _2f2=arr[arr.length-3]; 
     2720return this.week[_2f2]; 
     2721},_getDateTimeFromElement:function(_2f3){ 
     2722var id=_2f3.id.split("_"); 
     2723var _2f5=id[id.length-3]; 
     2724if(this.week[_2f5]){ 
     2725var date=new Date(this.week[_2f5].getTime()); 
    27072726date.setMinutes(parseInt(id.pop(),10)); 
    27082727date.setHours(parseInt(id.pop(),10)); 
    27092728return date; 
    27102729}else{ 
    2711 return this._getDate(_2f0); 
    2712 } 
    2713 },_getDate:function(_2f4){ 
    2714 var id=_2f4.id.split("_"); 
     2730return this._getDate(_2f3); 
     2731} 
     2732},_getDate:function(_2f7){ 
     2733var id=_2f7.id.split("_"); 
    27152734var date=new Date(this.calendar.date.getTime()); 
    27162735date.setMinutes(parseInt(id.pop(),10)); 
    27172736date.setHours(parseInt(id.pop(),10)); 
    27182737return date; 
    2719 },_getTimeString:function(_2f7){ 
    2720 var arr=_2f7.id.split("_"); 
     2738},_getTimeString:function(_2fa){ 
     2739var arr=_2fa.id.split("_"); 
    27212740var min=arr[arr.length-1]; 
    27222741if(min=="0"){ 
     
    27282747} 
    27292748return arr[arr.length-2]+min; 
    2730 },_getTime:function(_2fa){ 
    2731 return parseInt(this._getTimeString(_2fa),10); 
     2749},_getTime:function(_2fd){ 
     2750return parseInt(this._getTimeString(_2fd),10); 
    27322751}}); 
    27332752var CalendarDay=Class.create(); 
    27342753CalendarDay.id=["dayHeader"]; 
    27352754Object.extend(CalendarDay.prototype,CalendarWeek.prototype); 
    2736 Object.extend(CalendarDay.prototype,{initialize:function(_2fb){ 
    2737 var day=_2fb.date.getDay(); 
    2738 this.calendar=_2fb
     2755Object.extend(CalendarDay.prototype,{initialize:function(_2fe){ 
     2756var day=_2fe.date.getDay(); 
     2757this.calendar=_2fe
    27392758this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 
    27402759this.dayIds=SpinelzUtil.concat(this.calendar.element.id,CalendarDay.id); 
     
    27512770delete this.calendar.options.weekIndexOld; 
    27522771},buildHeaderCenter:function(){ 
    2753 var _2fd=this.calendar.date.toDateString(); 
     2772var _300=this.calendar.date.toDateString(); 
    27542773if(this.calendar.options.dayHeaderFormat){ 
    27552774var 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} 
     2777return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.dayIds.header+"' class='"+this.calendar.classNames.ym+"'>"+_300+"</span>"+"</td>"; 
    27592778},buildTimeLineTop:function(){ 
    27602779return ""; 
    27612780},buildCalendarHeader:function(){ 
    27622781return ""; 
    2763 },changeCalendar:function(_2ff){ 
    2764 var _300=Event.element(_2ff); 
    2765 var _301=new Date(this.calendar.date.toDateString()); 
    2766 if(this.hasClassName(_300,Calendar.className.preWeekMark)){ 
     2782},changeCalendar:function(_302){ 
     2783var _303=Event.element(_302); 
     2784var _304=new Date(this.calendar.date.toDateString()); 
     2785if(this.hasClassName(_303,Calendar.className.preWeekMark)){ 
    27672786this.calendar.date.setDate(this.calendar.date.getDate()-1); 
    27682787}else{ 
    2769 if(this.hasClassName(_300,Calendar.className.nextWeekMark)){ 
     2788if(this.hasClassName(_303,Calendar.className.nextWeekMark)){ 
    27702789this.calendar.date.setDate(this.calendar.date.getDate()+1); 
    27712790} 
    27722791} 
    2773 this.calendar.options.changeCalendar(this.calendar.date,_301); 
     2792this.calendar.options.changeCalendar(this.calendar.date,_304); 
    27742793this.calendar.refresh(); 
    27752794}}); 
    27762795var CalendarResizeableEx=Class.create(); 
    27772796Object.extend(CalendarResizeableEx.prototype,Resizeable.prototype); 
    2778 Object.extend(CalendarResizeableEx.prototype,{initialize:function(_302){ 
    2779 var _303=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=$(_302); 
     2797Object.extend(CalendarResizeableEx.prototype,{initialize:function(_305){ 
     2798var _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]||{}); 
     2799this.element=$(_305); 
    27812800this.handle=this.element; 
    27822801Element.makePositioned(this.element); 
    2783 this.options=_303
     2802this.options=_306
    27842803this.active=false; 
    27852804this.resizing=false; 
     
    27912810this.eventKeypress=this.keyPress.bindAsEventListener(this); 
    27922811this.registerEvents(); 
    2793 },startResize:function(_304){ 
    2794 Event.stop(_304); 
    2795 if(Event.isLeftClick(_304)){ 
    2796 var src=Event.element(_304); 
     2812},startResize:function(_307){ 
     2813Event.stop(_307); 
     2814if(Event.isLeftClick(_307)){ 
     2815var src=Event.element(_307); 
    27972816if(src.tagName&&(src.tagName=="INPUT"||src.tagName=="SELECT"||src.tagName=="BUTTON"||src.tagName=="TEXTAREA")){ 
    27982817return; 
    27992818} 
    2800 var dir=this.directions(_304); 
     2819var dir=this.directions(_307); 
    28012820if(dir.length>0){ 
    28022821this.active=true; 
     
    28052824this.startWidth=parseInt(Element.getStyle(this.element,"width"),10); 
    28062825this.startHeight=parseInt(Element.getStyle(this.element,"height"),10); 
    2807 this.startX=_304.clientX+document.body.scrollLeft+document.documentElement.scrollLeft; 
    2808 this.startY=_304.clientY+document.body.scrollTop+document.documentElement.scrollTop; 
     2826this.startX=_307.clientX+document.body.scrollLeft+document.documentElement.scrollLeft; 
     2827this.startY=_307.clientY+document.body.scrollTop+document.documentElement.scrollTop; 
    28092828this.currentDirection=dir; 
    28102829if(this.options.restriction){ 
    2811 var _307=this.element.parentNode; 
    2812 this.restDimensions=Element.getDimensions(_307); 
    2813 this.restOffset=Position.cumulativeOffset(_307); 
     2830var _30a=this.element.parentNode; 
     2831this.restDimensions=Element.getDimensions(_30a); 
     2832this.restOffset=Position.cumulativeOffset(_30a); 
    28142833this.scroll=Position.realOffset(this.element)[1]-(document.documentElement.scrollTop||document.body.scrollTop); 
    28152834} 
    28162835} 
    28172836} 
    2818 },draw:function(_308){ 
    2819 Event.stop(_308); 
    2820 var _309=[Event.pointerX(_308),Event.pointerY(_308)]; 
    2821 var _30a=this.element.style; 
     2837},draw:function(_30b){ 
     2838Event.stop(_30b); 
     2839var _30c=[Event.pointerX(_30b),Event.pointerY(_30b)]; 
     2840var _30d=this.element.style; 
    28222841if(this.currentDirection.indexOf("n")!=-1){ 
    2823 if(this.restOffset[1]-this.scroll>=_309[1]){ 
    2824 return; 
    2825 } 
    2826 var _30b=this.startY-_309[1]; 
    2827 var _30c=this.map(this.startHeight+_30b); 
    2828 if(_30c>this.options.minHeight){ 
    2829 _30a.height=(_30c-4)+"px"; 
    2830 _30a.top=this.map(this.startTop-_30b)+"px"; 
     2842if(this.restOffset[1]-this.scroll>=_30c[1]){ 
     2843return; 
     2844} 
     2845var _30e=this.startY-_30c[1]; 
     2846var _30f=this.map(this.startHeight+_30e); 
     2847if(_30f>this.options.minHeight){ 
     2848_30d.height=(_30f-4)+"px"; 
     2849_30d.top=this.map(this.startTop-_30e)+"px"; 
    28312850} 
    28322851} 
    28332852if(this.currentDirection.indexOf("w")!=-1){ 
    2834 var _30b=this.map(this.startX-_309[0]); 
    2835 var _30d=Element.getStyle(this.element,"margin-left")||"0"; 
    2836 var _30e=this.startWidth+_30b
    2837 if(_30e>this.options.minWidth){ 
    2838 _30a.left=(this.startLeft-_30b-parseInt(_30d))+"px"; 
    2839 _30a.width=_30e+"px"; 
     2853var _30e=this.map(this.startX-_30c[0]); 
     2854var _310=Element.getStyle(this.element,"margin-left")||"0"; 
     2855var _311=this.startWidth+_30e
     2856if(_311>this.options.minWidth){ 
     2857_30d.left=(this.startLeft-_30e-parseInt(_310))+"px"; 
     2858_30d.width=_311+"px"; 
    28402859} 
    28412860} 
    28422861if(this.currentDirection.indexOf("s")!=-1){ 
    2843 var _30f=this.restDimensions.height+this.restOffset[1]; 
    2844 var _30b=_309[1]-this.startY; 
    2845 if(_30f-this.scroll<=_309[1]){ 
    2846 return; 
    2847 } 
    2848 var _30c=this.map(this.startHeight+_309[1]-this.startY); 
    2849 if(_30c>this.options.minHeight){ 
    2850 _30a.height=(_30c-4)+"px"; 
     2862var _312=this.restDimensions.height+this.restOffset[1]; 
     2863var _30e=_30c[1]-this.startY; 
     2864if(_312-this.scroll<=_30c[1]){ 
     2865return; 
     2866} 
     2867var _30f=this.map(this.startHeight+_30c[1]-this.startY); 
     2868if(_30f>this.options.minHeight){ 
     2869_30d.height=(_30f-4)+"px"; 
    28512870} 
    28522871} 
    28532872if(this.currentDirection.indexOf("e")!=-1){ 
    2854 var _30e=this.map(this.startWidth+_309[0]-this.startX); 
    2855 if(_30e>this.options.minWidth){ 
    2856 _30a.width=_30e+"px"; 
    2857 } 
    2858 } 
    2859 if(_30a.visibility=="hidden"){ 
    2860 _30a.visibility=""; 
     2873var _311=this.map(this.startWidth+_30c[0]-this.startX); 
     2874if(_311>this.options.minWidth){ 
     2875_30d.width=_311+"px"; 
     2876} 
     2877} 
     2878if(_30d.visibility=="hidden"){ 
     2879_30d.visibility=""; 
    28612880} 
    28622881this.options.change(this.element); 
    2863 },directions:function(_310){ 
    2864 var _311=[Event.pointerX(_310),Event.pointerY(_310)]; 
    2865 var _312=Position.cumulativeOffset(this.element); 
    2866 var _313=document.documentElement.scrollTop||document.body.scrollTop; 
    2867 var _314=Position.realOffset(this.element)[1]-_313
    2868 var _315=""; 
    2869 if(this.between(_311[1]-_312[1]+_314,0,this.options.top)){ 
    2870 _315+="n"; 
    2871 } 
    2872 if(this.between((_312[1]+this.element.offsetHeight)-_311[1]-_314,0,this.options.bottom)){ 
    2873 _315+="s"; 
    2874 } 
    2875 if(this.between(_311[0]-_312[0],0,this.options.left)){ 
    2876 _315+="w"; 
    2877 } 
    2878 if(this.between((_312[0]+this.element.offsetWidth)-_311[0],0,this.options.right)){ 
    2879 _315+="e"; 
    2880 } 
    2881 return _315
    2882 },map:function(_316){ 
    2883 return Math.round(_316/this.options.distance)*this.options.distance; 
     2882},directions:function(_313){ 
     2883var _314=[Event.pointerX(_313),Event.pointerY(_313)]; 
     2884var _315=Position.cumulativeOffset(this.element); 
     2885var _316=document.documentElement.scrollTop||document.body.scrollTop; 
     2886var _317=Position.realOffset(this.element)[1]-_316
     2887var _318=""; 
     2888if(this.between(_314[1]-_315[1]+_317,0,this.options.top)){ 
     2889_318+="n"; 
     2890} 
     2891if(this.between((_315[1]+this.element.offsetHeight)-_314[1]-_317,0,this.options.bottom)){ 
     2892_318+="s"; 
     2893} 
     2894if(this.between(_314[0]-_315[0],0,this.options.left)){ 
     2895_318+="w"; 
     2896} 
     2897if(this.between((_315[0]+this.element.offsetWidth)-_314[0],0,this.options.right)){ 
     2898_318+="e"; 
     2899} 
     2900return _318
     2901},map:function(_319){ 
     2902return Math.round(_319/this.options.distance)*this.options.distance; 
    28842903}}); 
    28852904 
  • spinelz/trunk/src/javascripts/spinelz/calendar.js

    r5976 r5978  
    23632363    var same     = []; 
    23642364    var self     = this; 
     2365    if (!holder.sames) holder.sames = []; 
    23652366 
    23662367    holder.each(function(h) { 
     
    23832384      Element.setStyle(item, {left: left + 'px'}); 
    23842385    } 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      }); 
    23852397      same.push(item); 
    23862398      var width = parseInt(Element.getStyle(item, 'width'), 10) / (same.length) - (UserAgent.isIE() ? 1: 2) + 1; 
     
    23922404        }); 
    23932405      }); 
     2406      if (!exist) holder.sames.push(same); 
    23942407    } 
    23952408    return left;