2017-03-24 14:43:51 +01:00
|
|
|
!function(){"use strict";function a(){var b=this;this.defaults={},this.settings={},this.defaultsPromise=a.$$resource.fetch("jsonDefaults").then(function(c){var d=c||{},e=_.fromPairs(_.map(d.SOGoMailLabelsColors,function(a,b){return"$"==b.charAt(0)?["_"+b,a]:[b,a]}));return d.SOGoMailLabelsColors=e,_.forEach(d.SOGoSieveFilters,function(a){_.forEach(a.actions,function(a){"addflag"==a.method&&"$"==a.argument.charAt(0)&&(a.argument="_"+a.argument)})}),d.SOGoRememberLastModule&&(d.SOGoLoginModule="Last"),d.SOGoMailAutoSave=parseInt(d.SOGoMailAutoSave)||0,d.SOGoMailComposeFontSizeEnabled=parseInt(d.SOGoMailComposeFontSize)>0,window.CKEDITOR&&d.SOGoMailComposeFontSizeEnabled&&(window.CKEDITOR.config.fontSize_defaultLabel=d.SOGoMailComposeFontSize,window.CKEDITOR.addCss(".cke_editable { font-size: "+d.SOGoMailComposeFontSize+"px; }")),d.Vacation?(d.Vacation.startDate?d.Vacation.startDate=new Date(1e3*parseInt(d.Vacation.startDate)):(d.Vacation.startDateEnabled=0,d.Vacation.startDate=new Date,d.Vacation.startDate=d.Vacation.startDate.beginOfDay(),d.Vacation.startDate.addDays(1)),d.Vacation.endDate?d.Vacation.endDate=new Date(1e3*parseInt(d.Vacation.endDate)):(d.Vacation.endDateEnabled=0,d.Vacation.endDate=new Date(d.Vacation.startDate.getTime()),d.Vacation.endDate.addDays(1)),d.Vacation.autoReplyEmailAddresses&&d.Vacation.autoReplyEmailAddresses.length?d.Vacation.autoReplyEmailAddresses=d.Vacation.autoReplyEmailAddresses.join(","):delete d.Vacation.autoReplyEmailAddresses):d.Vacation={},angular.isUndefined(d.Vacation.autoReplyEmailAddresses)&&angular.isDefined(window.defaultEmailAddresses)&&(d.Vacation.autoReplyEmailAddresses=window.defaultEmailAddresses),angular.isUndefined(d.Vacation.daysBetweenResponse)&&(d.Vacation.daysBetweenResponse=7),angular.isUndefined(d.Vacation.startDate)&&(d.Vacation.startDateEnabled=0,d.Vacation.startDate=new Date),angular.isUndefined(d.Vacation.endDate)&&(d.Vacation.endDateEnabled=0,d.Vacation.endDate=new Date),d.Forward&&d.Forward.forwardAddress&&(d.Forward.forwardAddress=d.Forward.forwardAddress.join(",")),angular.isUndefined(d.SOGoCalendarCategoriesColors)&&(d.SOGoCalendarCategoriesColors={},d.SOGoCalendarCategories=[]),angular.isUndefined(d.SOGoContactsCategories)&&(d.SOGoContactsCategories=[]),angular.extend(b.defaults,d),b.$mdDateLocaleProvider=a.$mdDateLocaleProvider,angular.extend(b.$mdDateLocaleProvider,d.locale),angular.extend(b.$mdDateLocaleProvider,{firstDayOfWeek:d.SOGoFirstDayOfWeek,firstWeekOfYear:d.SOGoFirstWeekOfYear}),b.$mdDateLocaleProvider.firstDayOfWeek=parseInt(d.SOGoFirstDayOfWeek),b.$mdDateLocaleProvider.weekNumberFormatter=function(a){return l("Week %d",a)},b.$mdDateLocaleProvider.msgCalendar=l("Calender"),b.$mdDateLocaleProvider.msgOpenCalendar=l("Open Calendar"),b.$mdDateLocaleProvider.parseDate=function(a){return a?a.parseDate(b.$mdDateLocaleProvider,d.SOGoShortDateFormat):new Date(NaN)},b.$mdDateLocaleProvider.formatDate=function(a){return a?a.format(b.$mdDateLocaleProvider,a.$dateFormat||d.SOGoShortDateFormat):""},b.$mdDateLocaleProvider.parseTime=function(a){return a?a.parseDate(b.$mdDateLocaleProvider,d.SOGoTimeFormat):new Date(NaN)},b.$mdDateLocaleProvider.formatTime=function(a){return a?a.format(b.$mdDateLocaleProvider,d.SOGoTimeFormat):""},b.defaults}),this.settingsPromise=a.$$resource.fetch("jsonSettings").then(function(c){return c.Calendar&&(c.Calendar.PreventInvitationsWhitelist?c.Calendar.PreventInvitationsWhitelist=_.map(c.Calendar.PreventInvitationsWhitelist,function(c,d){var e=/^(.+)\s<(\S+)>$/.exec(c),f=new a.$User({uid:d,cn:e[1],c_email:e[2]});return f.$$image||b.avatar(f.c_email,32,{no_404:!0}).then(function(a){f.$$image=a}),f}):c.Calendar.PreventInvitationsWhitelist=[]),angular.extend(b.settings,c),b.settings})}a.$factory=["$q","$timeout","$log","$mdDateLocale","sgSettings","Gravatar","Resource","User",function(b,c,d,e,f,g,h,i){return angular.extend(a,{$q:b,$timeout:c,$log:d,$mdDateLocaleProvider:e,$gravatar:g,$$resource:new h(f.activeUser("folderURL"),f.activeUser()),$resourcesURL:f.resourcesURL(),$User:i}),new a}];try{angular.module("SOGo.PreferencesU
|