File manager - Edit - /usr/local/cpanel/whostmgr/docroot/templates/feature/views/featureListController.min.js
Back
define(["angular","lodash","cjt/util/locale","uiBootstrap","cjt/directives/autoFocus","cjt/filters/wrapFilter","cjt/filters/splitFilter","cjt/filters/htmlFilter","cjt/directives/spinnerDirective","cjt/directives/actionButtonDirective","cjt/directives/validationContainerDirective","cjt/directives/validationItemDirective","cjt/services/alertService","app/services/featureListService","cjt/io/whm-v1-querystring-service"],(function(angular,_,LOCALE){"use strict";var app=angular.module("App");var controller=app.controller("featureListController",["$scope","$location","$anchorScroll","$timeout","featureListService","alertService",function($scope,$location,$anchorScroll,$timeout,featureListService,alertService){$scope.loadingPageData=true;$scope.loadingView=false;$scope.onlyReseller=!PAGE.hasRoot;$scope.hasMailOnlyList=PAGE.hasMailOnlyList;$scope.isEditable=function(list){return typeof list!=="undefined"&&list!==""};$scope.isDeletable=function(list){if(typeof list!=="undefined"){return $scope.isEditable(list)&&!$scope.isSystemList(list)}return false};$scope.isSystemList=function(list){if(typeof list!=="undefined"){return list==="default"||list==="disabled"||list==="Mail Only"}return false};$scope.add=function(list){if(!$scope.formAddFeature.$valid){var currentValue=$scope.formAddFeature.txtNewFeatureList.$viewValue;$scope.formAddFeature.txtNewFeatureList.$setViewValue(currentValue);return}if(!PAGE.hasRoot){var re=new RegExp("^"+PAGE.remoteUser+"_\\w+","i");if(list.search(re)===-1){list=PAGE.remoteUser+"_"+list}}return featureListService.add(list).then((function(){$scope.loadingView=true;$scope.loadView("editFeatureList",{name:list})}),(function(error){alertService.add({type:"danger",message:error,id:"errorAddingingFeatureList"})}))};$scope.delete=function(list){return featureListService.remove(list).then((function(results){$scope.featureLists=results.items;$scope.selectedFeatureList=$scope.featureLists[0]}),(function(error){alertService.add({type:"danger",message:error,id:"errorDeletingFeatureList"})}),(function(){alertService.add({type:"success",message:LOCALE.maketext("You successfully deleted the “[_1]” feature list.",_.escape(list)),id:"alertDeleteSuccess"})}))};$scope.fetch=function(){$scope.loadingPageData=true;alertService.removeById("errorFetchFeatureLists");return featureListService.loadFeatureLists().then((function(results){$scope.featureLists=results.items;$scope.selectedFeatureList=$scope.featureLists[0]}),(function(error){alertService.add({type:"danger",message:error,id:"errorFetchFeatureLists"});throw error})).finally((function(){$scope.loadingPageData=false}))};$scope.$on("$viewContentLoaded",(function(){if(app.firstLoad.featureList&&PAGE.featureLists){app.firstLoad.featureList=false;$scope.loadingPageData=false;var featureLists=featureListService.prepareList(PAGE.featureLists);$scope.featureLists=featureLists.items;$scope.selectedFeatureList=$scope.featureLists[0];if(!featureLists.status){$scope.loadingPageData="error";alertService.add({type:"danger",message:LOCALE.maketext("There was a problem loading the page. The system is reporting the following error: [_1].",PAGE.featureLists.metadata.reason),id:"errorFetchFeatureLists"})}}else{$scope.fetch()}}))}]);return controller}));
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings