1 line
44 KiB
Plaintext
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","Dialog","selectComponentType","type","options","reload","componentType","isUndefined","$filter","unselectComponents","saveSelectedList","_","each","component","selected","selectAll","toggleComponentSelection","preventDefault","stopPropagation","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","encodeUriFilter","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,UACtB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S,YAAcV,MAAMI,MAAM/K,UAAU0H,UAxBxD,OACE4D,SAAU,IACVX,OACEI,MAAO,WACPQ,WAAY,YAEd7N,SAAS,EACT8N,UACE,mHACA,8EACA,kCACA,yBACA,wEACA,2FACA,oFACA,YACA,qCACA,sCACA,UACApF,KAAK,IACPsE,KAAMA,MAQV/M,QACGC,OAAO,oBACP6N,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', 'Dialog', 'Preferences', 'Calendar', 'Component'];\n function CalendarListController($scope, $timeout, $state, $mdDialog, 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.toggleComponentSelection = toggleComponentSelection;\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 toggleComponentSelection($event, component) {\n component.selected = !component.selected;\n $event.preventDefault();\n $event.stopPropagation();\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"]} |