Your IP : 3.144.18.202


Current Path : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/calendar/new/
Upload File :
Current File : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/calendar/new/calendar-view-transition.min.js

(function(e){function t(e){this.calendar=e;this.util=e.util;this.WEEK_TOP_MIN_HEIGHT=21;this.defaultBg={r:255,g:255,b:255};this.currentBg={r:250,g:250,b:250}}t.prototype={transit:function(e){var t=e.currentView,i=e.newView,n=e.currentView.getName(),o=e.newView.getName();this.currentViewDate=e.currentViewDate;this.newViewDate=e.newViewDate;if(n=="month"&&o=="week"){this.fromMonthToWeek(t,i)}else if(n=="month"&&o=="day"){this.fromMonthToDay(t,i)}else if(n=="month"&&o=="list"){this.fromMonthToList(t,i)}else if(n=="week"&&o=="month"){this.fromWeekToMonth(t,i)}else if(n=="week"&&o=="day"){this.fromWeekToDay(t,i)}else if(n=="week"&&o=="list"){this.fromWeekToList(t,i)}else if(n=="day"&&o=="week"){this.fromDayToWeek(t,i)}else if(n=="day"&&o=="month"){this.fromDayToMonth(t,i)}else if(n=="day"&&o=="list"){this.fromDayToList(t,i)}else if(n=="list"&&o=="month"){this.fromListToMonth(t,i)}else if(n=="list"&&o=="week"){this.fromListToWeek(t,i)}else if(n=="list"&&o=="day"){this.fromListToDay(t,i)}this.calendar.currentViewName=i.getName();if(i.switchNode){BX.addClass(i.switchNode,"calendar-view-switcher-list-item-active")}if(t.switchNode){BX.removeClass(t.switchNode,"calendar-view-switcher-list-item-active")}},fromMonthToWeek:function(e,t){var i=this,n=255,o=255,a=255,s=234,d=249,l=254,r=100,h=310,y=100;t.viewCont.style.opacity=0;t.show();BX.removeClass(t.grid,"calendar-events-holder-show");BX.removeClass(t.fullDayEventsCont,"calendar-events-holder-show");BX.removeClass(e.gridMonthContainer,"calendar-events-holder-show");this.calendar.viewsCont.style.overflow="hidden";var w=parseInt(t.fullDayEventsCont.style.height)||this.WEEK_TOP_MIN_HEIGHT,c=BX.pos(t.viewCont),f=e.monthRows.length,g=this.util.getDayCode(this.newViewDate),v=Math.ceil((e.dayIndex[g]+1)/e.dayCount)-1;if(!e.monthRows[v])v=0;var C=e.monthRows[v].querySelectorAll(".calendar-grid-cell-inner");t.viewCont.style.display="block";t.viewCont.style.position="absolute";t.viewCont.style.top=0;t.viewCont.style.left=0;t.viewCont.style.width=c.width+"px";t.viewCont.style.height=c.height+"px";t.viewCont.style.zIndex=100;e.gridWrap.style.overflow="hidden";e.gridWrap.style.height=BX.pos(t.gridWrap).height+"px";t.outerGrid.style.paddingLeft=0;t.fullDayEventsCont.style.height=0;t.titleCont.style.paddingLeft=0;BX.addClass(e.viewCont,"calendar-animate-mod");this.firstStage=new BX.easing({duration:r,start:{red:n,green:o,blue:a},finish:{red:s,green:d,blue:l},step:function(t){e.monthRows[v].style.background="rgb("+t.red+","+t.green+","+t.blue+")";for(var i=0;i<C.length;i++){C[i].style.background="rgb("+t.red+","+t.green+","+t.blue+")"}},complete:function(){setTimeout(function(){BX.addClass(e.viewCont,"calendar-change-animate-month-to-week");BX.removeClass(e.gridMonthContainer,"calendar-events-holder-show");for(var n=0;n<f;n++){if(n!=v){e.monthRows[n].style.height=0;if(n+1<v){e.monthRows[n].style.borderBottom="none"}}else{e.monthRows[n].style.height=BX.pos(t.outerGrid).height+"px"}}setTimeout(function(){i.secontStage.animate()},50)},100)}});this.secontStage=new BX.easing({duration:h,start:{fadeShow:0,fadeHide:100},finish:{fadeShow:100,fadeHide:0},step:function(i){e.viewCont.style.opacity=i.fadeHide/100;t.viewCont.style.opacity=i.fadeShow/100},complete:BX.delegate(function(){this.thirdStage.animate();BX.addClass(t.grid,"calendar-events-holder-show");BX.addClass(t.fullDayEventsCont,"calendar-events-holder-show")},this)});this.thirdStage=new BX.easing({duration:y,start:{paddingLeft:0,topHolderHeight:0},finish:{paddingLeft:43,topHolderHeight:w},step:function(e){t.outerGrid.style.paddingLeft=e.paddingLeft+"px";t.titleCont.style.paddingLeft=e.paddingLeft+"px";t.fullDayEventsCont.style.height=e.topHolderHeight+"px"},complete:BX.delegate(function(){t.titleCont.style.paddingLeft="";e.gridMonthContainer.style.paddingLeft="";e.monthRows[v].style.background="";BX.removeClass(e.viewCont,"calendar-change-animate-month-to-week");this.adjustViewAnimate(e,t)},this)});this.firstStage.animate()},fromMonthToDay:function(e,t){e.viewCont.style.width=e.viewCont.offsetWidth+"px";t.viewCont.style.opacity=0;t.viewCont.style.zIndex=110;t.show();e.viewCont.style.position="absolute";e.viewCont.style.top=0;e.viewCont.style.left=0;var i=this.util.getDayCode(this.newViewDate);if(e.dayIndex[i]!==undefined&&e.days[e.dayIndex[i]]){var n=e.days[e.dayIndex[i]];var o=255,a=255,s=255,d=234,l=249,r=254,h=300,y=200,w=BX.pos(n.node),c=BX.pos(e.gridWrap),f=document.body.appendChild(BX.create("DIV",{props:{className:"calendar-animate-casper-day"},style:{top:w.top+"px",right:w.right+"px",bottom:w.bottom+"px",left:w.left+"px",height:w.height+"px",width:w.width+"px"}}));this.firstStage=new BX.easing({duration:h,start:{top:w.top,right:w.right,bottom:w.bottom,left:w.left,height:w.height,width:w.width,dayRed:o,dayGreen:a,dayBlue:s},finish:{top:c.top,right:c.right,bottom:c.bottom,left:c.left,height:c.height,width:c.width,dayRed:d,dayGreen:l,dayBlue:r},step:function(e){f.style.top=e.top+"px";f.style.right=e.right+"px";f.style.bottom=e.bottom+"px";f.style.left=e.left+"px";f.style.height=e.height+"px";f.style.width=e.width+"px";f.style.background="rgb("+e.dayRed+","+e.dayGreen+","+e.dayBlue+")"},complete:BX.delegate(function(){this.secondStage.animate();e.viewCont.style.opacity=0},this)});this.secondStage=new BX.easing({duration:y,start:{hide:100,show:0},finish:{hide:0,show:100},step:function(e){t.viewCont.style.opacity=e.show/100;f.style.opacity=e.hide/100},complete:BX.delegate(function(){BX.addClass(this.calendar.mainCont,"calendar-main-container-small-calendar");BX.remove(f);this.adjustViewAnimate(e,t)},this)});this.firstStage.animate()}},fromMonthToList:function(e,t){BX.addClass(this.calendar.mainCont,"calendar-main-container-small-calendar");t.show();this.adjustViewAnimate(e,t)},fromWeekToMonth:function(e,t){var i,n=this,o=255,a=255,s=255,d=234,l=249,r=254,h=100,y=75,w=75;t.viewCont.style.opacity=0;t.show();BX.removeClass(e.grid,"calendar-events-holder-show");BX.removeClass(e.fullDayEventsCont,"calendar-events-holder-show");BX.removeClass(t.gridMonthContainer,"calendar-events-holder-show");this.calendar.viewsCont.style.overflow="hidden";t.viewCont.style.display="block";var c=BX.pos(t.viewCont);t.viewCont.style.position="absolute";t.viewCont.style.top=0;t.viewCont.style.left=0;t.viewCont.style.width=c.width+"px";t.viewCont.style.height=c.height+"px";t.viewCont.style.zIndex=100;var f=this.util.getDayCode(this.currentViewDate),g=Math.ceil((t.dayIndex[f]+1)/t.dayCount)-1,v=e.outerGrid.querySelectorAll(".calendar-grid-cell-inner"),C=t.monthRows.length;if(!t.monthRows[g])g=0;var p=t.monthRows[g].querySelectorAll(".calendar-grid-cell-inner");BX.addClass(e.viewCont,"calendar-change-animate-week-to-month");for(i=0;i<p.length;i++){p[i].style.background="rgb("+d+","+l+","+r+")"}for(i=0;i<C;i++){t.monthRows[i].style.height=i!=g?0:BX.pos(e.outerGrid).height+"px"}BX.addClass(e.viewCont,"calendar-animate-mod");BX.addClass(t.viewCont,"calendar-animate-mod");this.firstStage=new BX.easing({duration:h,start:{topHolderHeight:parseInt(e.fullDayEventsCont.style.height)||0,paddingLeft:43,fadeHide:100,red:o,green:a,blue:s},finish:{topHolderHeight:0,paddingLeft:0,fadeHide:0,red:d,green:l,blue:r},step:function(t){for(i=0;i<v.length;i++){v[i].style.background="rgb("+t.red+","+t.green+","+t.blue+")"}e.timeLinesCont.style.opacity=t.fadeHide/100;e.outerGrid.style.paddingLeft=t.paddingLeft+"px";e.titleCont.style.paddingLeft=t.paddingLeft+"px";e.fullDayEventsCont.style.height=t.topHolderHeight+"px"},complete:function(){setTimeout(function(){t.viewCont.style.opacity=1;e.viewCont.style.opacity=0;n.secondStage.animate()},100)}});this.secondStage=new BX.easing({duration:y,start:{fadeHide:100},finish:{fadeHide:0},step:function(t){e.viewCont.style.opacity=t.fadeHide/100},complete:function(){for(i=0;i<C;i++){t.monthRows[i].style.height=t.rowHeight+"px"}setTimeout(function(){BX.addClass(t.gridMonthContainer,"calendar-events-holder-show");n.thirdStage.animate()},410)}});this.thirdStage=new BX.easing({duration:w,start:{red:d,green:l,blue:r},finish:{red:o,green:a,blue:s},step:function(e){for(i=0;i<p.length;i++){p[i].style.background="rgb("+e.red+","+e.green+","+e.blue+")"}},complete:BX.delegate(function(){e.outerGrid.style.paddingLeft="";e.titleCont.style.paddingLeft="";e.fullDayEventsCont.style.height="";e.viewCont.style.opacity=0;for(i=0;i<v.length;i++){v[i].style.background=""}for(i=0;i<p.length;i++){p[i].style.background=""}BX.removeClass(e.viewCont,"calendar-change-animate-week-to-month");this.adjustViewAnimate(e,t)},this)});this.firstStage.animate()},fromWeekToDay:function(e,t){t.viewCont.style.opacity=0;t.show();t.viewCont.style.display="block";var i=BX.pos(t.viewCont);t.viewCont.style.position="absolute";t.viewCont.style.top="0px";t.viewCont.style.left="0px";t.viewCont.style.width=i.width+"px";t.viewCont.style.height=i.height+"px";t.viewCont.style.zIndex="100";this.calendar.viewsCont.style.overflow="hidden";BX.removeClass(e.grid,"calendar-events-holder-show");BX.removeClass(e.fullDayEventsCont,"calendar-events-holder-show");BX.removeClass(t.grid,"calendar-events-holder-show");BX.removeClass(t.fullDayEventsCont,"calendar-events-holder-show");var n=255,o=255,a=255,s=234,d=249,l=254,r=this.util.getDayCode(this.newViewDate),h=e.days[e.dayIndex[r]],y=75,w=310,c=e.titleCont.children.length;if(!h){h=e.days[this.util.getWeekDayOffset(this.util.getWeekDayByInd(this.newViewDate.getDay()))]}BX.addClass(e.viewCont,"calendar-animate-mod");var f=new BX.easing({duration:y,start:{topHolderHeight:parseInt(e.fullDayEventsCont.style.height)||this.WEEK_TOP_MIN_HEIGHT,red:n,green:o,blue:a},finish:{topHolderHeight:this.WEEK_TOP_MIN_HEIGHT,red:s,green:d,blue:l},step:function(t){h.node.style.background="rgb("+t.red+","+t.green+","+t.blue+")";e.fullDayEventsCont.style.height=t.topHolderHeight+"px";if(e.titleCont.children[h.dayOffset]){e.titleCont.children[h.dayOffset].style.background="rgb("+t.red+","+t.green+","+t.blue+")"}},complete:function(){setTimeout(function(){BX.addClass(e.viewCont,"calendar-change-animate-week-to-day");BX.removeClass(e.gridMonthContainer,"calendar-events-holder-show");for(var i=0;i<c;i++){if(i!=h.dayOffset){e.gridRow.children[i].style.flex=0;e.titleCont.children[i].style.flex=0}}setTimeout(function(){g.animate();BX.addClass(t.grid,"calendar-events-holder-show");BX.addClass(t.fullDayEventsCont,"calendar-events-holder-show")},210)},150)}});var g=new BX.easing({duration:w,start:{fadeShow:0,fadeHide:100},finish:{fadeShow:100,fadeHide:0},step:function(i){e.viewCont.style.opacity=i.fadeHide/100;t.viewCont.style.opacity=i.fadeShow/100},complete:BX.delegate(function(){h.node.style.background="";if(e.titleCont.children[h.dayOffset]){e.titleCont.children[h.dayOffset].style.background=""}BX.addClass(this.calendar.mainCont,"calendar-main-container-small-calendar");this.adjustViewAnimate(e,t)},this)});f.animate()},fromWeekToList:function(e,t){BX.addClass(this.calendar.mainCont,"calendar-main-container-small-calendar");t.show();this.adjustViewAnimate(e,t)},fromDayToMonth:function(e,t){BX.removeClass(this.calendar.mainCont,"calendar-main-container-small-calendar");var i=e.days[0].dayCode,n=255,o=255,a=255,s=234,d=249,l=254,r,h=250,y=300;this.firstStage=BX.delegate(function(){t.viewCont.style.opacity=0;t.viewCont.style.zIndex=110;t.show();t.viewCont.style.width=e.viewCont.offsetWidth+"px";t.viewCont.style.position="absolute";t.viewCont.style.top=0;t.viewCont.style.left=0;var r=t.days[t.dayIndex[i]],w=BX.pos(r.node),c=BX.pos(t.gridWrap),f=document.body.appendChild(BX.create("DIV",{props:{className:"calendar-animate-casper-day"},style:{opacity:0,top:c.top+"px",right:c.right+"px",bottom:c.bottom+"px",left:c.left+"px",height:c.height+"px",width:c.width+"px",background:"#000"}}));this.secondStage=new BX.easing({duration:h,start:{hide:100,show:0,dayRed:n,dayGreen:o,dayBlue:a},finish:{hide:0,show:100,dayRed:s,dayGreen:d,dayBlue:l},step:function(t){e.viewCont.style.opacity=t.hide/100;f.style.opacity=t.show/100;f.style.background="rgb("+t.dayRed+","+t.dayGreen+","+t.dayBlue+")"},complete:BX.delegate(function(){t.viewCont.style.opacity=1;this.thirdStage.animate()},this)});this.thirdStage=new BX.easing({duration:y,start:{top:c.top,right:c.right,bottom:c.bottom,left:c.left,height:c.height,width:c.width,dayRed:s,dayGreen:d,dayBlue:l},finish:{top:w.top,right:w.right,bottom:w.bottom,left:w.left,height:w.height,width:w.width,dayRed:n,dayGreen:o,dayBlue:a},step:function(e){f.style.show=e.top+"px";f.style.top=e.top+"px";f.style.right=e.right+"px";f.style.bottom=e.bottom+"px";f.style.left=e.left+"px";f.style.height=e.height+"px";f.style.width=e.width+"px";f.style.background="rgb("+e.dayRed+","+e.dayGreen+","+e.dayBlue+")"},complete:BX.delegate(function(){BX.remove(f);this.adjustViewAnimate(e,t)},this)});this.secondStage.animate()},this);setTimeout(BX.delegate(this.firstStage,this),300)},fromDayToWeek:function(e,t){BX.removeClass(this.calendar.mainCont,"calendar-main-container-small-calendar");var i=255,n=255,o=255,a=234,s=249,d=254,l=100,r=100;setTimeout(BX.delegate(function(){t.viewCont.style.opacity=0;t.show();t.viewCont.style.display="block";var h=parseInt(t.fullDayEventsCont.style.height)||this.WEEK_TOP_MIN_HEIGHT,y=BX.pos(t.viewCont);t.viewCont.style.position="absolute";t.viewCont.style.top=0;t.viewCont.style.left=0;t.viewCont.style.width=y.width+"px";t.viewCont.style.height=y.height+"px";t.viewCont.style.zIndex=100;t.fullDayEventsCont.style.height=this.WEEK_TOP_MIN_HEIGHT+"px";this.calendar.viewsCont.style.overflow="hidden";BX.removeClass(t.grid,"calendar-events-holder-show");BX.removeClass(t.fullDayEventsCont,"calendar-events-holder-show");BX.removeClass(e.grid,"calendar-events-holder-show");BX.removeClass(e.fullDayEventsCont,"calendar-events-holder-show");var w=this.util.getDayCode(this.currentViewDate),c=t.days[t.dayIndex[w]],f=t.titleCont.children.length;if(!c){w=this.util.getDayCode(this.newViewDate);c=t.days[t.dayIndex[w]]}c.node.style.background="rgb("+a+","+s+","+d+")";if(t.titleCont.children[c.dayOffset]){t.titleCont.children[c.dayOffset].style.background="rgb("+a+","+s+","+d+")"}BX.addClass(e.viewCont,"calendar-change-animate-day-to-week");for(var g=0;g<f;g++){if(g!=c.dayOffset){t.gridRow.children[g].style.flex=0;t.titleCont.children[g].style.flex=0}}var v=new BX.easing({duration:l,start:{topHolderHeight:parseInt(e.fullDayEventsCont.style.height)||this.WEEK_TOP_MIN_HEIGHT,topPadding:10,red:i,green:n,blue:o},finish:{topHolderHeight:this.WEEK_TOP_MIN_HEIGHT,topPadding:0,red:a,green:s,blue:d},step:function(t){e.fullDayEventsCont.style.height=t.topHolderHeight+"px";e.outerGrid.children[0].style.background="rgb("+t.red+","+t.green+","+t.blue+")";e.viewCont.style.paddingTop=t.topPadding+"px"},complete:BX.delegate(function(){BX.removeClass(e.viewCont,"calendar-animate-mod");setTimeout(function(){e.outerGrid.children[0].style.background="";t.viewCont.style.opacity=1;BX.addClass(t.viewCont,"calendar-animate-mod");for(var i=0;i<f;i++){t.gridRow.children[i].style.flex=1;t.titleCont.children[i].style.flex=1}setTimeout(function(){C.animate()},310)},100)},this)});var C=new BX.easing({duration:r,start:{fadeHide:100,topHolderHeight:this.WEEK_TOP_MIN_HEIGHT,red:a,green:s,blue:d},finish:{fadeHide:0,topHolderHeight:h,red:i,green:n,blue:o},step:function(i){e.viewCont.style.opacity=i.fadeHide/100;t.fullDayEventsCont.style.height=i.topHolderHeight+"px";c.node.style.background="rgb("+i.red+","+i.green+","+i.blue+")";if(t.titleCont.children[c.dayOffset]){t.titleCont.children[c.dayOffset].style.background="rgb("+i.red+","+i.green+","+i.blue+")"}},complete:BX.delegate(function(){e.outerGrid.children[0].style.background="";if(t.titleCont.children[c.dayOffset]){t.titleCont.children[c.dayOffset].style.background=""}c.node.style.background="";BX.removeClass(e.viewCont,"calendar-change-animate-day-to-week");BX.addClass(t.grid,"calendar-events-holder-show");BX.addClass(t.fullDayEventsCont,"calendar-events-holder-show");this.adjustViewAnimate(e,t)},this)});v.animate()},this),200)},fromDayToList:function(e,t){t.show();this.adjustViewAnimate(e,t)},fromListToMonth:function(e,t){var i=300,n=350;BX.removeClass(t.gridMonthContainer,"calendar-events-holder-show");BX.removeClass(this.calendar.mainCont,"calendar-main-container-small-calendar");setTimeout(BX.delegate(function(){t.viewCont.style.opacity=0;t.show();var e=BX.pos(t.viewCont);t.viewCont.style.display="block";t.viewCont.style.overflow="hidden";t.viewCont.style.position="absolute";t.viewCont.style.top=0;t.viewCont.style.left=0;t.viewCont.style.width=e.width+"px";t.viewCont.style.height=e.height+"px";t.viewCont.style.zIndex=100;this.calendar.viewsCont.style.overflow="hidden";this.firstStage.animate()},this),i);this.firstStage=new BX.easing({duration:n,start:{fadeShow:0,fadeHide:100},finish:{fadeShow:100,fadeHide:0},step:function(i){e.viewCont.style.opacity=i.fadeHide/100;t.viewCont.style.opacity=i.fadeShow/100},complete:BX.delegate(function(){this.adjustViewAnimate(e,t)},this)})},fromListToWeek:function(e,t){var i=300,n=350;BX.removeClass(t.gridMonthContainer,"calendar-events-holder-show");BX.removeClass(this.calendar.mainCont,"calendar-main-container-small-calendar");setTimeout(BX.delegate(function(){t.viewCont.style.opacity=0;t.show();var e=BX.pos(t.viewCont);t.viewCont.style.display="block";t.viewCont.style.overflow="hidden";t.viewCont.style.position="absolute";t.viewCont.style.top=0;t.viewCont.style.left=0;t.viewCont.style.width=e.width+"px";t.viewCont.style.height=e.height+"px";t.viewCont.style.zIndex=100;this.calendar.viewsCont.style.overflow="hidden";this.firstStage.animate()},this),i);this.firstStage=new BX.easing({duration:n,start:{fadeShow:0,fadeHide:100},finish:{fadeShow:100,fadeHide:0},step:function(i){e.viewCont.style.opacity=i.fadeHide/100;t.viewCont.style.opacity=i.fadeShow/100},complete:BX.delegate(function(){this.adjustViewAnimate(e,t)},this)})},fromListToDay:function(e,t){t.show();this.adjustViewAnimate(e,t)},adjustViewAnimate:function(e,t){this.calendar.viewsCont.style.cssText="";t.viewCont.style.cssText="";e.viewCont.style.cssText="";BX.removeClass(e.viewCont,"calendar-animate-mod");BX.removeClass(t.viewCont,"calendar-animate-mod");e.viewCont.style.display="none";BX.addClass(t.gridMonthContainer,"calendar-events-holder-show");if(t.getName()!=this.calendar.currentViewName)e.hide()},getRgb:function(){}};if(e.BXEventCalendar){e.BXEventCalendar.ViewTransition=t}else{BX.addCustomEvent(e,"onBXEventCalendarInit",function(){e.BXEventCalendar.ViewTransition=t})}})(window);