;(function($,_,undefined){"use strict";ips.controller.register('calendar.front.browse.monthView',{_emptyEvent:"
",initialize:function(){this.setup();},setup:function(){this._alignEvents();},_alignEvents:function(){var days=this.scope.find('.cCalendar_date');var currentPositions=[];var self=this;_.each(days,function(day){var day=$(day);var dayNumber=day.find('.cCalendar_dayNumber').text();var weekStart=false;if(day.closest('td').is('tr > td:first-child')){weekStart=true;}
var events=day.find('.cEvents_ranged [data-eventID]');if(!events.length){currentPositions=[];return;}
var wrapper=$("").addClass('cEvents');var spaces=0;if(currentPositions.length){var doneEvent=false;for(var i=0;i .cEvents').replaceWith(wrapper);currentPositions=[];_.each(day.find('.cEvents_ranged [data-eventID]'),function(event){var eventID=parseInt($(event).attr('data-eventID'));if(eventID===0){currentPositions.push('-');}else if(_.isNumber(eventID)&&!_.isNaN(eventID)){currentPositions.push(eventID);}});});_.each(this.scope.find('tr'),function(row){if(!$(row).find('.cCalendar_birthdays').length){return;}
var cells=$(row).find('td.cCalendar_date');var maxHeightCell=_.max(cells,function(cell){return parseInt($(cell).height());});if(!_.isElement(maxHeightCell)){return;}
cells.find('> div').css({height:$(maxHeightCell).height()+20+'px'});});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('calendar.front.browse.main',{_ajaxObj:null,initialize:function(){this.on('click','[data-action="changeView"]',this.changeView);this.on(window,'statechange',this.stateChange);this.setup();},setup:function(){History.pushState({controller:'calendarView'},document.title,window.location.href);},changeView:function(e){e.preventDefault();var self=this;var title=$(e.currentTarget).attr('title');var url=$(e.currentTarget).attr('href');History.pushState({controller:'calendarView'},title,url);},stateChange:function(){var state=History.getState();if(_.isUndefined(state.data.controller)||state.data.controller!='calendarView'){return;}
ips.utils.analytics.trackPageView(state.url);this._updateView(state.url,state.title)},_updateView:function(url,title){var self=this;if(this._ajaxObj&&_.isFunction(this._ajaxObj.abort)){this._ajaxObj.abort();}
this._setLoading(true);this._ajaxObj=ips.getAjax()(url,{showLoading:true}).done(function(response){self.scope.html(response);$(document).trigger('contentChange',[self.scope]);History.pushState({controller:'calendarView'},title,url);}).always(function(){self._setLoading(false);});},_setLoading:function(state){if(state){this.scope.animate({opacity:"0.6"},'fast');}else{this.scope.animate({opacity:"1"},'fast');}}});}(jQuery,_));;