File manager - Edit - /usr/local/cpanel/whostmgr/docroot/templates/cpanel_customization/views/jupiter/faviconController.min.js
Back
define(["lodash","angular","cjt/util/locale","app/constants","cjt/decorators/growlDecorator","app/directives/fileUpload","app/services/customizeService","app/services/savedService"],(function(_,angular,LOCALE,CONSTANTS){"use strict";var module=angular.module("customize.views.faviconController",["customize.directives.fileUpload","customize.services.customizeService","customize.services.savedService","customize.directives.fileUpload"]);var controller=module.controller("faviconController",["$scope","customizeService","savedService","growl","growlMessages","PAGE",function($scope,customizeService,savedService,growl,growlMessages,PAGE){$scope.saving=false;$scope.MAX_FILE_SIZE=CONSTANTS.MAX_FILE_SIZE;$scope.LOCALE=LOCALE;var favicon=PAGE.data.jupiter.brand.favicon;$scope.model={favicon:{data:favicon?CONSTANTS.EMBEDDED_ICO+favicon:"",filename:favicon?"favicon.ico":"",saved:!!favicon}};$scope.$watch("model.favicon",(function(){savedService.update("favicon",$scope.customization.$dirty)}),true);$scope.save=function($formCtrl){growlMessages.destroyAllMessages();if(!$formCtrl.$valid){growl.error(LOCALE.maketext("The current customization is invalid."));return}if($scope.saving){growl.warning(LOCALE.maketext("The system is busy. Try again once the current operation is complete."));return}$scope.saving=true;var favicon=$scope.model.favicon.data.replace(CONSTANTS.DATA_URL_PREFIX_REGEX,"");return customizeService.update({brand:{favicon:favicon}}).then((function(update){$scope.model.favicon.filename="favicon.ico";$scope.model.favicon.saved=true;PAGE.data.jupiter.brand.favicon=favicon;$formCtrl.$setPristine();savedService.update("favicon",false);growl.success(LOCALE.maketext("The system successfully updated the favicon."))})).catch((function(error){growl.error(LOCALE.maketext("The system failed to update the favicon."))})).finally((function(){$scope.saving=false}))};$scope.reset=function($formCtrl){growlMessages.destroyAllMessages();$formCtrl.file_upload_favicon_file.$setPristine();savedService.update("favicons",false)};$scope.delete=function($formCtrl){growlMessages.destroyAllMessages();if($scope.saving){growl.warning(LOCALE.maketext("The system is busy. Try again once the current operation is complete."));return}$scope.saving=true;return customizeService.delete("brand.favicon").then((function(update){$scope.model.favicon.saved=false;$scope.model.favicon.data="";$scope.model.favicon.filename="";PAGE.data.jupiter.brand.favicon="";$formCtrl.$setPristine();savedService.update("favicon",false);growl.success(LOCALE.maketext("The system successfully removed the custom favicon and restored the default [asis,cPanel] favicon."))})).catch((function(error){growl.error(LOCALE.maketext("The system failed to remove the custom favicon."))})).finally((function(){$scope.saving=false}))}}]);return controller}));
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings