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