Viewing File: /usr/local/cpanel/base/frontend/jupiter/mail/spam/views/main.min.js

define(["angular","lodash","cjt/util/locale","app/views/ROUTES","cjt/decorators/alertAPIReporter","cjt/directives/alertList","app/services/spamAssassin","cjt/directives/toggleSwitchDirective","cjt/services/alertService"],(function(t,e,r,a){"use strict";return t.module("cpanel.apacheSpamAssassin").controller("main",["$scope","$rootScope","$location","spamAssassin","alertService","$window",function(n,o,i,u,s,c){function l(t){var e;return n.routes.forEach((function(r,a){r.route===t&&(e=a)})),e}function f(t,e){n.breadcrumbs.push({label:t.title,active:e,href:"#"+t.route})}function p(t,e){if(!e.parentRoute||"atAGlance"===e.parentRoute)return t;var r=b(e.parentRoute);return t.unshift(r),p(t,r)}function g(){if(n.breadcrumbs=[],f({title:r.maketext("Spam Filters"),route:"/overview"},!0),n.currentTab){var t=p([n.currentTab],n.currentTab);t.forEach((function(e,r){f(e,r!==t.length-1)}))}return n.breadcrumbs}function b(t){var e;return n.routes.forEach((function(r){r.id===t&&(e=r)})),e}o.$on("$routeChangeStart",(function(t,r,a){if(n.loading=!0,r){if(r&&r.$$route&&r.$$route.originalPath)var o=l(r.$$route.originalPath);e.isUndefined(o)&&(t.preventDefault(),n.goToFirstTab());var i=n.routes[o];i&&!1!==u.hasFeature(i.id)?s.clear():(t.preventDefault(),n.goToFirstTab())}else c.history.back()})),o.$on("$routeChangeSuccess",(function(t,e){if(n.loading=!1,n.parentTab=null,e&&e.$$route&&e.$$route.originalPath){var r=l(e.$$route.originalPath);n.currentTab=n.routes[r],n.activeTab=r,n.parentTab=b(n.currentTab.parentRoute)}g()})),o.$on("$routeChangeError",(function(){n.loading=!1})),u.getSpamAssassinSettings().then((function(){""===i.path()?n.goToFirstTab():n.routes.some((function(t){return t.route===i.path()}))||n.goToFirstTab()})),g(),t.extend(n,{go:function(t){var e="";n.routes.forEach((function(r,a){r.id===t&&(e=r.route)})),""!==e&&i.path(e)},goToFirstTab:function(){var t=n.routes[0];t&&n.go(t.id)},activeTab:0,currentTab:null,routes:u.getValidRoutes(a),breadcrumbs:[],settings:u.spamAssassinSettings})}])}));
Back to Directory File Manager