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

2 lines
14 KiB
JavaScript
Raw Normal View History

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