sogo/UI/WebServerResources/js/Preferences.services.js

2 lines
8.2 KiB
JavaScript
Raw Normal View History

2020-02-01 07:20:57 +01:00
!function(){"use strict";function d(){var e,a,t,r=this;if(this.defaults={},this.settings={Mail:{}},e=d.$document[0].getElementById("UserDefaults")){try{t=angular.fromJson(e.textContent||e.innerHTML)}catch(e){d.$log.error("Can't parse user's defaults: "+e.message),t={}}t.SOGoMailLabelsColorsKeys=[],t.SOGoMailLabelsColorsValues=[],_.forEach(t.SOGoMailLabelsColors,function(e,a){t.SOGoMailLabelsColorsKeys.push(a),t.SOGoMailLabelsColorsValues.push(e),"$"==a.charAt(0)&&(Object.defineProperty(t.SOGoMailLabelsColors,"_"+a,Object.getOwnPropertyDescriptor(t.SOGoMailLabelsColors,a)),delete t.SOGoMailLabelsColors[a])}),_.forEach(t.SOGoSieveFilters,function(e){_.forEach(e.actions,function(e){"addflag"==e.method&&"$"==e.argument.charAt(0)&&(e.argument="_"+e.argument)})}),t.SOGoRememberLastModule&&(t.SOGoLoginModule="Last"),t.SOGoMailAutoSave=parseInt(t.SOGoMailAutoSave)||0,t.SOGoMailComposeWindowEnabled=angular.isDefined(t.SOGoMailComposeWindow),t.SOGoMailComposeFontSizeEnabled=0<parseInt(t.SOGoMailComposeFontSize),window.CKEDITOR&&t.SOGoMailComposeFontSizeEnabled&&(window.CKEDITOR.config.fontSize_defaultLabel=t.SOGoMailComposeFontSize,window.CKEDITOR.addCss(".cke_editable { font-size: "+t.SOGoMailComposeFontSize+"px; }")),_.forEach(t.AuxiliaryMailAccounts,function(e){isNaN(parseInt(e.port))&&(e.port=null)}),t.Vacation?(t.Vacation.startDate?t.Vacation.startDate=new Date(1e3*parseInt(t.Vacation.startDate)):(t.Vacation.startDateEnabled=0,t.Vacation.startDate=new Date,t.Vacation.startDate=t.Vacation.startDate.beginOfDay(),t.Vacation.startDate.addDays(1)),t.Vacation.endDate?t.Vacation.endDate=new Date(1e3*parseInt(t.Vacation.endDate)):(t.Vacation.endDateEnabled=0,t.Vacation.endDate=new Date(t.Vacation.startDate.getTime()),t.Vacation.endDate.addDays(1)),t.Vacation.autoReplyEmailAddresses&&angular.isArray(t.Vacation.autoReplyEmailAddresses)&&t.Vacation.autoReplyEmailAddresses.length?t.Vacation.autoReplyEmailAddresses=t.Vacation.autoReplyEmailAddresses.join(","):delete t.Vacation.autoReplyEmailAddresses):t.Vacation={},angular.isUndefined(t.Vacation.autoReplyEmailAddresses)&&angular.isDefined(window.defaultEmailAddresses)&&(t.Vacation.autoReplyEmailAddresses=window.defaultEmailAddresses),angular.isUndefined(t.Vacation.daysBetweenResponse)&&(t.Vacation.daysBetweenResponse=7),angular.isUndefined(t.Vacation.startDate)&&(t.Vacation.startDateEnabled=0,t.Vacation.startDate=new Date),angular.isUndefined(t.Vacation.endDate)&&(t.Vacation.endDateEnabled=0,t.Vacation.endDate=new Date),t.Forward&&t.Forward.forwardAddress&&angular.isArray(t.Forward.forwardAddress)&&(t.Forward.forwardAddress=t.Forward.forwardAddress.join(",")),angular.isUndefined(t.SOGoCalendarCategories)&&(t.SOGoCalendarCategories=[]),t.SOGoCalendarCategoriesColorsValues=[],_.forEach(t.SOGoCalendarCategories,function(e){t.SOGoCalendarCategoriesColorsValues.push(t.SOGoCalendarCategoriesColors[e])}),angular.isUndefined(t.SOGoContactsCategories)?t.SOGoContactsCategories=[]:t.SOGoContactsCategories=_.compact(t.SOGoContactsCategories),angular.extend(r.defaults,t),r.$mdDateLocaleProvider=d.$mdDateLocaleProvider,angular.extend(r.$mdDateLocaleProvider,t.locale),angular.extend(r.$mdDateLocaleProvider,{firstDayOfWeek:t.SOGoFirstDayOfWeek,firstWeekOfYear:t.SOGoFirstWeekOfYear}),r.$mdDateLocaleProvider.firstDayOfWeek=parseInt(t.SOGoFirstDayOfWeek),r.$mdDateLocaleProvider.weekNumberFormatter=function(e){return l("Week %d",e)},r.$mdDateLocaleProvider.msgCalendar=l("Calendar"),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):""},r.$mdDateLocaleProvider.isDateComplete=function
//# sourceMappingURL=Preferences.services.js.map