sogo/UI/WebServerResources/js/Scheduler.js

2 lines
2.1 KiB
JavaScript

!function(){"use strict";function e(e,a,n){e.state("calendars",{url:"/calendar",views:{calendars:{templateUrl:"UIxCalMainView",controller:"CalendarsController",controllerAs:"app"}},resolve:{stateCalendars:r}}).state("calendars.view",{url:"/{view:(?:day|week|month|multicolumnday)}/{day:[0-9]{8}}",views:{calendarView:{templateUrl:function(e){return e.view+"view?day="+e.day},controller:"CalendarController",controllerAs:"calendar"}},resolve:{stateEventsBlocks:t}}),a.rules.when("/calendar/day",function(){return"/calendar/day/"+(new Date).getDayString()}),a.rules.when("/calendar/multicolumnday",function(){return"/calendar/multicolumnday/"+(new Date).getDayString()}),a.rules.when("/calendar/week",function(){return"/calendar/week/"+(new Date).getDayString()}),a.rules.when("/calendar/month",function(){return"/calendar/month/"+(new Date).getDayString()}),a.rules.otherwise("/calendar/week")}function r(e){return e.$calendars||e.$findAll(window.calendarsData)}function t(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})}function a(e,a,n,r,t,l){if(e.DebugEnabled||t.defaultErrorHandler(function(){}),n.onError({to:"calendars.**"},function(e){"calendars"==e.to().name||e.ignored()||(a.error("transition error to "+e.to().name+": "+e.error().detail),t.go({state:"calendars"}))}),0===r.url().length){e="/calendar/",n=/(.+)view/.exec(l.settings.Calendar.View);e+=n?n[1]:"week";var o=new Date;if(l.defaults.SOGoCalendarWeekdays)for(var i=["SU","MO","TU","WE","TH","FR","SA"],d=i[o.getDay()];l.defaults.SOGoCalendarWeekdays.indexOf(d)<0;)o.addDays(1),d=i[o.getDay()];e+="/"+o.getDayString(),r.replace().url(e)}}angular.module("SOGo.SchedulerUI",["ngCookies","ui.router","angularFileUpload","sgCkeditor","SOGo.Common","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.MailerUI","as.sortable"]).config(e).run(a),e.$inject=["$stateProvider","$urlServiceProvider","$mdThemingProvider"],r.$inject=["Calendar"],t.$inject=["$stateParams","Component","Calendar"],a.$inject=["$window","$log","$transitions","$location","$state","Preferences"]}();
//# sourceMappingURL=Scheduler.js.map