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

2 lines
14 KiB
JavaScript
Raw Normal View History

2021-08-10 06:18:24 +02:00
!function(){"use strict";function m(){var e,t,o=this;if(this.nextAlarm=null,this.nextInboxPoll=null,this.currentToast=m.$q.when(!0),this.lastUid=null,this.notifications={},this.defaults={},this.settings={Mail:{}},e=m.$document[0].getElementById("UserDefaults")){try{t=angular.fromJson(e.textContent||e.innerHTML)}catch(e){m.$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.isString(t.Vacation.autoReplyEmailAddresses)&&t.Vacation.autoReplyEmailAddresses.length&&(t.Vacation.autoReplyEmailAddresses=t.Vacation.autoReplyEmailAddresses.split(/, */))):t.Vacation={},(angular.isUndefined(t.Vacation.autoReplyEmailAddresses)||0==t.Vacation.autoReplyEmailAddresses.length)&&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&&(angular.isString(t.Forward.forwardAddress)?t.Forward.forwardAddress=t.Forward.forwardAddress.split(/, */):angular.isArray(t.Forward.forwardAddress)||(t.Forward.forwardAddress=[])),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(o.defaults,t),o.$mdDateLocaleProvider=m.$mdDateLocaleProvider,angular.extend(o.$mdDateLocaleProvider,t.locale),angular.extend(o.$mdDateLocaleProvider,{firstDayOfWeek:t.SOGoFirstDayOfWeek,firstWeekOfYear:t.SOGoFirstWeekOfYear}),o.$mdDateLocaleProvider.firstDayOfWeek=parseInt(t.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