sogo/UI/WebServerResources/js/Scheduler.js.map
2015-08-21 13:40:07 -04:00

1 line
44 KiB
Plaintext

{"version":3,"file":"Scheduler.js","sources":["Scheduler/Scheduler.app.js","Scheduler/CalendarController.js","Scheduler/CalendarListController.js","Scheduler/CalendarsController.js","Scheduler/ComponentController.js","Scheduler/sgCalendarDayBlock.directive.js","Scheduler/sgCalendarDayTable.directive.js","Scheduler/sgCalendarMonthDay.directive.js","Scheduler/sgCalendarMonthEvent.directive.js"],"names":["configure","$stateProvider","$urlRouterProvider","state","url","views","calendars","templateUrl","controller","controllerAs","resolve","stateCalendars","sticky","deepStateRedirect","calendarView","$stateParams","view","day","stateEventsBlocks","when","now","Date","getDayString","otherwise","Calendar","$calendars","$findAll","window","calendarsData","Component","$eventsBlocksForView","asDate","runBlock","$rootScope","$location","Preferences","$on","event","current","previous","rejection","console","error","length","ready","then","exec","settings","View","replace","angular","module","config","run","$inject","CalendarController","$scope","$state","$timeout","$interval","$log","focus","changeView","$event","date","element","currentTarget","attr","go","vm","this","blocks","data","CalendarListController","$mdDialog","encodeUriFilter","Dialog","selectComponentType","type","options","reload","componentType","isUndefined","$filter","unselectComponents","saveSelectedList","_","each","component","selected","selectAll","confirmDeleteSelectedComponents","confirm","l","components","filter","$deleteComponents","status","openEvent","viewable","openComponent","openTask","task","capitalize","show","parent","document","body","targetEvent","clickOutsideToClose","escapeToClose","locals","stateComponent","newComponent","pid","filterpopup","filteredBy","sort","field","sortedBy","cancelSearch","mode","search","value","selectedList","SelectedList","CalendarsController","$q","Settings","User","newCalendar","ev","prompt","name","calendar","isEditable","isRemote","owner","UserLogin","$add","addWebCalendar","inputType","$addWebCalendar","confirmDelete","folder","isSubscription","$delete","$broadcast","alert","showLinks","LinksDialogController","close","hide","id","showProperties","PropertiesDialogController","saveProperties","$save","init","$omit","share","$acl","$users","usersWithACL","users","subscribeToFolder","calendarData","debug","$subscribe","activeUser","service","$watch","union","map","o","pick","$subscriptions","$webcalendars","newList","oldList","ids","pluck","i","isEqual","join","$get","$setActivation","ComponentController","AddressBook","Alarm","cardFilter","$query","$filterAll","$cards","edit","editAllOccurrences","$getComponent","$futureComponentData","reply","c","$reply","getAlarms","replyAllOccurrences","delegatedTo","$hasAlarm","alarm","c_folder","c_name","c_recurrence_id","organizer","ComponentEditorController","Card","addAttachUrl","toggleRecurrenceEditor","showRecurrenceEditor","$hasCustomRepeat","toggleAttendeesEditor","showAttendeesEditor","addAttendee","card","isString","isValidEmail","emails","searchText","save","form","$valid","cancel","$reset","isNew","getDays","days","start","end","daysUpTo","stringWithSeparator","getHours","hours","push","toString","categories","isDefined","attendees","attendeesEditor","startDate","endDate","newStartDate","oldStartDate","substring","freebusy","updateFreeBusyCoverage","newEndDate","oldEndDate","sgCalendarDayBlock","link","scope","iElement","attrs","pc","block","siblings","left","position","right","css","addClass","restrict","clickBlock","template","directive","sgCalendarDayTable","sgCalendarMonthDay","sgCalendarMonthEvent"],"mappings":"CAGA,WACE,YAUA,SAASA,WAAUC,eAAgBC,oBACjCD,eACGE,MAAM,aACLC,IAAK,YACLC,OACEC,WACEC,YAAa,kBACbC,WAAY,sBACZC,aAAc,cAGlBC,SACEC,eAAgBA,kBAGnBR,MAAM,kBACLC,IAAK,kCACLQ,QAAQ,EACRC,mBAAmB,EACnBR,OACES,cACEP,YAAa,SAASQ,cAIpB,MAAOA,cAAaC,KAAO,YAAcD,aAAaE,KAExDT,WAAY,qBACZC,aAAc,aAGlBC,SACEQ,kBAAmBA,qBAIzBhB,mBAAmBiB,KAAK,gBAAiB,WAEvC,GAAIC,KAAM,GAAIC,KACd,OAAO,iBAAmBD,IAAIE,iBAEhCpB,mBAAmBiB,KAAK,iBAAkB,WAExC,GAAIC,KAAM,GAAIC,KACd,OAAO,kBAAoBD,IAAIE,iBAEjCpB,mBAAmBiB,KAAK,kBAAmB,WAEzC,GAAIC,KAAM,GAAIC,KACd,OAAO,mBAAqBD,IAAIE,iBAKlCpB,mBAAmBqB,UAAU,aAO/B,QAASZ,gBAAea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,UACE,mHACA,8EACA,kCACA,yBACA,wEACA,2FACA,oFACA,YACA,qCACA,sCACA,UACApF,KAAK,IACPsE,KAAMA,MAQV5M,QACGC,OAAO,oBACP0N,UAAU,uBAAwBG","sourcesContent":["/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* JavaScript for SOGo.SchedulerUI module */\n\n(function() {\n 'use strict';\n\n angular.module('SOGo.SchedulerUI', ['ngSanitize', 'ui.router', 'SOGo.Common', 'SOGo.PreferencesUI', 'SOGo.ContactsUI', 'SOGo.MailerUI'])\n .config(configure)\n .run(runBlock);\n\n /**\n * @ngInject\n */\n configure.$inject = ['$stateProvider', '$urlRouterProvider'];\n function configure($stateProvider, $urlRouterProvider) {\n $stateProvider\n .state('calendars', {\n url: '/calendar',\n views: {\n calendars: {\n templateUrl: 'UIxCalMainFrame', // UI/Templates/SchedulerUI/UIxCalMainFrame.wox\n controller: 'CalendarsController',\n controllerAs: 'calendars'\n }\n },\n resolve: {\n stateCalendars: stateCalendars\n }\n })\n .state('calendars.view', {\n url: '/{view:(?:day|week|month)}/:day',\n sticky: true,\n deepStateRedirect: true,\n views: {\n calendarView: {\n templateUrl: function($stateParams) {\n // UI/Templates/SchedulerUI/UIxCalDayView.wox or\n // UI/Templates/SchedulerUI/UIxCalWeekView.wox or\n // UI/Templates/SchedulerUI/UIxCalMonthView.wox\n return $stateParams.view + 'view?day=' + $stateParams.day;\n },\n controller: 'CalendarController',\n controllerAs: 'calendar'\n }\n },\n resolve: {\n stateEventsBlocks: stateEventsBlocks\n }\n });\n\n $urlRouterProvider.when('/calendar/day', function() {\n // If no date is specified, show today\n var now = new Date();\n return '/calendar/day/' + now.getDayString();\n });\n $urlRouterProvider.when('/calendar/week', function() {\n // If no date is specified, show today's week\n var now = new Date();\n return '/calendar/week/' + now.getDayString();\n });\n $urlRouterProvider.when('/calendar/month', function() {\n // If no date is specified, show today's month\n var now = new Date();\n return '/calendar/month/' + now.getDayString();\n });\n\n // If none of the above states are matched, use this as the fallback.\n // runBlock will also act as a fallback by looking at user's settings\n $urlRouterProvider.otherwise('/calendar');\n }\n\n /**\n * @ngInject\n */\n stateCalendars.$inject = ['Calendar'];\n function stateCalendars(Calendar) {\n return Calendar.$calendars || Calendar.$findAll(window.calendarsData);\n }\n\n /**\n * @ngInject\n */\n stateEventsBlocks.$inject = ['$stateParams', 'Component'];\n function stateEventsBlocks($stateParams, Component) {\n return Component.$eventsBlocksForView($stateParams.view, $stateParams.day.asDate());\n }\n\n /**\n * @ngInject\n */\n runBlock.$inject = ['$rootScope', '$location', 'Preferences'];\n function runBlock($rootScope, $location, Preferences) {\n $rootScope.$on('$routeChangeError', function(event, current, previous, rejection) {\n console.error(event, current, previous, rejection);\n });\n if ($location.url().length === 0) {\n // Restore user's last view\n Preferences.ready().then(function() {\n var view = /(.+)view/.exec(Preferences.settings.Calendar.View);\n if (view) {\n $location.replace().url('/calendar/' + view[1]);\n }\n });\n }\n }\n\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /**\n * @ngInject\n */\n CalendarController.$inject = ['$scope', '$state', '$stateParams', '$timeout', '$interval', '$log', 'sgFocus', 'Calendar', 'Component', 'stateEventsBlocks'];\n function CalendarController($scope, $state, $stateParams, $timeout, $interval, $log, focus, Calendar, Component, stateEventsBlocks) {\n var vm = this;\n\n vm.blocks = stateEventsBlocks;\n vm.changeView = changeView;\n\n // Refresh current view when the list of calendars is modified\n $scope.$on('calendars:list', function() {\n Component.$eventsBlocksForView($stateParams.view, $stateParams.day.asDate()).then(function(data) {\n vm.blocks = data;\n });\n });\n\n // Change calendar's view\n function changeView($event) {\n var date = angular.element($event.currentTarget).attr('date');\n $state.go('calendars.view', { view: $stateParams.view, day: date });\n }\n }\n \n angular\n .module('SOGo.SchedulerUI') \n .controller('CalendarController', CalendarController);\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /**\n * @ngInject\n */\n CalendarListController.$inject = ['$scope', '$timeout', '$state', '$mdDialog', 'encodeUriFilter', 'Dialog', 'Preferences', 'Calendar', 'Component'];\n function CalendarListController($scope, $timeout, $state, $mdDialog, encodeUriFilter, Dialog, Preferences, Calendar, Component) {\n var vm = this;\n\n vm.component = Component;\n vm.componentType = 'events';\n vm.selectedList = 0;\n vm.selectComponentType = selectComponentType;\n vm.unselectComponents = unselectComponents;\n vm.selectAll = selectAll;\n vm.confirmDeleteSelectedComponents = confirmDeleteSelectedComponents;\n vm.openEvent = openEvent;\n vm.openTask = openTask;\n vm.newComponent = newComponent;\n vm.filter = filter;\n vm.filteredBy = filteredBy;\n vm.sort = sort;\n vm.sortedBy = sortedBy;\n vm.cancelSearch = cancelSearch;\n vm.mode = { search: false };\n\n // Select list based on user's settings\n Preferences.ready().then(function() {\n var type = 'events';\n if (Preferences.settings.Calendar.SelectedList == 'tasksListView') {\n vm.selectedList = 1;\n type = 'tasks';\n }\n selectComponentType(type, { reload: true });\n });\n\n // Refresh current list when the list of calendars is modified\n $scope.$on('calendars:list', function() {\n Component.$filter(vm.componentType, { reload: true });\n });\n\n // Switch between components tabs\n function selectComponentType(type, options) {\n if (options && options.reload || vm.componentType != type) {\n // TODO: save user settings (Calendar.SelectedList)\n if (angular.isUndefined(Component['$' + type]))\n Component.$filter(type);\n vm.unselectComponents();\n vm.componentType = type;\n Component.saveSelectedList(type);\n }\n }\n\n function unselectComponents() {\n _.each(Component['$' + vm.componentType], function(component) { component.selected = false; });\n }\n\n function selectAll() {\n _.each(Component['$' + vm.componentType], function(component) {\n component.selected = true;\n });\n }\n\n function confirmDeleteSelectedComponents() {\n Dialog.confirm(l('Warning'),\n l('Are you sure you want to delete the selected components?'))\n .then(function() {\n // User confirmed the deletion\n var components = _.filter(Component['$' + vm.componentType], function(component) { return component.selected; });\n Calendar.$deleteComponents(components);\n }, function(data, status) {\n // Delete failed\n });\n }\n\n function openEvent($event, event) {\n if (event.viewable)\n openComponent($event, event, 'appointment');\n }\n\n function openTask($event, task) {\n if (task.viewable)\n openComponent($event, task, 'task');\n }\n\n function openComponent($event, component, type) {\n // UI/Templates/SchedulerUI/UIxAppointmentViewTemplate.wox or\n // UI/Templates/SchedulerUI/UIxTaskViewTemplate.wox\n var templateUrl = 'UIx' + type.capitalize() + 'ViewTemplate';\n $mdDialog.show({\n parent: angular.element(document.body),\n targetEvent: $event,\n clickOutsideToClose: true,\n escapeToClose: true,\n templateUrl: templateUrl,\n controller: 'ComponentController',\n controllerAs: 'editor',\n locals: {\n stateComponent: component\n }\n });\n }\n\n function newComponent($event) {\n var type = 'appointment', component;\n\n if (vm.componentType == 'tasks')\n type = 'task';\n component = new Component({ pid: 'personal', type: type });\n\n // UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox or\n // UI/Templates/SchedulerUI/UIxTaskEditorTemplate.wox\n var templateUrl = 'UIx' + type.capitalize() + 'EditorTemplate';\n $mdDialog.show({\n parent: angular.element(document.body),\n targetEvent: $event,\n clickOutsideToClose: true,\n escapeToClose: true,\n templateUrl: templateUrl,\n controller: 'ComponentEditorController',\n controllerAs: 'editor',\n locals: {\n stateComponent: component\n }\n });\n }\n\n function filter(filterpopup) {\n Component.$filter(vm.componentType, { filterpopup: filterpopup });\n }\n\n function filteredBy(filterpopup) {\n return Component['$query' + vm.componentType.capitalize()].filterpopup == filterpopup;\n }\n\n function sort(field) {\n Component.$filter(vm.componentType, { sort: field });\n }\n\n function sortedBy(field) {\n return Component['$query' + vm.componentType.capitalize()].sort == field;\n }\n\n function cancelSearch() {\n vm.mode.search = false;\n Component.$filter(vm.componentType, { value: '' });\n }\n }\n \n angular\n .module('SOGo.SchedulerUI')\n .controller('CalendarListController', CalendarListController);\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /**\n * @ngInject\n */\n CalendarsController.$inject = ['$scope', '$rootScope', '$stateParams', '$state', '$timeout', '$q', '$mdDialog', '$log', 'sgFocus', 'encodeUriFilter', 'Dialog', 'sgSettings', 'Calendar', 'User', 'stateCalendars'];\n function CalendarsController($scope, $rootScope, $stateParams, $state, $timeout, $q, $mdDialog, $log, focus, encodeUriFilter, Dialog, Settings, Calendar, User, stateCalendars) {\n var vm = this;\n\n vm.activeUser = Settings.activeUser;\n vm.service = Calendar;\n vm.newCalendar = newCalendar;\n vm.addWebCalendar = addWebCalendar;\n vm.confirmDelete = confirmDelete;\n vm.share = share;\n vm.showLinks = showLinks;\n vm.showProperties = showProperties;\n vm.subscribeToFolder = subscribeToFolder;\n\n // Dispatch the event named 'calendars:list' when a calendar is activated or deactivated or\n // when the color of a calendar is changed\n $scope.$watch(\n function() {\n return _.union(\n _.map(Calendar.$calendars, function(o) { return _.pick(o, ['id', 'active', 'color']); }),\n _.map(Calendar.$subscriptions, function(o) { return _.pick(o, ['id', 'active', 'color']); }),\n _.map(Calendar.$webcalendars, function(o) { return _.pick(o, ['id', 'active', 'color']); })\n );\n },\n function(newList, oldList) {\n // Identify which calendar has changed\n var ids = _.pluck(_.filter(newList, function(o, i) { return !_.isEqual(o, oldList[i]); }), 'id');\n if (ids.length > 0) {\n $log.debug(ids.join(', ') + ' changed');\n _.each(ids, function(id) {\n var calendar = Calendar.$get(id);\n calendar.$setActivation().then(function() {\n $scope.$broadcast('calendars:list');\n });\n });\n }\n },\n true // compare for object equality\n );\n\n function newCalendar(ev) {\n Dialog.prompt(l('New calendar'), l('Name of the Calendar'))\n .then(function(name) {\n var calendar = new Calendar(\n {\n name: name,\n isEditable: true,\n isRemote: false,\n owner: UserLogin\n }\n );\n Calendar.$add(calendar);\n });\n }\n\n function addWebCalendar() {\n Dialog.prompt(l('Subscribe to a web calendar...'), l('URL of the Calendar'), {inputType: 'url'})\n .then(function(url) {\n Calendar.$addWebCalendar(url);\n });\n }\n\n function confirmDelete(folder) {\n if (folder.isSubscription) {\n // Unsubscribe without confirmation\n folder.$delete()\n .then(function() {\n $scope.$broadcast('calendars:list');\n }, function(data, status) {\n Dialog.alert(l('An error occured while deleting the calendar \"%{0}\".', folder.name),\n l(data.error));\n });\n }\n else {\n Dialog.confirm(l('Warning'), l('Are you sure you want to delete the calendar <em>%{0}</em>?', folder.name))\n .then(function() {\n folder.$delete()\n .then(function() {\n $scope.$broadcast('calendars:list');\n }, function(data, status) {\n Dialog.alert(l('An error occured while deleting the calendar \"%{0}\".', folder.name),\n l(data.error));\n });\n });\n }\n }\n\n function showLinks(calendar) {\n $mdDialog.show({\n parent: angular.element(document.body),\n clickOutsideToClose: true,\n escapeToClose: true,\n templateUrl: calendar.id + '/links',\n controller: LinksDialogController,\n controllerAs: 'links',\n locals: {\n calendar: calendar\n }\n });\n \n /**\n * @ngInject\n */\n LinksDialogController.$inject = ['$mdDialog', 'calendar'];\n function LinksDialogController($mdDialog, calendar) {\n var vm = this;\n vm.calendar = calendar;\n vm.close = close;\n\n function close() {\n $mdDialog.hide();\n }\n }\n }\n\n function showProperties(calendar) {\n $mdDialog.show({\n templateUrl: calendar.id + '/properties',\n controller: PropertiesDialogController,\n controllerAs: 'properties',\n clickOutsideToClose: true,\n escapeToClose: true,\n locals: {\n calendar: calendar\n }\n });\n \n /**\n * @ngInject\n */\n PropertiesDialogController.$inject = ['$mdDialog', 'calendar'];\n function PropertiesDialogController($mdDialog, calendar) {\n var vm = this;\n\n vm.calendar = new Calendar(calendar.$omit());\n vm.saveProperties = saveProperties;\n vm.close = close;\n\n function saveProperties() {\n vm.calendar.$save();\n // Refresh list instance\n calendar.init(vm.calendar.$omit());\n $mdDialog.hide();\n }\n\n function close() {\n $mdDialog.hide();\n }\n }\n }\n\n function share(calendar) {\n calendar.$acl.$users().then(function() {\n $mdDialog.show({\n templateUrl: calendar.id + '/UIxAclEditor', // UI/Templates/UIxAclEditor.wox\n controller: 'AclController', // from the ng module SOGo.Common\n controllerAs: 'acl',\n clickOutsideToClose: true,\n escapeToClose: true,\n locals: {\n usersWithACL: calendar.$acl.users,\n User: User,\n folder: calendar\n }\n });\n });\n }\n\n // Callback of sgSubscribe directive\n function subscribeToFolder(calendarData) {\n $log.debug('subscribeToFolder ' + calendarData.owner + calendarData.name);\n Calendar.$subscribe(calendarData.owner, calendarData.name).catch(function(data) {\n Dialog.alert(l('Warning'), l('An error occured please try again.'));\n });\n }\n }\n\n angular\n .module('SOGo.SchedulerUI')\n .controller('CalendarsController', CalendarsController);\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /**\n * @ngInject\n */\n ComponentController.$inject = ['$rootScope', '$mdDialog', 'Calendar', 'AddressBook', 'Alarm', 'stateComponent'];\n function ComponentController($rootScope, $mdDialog, Calendar, AddressBook, Alarm, stateComponent) {\n var vm = this, component;\n\n vm.component = stateComponent;\n vm.close = close;\n vm.cardFilter = cardFilter;\n vm.edit = edit;\n vm.editAllOccurrences = editAllOccurrences;\n vm.reply = reply;\n vm.replyAllOccurrences = replyAllOccurrences;\n\n // Load all attributes of component\n if (angular.isUndefined(vm.component.$futureComponentData)) {\n component = Calendar.$get(vm.component.c_folder).$getComponent(vm.component.c_name, vm.component.c_recurrence_id);\n component.$futureComponentData.then(function() {\n vm.component = component;\n vm.organizer = [vm.component.organizer];\n });\n }\n\n function close() {\n $mdDialog.hide();\n }\n\n // Autocomplete cards for attendees\n function cardFilter($query) {\n AddressBook.$filterAll($query);\n return AddressBook.$cards;\n }\n\n function edit() {\n var type = (vm.component.component == 'vevent')? 'Appointment':'Task';\n $mdDialog.hide().then(function() {\n // UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox or\n // UI/Templates/SchedulerUI/UIxTaskEditorTemplate.wox\n var templateUrl = 'UIx' + type + 'EditorTemplate';\n $mdDialog.show({\n parent: angular.element(document.body),\n clickOutsideToClose: true,\n escapeToClose: true,\n templateUrl: templateUrl,\n controller: 'ComponentEditorController',\n controllerAs: 'editor',\n locals: {\n stateComponent: vm.component\n }\n });\n });\n }\n\n function editAllOccurrences() {\n component = Calendar.$get(vm.component.pid).$getComponent(vm.component.id);\n component.$futureComponentData.then(function() {\n vm.component = component;\n edit();\n });\n }\n\n function reply(component) {\n var c = component || vm.component;\n\n c.$reply().then(function() {\n $rootScope.$broadcast('calendars:list');\n $mdDialog.hide();\n Alarm.getAlarms();\n });\n }\n\n function replyAllOccurrences() {\n // Retrieve master event\n component = Calendar.$get(vm.component.pid).$getComponent(vm.component.id);\n component.$futureComponentData.then(function() {\n // Propagate the participant status and alarm to the master event\n component.reply = vm.component.reply;\n component.delegatedTo = vm.component.delegatedTo;\n component.$hasAlarm = vm.component.$hasAlarm;\n component.alarm = vm.component.alarm;\n // Send reply to the server\n reply(component);\n });\n }\n }\n\n /**\n * @ngInject\n */\n ComponentEditorController.$inject = ['$rootScope', '$scope', '$log', '$timeout', '$mdDialog', 'User', 'Calendar', 'Component', 'AddressBook', 'Card', 'Alarm', 'stateComponent'];\n function ComponentEditorController($rootScope, $scope, $log, $timeout, $mdDialog, User, Calendar, Component, AddressBook, Card, Alarm, stateComponent) {\n var vm = this, component;\n\n vm.calendars = Calendar.$calendars;\n vm.component = stateComponent;\n vm.categories = {};\n vm.showRecurrenceEditor = vm.component.$hasCustomRepeat;\n vm.toggleRecurrenceEditor = toggleRecurrenceEditor;\n vm.showAttendeesEditor = angular.isDefined(vm.component.attendees);\n vm.toggleAttendeesEditor = toggleAttendeesEditor;\n vm.cardFilter = cardFilter;\n vm.addAttendee = addAttendee;\n vm.addAttachUrl = addAttachUrl;\n vm.cancel = cancel;\n vm.save = save;\n vm.attendeesEditor = {\n startDate: vm.component.startDate,\n endDate: vm.component.endDate,\n days: getDays(),\n hours: getHours()\n };\n\n $scope.$watch('editor.component.startDate', function(newStartDate, oldStartDate) {\n if (newStartDate) {\n $timeout(function() {\n vm.component.start = new Date(newStartDate.substring(0,10) + ' ' + newStartDate.substring(11,16));\n vm.component.freebusy = vm.component.updateFreeBusyCoverage();\n vm.attendeesEditor.days = getDays();\n });\n }\n });\n\n $scope.$watch('editor.component.endDate', function(newEndDate, oldEndDate) {\n if (newEndDate) {\n $timeout(function() {\n vm.component.end = new Date(newEndDate.substring(0,10) + ' ' + newEndDate.substring(11,16));\n vm.component.freebusy = vm.component.updateFreeBusyCoverage();\n vm.attendeesEditor.days = getDays();\n });\n }\n });\n\n function addAttachUrl() {\n var i = vm.component.addAttachUrl('');\n focus('attachUrl_' + i);\n }\n\n function toggleRecurrenceEditor() {\n vm.showRecurrenceEditor = !vm.showRecurrenceEditor;\n vm.component.$hasCustomRepeat = vm.showRecurrenceEditor;\n }\n\n function toggleAttendeesEditor() {\n vm.showAttendeesEditor = !vm.showAttendeesEditor;\n }\n\n // Autocomplete cards for attendees\n function cardFilter($query) {\n AddressBook.$filterAll($query);\n return AddressBook.$cards;\n }\n\n function addAttendee(card) {\n if (angular.isString(card)) {\n // User pressed \"Enter\" in search field, adding a non-matching card\n if (card.isValidEmail()) {\n vm.component.addAttendee(new Card({ emails: [{ value: card }] }));\n vm.searchText = '';\n }\n }\n else {\n vm.component.addAttendee(card);\n }\n }\n\n function save(form) {\n if (form.$valid) {\n vm.component.$save()\n .then(function(data) {\n $rootScope.$broadcast('calendars:list');\n $mdDialog.hide();\n Alarm.getAlarms();\n }, function(data, status) {\n $log.debug('failed');\n });\n }\n }\n\n function cancel() {\n vm.component.$reset();\n if (vm.component.isNew) {\n // Cancelling the creation of a component\n vm.component = null;\n }\n $mdDialog.hide();\n }\n\n function getDays() {\n var days = [];\n\n if (vm.component.start && vm.component.end)\n days = vm.component.start.daysUpTo(vm.component.end);\n\n return _.map(days, function(date) {\n return { stringWithSeparator: date.stringWithSeparator(),\n getDayString: date.getDayString() };\n });\n }\n\n function getHours() {\n var hours = [];\n for (var i = 0; i <= 23; i++) {\n //hours.push(Component.timeFormat.formatTime(i, 0));\n hours.push(i.toString());\n }\n return hours;\n }\n }\n\n angular\n .module('SOGo.SchedulerUI')\n .controller('ComponentController', ComponentController)\n .controller('ComponentEditorController', ComponentEditorController);\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /*\n * sgCalendarDayBlock - An event block to be displayed in a week\n * @memberof SOGo.Common\n * @restrict element\n * @param {object} sgBlock - the event block definition\n * @param {function} sgClick - the function to call when clicking on a block.\n * Two variables are available: clickEvent (the event that triggered the mouse click),\n * and clickComponent (a Component object)\n *\n * @example:\n\n <sg-calendar-day-block\n ng-repeat=\"block in blocks[day]\"\n sg-block=\"block\"\n sg-click=\"open(clickEvent, clickComponent)\" />\n */\n function sgCalendarDayBlock() {\n return {\n restrict: 'E',\n scope: {\n block: '=sgBlock',\n clickBlock: '&sgClick'\n },\n replace: true,\n template: [\n '<div class=\"sg-event sg-draggable\">',\n ' <div class=\"eventInside\" ng-click=\"clickBlock({clickEvent: $event, clickComponent: block.component})\">',\n ' <div class=\"gradient\">',\n ' </div>',\n ' <div class=\"text\">{{ block.component.c_title }}',\n ' <span class=\"icons\">',\n // Component has an alarm\n ' <md-icon ng-if=\"block.component.c_nextalarm\" class=\"material-icons icon-alarm\"></md-icon>',\n // Component is confidential\n ' <md-icon ng-if=\"block.component.c_classification == 1\" class=\"material-icons icon-visibility-off\"></md-icon>',\n // Component is private\n ' <md-icon ng-if=\"block.component.c_classification == 2\" class=\"material-icons icon-vpn-key\"></md-icon>',\n ' </span></div>',\n ' </div>',\n ' <div class=\"topDragGrip\"></div>',\n ' <div class=\"bottomDragGrip\"></div>',\n '</div>'\n ].join(''),\n link: link\n };\n\n function link(scope, iElement, attrs) {\n // Compute overlapping (5%)\n var pc = 100 / scope.block.siblings,\n left = scope.block.position * pc,\n right = 100 - (scope.block.position + 1) * pc;\n\n if (pc < 100) {\n if (left > 0)\n left -= 5;\n if (right > 0)\n right -= 5;\n }\n\n // Set position\n iElement.css('left', left + '%');\n iElement.css('right', right + '%');\n iElement.addClass('starts' + scope.block.start);\n iElement.addClass('lasts' + scope.block.length);\n iElement.addClass('bg-folder' + scope.block.component.c_folder);\n }\n }\n\n angular\n .module('SOGo.SchedulerUI')\n .directive('sgCalendarDayBlock', sgCalendarDayBlock);\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /*\n * sgCalendarDayTable - Build list of blocks for a specific day\n * @memberof SOGo.Common\n * @restrict element\n * @param {object} sgBlocks - the events blocks definitions for the current view\n * @param {string} sgDay - the day of the events to display\n * @param {function} sgClick - the function to call when clicking on a block.\n * Two variables are available: event (the event that triggered the mouse click),\n * and component (a Component object)\n *\n * @example:\n\n <sg-calendar-day-table\n sg-blocks=\"calendar.blocks\"\n sg-day=\"20150330\"\n sg-click=\"open({ event: clickEvent, component: clickComponent })\"/>\n */\n function sgCalendarDayTable() {\n return {\n restrict: 'E',\n scope: {\n blocks: '=sgBlocks',\n day: '@sgDay',\n clickBlock: '&sgClick'\n },\n template: [\n '<sg-calendar-day-block class=\"sg-event draggable\"',\n ' ng-repeat=\"block in blocks[day]\"',\n ' sg-block=\"block\"',\n ' sg-click=\"clickBlock({event: clickEvent, component: clickComponent})\"/>'\n ].join('')\n };\n }\n\n angular\n .module('SOGo.SchedulerUI')\n .directive('sgCalendarDayTable', sgCalendarDayTable);\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /*\n * sgCalendarMonthDay - Build list of blocks for a specific day in a month\n * @memberof SOGo.Common\n * @restrict element\n * @param {object} sgBlocks - the events blocks definitions for the current view\n * @param {string} sgDay - the day of the events to display\n * @ngInject\n * @example:\n\n <sg-calendar-monh-day\n sg-blocks=\"calendar.blocks\"\n sg-day=\"20150408\"\n sg-click=\"open({ event: clickEvent, component: clickComponent })\"/>\n */\n function sgCalendarMonthDay() {\n return {\n restrict: 'E',\n scope: {\n blocks: '=sgBlocks',\n day: '@sgDay',\n clickBlock: '&sgClick'\n },\n template: [\n '<sg-calendar-month-event',\n ' ng-repeat=\"block in blocks[day]\"',\n ' sg-block=\"block\"',\n ' sg-click=\"clickBlock({event: clickEvent, component: clickComponent})\"/>'\n ].join('')\n };\n }\n\n angular\n .module('SOGo.SchedulerUI')\n .directive('sgCalendarMonthDay', sgCalendarMonthDay);\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /*\n * sgCalendarMonthEvent - An event block to be displayed in a month\n * @memberof SOGo.Common\n * @restrict element\n * @param {object} sgBlock - the event block definition\n * @ngInject\n * @example:\n\n <sg-calendar-month-event\n ng-repeat=\"block in blocks[day]\"\n sg-block=\"block\"/>\n */\n function sgCalendarMonthEvent() {\n return {\n restrict: 'E',\n scope: {\n block: '=sgBlock',\n clickBlock: '&sgClick'\n },\n replace: true,\n template: [\n '<div class=\"sg-event sg-draggable\" ng-click=\"clickBlock({clickEvent: $event, clickComponent: block.component})\">',\n ' <span ng-if=\"!block.component.c_isallday\">{{ block.starthour }} - </span>',\n ' {{ block.component.c_title }}',\n ' <span class=\"icons\">',\n ' <i ng-if=\"block.component.c_nextalarm\" class=\"md-icon-alarm\"></i>',\n ' <i ng-if=\"block.component.c_classification == 1\" class=\"md-icon-visibility-off\"></i>',\n ' <i ng-if=\"block.component.c_classification == 2\" class=\"md-icon-vpn-key\"></i>',\n ' </span>',\n ' <div class=\"leftDragGrip\"></div>',\n ' <div class=\"rightDragGrip\"></div>',\n '</div>'\n ].join(''),\n link: link\n };\n\n function link(scope, iElement, attrs) {\n iElement.addClass('bg-folder' + scope.block.component.c_folder);\n }\n }\n\n angular\n .module('SOGo.SchedulerUI')\n .directive('sgCalendarMonthEvent', sgCalendarMonthEvent);\n})();\n"]}