sogo/UI/WebServerResources/js/Preferences.js

2 lines
14 KiB
JavaScript
Raw Normal View History

2017-12-22 07:28:55 +01:00
!function(){"use strict";function e(e,t){e.state("preferences",{abstract:!0,views:{preferences:{templateUrl:"preferences.html",controller:"PreferencesController",controllerAs:"app"}}}).state("preferences.general",{url:"/general",views:{module:{templateUrl:"generalPreferences.html"}}}).state("preferences.calendars",{url:"/calendars",views:{module:{templateUrl:"calendarsPreferences.html"}}}).state("preferences.addressbooks",{url:"/addressbooks",views:{module:{templateUrl:"addressbooksPreferences.html"}}}).state("preferences.mailer",{url:"/mailer",views:{module:{templateUrl:"mailerPreferences.html"}}}),t.otherwise("/general")}function t(e){e.$on("$routeChangeError",function(e,t,a,r){console.error(e,t,a,r)})}angular.module("SOGo.PreferencesUI",["ui.router","ck","angularFileUpload","SOGo.Common","SOGo.MailerUI","SOGo.ContactsUI","SOGo.Authentication","as.sortable"]).config(e).run(t),e.$inject=["$stateProvider","$urlRouterProvider"],t.$inject=["$rootScope"]}(),function(){"use strict";function e(e,t,a,r,n,i,s,o,c,d){function u(e){var t=e.type.indexOf("pkcs12")>0||/\.(p12|pfx)$/.test(e.name);return f.form.certificateFilename.$setValidity("fileformat",t),t}var f=this;f.defaultPort=143,f.defaults=s,f.account=o,f.accountId=c,f.customFromIsReadonly=function(){return!(c>0||d)},f.onBeforeUploadCertificate=function(e){f.form=e,f.uploader.clearQueue()},f.certificateIsInstalled=function(){return f.certificateFilename&&0===f.uploader.queue.length},f.removeCertificate=function(){new i({id:c}).$removeCertificate().then(function(){delete f.certificateFilename})},f.importCertificate=function(){f.uploader.queue[0].formData=[{password:f.certificatePassword}],f.uploader.uploadAll()},f.cancel=function(){e.cancel()},f.save=function(){e.hide()},f.hostnameRE=c>0?/^(?!(127\.0\.0\.1|localhost(?:\.localdomain)?)$)/:/./,f.account.encryption?"ssl"==f.account.encryption&&(f.defaultPort=993):f.account.encryption="none",f.account.certificateFilename&&(f.certificateFilename=f.account.certificateFilename),f.uploader=new a({url:[n.activeUser("folderURL")+"Mail",c,"importCertificate"].join("/"),autoUpload:!1,queueLimit:1,filters:[{name:u,fn:u}],onAfterAddingFile:function(e){f.certificateFilename=e.file.name},onSuccessItem:function(e,a,r,n){var i=angular.element(document.getElementById("accountSecurityContent"));t.show(t.simple().content(l("Success")).parent(i).position("top right").hideDelay(3e3)),this.clearQueue()},onErrorItem:function(e,t,a,n){r.alert(l("Error"),l("An error occurred while importing the certificate. Verify your password."))}})}e.$inject=["$mdDialog","$mdToast","FileUploader","Dialog","sgSettings","Account","defaults","account","accountId","mailCustomFromEnabled"],angular.module("SOGo.PreferencesUI").controller("AccountDialogController",e)}(),function(){"use strict";function e(e,t,a,r,n,i){var s=this,o=t.sieveCapabilities,c=t.forwardEnabled;t.vacationEnabled;s.filter=r,s.mailboxes=n,s.labels=i,s.cancel=function(){a.cancel()},s.hasRulesAndActions=function(){var e=[s.filter.actions];return"allmessages"!=s.filter.match&&e.push(s.filter.rules),_.every(e,function(e){return e&&e.length>0})},s.save=function(e){a.hide()},s.addMailFilterRule=function(e){s.filter.rules||(s.filter.rules=[]),s.filter.rules.push({field:"subject",operator:"contains"})},s.removeMailFilterRule=function(e){s.filter.rules.splice(e,1)},s.addMailFilterAction=function(e){s.filter.actions||(s.filter.actions=[]),s.filter.actions.push({method:"discard"})},s.removeMailFilterAction=function(e){s.filter.actions.splice(e,1)},s.fieldLabels={subject:l("Subject"),from:l("From"),to:l("To"),cc:l("Cc"),to_or_cc:l("To or Cc"),size:l("Size (Kb)"),header:l("Header")},o.indexOf("body")>-1&&(s.fieldLabels.body=l("Body")),s.methodLabels={discard:l("Discard the message"),keep:l("Keep the message"),stop:l("Stop processing filter rules")},c&&(s.methodLabels.redirect=l("Forward the message to")),o.indexOf("reject")>-1&&(s.methodLabels.reject=l("Send a reject message")),o.indexOf("fileinto")>-1&&(s.methodLabels.fileinto=l("File the message in")),(o.indexOf("imapflags")>-1||o.indexOf("imap4flags")>-1)&&(s
//# sourceMappingURL=Preferences.js.map