2017-06-02 08:16:11 +02:00
|
|
|
!function(){"use strict";function e(){var a,t,r,o=this;if(this.defaults={},this.settings={},a=e.$document[0].getElementById("UserDefaults")){try{r=angular.fromJson(a.textContent||a.innerHTML)}catch(a){e.$log.error("Can't parse user's defaults: "+a.message),r={}}var n=_.fromPairs(_.map(r.SOGoMailLabelsColors,function(e,a){return"$"==a.charAt(0)?["_"+a,e]:[a,e]}));r.SOGoMailLabelsColors=n,_.forEach(r.SOGoSieveFilters,function(e){_.forEach(e.actions,function(e){"addflag"==e.method&&"$"==e.argument.charAt(0)&&(e.argument="_"+e.argument)})}),r.SOGoRememberLastModule&&(r.SOGoLoginModule="Last"),r.SOGoMailAutoSave=parseInt(r.SOGoMailAutoSave)||0,r.SOGoMailComposeFontSizeEnabled=parseInt(r.SOGoMailComposeFontSize)>0,window.CKEDITOR&&r.SOGoMailComposeFontSizeEnabled&&(window.CKEDITOR.config.fontSize_defaultLabel=r.SOGoMailComposeFontSize,window.CKEDITOR.addCss(".cke_editable { font-size: "+r.SOGoMailComposeFontSize+"px; }")),r.Vacation?(r.Vacation.startDate?r.Vacation.startDate=new Date(1e3*parseInt(r.Vacation.startDate)):(r.Vacation.startDateEnabled=0,r.Vacation.startDate=new Date,r.Vacation.startDate=r.Vacation.startDate.beginOfDay(),r.Vacation.startDate.addDays(1)),r.Vacation.endDate?r.Vacation.endDate=new Date(1e3*parseInt(r.Vacation.endDate)):(r.Vacation.endDateEnabled=0,r.Vacation.endDate=new Date(r.Vacation.startDate.getTime()),r.Vacation.endDate.addDays(1)),r.Vacation.autoReplyEmailAddresses&&r.Vacation.autoReplyEmailAddresses.length?r.Vacation.autoReplyEmailAddresses=r.Vacation.autoReplyEmailAddresses.join(","):delete r.Vacation.autoReplyEmailAddresses):r.Vacation={},angular.isUndefined(r.Vacation.autoReplyEmailAddresses)&&angular.isDefined(window.defaultEmailAddresses)&&(r.Vacation.autoReplyEmailAddresses=window.defaultEmailAddresses),angular.isUndefined(r.Vacation.daysBetweenResponse)&&(r.Vacation.daysBetweenResponse=7),angular.isUndefined(r.Vacation.startDate)&&(r.Vacation.startDateEnabled=0,r.Vacation.startDate=new Date),angular.isUndefined(r.Vacation.endDate)&&(r.Vacation.endDateEnabled=0,r.Vacation.endDate=new Date),r.Forward&&r.Forward.forwardAddress&&(r.Forward.forwardAddress=r.Forward.forwardAddress.join(",")),angular.isUndefined(r.SOGoCalendarCategoriesColors)&&(r.SOGoCalendarCategoriesColors={},r.SOGoCalendarCategories=[]),angular.isUndefined(r.SOGoContactsCategories)&&(r.SOGoContactsCategories=[]),angular.extend(o.defaults,r),o.$mdDateLocaleProvider=e.$mdDateLocaleProvider,angular.extend(o.$mdDateLocaleProvider,r.locale),angular.extend(o.$mdDateLocaleProvider,{firstDayOfWeek:r.SOGoFirstDayOfWeek,firstWeekOfYear:r.SOGoFirstWeekOfYear}),o.$mdDateLocaleProvider.firstDayOfWeek=parseInt(r.SOGoFirstDayOfWeek),o.$mdDateLocaleProvider.weekNumberFormatter=function(e){return l("Week %d",e)},o.$mdDateLocaleProvider.msgCalendar=l("Calender"),o.$mdDateLocaleProvider.msgOpenCalendar=l("Open Calendar"),o.$mdDateLocaleProvider.parseDate=function(e){return e?e.parseDate(o.$mdDateLocaleProvider,o.defaults.SOGoShortDateFormat):new Date(NaN)},o.$mdDateLocaleProvider.formatDate=function(e){return e?e.format(o.$mdDateLocaleProvider,e.$dateFormat||o.defaults.SOGoShortDateFormat):""},o.$mdDateLocaleProvider.parseTime=function(e){return e?e.parseDate(o.$mdDateLocaleProvider,o.defaults.SOGoTimeFormat):new Date(NaN)},o.$mdDateLocaleProvider.formatTime=function(e){return e?e.format(o.$mdDateLocaleProvider,o.defaults.SOGoTimeFormat):""}}if(t=e.$document[0].getElementById("UserSettings")){try{r=angular.fromJson(t.textContent||t.innerHTML)}catch(a){e.$log.error("Can't parse user's settings: "+a.message),r={}}r.Calendar&&(r.Calendar.PreventInvitationsWhitelist?r.Calendar.PreventInvitationsWhitelist=_.map(r.Calendar.PreventInvitationsWhitelist,function(a,t){var r=/^(.+)\s<(\S+)>$/.exec(a),n=new e.$User({uid:t,cn:r[1],c_email:r[2]});return n.$$image||(n.$$image=o.avatar(n.c_email,32,{no_404:!0})),n}):r.Calendar.PreventInvitationsWhitelist=[]),angular.extend(o.settings,r)}}e.$factory=["$document","$q","$timeout","$log","$mdDateLocale","sgSettings","Gravatar","Resource","User",function(a,t,r,o,n,s,i,d,l){return angular.extend(e,{$document:a,$q
|