sogo/UI/WebServerResources/js/Scheduler.js

2 lines
21 KiB
JavaScript
Raw Normal View History

!function(){"use strict";function configure($stateProvider,$urlRouterProvider){$stateProvider.state("calendars",{url:"/calendar",views:{calendars:{templateUrl:"UIxCalMainFrame",controller:"CalendarsController",controllerAs:"app"}},resolve:{stateCalendars:stateCalendars}}).state("calendars.view",{url:"/{view:(?:day|week|month|multicolumnday)}/:day",sticky:!0,deepStateRedirect:!0,views:{calendarView:{templateUrl:function($stateParams){return $stateParams.view+"view?day="+$stateParams.day},controller:"CalendarController",controllerAs:"calendar"}},resolve:{stateEventsBlocks:stateEventsBlocks}}),$urlRouterProvider.when("/calendar/day",function(){var now=new Date;return"/calendar/day/"+now.getDayString()}),$urlRouterProvider.when("/calendar/multicolumnday",function(){var now=new Date;return"/calendar/multicolumnday/"+now.getDayString()}),$urlRouterProvider.when("/calendar/week",function(){var now=new Date;return"/calendar/week/"+now.getDayString()}),$urlRouterProvider.when("/calendar/month",function(){var now=new Date;return"/calendar/month/"+now.getDayString()}),$urlRouterProvider.otherwise("/calendar")}function stateCalendars(Calendar){return Calendar.$calendars||Calendar.$findAll(window.calendarsData)}function stateEventsBlocks($stateParams,Component,Calendar){return Component.$eventsBlocksForView($stateParams.view,$stateParams.day.asDate()).then(function(views){return _.forEach(views,function(view){view.id&&(view.calendar=new Calendar({id:view.id,name:view.calendarName}))}),views})}function runBlock($rootScope,$log,$location,$state,Preferences){$rootScope.$on("$stateChangeError",function(event,toState,toParams,fromState,fromParams,error){$log.error(error),$state.go("calendar")}),$rootScope.$on("$routeChangeError",function(event,current,previous,rejection){$log.error(event,current,previous,rejection)}),0===$location.url().length&&Preferences.ready().then(function(){var view=/(.+)view/.exec(Preferences.settings.Calendar.View);view&&$location.replace().url("/calendar/"+view[1])})}angular.module("SOGo.SchedulerUI",["ngSanitize","ui.router","SOGo.Common","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.MailerUI"]).config(configure).run(runBlock),configure.$inject=["$stateProvider","$urlRouterProvider"],stateCalendars.$inject=["Calendar"],stateEventsBlocks.$inject=["$stateParams","Component","Calendar"],runBlock.$inject=["$rootScope","$log","$location","$state","Preferences"]}(),function(){"use strict";function CalendarController($scope,$state,$stateParams,$timeout,$interval,$log,focus,Calendar,Component,stateEventsBlocks){function changeView($event){var date=angular.element($event.currentTarget).attr("date");$state.go("calendars.view",{view:$stateParams.view,day:date})}var vm=this;vm.views=stateEventsBlocks,vm.changeView=changeView,$scope.$on("calendars:list",function(){Component.$eventsBlocksForView($stateParams.view,$stateParams.day.asDate()).then(function(data){vm.views=data,_.forEach(vm.views,function(view){view.id&&(view.calendar=new Calendar({id:view.id,name:view.calendarName}))})})})}CalendarController.$inject=["$scope","$state","$stateParams","$timeout","$interval","$log","sgFocus","Calendar","Component","stateEventsBlocks"],angular.module("SOGo.SchedulerUI").controller("CalendarController",CalendarController)}(),function(){"use strict";function CalendarListController($scope,$timeout,$state,$mdDialog,Dialog,Preferences,Calendar,Component){function selectComponentType(type,options){(options&&options.reload||vm.componentType!=type)&&(angular.isUndefined(Component["$"+type])&&Component.$filter(type),vm.unselectComponents(),vm.componentType=type,Component.saveSelectedList(type))}function unselectComponents(){_.each(Component["$"+vm.componentType],function(component){component.selected=!1})}function selectAll(){_.each(Component["$"+vm.componentType],function(component){component.selected=!0})}function toggleComponentSelection($event,component){component.selected=!component.selected,$event.preventDefault(),$event.stopPropagation()}function confirmDeleteSelectedComponents(){Dialog.confirm(l("Warning"),l("Are you sure you want to
//# sourceMappingURL=Scheduler.js.map