X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=validation.git;a=blobdiff_plain;f=ui%2Fsrc%2Fmain%2Fwebapp%2Fresources%2Fjs%2FCommonController.js;fp=ui%2Fsrc%2Fmain%2Fwebapp%2Fresources%2Fjs%2FCommonController.js;h=0000000000000000000000000000000000000000;hp=dda7718123243600eef738a0609c86517737ca45;hb=2879b2ee5e1e2815e5f43cb802352bf2878397af;hpb=ce4ad29dc48317cc7cb60fe433072ac46dea2ebb diff --git a/ui/src/main/webapp/resources/js/CommonController.js b/ui/src/main/webapp/resources/js/CommonController.js deleted file mode 100644 index dda7718..0000000 --- a/ui/src/main/webapp/resources/js/CommonController.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var AECBlueprintValidationUIApp = angular - .module('BlueprintValidationUIManagement'); - -AECBlueprintValidationUIApp.controller('CommonController', function($scope, - $http, $sce, ngDialog, $filter, $rootScope, $state, $templateCache) { - $scope.errorHandle = function(error) { - if (error.status == 400) { - localStorage.removeItem("tokenId"); - $state.transitionTo('login'); - localStorage.removeItem("tokenId"); - $rootScope.message = 'Session Invalid, please login again...'; - } else if (error.status == 401) { - localStorage.removeItem("tokenId"); - $state.transitionTo('login'); - $rootScope.message = 'Invalid Credentials, please try again...'; - } else if (error.status == 307) { - localStorage.removeItem("tokenId"); - $state.transitionTo('login'); - $rootScope.message = 'Session expired,Please try again...'; - } - } - - $scope.$on('onBeforeUnload', function(e, confirmation) { - var e2 = e || window.event; - if (e2) { - confirmation.message = "All data willl be lost."; - e2.preventDefault(); - } - }); - $scope.$on('onUnload', function() { - $templateCache.removeAll(); - }); - - $scope.cmp = function(x, y) { - return x > y ? 1 : x < y ? -1 : 0; - }; - -}); \ No newline at end of file