sogo/UI/WebServerResources/js/Scheduler.js
2018-03-08 01:37:43 -05:00

2 lines
2 KiB
JavaScript

!function(){"use strict";angular.module("SOGo.SchedulerUI",["ngCookies","ui.router","angularFileUpload","ck","SOGo.Common","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.MailerUI","as.sortable"]).config(e).run(r),e.$inject=["$stateProvider","$urlRouterProvider"];function e(e,r){e.state("calendars",{url:"/calendar",views:{calendars:{templateUrl:"UIxCalMainView",controller:"CalendarsController",controllerAs:"app"}},resolve:{stateCalendars:a}}).state("calendars.view",{url:"/{view:(?:day|week|month|multicolumnday)}/:day",views:{calendarView:{templateUrl:function(e){return e.view+"view?day="+e.day},controller:"CalendarController",controllerAs:"calendar"}},resolve:{stateEventsBlocks:n}}),r.when("/calendar/day",function(){return"/calendar/day/"+(new Date).getDayString()}),r.when("/calendar/multicolumnday",function(){return"/calendar/multicolumnday/"+(new Date).getDayString()}),r.when("/calendar/week",function(){return"/calendar/week/"+(new Date).getDayString()}),r.when("/calendar/month",function(){return"/calendar/month/"+(new Date).getDayString()}),r.otherwise("/calendar")}a.$inject=["Calendar"];function a(e){return e.$calendars||e.$findAll(window.calendarsData)}n.$inject=["$stateParams","Component","Calendar"];function n(e,a,n){return a.$eventsBlocksForView(e.view,e.day.asDate()).then(function(e){return _.forEach(e,function(e){e.id&&(e.calendar=new n({id:e.id,name:e.calendarName}))}),e})}r.$inject=["$rootScope","$log","$location","$state","Preferences"];function r(e,a,n,r,t){if(e.$on("$stateChangeError",function(e,n,t,l,o,c){a.error(c),r.go("calendar")}),e.$on("$routeChangeError",function(e,n,r,t){a.error(e,n,r,t)}),0===n.url().length){var l="/calendar/",o=/(.+)view/.exec(t.settings.Calendar.View);l+=o?o[1]:"week";var c=new Date;if(t.defaults.SOGoCalendarWeekdays)for(var i=["SU","MO","TU","WE","TH","FR","SA"],d=i[c.getDay()];t.defaults.SOGoCalendarWeekdays.indexOf(d)<0;)c.addDays(1),d=i[c.getDay()];l+="/"+c.getDayString(),n.replace().url(l)}}}();
//# sourceMappingURL=Scheduler.js.map