Viewing File: /usr/local/cpanel/whostmgr/docroot/templates/mailbox_converter/index.cmb.min.js

define("app/services/indexService",["angular"],(function(t){return t.module("App").factory("indexService",(function(){var t,e,r={};return r.set_accounts=function(t){return e=t},r.get_accounts=function(){return e},r.set_format=function(r){return r!==t&&Array.isArray(e)&&e.forEach((function(t){t.selected=0})),t=r},r.get_format=function(){return t},r}))})),define("app/views/selectAccountsController",["lodash","angular","cjt/util/locale","uiBootstrap","cjt/directives/toggleSortDirective","cjt/directives/searchDirective","cjt/directives/pageSizeDirective","cjt/directives/triStateCheckbox","cjt/filters/startFromFilter","cjt/decorators/paginationDecorator"],(function(t,e,r){return e.module("App").controller("selectAccountsController",["$scope","$filter","indexService","$route",function(t,o,n){t.$parent.ready=!1;var a=n.get_format(),c=n.get_accounts(),i=[];e.forEach(c,(function(t){t.selected=t.selected||0,i.push(t)})),t.accounts=i,t.meta={sortReverse:!1,sortBy:"username",sortDirection:"desc",maxPages:5,totalItems:t.accounts.length,currentPage:1,pageSize:10,pageSizes:[10,20,50,100],start:0,limit:10,filterValue:""},t.showPager=!0;var u={filter:o("filter"),orderBy:o("orderBy"),startFrom:o("startFrom"),limitTo:o("limitTo")};t.sortList=function(){t.fetch()},t.selectPage=function(){t.fetch()},t.selectPageSize=function(){t.fetch()},t.searchList=function(){t.fetch()},t.toggleCheckAll=function(t,e,r){t.forEach((function(o,n){t[n][e]=r}))};t.fetch=function(){var e=[];if(e=""!==t.meta.filterValue?u.filter(t.accounts,t.meta.filterValue,!1):t.accounts,e=u.filter(e,{mailbox_format:"!"+a}),""!==t.meta.sortDirection&&""!==t.meta.sortBy&&(e=u.orderBy(e,t.meta.sortBy,"asc"===t.meta.sortDirection)),t.meta.totalItems=e.length,t.meta.totalItems>function(t){for(var e=t[0],r=0;r<t.length;r++)e=t[r]<e?t[r]:e;return e}(t.meta.pageSizes)){var r=(t.meta.currentPage-1)*t.meta.pageSize,o=t.meta.pageSize;e=u.limitTo(u.startFrom(e,r),o),t.showPager=!0,t.meta.start=r+1,t.meta.limit=r+e.length}else t.showPager=!1,0===e.length?t.meta.start=0:t.meta.start=1,t.meta.limit=e.length;return t.filteredAccounts=e,e},t.fetch(),t.$watch("accounts",(function(e){n.set_accounts(e),u.filter(e,{selected:1}).length?t.$parent.ready=!0:t.$parent.ready=!1}),!0),t.pagination_msg=function(){return r.maketext("Showing [numf,_1] - [numf,_2] of [quant,_3,item,items]",t.meta.start,t.meta.limit,t.meta.totalItems)}}])})),define("app/views/selectFormatController",["lodash","angular","cjt/util/locale","uiBootstrap"],(function(t,e,r){return e.module("App").controller("selectFormatController",["$scope","indexService",function(t,e){t.$parent.ready=!1,t.selected_format=e.get_format();var o=e.get_accounts();t.selected_format&&(t.$parent.ready=!0);var n={};o.forEach((function(t){t.mailbox_format in n?n[t.mailbox_format]+=1:n[t.mailbox_format]=1})),t.maildir_count=n,t.select=function(r){t.selected_format=e.set_format(r),t.$parent.ready=!0},t.format_is=function(e){return e===t.selected_format},t.number_of_accounts_msg=function(e){return r.maketext("[quant,_1,account,accounts,No accounts] [numerate,_1,uses,use] this format.",t.maildir_count[e]||0)}}])})),define("app/views/confirmController",["lodash","angular","cjt/util/locale","uiBootstrap"],(function(t,e,r){return e.module("App").controller("confirmController",["$scope","$filter","indexService",function(t,e,o){t.$parent.ready=!1;var n=o.get_accounts();t.accounts=e("filter")(n,{selected:1}),t.chosen_mailbox_format=o.get_format(),t.chosen_mailbox_format?t.accounts&&t.accounts.length||t.$parent.go(1):t.$parent.go(0),t.selected_accounts_msg=r.maketext("You selected [quant,_1,account,accounts] to convert to [_2].",t.accounts.length,t.chosen_mailbox_format)}])})),define("app/index",["angular","cjt/core","cjt/util/locale","cjt/modules","uiBootstrap","ngRoute","ngAnimate"],(function(t,e,r){return function(){return t.module("App",["cjt2.config.whm.configProvider","ngRoute","ui.bootstrap","cjt2.whm","ngAnimate"]),require(["cjt/bootstrap","uiBootstrap","cjt/services/whm/breadcrumbService","app/services/indexService","app/views/selectAccountsController","app/views/selectFormatController","app/views/confirmController"],(function(o){var n=t.module("App");n.value("PAGE",PAGE);var a=[{route:"select_format",breadcrumb:r.maketext("Select Format"),templateUrl:e.buildFullPath("mailbox_converter/views/selectFormatView.ptt"),controller:"selectFormatController",default:!0,is_ready:function(t){return t((function(t){t("")}))}},{route:"select_accounts",breadcrumb:r.maketext("Select Accounts"),templateUrl:e.buildFullPath("mailbox_converter/views/selectAccountsView.ptt"),controller:"selectAccountsController",is_ready:function(t,e){return t((function(t,r){e.get_format()?t(""):r("Missing necessary data")}))}},{route:"finalize",breadcrumb:r.maketext("Review and Finalize"),templateUrl:e.buildFullPath("mailbox_converter/views/confirmView.ptt"),controller:"confirmController",is_ready:function(t,e){var r=e.get_accounts(),o=!1;if(r)for(var n=0;n<r.length;n++)if(r[n].selected){o=!0;break}return t((function(t,r){e.get_format()&&o?t(""):r("Missing necessary data")}))}}];n.controller("BaseController",["$rootScope","$scope","$route","$location","indexService","$q","PAGE","$window",function(t,e,o,n,c,i,u,l){e.steps=a,e.current_step=0,e.LOCALE=r;var s=!1;c.set_accounts(u.data.accounts),t.$on("$routeChangeStart",(function(t,r,o){o&&void 0!==o.$$route&&o.$$route.page===e.current_step&&(e.current_step=r.$$route.page),s=!0})),t.$on("$routeChangeSuccess",(function(){s=!1})),t.$on("$routeChangeError",(function(t,r,o){s=!1,o?n.path(a[o.$$route.page].route).replace():n.path(a[e.current_step].route).replace()})),e.current_route_matches=function(t){return n.path().match(t)},e.get_view_styles=function(){var t=[];return s&&t.push("view-disabled"),t},e.submit_form=function(t){document.getElementById(t).submit()},e.go_back=function(t,r){if(void 0===t)return l.history.back(),void(e.current_step=e.current_step-1);for(var o=r-t;o>0;)l.history.back(),o--;e.current_step=t},e.go=function(t,r){r&&a[t].is_ready(i,c).then((function(){n.path(a[t].route),e.current_step=t}),(function(){}))}}]),n.config(["$routeProvider",function(t){var e=0;a.forEach((function(r){t.when("/"+r.route,{controller:r.controller,templateUrl:r.templateUrl,breadcrumb:r.breadcrumb,resolve:{data:["$q","indexService",r.is_ready]},page:e++}),r.hasOwnProperty("default")&&r.default&&t.otherwise({redirectTo:"/"+r.route})}))}]),n.run(["breadcrumbService",function(t){t.initialize()}]),o()}))}}));
Back to Directory File Manager