Viewing File: /usr/local/cpanel/base/frontend/jupiter/mail/spam/views/configurations.min.js
define(["angular","lodash","cjt/util/locale","app/services/spamAssassin","cjt/directives/toggleSwitchDirective","cjt/directives/toggleLabelInfoDirective","cjt/directives/multiFieldEditorItem","cjt/directives/multiFieldEditor","app/directives/scoreField","cjt/directives/formWaiting"],(function(e,r,s){"use strict";return e.module("cpanel.apacheSpamAssassin").controller("configurations",["$scope","$location","spamAssassin","userPreferences",function(c,i,o,t){function n(e){return o.updateUserPreference(e,c.workingPreferences[e]).then((function(){"required_score"===e&&(t.required_score_select=c.workingPreferences.required_score_select=t.required_score.toString(),c.workingPreferences.customRequiredScoreValue=c.workingPreferences.required_score,t.customRequiredScoreValue=c.workingPreferences.required_score,l("required_score_select"),l("customRequiredScoreValue")),l(e)}))}var u={};function a(){c.requiredScoreOptions=[{score:1,label:s.maketext("Aggressive, Many False Positives ([_1])",1)},{score:4,label:s.maketext("Recommended for Well-Tested Servers ([_1])",4)},{score:5,label:s.maketext("Default ([_1])",5)},{score:8,label:s.maketext("Recommended For Internet service providers ([_1])",8)},{score:10,label:s.maketext("Passive, Only Very Obvious Spam ([_1])",10)},c.customRequiredScore];var e=[1,4,5,8,10].indexOf(c.workingPreferences.required_score);c.workingPreferences.customRequiredScoreValue=c.workingPreferences.required_score,-1===e?(c.workingPreferences.required_score_select="custom",c.requiredScoreOptions=c.requiredScoreOptions.sort((function(e,r){return e.score>r.score?1:-1}))):c.requiredScoreOptions[e].label+=" ("+s.maketext("Current")+")"}function l(e){u[e]=r.isEqual(c.workingPreferences[e],t[e])}function d(e,r){c[r?"$watchCollection":"$watch"]("workingPreferences."+e,(function(r,s){l(e)}))}c.workingPreferences={},c.customRequiredScore={score:"custom",label:s.maketext("Custom")},e.extend(c,{settings:o.spamAssassinSettings,getSymbolicTestNames:o.getSymbolicTestNames,symbolicTestNames:o.symbolicTestNames,updateWhitelistFrom:function(){return n("whitelist_from")},updateBlacklistFrom:function(){return n("blacklist_from")},updateRequiredScore:function(){return"custom"!==c.workingPreferences.required_score_select?c.workingPreferences.required_score=Number(c.workingPreferences.required_score_select):c.workingPreferences.required_score=c.workingPreferences.customRequiredScoreValue,n("required_score").then(a)},updateTestingScores:function(){return n("score")},disableSpamAssassin:function(){return o.disableSpamAssassin().then((function(){i.path("/")}))},getRequiredScoreOptions:function(){return c.requiredScoreOptions||a(),c.requiredScoreOptions},checkPristine:function(e){return u[e]}}),c.workingPreferences=e.copy(t),t.customRequiredScoreValue=c.workingPreferences.required_score,c.workingPreferences.customRequiredScoreValue=c.workingPreferences.required_score,["required_score","required_score_select","customRequiredScoreValue"].forEach((function(e){d(e)})),["score","whitelist_from","blacklist_from"].forEach((function(e){d(e,!0)})),t.required_score_select=c.workingPreferences.required_score_select=c.workingPreferences.required_score.toString()}])}));
Back to Directory
File Manager