1(function() { 2 'use strict'; 3 4 angular.module('irk') 5 .controller('LogowanieController', LogowanieController); 6 7 function LogowanieController($http, $scope, $rootScope, $compile, 8 $document, AUTH_EVENTS, AuthService, vcRecaptchaService, toaster, 9 $location, i18n) { 10 $scope.resetUser = function() { 11 $scope.daneLogowania = { 12 email : '', 13 haslo : '', 14 recaptcha : '' 15 }; 16 } 17 18 $scope.reset = function() { 19 $scope.resetUser(); 20 resetPasswordField(); 21 vcRecaptchaService.reload(); 22 } 23 24 $scope.resetUser(); 25 26 var resetPasswordField = function() { 27 var passwordField = document.getElementById("inputPassword"); 28 var eyeIcon = document.getElementById("eye-icon"); 29 passwordField.type = "password"; 30 eyeIcon.classList.remove("glyphicon-eye-open"); 31 eyeIcon.classList.add("glyphicon-eye-close"); 32 }; 33 34 $scope.togglePassword = function() { 35 var passwordField = document.getElementById("inputPassword"); 36 var eyeIcon = document.getElementById("eye-icon"); 37 if(passwordField.type === "password") { 38 passwordField.type = "text"; 39 eyeIcon.classList.remove("glyphicon-eye-close"); 40 eyeIcon.classList.add("glyphicon-eye-open"); 41 } else { 42 passwordField.type = "password"; 43 eyeIcon.classList.remove("glyphicon-eye-open"); 44 eyeIcon.classList.add("glyphicon-eye-close"); 45 } 46 }; 47 48 var loginSuccess = function(result) { 49 $rootScope.$broadcast(AUTH_EVENTS.loginSuccess); 50 i18n.get('enum.pl.verbis.irk.web.rest.srv.login.RodzajWynikuLogowania.'+result).then(function(komunikat) { 51 toaster.pop('success', komunikat); 52 }); 53 if ($rootScope.routeAfterLogin) { 54 $location.path($rootScope.routeAfterLogin.originalPath).replace(); 55 $rootScope.routeAfterLogin = null; 56 } else { 57 58 $location.path('/StronaGlowna'); 59 } 60 }; 61 62 var loginError = function(result) { 63 i18n.get('enum.pl.verbis.irk.web.rest.srv.login.RodzajWynikuLogowania.'+result).then(function(komunikat) { 64 toaster.pop('error', komunikat); 65 }); 66 $rootScope.$broadcast(AUTH_EVENTS.loginFailed); 67 }; 68 69 var loginFinally = function() { 70 $scope.reset(); 71 }; 72 73 $scope.login = function(daneLogowania) { 74 AuthService 75 .login(daneLogowania) 76 .then(loginSuccess, loginError)['finally'](loginFinally); 77 }; 78 79 $scope.setResponse = function(response) { 80 $scope.daneLogowania.recaptcha = response; 81 }; 82 angular.element( document.getElementById( 'inputPassword' ) ).triggerHandler('input'); 83 84 } 85})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.