{"version":3,"sources":["templates.js","angular-bootstrap-calendar-tpls.js","services/moment.js","services/calendarTitle.js","services/calendarHelper.js","services/calendarDebounce.js","services/calendarConfig.js","filters/calendarTruncateEventTitle.js","filters/calendarLimitTo.js","directives/mwlDateModifier.js","directives/mwlCollapseFallback.js","directives/mwlCalendarYear.js","directives/mwlCalendarWeek.js","directives/mwlCalendarSlideBox.js","directives/mwlCalendarMonth.js","directives/mwlCalendarDay.js","directives/mwlCalendar.js"],"names":["window","$templateCache","angular","run","put","module","constant","moment","factory","weekTitleLabel","day","currentDay","month","format","calendarConfig","titleFormats","week","replace","year","eventEnd","eventStart","eventIsInPeriod","periodStart","periodEnd","getEventsInPeriod","startPeriod","allEvents","filter","endsAt","endPeriod","isAfter","isBefore","isSame","calendarDate","period","startOf","endOf","incrementsBadgeTotal","length","event","startsAt","weekdays","events","count","getWeekDayNames","filterEventsInPeriod","view","eventsInPeriod","getYearView","push","label","periodEvents","clone","date","badgeTotal","getBadgeTotal","dateFormats","startOfMonth","endOfMonthView","today","monthEvents","inMonth","isPast","isFuture","isWeekend","indexOf","getWeekView","endOfWeek","days","weekDayLabel","dayCounter","isToday","weekDay","dayLabel","eventsSorted","weekViewEnd","weekViewStart","span","offset","diff","daySpan","dayOffset","calendarEnd","calendarHeight","calendarStart","add","dayStartHour","dayEndHour","hourHeight","hourHeightMultiplier","buckets","toDate","top","height","diffStart","forEach","bucket","map","canFitInThisBucket","cannotFitInABucket","getMonthView","bucketIndex","bucketItem","left","getDayView","service","args","$timeout","debounce","immediate","timeout","callNow","cancel","apply","context","this","arguments","later","wait","func","hour","provider","defaultTitleFormats","i18nStrings","eventsLabel","timeLabel","configProvider","formats","extend","defaultDateFormats","strings","$get","string","boxHeight","substr","limit","begin","Infinity","Math","abs","input","Number","toString","isNaN","slice","parseInt","max","directive","restrict","controller","$element","isDefined","$scope","$attrs","setToToday","$apply","Date","increment","onClick","decrement","unbind","subtract","bind","$on","scope","$injector","has","unbindWatcher","$watch","mwlCollapseFallback","shouldCollapse","unbindDestroy","addClass","removeClass","templateUrl","onEventClick","onEditEventClick","require","onDeleteEventClick","deleteEventHtml","autoOpen","onTimespanClick","editEventHtml","vm","firstRun","calendarHelper","monthClicked","monthClickedFirstRun","openMonthIndex","openRowIndex","monthIndex","attrs","calendarCtrl","controllerAs","$sce","isOpen","isMonthView","link","elm","ctrls","floor","monthOffsets","weekDays","rows","i","dayClickedFirstRun","dayClicked","openDayIndex","dayIndex","highlightEvent","highlightClass","shouldAddClass","dayContainsEvent","type","dayViewStart","dayViewEnd","dayViewSplit","hours","originalLocale","locale","updateDays","onDrillDownClick","calendarTitle","calendarDebounce","drillDown","changeView","newDay","nextView","calendarNextView","previousDate","previousView","copy","refreshCalendar","rawDate","shouldUpdate","$broadcast","currentDate","unbindLocaleWatcher","unbindOnDestroy","unbindDestroyListener"],"mappings":"CAA+E,SAAAA,EAACC,GAAD,YAAAC,GAE/ED,OAAAA,mBAF+EC,EAG/ED,OAAAA,gBAAmBE,KAH4D,iBAAA,SAK/EF,GACAA,EAAeG,IAAI,8BAAA,szCACnBH,EAAeG,IAAI,qCAAnB,2uDAPmCH,EAAAG,IAAA,sCAAA,+0BCevBH,EAAeG,IAAI,6CAA8C,kZCf7EH,EDgB2BG,IAAI,uCAAwC,u8BCbpEC,EAAOD,IAAA,sCDc4D,ojCEjBtEH,EFkB2BG,IAAI,sCAAuC,i2BEfnEC,EAAOD,IAAA,sCACC,wtCAAkDF,EAEzDG,OAAA,gBAAAC,SAAyB,SAAAN,EAAAO,QAAAL,EAAAG,OAFgC,gBAAAG,QAAA,iBAAA,SAM/B,iBAAA,SAExBD,EAAOE,GAFiB,QAN+BC,GAAAC,GAWzD,MAASC,GAAMD,GAAYE,OAAAC,EAAAC,aAAAL,KAAA,QAX8BM,GAAAL,GAezD,GAAAF,GAAAK,EAA0BC,aAAAC,IACxB,OAAOT,GAAOI,QAAYE,SAAOC,EAAAH,GAAeI,QADxBE,QAAA,SAAAV,EAAAI,GAAAE,OA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,GAAIC,KAAAA,GACuCD,EACvC7L,KADuCuG,EAAAgB,OAAA,aAAAgE,IAAAM,EADmB7L,KAAAuG,EAAAgB,OAAA,OAAAgE,IAAAM,EAlEgB7L,KAAAuG,EAAAgB,OAAA,SAAAgE,GAAA,GAAhF,IAAAO,GAAAvF,EAAAW,IAAA,WAAA,WApBK2E,EAAA/I,QAAA,SAAAiE,GAF4BA,Of4uBnB8E,GAAgB7L,KAAK8L,SAKvC/O,OAAQE","file":"angular-bootstrap-calendar-tpls.min.js","sourcesContent":["angular.module(\"mwl.calendar\").run([\"$templateCache\", function($templateCache) {$templateCache.put(\"src/templates/calendar.html\",\"
The value passed to the view attribute of the calendar is not set
The value passed to current-day attribute of the calendar is not set
\");\n$templateCache.put(\"src/templates/calendarDayView.html\",\"
\");\n$templateCache.put(\"src/templates/calendarMonthDay.html\",\"
0\\\" ng-bind=\\\"day.badgeTotal\\\">
0\\\">
\");\n$templateCache.put(\"src/templates/calendarMonthEventsList.html\",\"
0\\\">
\");\n$templateCache.put(\"src/templates/calendarMonthView.html\",\"
0}\\\">
0\\\" events=\\\"vm.view[vm.openDayIndex].events\\\" on-event-click=\\\"onEventClick\\\" edit-event-html=\\\"editEventHtml\\\" on-edit-event-click=\\\"onEditEventClick\\\" delete-event-html=\\\"deleteEventHtml\\\" on-delete-event-click=\\\"onDeleteEventClick\\\">
\");\n$templateCache.put(\"src/templates/calendarSlideBox.html\",\"
\");\n$templateCache.put(\"src/templates/calendarWeekView.html\",\"

\");\n$templateCache.put(\"src/templates/calendarYearView.html\",\"
0, \\'cal-day-today\\': month.isToday}\\\"> 0\\\" ng-bind=\\\"month.badgeTotal\\\">
0\\\">
0\\\" events=\\\"vm.view[vm.openMonthIndex].events\\\" on-event-click=\\\"onEventClick\\\" edit-event-html=\\\"editEventHtml\\\" on-edit-event-click=\\\"onEditEventClick\\\" delete-event-html=\\\"deleteEventHtml\\\" on-delete-event-click=\\\"onDeleteEventClick\\\">
\");}]);","/**\n * angular-bootstrap-calendar - A pure AngularJS bootstrap themed responsive calendar that can display events and has views for year, month, week and day\n * @version v0.10.6\n * @link https://github.com/mattlewis92/angular-bootstrap-calendar\n * @license MIT\n */\n(function (window, angular) {\n 'use strict';\n angular.module('mwl.calendar', []);\n angular.module('mwl.calendar').run([\n '$templateCache',\n function ($templateCache) {\n $templateCache.put('src/templates/calendar.html', '
The value passed to the view attribute of the calendar is not set
The value passed to current-day attribute of the calendar is not set
');\n $templateCache.put('src/templates/calendarDayView.html', '
');\n $templateCache.put('src/templates/calendarMonthDay.html', '
0\" ng-bind=\"day.badgeTotal\">
0\">
');\n $templateCache.put('src/templates/calendarMonthEventsList.html', '
0\">
');\n $templateCache.put('src/templates/calendarMonthView.html', '
0}\">
0\" events=\"vm.view[vm.openDayIndex].events\" on-event-click=\"onEventClick\" edit-event-html=\"editEventHtml\" on-edit-event-click=\"onEditEventClick\" delete-event-html=\"deleteEventHtml\" on-delete-event-click=\"onDeleteEventClick\">
');\n $templateCache.put('src/templates/calendarSlideBox.html', '
');\n $templateCache.put('src/templates/calendarWeekView.html', '

');\n $templateCache.put('src/templates/calendarYearView.html', '
0, \\'cal-day-today\\': month.isToday}\"> 0\" ng-bind=\"month.badgeTotal\">
0\">
0\" events=\"vm.view[vm.openMonthIndex].events\" on-event-click=\"onEventClick\" edit-event-html=\"editEventHtml\" on-edit-event-click=\"onEditEventClick\" delete-event-html=\"deleteEventHtml\" on-delete-event-click=\"onDeleteEventClick\">
');\n }\n ]);\n 'use strict';\n angular.module('mwl.calendar').constant('moment', window.moment);\n 'use strict';\n angular.module('mwl.calendar').factory('calendarTitle', [\n 'moment',\n 'calendarConfig',\n function (moment, calendarConfig) {\n function day(currentDay) {\n return moment(currentDay).format(calendarConfig.titleFormats.day);\n }\n function week(currentDay) {\n var weekTitleLabel = calendarConfig.titleFormats.week;\n return weekTitleLabel.replace('{week}', moment(currentDay).week()).replace('{year}', moment(currentDay).format('YYYY'));\n }\n function month(currentDay) {\n return moment(currentDay).format(calendarConfig.titleFormats.month);\n }\n function year(currentDay) {\n return moment(currentDay).format(calendarConfig.titleFormats.year);\n }\n return {\n day: day,\n week: week,\n month: month,\n year: year\n };\n }\n ]);\n 'use strict';\n angular.module('mwl.calendar').factory('calendarHelper', [\n 'moment',\n 'calendarConfig',\n function (moment, calendarConfig) {\n function eventIsInPeriod(eventStart, eventEnd, periodStart, periodEnd) {\n eventStart = moment(eventStart);\n eventEnd = moment(eventEnd);\n periodStart = moment(periodStart);\n periodEnd = moment(periodEnd);\n return eventStart.isAfter(periodStart) && eventStart.isBefore(periodEnd) || eventEnd.isAfter(periodStart) && eventEnd.isBefore(periodEnd) || eventStart.isBefore(periodStart) && eventEnd.isAfter(periodEnd) || eventStart.isSame(periodStart) || eventEnd.isSame(periodEnd);\n }\n function getEventsInPeriod(calendarDate, period, allEvents) {\n var startPeriod = moment(calendarDate).startOf(period);\n var endPeriod = moment(calendarDate).endOf(period);\n return allEvents.filter(function (event) {\n return eventIsInPeriod(event.startsAt, event.endsAt, startPeriod, endPeriod);\n });\n }\n function getBadgeTotal(events) {\n return events.filter(function (event) {\n return event.incrementsBadgeTotal !== false;\n }).length;\n }\n function getWeekDayNames() {\n var weekdays = [];\n var count = 0;\n while (count < 7) {\n weekdays.push(moment().weekday(count++).format(calendarConfig.dateFormats.weekDay));\n }\n return weekdays;\n }\n function filterEventsInPeriod(events, startPeriod, endPeriod) {\n return events.filter(function (event) {\n return eventIsInPeriod(event.startsAt, event.endsAt, startPeriod, endPeriod);\n });\n }\n function getYearView(events, currentDay) {\n var view = [];\n var eventsInPeriod = getEventsInPeriod(currentDay, 'year', events);\n var month = moment(currentDay).startOf('year');\n var count = 0;\n while (count < 12) {\n var startPeriod = month.clone();\n var endPeriod = startPeriod.clone().endOf('month');\n var periodEvents = filterEventsInPeriod(eventsInPeriod, startPeriod, endPeriod);\n view.push({\n label: startPeriod.format(calendarConfig.dateFormats.month),\n isToday: startPeriod.isSame(moment().startOf('month')),\n events: periodEvents,\n date: startPeriod,\n badgeTotal: getBadgeTotal(periodEvents)\n });\n month.add(1, 'month');\n count++;\n }\n return view;\n }\n function getMonthView(events, currentDay) {\n var eventsInPeriod = getEventsInPeriod(currentDay, 'month', events);\n var startOfMonth = moment(currentDay).startOf('month');\n var day = startOfMonth.clone().startOf('week');\n var endOfMonthView = moment(currentDay).endOf('month').endOf('week');\n var view = [];\n var today = moment().startOf('day');\n while (day.isBefore(endOfMonthView)) {\n var inMonth = day.month() === moment(currentDay).month();\n var monthEvents = [];\n if (inMonth) {\n monthEvents = filterEventsInPeriod(eventsInPeriod, day, day.clone().endOf('day'));\n }\n view.push({\n label: day.date(),\n date: day.clone(),\n inMonth: inMonth,\n isPast: today.isAfter(day),\n isToday: today.isSame(day),\n isFuture: today.isBefore(day),\n isWeekend: [\n 0,\n 6\n ].indexOf(day.day()) > -1,\n events: monthEvents,\n badgeTotal: getBadgeTotal(monthEvents)\n });\n day.add(1, 'day');\n }\n return view;\n }\n function getWeekView(events, currentDay) {\n var startOfWeek = moment(currentDay).startOf('week');\n var endOfWeek = moment(currentDay).endOf('week');\n var dayCounter = startOfWeek.clone();\n var days = [];\n var today = moment().startOf('day');\n while (days.length < 7) {\n days.push({\n weekDayLabel: dayCounter.format(calendarConfig.dateFormats.weekDay),\n date: dayCounter.clone(),\n dayLabel: dayCounter.format(calendarConfig.dateFormats.day),\n isPast: dayCounter.isBefore(today),\n isToday: dayCounter.isSame(today),\n isFuture: dayCounter.isAfter(today),\n isWeekend: [\n 0,\n 6\n ].indexOf(dayCounter.day()) > -1\n });\n dayCounter.add(1, 'day');\n }\n var eventsSorted = filterEventsInPeriod(events, startOfWeek, endOfWeek).map(function (event) {\n var eventStart = moment(event.startsAt).startOf('day');\n var eventEnd = moment(event.endsAt).startOf('day');\n var weekViewStart = moment(startOfWeek).startOf('day');\n var weekViewEnd = moment(endOfWeek).startOf('day');\n var offset, span;\n if (eventStart.isBefore(weekViewStart) || eventStart.isSame(weekViewStart)) {\n offset = 0;\n } else {\n offset = eventStart.diff(weekViewStart, 'days');\n }\n if (eventEnd.isAfter(weekViewEnd)) {\n eventEnd = weekViewEnd;\n }\n if (eventStart.isBefore(weekViewStart)) {\n eventStart = weekViewStart;\n }\n span = moment(eventEnd).diff(eventStart, 'days') + 1;\n event.daySpan = span;\n event.dayOffset = offset;\n return event;\n });\n return {\n days: days,\n events: eventsSorted\n };\n }\n function getDayView(events, currentDay, dayStartHour, dayEndHour, hourHeight) {\n var calendarStart = moment(currentDay).startOf('day').add(dayStartHour, 'hours');\n var calendarEnd = moment(currentDay).startOf('day').add(dayEndHour, 'hours');\n var calendarHeight = (dayEndHour - dayStartHour + 1) * hourHeight;\n var hourHeightMultiplier = hourHeight / 60;\n var buckets = [];\n var eventsInPeriod = filterEventsInPeriod(events, moment(currentDay).startOf('day').toDate(), moment(currentDay).endOf('day').toDate());\n return eventsInPeriod.map(function (event) {\n if (moment(event.startsAt).isBefore(calendarStart)) {\n event.top = 0;\n } else {\n event.top = moment(event.startsAt).startOf('minute').diff(calendarStart.startOf('minute'), 'minutes') * hourHeightMultiplier - 2;\n }\n if (moment(event.endsAt).isAfter(calendarEnd)) {\n event.height = calendarHeight - event.top;\n } else {\n var diffStart = event.startsAt;\n if (moment(event.startsAt).isBefore(calendarStart)) {\n diffStart = calendarStart.toDate();\n }\n event.height = moment(event.endsAt).diff(diffStart, 'minutes') * hourHeightMultiplier;\n }\n if (event.top - event.height > calendarHeight) {\n event.height = 0;\n }\n event.left = 0;\n return event;\n }).filter(function (event) {\n return event.height > 0;\n }).map(function (event) {\n var cannotFitInABucket = true;\n buckets.forEach(function (bucket, bucketIndex) {\n var canFitInThisBucket = true;\n bucket.forEach(function (bucketItem) {\n if (eventIsInPeriod(event.startsAt, event.endsAt, bucketItem.startsAt, bucketItem.endsAt) || eventIsInPeriod(bucketItem.startsAt, bucketItem.endsAt, event.startsAt, event.endsAt)) {\n canFitInThisBucket = false;\n }\n });\n if (canFitInThisBucket && cannotFitInABucket) {\n cannotFitInABucket = false;\n event.left = bucketIndex * 150;\n buckets[bucketIndex].push(event);\n }\n });\n if (cannotFitInABucket) {\n event.left = buckets.length * 150;\n buckets.push([event]);\n }\n return event;\n });\n }\n return {\n getWeekDayNames: getWeekDayNames,\n getYearView: getYearView,\n getMonthView: getMonthView,\n getWeekView: getWeekView,\n getDayView: getDayView\n };\n }\n ]);\n 'use strict';\n angular.module('mwl.calendar').service('calendarDebounce', [\n '$timeout',\n function ($timeout) {\n function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n function later() {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n }\n var callNow = immediate && !timeout;\n $timeout.cancel(timeout);\n timeout = $timeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n }\n return debounce;\n }\n ]);\n 'use strict';\n angular.module('mwl.calendar').provider('calendarConfig', function () {\n var defaultDateFormats = {\n hour: 'ha',\n day: 'D MMM',\n month: 'MMMM',\n weekDay: 'dddd'\n };\n var defaultTitleFormats = {\n day: 'dddd D MMMM, YYYY',\n week: 'Week {week} of {year}',\n month: 'MMMM YYYY',\n year: 'YYYY'\n };\n var i18nStrings = {\n eventsLabel: 'Events',\n timeLabel: 'Time'\n };\n var configProvider = this;\n configProvider.setDateFormats = function (formats) {\n angular.extend(defaultDateFormats, formats);\n return configProvider;\n };\n configProvider.setTitleFormats = function (formats) {\n angular.extend(defaultTitleFormats, formats);\n return configProvider;\n };\n configProvider.setI18nStrings = function (strings) {\n angular.extend(i18nStrings, strings);\n return configProvider;\n };\n configProvider.$get = function () {\n return {\n dateFormats: defaultDateFormats,\n titleFormats: defaultTitleFormats,\n i18nStrings: i18nStrings\n };\n };\n });\n 'use strict';\n angular.module('mwl.calendar').filter('calendarTruncateEventTitle', function () {\n return function (string, length, boxHeight) {\n if (!string) {\n return '';\n }\n //Only truncate if if actually needs truncating\n if (string.length >= length && string.length / 20 > boxHeight / 30) {\n return string.substr(0, length) + '...';\n } else {\n return string;\n }\n };\n });\n 'use strict';\n angular.module('mwl.calendar').filter('calendarLimitTo', function () {\n //Copied from the angular source. Only 1.4 has the begin functionality.\n return function (input, limit, begin) {\n if (Math.abs(Number(limit)) === Infinity) {\n limit = Number(limit);\n } else {\n limit = parseInt(limit);\n }\n if (isNaN(limit)) {\n return input;\n }\n if (angular.isNumber(input)) {\n input = input.toString();\n }\n if (!angular.isArray(input) && !angular.isString(input)) {\n return input;\n }\n begin = !begin || isNaN(begin) ? 0 : parseInt(begin);\n begin = begin < 0 && begin >= -input.length ? input.length + begin : begin;\n if (limit >= 0) {\n return input.slice(begin, begin + limit);\n } else if (begin === 0) {\n return input.slice(limit, input.length);\n } else {\n return input.slice(Math.max(0, begin + limit), begin);\n }\n };\n });\n 'use strict';\n angular.module('mwl.calendar').directive('mwlDateModifier', function () {\n return {\n restrict: 'A',\n controller: [\n '$element',\n '$attrs',\n '$scope',\n 'moment',\n function ($element, $attrs, $scope, moment) {\n function onClick() {\n if (angular.isDefined($attrs.setToToday)) {\n $scope.date = new Date();\n } else if (angular.isDefined($attrs.increment)) {\n $scope.date = moment($scope.date).add(1, $scope.increment).toDate();\n } else if (angular.isDefined($attrs.decrement)) {\n $scope.date = moment($scope.date).subtract(1, $scope.decrement).toDate();\n }\n $scope.$apply();\n }\n $element.bind('click', onClick);\n $scope.$on('$destroy', function () {\n $element.unbind('click', onClick);\n });\n }\n ],\n scope: {\n date: '=',\n increment: '=',\n decrement: '='\n }\n };\n });\n 'use strict';\n angular.module('mwl.calendar').directive('mwlCollapseFallback', [\n '$injector',\n function ($injector) {\n if ($injector.has('collapseDirective')) {\n return {};\n }\n return {\n restrict: 'A',\n controller: [\n '$scope',\n '$attrs',\n '$element',\n function ($scope, $attrs, $element) {\n var unbindWatcher = $scope.$watch($attrs.mwlCollapseFallback, function (shouldCollapse) {\n if (shouldCollapse) {\n $element.addClass('ng-hide');\n } else {\n $element.removeClass('ng-hide');\n }\n });\n var unbindDestroy = $scope.$on('$destroy', function () {\n unbindDestroy();\n unbindWatcher();\n });\n }\n ]\n };\n }\n ]);\n 'use strict';\n angular.module('mwl.calendar').directive('mwlCalendarYear', function () {\n return {\n templateUrl: 'src/templates/calendarYearView.html',\n restrict: 'EA',\n require: '^mwlCalendar',\n scope: {\n events: '=',\n currentDay: '=',\n onEventClick: '=',\n onEditEventClick: '=',\n onDeleteEventClick: '=',\n editEventHtml: '=',\n deleteEventHtml: '=',\n autoOpen: '=',\n onTimespanClick: '='\n },\n controller: [\n '$scope',\n 'moment',\n 'calendarHelper',\n function ($scope, moment, calendarHelper) {\n var vm = this;\n var firstRun = true;\n $scope.$on('calendar.refreshView', function () {\n vm.view = calendarHelper.getYearView($scope.events, $scope.currentDay);\n //Auto open the calendar to the current day if set\n if ($scope.autoOpen && firstRun) {\n firstRun = false;\n vm.view.forEach(function (month) {\n if (moment($scope.currentDay).startOf('month').isSame(month.date)) {\n vm.monthClicked(month, true);\n }\n });\n }\n });\n vm.monthClicked = function (month, monthClickedFirstRun) {\n if (!monthClickedFirstRun) {\n $scope.onTimespanClick({ calendarDate: month.date.toDate() });\n }\n vm.openRowIndex = null;\n var monthIndex = vm.view.indexOf(month);\n if (monthIndex === vm.openMonthIndex) {\n //the month has been clicked and is already open\n vm.openMonthIndex = null; //close the open month\n } else {\n vm.openMonthIndex = monthIndex;\n vm.openRowIndex = Math.floor(monthIndex / 4);\n }\n };\n }\n ],\n controllerAs: 'vm',\n link: function (scope, element, attrs, calendarCtrl) {\n scope.vm.calendarCtrl = calendarCtrl;\n }\n };\n });\n 'use strict';\n angular.module('mwl.calendar').directive('mwlCalendarWeek', function () {\n return {\n templateUrl: 'src/templates/calendarWeekView.html',\n restrict: 'EA',\n require: '^mwlCalendar',\n scope: {\n events: '=',\n currentDay: '=',\n onEventClick: '='\n },\n controller: [\n '$scope',\n 'calendarHelper',\n function ($scope, calendarHelper) {\n var vm = this;\n $scope.$on('calendar.refreshView', function () {\n vm.view = calendarHelper.getWeekView($scope.events, $scope.currentDay);\n });\n }\n ],\n controllerAs: 'vm',\n link: function (scope, element, attrs, calendarCtrl) {\n scope.vm.calendarCtrl = calendarCtrl;\n }\n };\n });\n 'use strict';\n angular.module('mwl.calendar').directive('mwlCalendarSlideBox', function () {\n return {\n restrict: 'EA',\n templateUrl: 'src/templates/calendarSlideBox.html',\n replace: true,\n controller: [\n '$scope',\n '$sce',\n function ($scope, $sce) {\n var vm = this;\n vm.$sce = $sce;\n var unbindWatcher = $scope.$watch('isOpen', function (isOpen) {\n vm.shouldCollapse = !isOpen;\n });\n var unbindDestroy = $scope.$on('$destroy', function () {\n unbindDestroy();\n unbindWatcher();\n });\n }\n ],\n controllerAs: 'vm',\n require: [\n '^?mwlCalendarMonth',\n '^?mwlCalendarYear'\n ],\n link: function (scope, elm, attrs, ctrls) {\n scope.isMonthView = !!ctrls[0];\n scope.isYearView = !!ctrls[1];\n },\n scope: {\n isOpen: '=',\n events: '=',\n onEventClick: '=',\n editEventHtml: '=',\n onEditEventClick: '=',\n deleteEventHtml: '=',\n onDeleteEventClick: '='\n }\n };\n });\n 'use strict';\n angular.module('mwl.calendar').directive('mwlCalendarMonth', function () {\n return {\n templateUrl: 'src/templates/calendarMonthView.html',\n restrict: 'EA',\n require: '^mwlCalendar',\n scope: {\n events: '=',\n currentDay: '=',\n onEventClick: '=',\n onEditEventClick: '=',\n onDeleteEventClick: '=',\n editEventHtml: '=',\n deleteEventHtml: '=',\n autoOpen: '=',\n onTimespanClick: '='\n },\n controller: [\n '$scope',\n 'moment',\n 'calendarHelper',\n function ($scope, moment, calendarHelper) {\n var vm = this;\n var firstRun = true;\n $scope.$on('calendar.refreshView', function () {\n vm.weekDays = calendarHelper.getWeekDayNames();\n vm.view = calendarHelper.getMonthView($scope.events, $scope.currentDay);\n var rows = Math.floor(vm.view.length / 7);\n vm.monthOffsets = [];\n for (var i = 0; i < rows; i++) {\n vm.monthOffsets.push(i * 7);\n }\n //Auto open the calendar to the current day if set\n if ($scope.autoOpen && firstRun) {\n firstRun = false;\n vm.view.forEach(function (day) {\n if (day.inMonth && moment($scope.currentDay).startOf('day').isSame(day.date)) {\n vm.dayClicked(day, true);\n }\n });\n }\n });\n vm.dayClicked = function (day, dayClickedFirstRun) {\n if (!dayClickedFirstRun) {\n $scope.onTimespanClick({ calendarDate: day.date.toDate() });\n }\n vm.openRowIndex = null;\n var dayIndex = vm.view.indexOf(day);\n if (dayIndex === vm.openDayIndex) {\n //the day has been clicked and is already open\n vm.openDayIndex = null; //close the open day\n } else {\n vm.openDayIndex = dayIndex;\n vm.openRowIndex = Math.floor(dayIndex / 7);\n }\n };\n vm.highlightEvent = function (event, shouldAddClass) {\n vm.view.forEach(function (day) {\n delete day.highlightClass;\n if (shouldAddClass) {\n var dayContainsEvent = day.events.indexOf(event) > -1;\n if (dayContainsEvent) {\n day.highlightClass = 'day-highlight dh-event-' + event.type;\n }\n }\n });\n };\n }\n ],\n controllerAs: 'vm',\n link: function (scope, element, attrs, calendarCtrl) {\n scope.vm.calendarCtrl = calendarCtrl;\n }\n };\n });\n 'use strict';\n angular.module('mwl.calendar').directive('mwlCalendarDay', function () {\n return {\n templateUrl: 'src/templates/calendarDayView.html',\n restrict: 'EA',\n require: '^mwlCalendar',\n scope: {\n events: '=',\n currentDay: '=',\n onEventClick: '=',\n dayViewStart: '=',\n dayViewEnd: '=',\n dayViewSplit: '='\n },\n controller: [\n '$scope',\n '$timeout',\n 'moment',\n 'calendarHelper',\n 'calendarConfig',\n function ($scope, $timeout, moment, calendarHelper, calendarConfig) {\n var vm = this;\n var dayViewStart, dayViewEnd;\n vm.calendarConfig = calendarConfig;\n function updateDays() {\n dayViewStart = moment($scope.dayViewStart || '00:00', 'HH:mm');\n dayViewEnd = moment($scope.dayViewEnd || '23:00', 'HH:mm');\n vm.dayViewSplit = parseInt($scope.dayViewSplit);\n vm.hourHeight = 60 / $scope.dayViewSplit * 30;\n vm.hours = [];\n var dayCounter = moment(dayViewStart);\n for (var i = 0; i <= dayViewEnd.diff(dayViewStart, 'hours'); i++) {\n vm.hours.push({ label: dayCounter.format(calendarConfig.dateFormats.hour) });\n dayCounter.add(1, 'hour');\n }\n }\n var originalLocale = moment.locale();\n $scope.$on('calendar.refreshView', function () {\n if (originalLocale !== moment.locale()) {\n originalLocale = moment.locale();\n updateDays();\n }\n vm.view = calendarHelper.getDayView($scope.events, $scope.currentDay, dayViewStart.hours(), dayViewEnd.hours(), vm.hourHeight);\n });\n updateDays();\n }\n ],\n controllerAs: 'vm'\n };\n });\n 'use strict';\n angular.module('mwl.calendar').directive('mwlCalendar', function () {\n return {\n templateUrl: 'src/templates/calendar.html',\n restrict: 'EA',\n scope: {\n events: '=',\n view: '=',\n viewTitle: '=',\n currentDay: '=',\n editEventHtml: '=',\n deleteEventHtml: '=',\n autoOpen: '=',\n onEventClick: '&',\n onEditEventClick: '&',\n onDeleteEventClick: '&',\n onTimespanClick: '&',\n onDrillDownClick: '&',\n dayViewStart: '@',\n dayViewEnd: '@',\n dayViewSplit: '@'\n },\n controller: [\n '$scope',\n '$timeout',\n 'moment',\n 'calendarTitle',\n 'calendarDebounce',\n function ($scope, $timeout, moment, calendarTitle, calendarDebounce) {\n var vm = this;\n $scope.events = $scope.events || [];\n vm.changeView = function (view, newDay) {\n $scope.view = view;\n $scope.currentDay = newDay;\n };\n vm.drillDown = function (date) {\n var rawDate = moment(date).toDate();\n var nextView = {\n year: 'month',\n month: 'day',\n week: 'day'\n };\n if ($scope.onDrillDownClick({\n calendarDate: rawDate,\n calendarNextView: nextView[$scope.view]\n }) !== false) {\n vm.changeView(nextView[$scope.view], rawDate);\n }\n };\n var previousDate = moment($scope.currentDay);\n var previousView = angular.copy($scope.view);\n //Use a debounce to prevent it being called 3 times on initialisation\n var refreshCalendar = calendarDebounce(function () {\n if (calendarTitle[$scope.view]) {\n $scope.viewTitle = calendarTitle[$scope.view]($scope.currentDay);\n }\n //if on-timespan-click=\"calendarDay = calendarDate\" is set then dont update the view as nothing needs to change\n var currentDate = moment($scope.currentDay);\n var shouldUpdate = true;\n if (previousDate.clone().startOf($scope.view).isSame(currentDate.clone().startOf($scope.view)) && !previousDate.isSame(currentDate) && $scope.view === previousView) {\n shouldUpdate = false;\n }\n previousDate = currentDate;\n previousView = angular.copy($scope.view);\n if (shouldUpdate) {\n $scope.$broadcast('calendar.refreshView');\n }\n }, 50);\n //Auto update the calendar when the locale changes\n var unbindLocaleWatcher = $scope.$watch(function () {\n return moment.locale();\n }, refreshCalendar);\n var unbindOnDestroy = [];\n unbindOnDestroy.push(unbindLocaleWatcher);\n //Refresh the calendar when any of these variables change.\n unbindOnDestroy.push($scope.$watch('currentDay', refreshCalendar));\n unbindOnDestroy.push($scope.$watch('view', refreshCalendar));\n unbindOnDestroy.push($scope.$watch('events', refreshCalendar, true));\n //Remove any watchers when the calendar is destroyed\n var unbindDestroyListener = $scope.$on('$destroy', function () {\n unbindOnDestroy.forEach(function (unbind) {\n unbind();\n });\n });\n unbindOnDestroy.push(unbindDestroyListener);\n }\n ]\n };\n });\n}(window, angular));","'use strict';\n\nangular\n .module('mwl.calendar')\n .constant('moment', window.moment);\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .factory('calendarTitle', function(moment, calendarConfig) {\n\n function day(currentDay) {\n return moment(currentDay).format(calendarConfig.titleFormats.day);\n }\n\n function week(currentDay) {\n var weekTitleLabel = calendarConfig.titleFormats.week;\n return weekTitleLabel.replace('{week}', moment(currentDay).week()).replace('{year}', moment(currentDay).format('YYYY'));\n }\n\n function month(currentDay) {\n return moment(currentDay).format(calendarConfig.titleFormats.month);\n }\n\n function year(currentDay) {\n return moment(currentDay).format(calendarConfig.titleFormats.year);\n }\n\n return {\n day: day,\n week: week,\n month: month,\n year: year\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .factory('calendarHelper', function(moment, calendarConfig) {\n\n function eventIsInPeriod(eventStart, eventEnd, periodStart, periodEnd) {\n\n eventStart = moment(eventStart);\n eventEnd = moment(eventEnd);\n periodStart = moment(periodStart);\n periodEnd = moment(periodEnd);\n\n return (eventStart.isAfter(periodStart) && eventStart.isBefore(periodEnd)) ||\n (eventEnd.isAfter(periodStart) && eventEnd.isBefore(periodEnd)) ||\n (eventStart.isBefore(periodStart) && eventEnd.isAfter(periodEnd)) ||\n eventStart.isSame(periodStart) ||\n eventEnd.isSame(periodEnd);\n\n }\n\n function getEventsInPeriod(calendarDate, period, allEvents) {\n var startPeriod = moment(calendarDate).startOf(period);\n var endPeriod = moment(calendarDate).endOf(period);\n return allEvents.filter(function(event) {\n return eventIsInPeriod(event.startsAt, event.endsAt, startPeriod, endPeriod);\n });\n }\n\n function getBadgeTotal(events) {\n return events.filter(function(event) {\n return event.incrementsBadgeTotal !== false;\n }).length;\n }\n\n function getWeekDayNames() {\n var weekdays = [];\n var count = 0;\n while (count < 7) {\n weekdays.push(moment().weekday(count++).format(calendarConfig.dateFormats.weekDay));\n }\n return weekdays;\n }\n\n function filterEventsInPeriod(events, startPeriod, endPeriod) {\n return events.filter(function(event) {\n return eventIsInPeriod(event.startsAt, event.endsAt, startPeriod, endPeriod);\n });\n }\n\n function getYearView(events, currentDay) {\n\n var view = [];\n var eventsInPeriod = getEventsInPeriod(currentDay, 'year', events);\n var month = moment(currentDay).startOf('year');\n var count = 0;\n while (count < 12) {\n var startPeriod = month.clone();\n var endPeriod = startPeriod.clone().endOf('month');\n var periodEvents = filterEventsInPeriod(eventsInPeriod, startPeriod, endPeriod);\n view.push({\n label: startPeriod.format(calendarConfig.dateFormats.month),\n isToday: startPeriod.isSame(moment().startOf('month')),\n events: periodEvents,\n date: startPeriod,\n badgeTotal: getBadgeTotal(periodEvents)\n });\n\n month.add(1, 'month');\n count++;\n }\n\n return view;\n\n }\n\n function getMonthView(events, currentDay) {\n\n var eventsInPeriod = getEventsInPeriod(currentDay, 'month', events);\n var startOfMonth = moment(currentDay).startOf('month');\n var day = startOfMonth.clone().startOf('week');\n var endOfMonthView = moment(currentDay).endOf('month').endOf('week');\n var view = [];\n var today = moment().startOf('day');\n while (day.isBefore(endOfMonthView)) {\n\n var inMonth = day.month() === moment(currentDay).month();\n var monthEvents = [];\n if (inMonth) {\n monthEvents = filterEventsInPeriod(eventsInPeriod, day, day.clone().endOf('day'));\n }\n\n view.push({\n label: day.date(),\n date: day.clone(),\n inMonth: inMonth,\n isPast: today.isAfter(day),\n isToday: today.isSame(day),\n isFuture: today.isBefore(day),\n isWeekend: [0, 6].indexOf(day.day()) > -1,\n events: monthEvents,\n badgeTotal: getBadgeTotal(monthEvents)\n });\n\n day.add(1, 'day');\n }\n\n return view;\n\n }\n\n function getWeekView(events, currentDay) {\n\n var startOfWeek = moment(currentDay).startOf('week');\n var endOfWeek = moment(currentDay).endOf('week');\n var dayCounter = startOfWeek.clone();\n var days = [];\n var today = moment().startOf('day');\n while (days.length < 7) {\n days.push({\n weekDayLabel: dayCounter.format(calendarConfig.dateFormats.weekDay),\n date: dayCounter.clone(),\n dayLabel: dayCounter.format(calendarConfig.dateFormats.day),\n isPast: dayCounter.isBefore(today),\n isToday: dayCounter.isSame(today),\n isFuture: dayCounter.isAfter(today),\n isWeekend: [0, 6].indexOf(dayCounter.day()) > -1\n });\n dayCounter.add(1, 'day');\n }\n\n var eventsSorted = filterEventsInPeriod(events, startOfWeek, endOfWeek).map(function(event) {\n\n var eventStart = moment(event.startsAt).startOf('day');\n var eventEnd = moment(event.endsAt).startOf('day');\n var weekViewStart = moment(startOfWeek).startOf('day');\n var weekViewEnd = moment(endOfWeek).startOf('day');\n var offset, span;\n\n if (eventStart.isBefore(weekViewStart) || eventStart.isSame(weekViewStart)) {\n offset = 0;\n } else {\n offset = eventStart.diff(weekViewStart, 'days');\n }\n\n if (eventEnd.isAfter(weekViewEnd)) {\n eventEnd = weekViewEnd;\n }\n\n if (eventStart.isBefore(weekViewStart)) {\n eventStart = weekViewStart;\n }\n\n span = moment(eventEnd).diff(eventStart, 'days') + 1;\n\n event.daySpan = span;\n event.dayOffset = offset;\n\n return event;\n });\n\n return {days: days, events: eventsSorted};\n\n }\n\n function getDayView(events, currentDay, dayStartHour, dayEndHour, hourHeight) {\n\n var calendarStart = moment(currentDay).startOf('day').add(dayStartHour, 'hours');\n var calendarEnd = moment(currentDay).startOf('day').add(dayEndHour, 'hours');\n var calendarHeight = (dayEndHour - dayStartHour + 1) * hourHeight;\n var hourHeightMultiplier = hourHeight / 60;\n var buckets = [];\n var eventsInPeriod = filterEventsInPeriod(\n events,\n moment(currentDay).startOf('day').toDate(),\n moment(currentDay).endOf('day').toDate()\n );\n\n return eventsInPeriod.map(function(event) {\n if (moment(event.startsAt).isBefore(calendarStart)) {\n event.top = 0;\n } else {\n event.top = (moment(event.startsAt).startOf('minute').diff(calendarStart.startOf('minute'), 'minutes') * hourHeightMultiplier) - 2;\n }\n\n if (moment(event.endsAt).isAfter(calendarEnd)) {\n event.height = calendarHeight - event.top;\n } else {\n var diffStart = event.startsAt;\n if (moment(event.startsAt).isBefore(calendarStart)) {\n diffStart = calendarStart.toDate();\n }\n event.height = moment(event.endsAt).diff(diffStart, 'minutes') * hourHeightMultiplier;\n }\n\n if (event.top - event.height > calendarHeight) {\n event.height = 0;\n }\n\n event.left = 0;\n\n return event;\n }).filter(function(event) {\n return event.height > 0;\n }).map(function(event) {\n\n var cannotFitInABucket = true;\n buckets.forEach(function(bucket, bucketIndex) {\n var canFitInThisBucket = true;\n\n bucket.forEach(function(bucketItem) {\n if (eventIsInPeriod(event.startsAt, event.endsAt, bucketItem.startsAt, bucketItem.endsAt) ||\n eventIsInPeriod(bucketItem.startsAt, bucketItem.endsAt, event.startsAt, event.endsAt)) {\n canFitInThisBucket = false;\n }\n });\n\n if (canFitInThisBucket && cannotFitInABucket) {\n cannotFitInABucket = false;\n event.left = bucketIndex * 150;\n buckets[bucketIndex].push(event);\n }\n\n });\n\n if (cannotFitInABucket) {\n event.left = buckets.length * 150;\n buckets.push([event]);\n }\n\n return event;\n\n });\n\n }\n\n return {\n getWeekDayNames: getWeekDayNames,\n getYearView: getYearView,\n getMonthView: getMonthView,\n getWeekView: getWeekView,\n getDayView: getDayView\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .service('calendarDebounce', function($timeout) {\n\n function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n function later() {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n }\n var callNow = immediate && !timeout;\n $timeout.cancel(timeout);\n timeout = $timeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n }\n\n return debounce;\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .provider('calendarConfig', function() {\n\n var defaultDateFormats = {\n hour: 'ha',\n day: 'D MMM',\n month: 'MMMM',\n weekDay: 'dddd'\n };\n\n var defaultTitleFormats = {\n day: 'dddd D MMMM, YYYY',\n week: 'Week {week} of {year}',\n month: 'MMMM YYYY',\n year: 'YYYY'\n };\n\n var i18nStrings = {\n eventsLabel: 'Events',\n timeLabel: 'Time'\n };\n\n var configProvider = this;\n\n configProvider.setDateFormats = function(formats) {\n angular.extend(defaultDateFormats, formats);\n return configProvider;\n };\n\n configProvider.setTitleFormats = function(formats) {\n angular.extend(defaultTitleFormats, formats);\n return configProvider;\n };\n\n configProvider.setI18nStrings = function(strings) {\n angular.extend(i18nStrings, strings);\n return configProvider;\n };\n\n configProvider.$get = function() {\n return {\n dateFormats: defaultDateFormats,\n titleFormats: defaultTitleFormats,\n i18nStrings: i18nStrings\n };\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .filter('calendarTruncateEventTitle', function() {\n\n return function(string, length, boxHeight) {\n if (!string) {\n return '';\n }\n\n //Only truncate if if actually needs truncating\n if (string.length >= length && string.length / 20 > boxHeight / 30) {\n return string.substr(0, length) + '...';\n } else {\n return string;\n }\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .filter('calendarLimitTo', function() {\n\n //Copied from the angular source. Only 1.4 has the begin functionality.\n return function(input, limit, begin) {\n if (Math.abs(Number(limit)) === Infinity) {\n limit = Number(limit);\n } else {\n limit = parseInt(limit);\n }\n if (isNaN(limit)) {\n return input;\n }\n\n if (angular.isNumber(input)) {\n input = input.toString();\n }\n if (!angular.isArray(input) && !angular.isString(input)) {\n return input;\n }\n\n begin = (!begin || isNaN(begin)) ? 0 : parseInt(begin);\n begin = (begin < 0 && begin >= -input.length) ? input.length + begin : begin;\n\n if (limit >= 0) {\n return input.slice(begin, begin + limit);\n } else if (begin === 0) {\n return input.slice(limit, input.length);\n } else {\n return input.slice(Math.max(0, begin + limit), begin);\n }\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .directive('mwlDateModifier', function() {\n\n return {\n restrict: 'A',\n controller: function($element, $attrs, $scope, moment) {\n\n function onClick() {\n if (angular.isDefined($attrs.setToToday)) {\n $scope.date = new Date();\n } else if (angular.isDefined($attrs.increment)) {\n $scope.date = moment($scope.date).add(1, $scope.increment).toDate();\n } else if (angular.isDefined($attrs.decrement)) {\n $scope.date = moment($scope.date).subtract(1, $scope.decrement).toDate();\n }\n $scope.$apply();\n }\n\n $element.bind('click', onClick);\n\n $scope.$on('$destroy', function() {\n $element.unbind('click', onClick);\n });\n\n },\n scope: {\n date: '=',\n increment: '=',\n decrement: '='\n }\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .directive('mwlCollapseFallback', function($injector) {\n\n if ($injector.has('collapseDirective')) {\n return {};\n }\n\n return {\n restrict: 'A',\n controller: function($scope, $attrs, $element) {\n var unbindWatcher = $scope.$watch($attrs.mwlCollapseFallback, function(shouldCollapse) {\n if (shouldCollapse) {\n $element.addClass('ng-hide');\n } else {\n $element.removeClass('ng-hide');\n }\n });\n\n var unbindDestroy = $scope.$on('$destroy', function() {\n unbindDestroy();\n unbindWatcher();\n });\n\n }\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .directive('mwlCalendarYear', function() {\n\n return {\n templateUrl: 'src/templates/calendarYearView.html',\n restrict: 'EA',\n require: '^mwlCalendar',\n scope: {\n events: '=',\n currentDay: '=',\n onEventClick: '=',\n onEditEventClick: '=',\n onDeleteEventClick: '=',\n editEventHtml: '=',\n deleteEventHtml: '=',\n autoOpen: '=',\n onTimespanClick: '='\n },\n controller: function($scope, moment, calendarHelper) {\n\n var vm = this;\n var firstRun = true;\n\n $scope.$on('calendar.refreshView', function() {\n vm.view = calendarHelper.getYearView($scope.events, $scope.currentDay);\n\n //Auto open the calendar to the current day if set\n if ($scope.autoOpen && firstRun) {\n firstRun = false;\n vm.view.forEach(function(month) {\n if (moment($scope.currentDay).startOf('month').isSame(month.date)) {\n vm.monthClicked(month, true);\n }\n });\n }\n\n });\n\n vm.monthClicked = function(month, monthClickedFirstRun) {\n\n if (!monthClickedFirstRun) {\n $scope.onTimespanClick({calendarDate: month.date.toDate()});\n }\n\n vm.openRowIndex = null;\n var monthIndex = vm.view.indexOf(month);\n if (monthIndex === vm.openMonthIndex) { //the month has been clicked and is already open\n vm.openMonthIndex = null; //close the open month\n } else {\n vm.openMonthIndex = monthIndex;\n vm.openRowIndex = Math.floor(monthIndex / 4);\n }\n\n };\n\n },\n controllerAs: 'vm',\n link: function(scope, element, attrs, calendarCtrl) {\n scope.vm.calendarCtrl = calendarCtrl;\n }\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .directive('mwlCalendarWeek', function() {\n\n return {\n templateUrl: 'src/templates/calendarWeekView.html',\n restrict: 'EA',\n require: '^mwlCalendar',\n scope: {\n events: '=',\n currentDay: '=',\n onEventClick: '='\n },\n controller: function($scope, calendarHelper) {\n\n var vm = this;\n\n $scope.$on('calendar.refreshView', function() {\n vm.view = calendarHelper.getWeekView($scope.events, $scope.currentDay);\n });\n\n },\n controllerAs: 'vm',\n link: function(scope, element, attrs, calendarCtrl) {\n scope.vm.calendarCtrl = calendarCtrl;\n }\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .directive('mwlCalendarSlideBox', function() {\n\n return {\n restrict: 'EA',\n templateUrl: 'src/templates/calendarSlideBox.html',\n replace: true,\n controller: function($scope, $sce) {\n\n var vm = this;\n vm.$sce = $sce;\n\n var unbindWatcher = $scope.$watch('isOpen', function(isOpen) {\n vm.shouldCollapse = !isOpen;\n });\n\n var unbindDestroy = $scope.$on('$destroy', function() {\n unbindDestroy();\n unbindWatcher();\n });\n\n },\n controllerAs: 'vm',\n require: ['^?mwlCalendarMonth', '^?mwlCalendarYear'],\n link: function(scope, elm, attrs, ctrls) {\n scope.isMonthView = !!ctrls[0];\n scope.isYearView = !!ctrls[1];\n },\n scope: {\n isOpen: '=',\n events: '=',\n onEventClick: '=',\n editEventHtml: '=',\n onEditEventClick: '=',\n deleteEventHtml: '=',\n onDeleteEventClick: '='\n }\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .directive('mwlCalendarMonth', function() {\n\n return {\n templateUrl: 'src/templates/calendarMonthView.html',\n restrict: 'EA',\n require: '^mwlCalendar',\n scope: {\n events: '=',\n currentDay: '=',\n onEventClick: '=',\n onEditEventClick: '=',\n onDeleteEventClick: '=',\n editEventHtml: '=',\n deleteEventHtml: '=',\n autoOpen: '=',\n onTimespanClick: '='\n },\n controller: function($scope, moment, calendarHelper) {\n\n var vm = this;\n var firstRun = true;\n\n $scope.$on('calendar.refreshView', function() {\n\n vm.weekDays = calendarHelper.getWeekDayNames();\n\n vm.view = calendarHelper.getMonthView($scope.events, $scope.currentDay);\n var rows = Math.floor(vm.view.length / 7);\n vm.monthOffsets = [];\n for (var i = 0; i < rows; i++) {\n vm.monthOffsets.push(i * 7);\n }\n\n //Auto open the calendar to the current day if set\n if ($scope.autoOpen && firstRun) {\n firstRun = false;\n vm.view.forEach(function(day) {\n if (day.inMonth && moment($scope.currentDay).startOf('day').isSame(day.date)) {\n vm.dayClicked(day, true);\n }\n });\n }\n\n });\n\n vm.dayClicked = function(day, dayClickedFirstRun) {\n\n if (!dayClickedFirstRun) {\n $scope.onTimespanClick({\n calendarDate: day.date.toDate()\n });\n }\n\n vm.openRowIndex = null;\n var dayIndex = vm.view.indexOf(day);\n if (dayIndex === vm.openDayIndex) { //the day has been clicked and is already open\n vm.openDayIndex = null; //close the open day\n } else {\n vm.openDayIndex = dayIndex;\n vm.openRowIndex = Math.floor(dayIndex / 7);\n }\n\n };\n\n vm.highlightEvent = function(event, shouldAddClass) {\n\n vm.view.forEach(function(day) {\n delete day.highlightClass;\n if (shouldAddClass) {\n var dayContainsEvent = day.events.indexOf(event) > -1;\n if (dayContainsEvent) {\n day.highlightClass = 'day-highlight dh-event-' + event.type;\n }\n }\n });\n\n };\n },\n controllerAs: 'vm',\n link: function(scope, element, attrs, calendarCtrl) {\n scope.vm.calendarCtrl = calendarCtrl;\n }\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .directive('mwlCalendarDay', function() {\n\n return {\n templateUrl: 'src/templates/calendarDayView.html',\n restrict: 'EA',\n require: '^mwlCalendar',\n scope: {\n events: '=',\n currentDay: '=',\n onEventClick: '=',\n dayViewStart: '=',\n dayViewEnd: '=',\n dayViewSplit: '='\n },\n controller: function($scope, $timeout, moment, calendarHelper, calendarConfig) {\n\n var vm = this;\n var dayViewStart, dayViewEnd;\n\n vm.calendarConfig = calendarConfig;\n\n function updateDays() {\n dayViewStart = moment($scope.dayViewStart || '00:00', 'HH:mm');\n dayViewEnd = moment($scope.dayViewEnd || '23:00', 'HH:mm');\n vm.dayViewSplit = parseInt($scope.dayViewSplit);\n vm.hourHeight = (60 / $scope.dayViewSplit) * 30;\n vm.hours = [];\n var dayCounter = moment(dayViewStart);\n for (var i = 0; i <= dayViewEnd.diff(dayViewStart, 'hours'); i++) {\n vm.hours.push({\n label: dayCounter.format(calendarConfig.dateFormats.hour)\n });\n dayCounter.add(1, 'hour');\n }\n }\n\n var originalLocale = moment.locale();\n\n $scope.$on('calendar.refreshView', function() {\n\n if (originalLocale !== moment.locale()) {\n originalLocale = moment.locale();\n updateDays();\n }\n\n vm.view = calendarHelper.getDayView($scope.events, $scope.currentDay, dayViewStart.hours(), dayViewEnd.hours(), vm.hourHeight);\n\n });\n\n updateDays();\n\n },\n controllerAs: 'vm'\n };\n\n });\n","'use strict';\n\nangular\n .module('mwl.calendar')\n .directive('mwlCalendar', function() {\n\n return {\n templateUrl: 'src/templates/calendar.html',\n restrict: 'EA',\n scope: {\n events: '=',\n view: '=',\n viewTitle: '=',\n currentDay: '=',\n editEventHtml: '=',\n deleteEventHtml: '=',\n autoOpen: '=',\n onEventClick: '&',\n onEditEventClick: '&',\n onDeleteEventClick: '&',\n onTimespanClick: '&',\n onDrillDownClick: '&',\n dayViewStart: '@',\n dayViewEnd: '@',\n dayViewSplit: '@'\n },\n controller: function($scope, $timeout, moment, calendarTitle, calendarDebounce) {\n\n var vm = this;\n\n $scope.events = $scope.events || [];\n\n vm.changeView = function(view, newDay) {\n $scope.view = view;\n $scope.currentDay = newDay;\n };\n\n vm.drillDown = function(date) {\n\n var rawDate = moment(date).toDate();\n\n var nextView = {\n year: 'month',\n month: 'day',\n week: 'day'\n };\n\n if ($scope.onDrillDownClick({calendarDate: rawDate, calendarNextView: nextView[$scope.view]}) !== false) {\n vm.changeView(nextView[$scope.view], rawDate);\n }\n\n };\n\n var previousDate = moment($scope.currentDay);\n var previousView = angular.copy($scope.view);\n\n //Use a debounce to prevent it being called 3 times on initialisation\n var refreshCalendar = calendarDebounce(function() {\n if (calendarTitle[$scope.view]) {\n $scope.viewTitle = calendarTitle[$scope.view]($scope.currentDay);\n }\n\n //if on-timespan-click=\"calendarDay = calendarDate\" is set then dont update the view as nothing needs to change\n var currentDate = moment($scope.currentDay);\n var shouldUpdate = true;\n if (previousDate.clone().startOf($scope.view).isSame(currentDate.clone().startOf($scope.view)) &&\n !previousDate.isSame(currentDate) &&\n $scope.view === previousView) {\n shouldUpdate = false;\n }\n previousDate = currentDate;\n previousView = angular.copy($scope.view);\n\n if (shouldUpdate) {\n $scope.$broadcast('calendar.refreshView');\n }\n }, 50);\n\n //Auto update the calendar when the locale changes\n var unbindLocaleWatcher = $scope.$watch(function() {\n return moment.locale();\n }, refreshCalendar);\n\n var unbindOnDestroy = [];\n unbindOnDestroy.push(unbindLocaleWatcher);\n\n //Refresh the calendar when any of these variables change.\n unbindOnDestroy.push($scope.$watch('currentDay', refreshCalendar));\n unbindOnDestroy.push($scope.$watch('view', refreshCalendar));\n unbindOnDestroy.push($scope.$watch('events', refreshCalendar, true));\n\n //Remove any watchers when the calendar is destroyed\n var unbindDestroyListener = $scope.$on('$destroy', function() {\n unbindOnDestroy.forEach(function(unbind) {\n unbind();\n });\n });\n unbindOnDestroy.push(unbindDestroyListener);\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}