From 112ec25e5a2126578b670921614ab2857e473adb Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 18 Feb 2016 16:08:33 +0100 Subject: Translate and improve "login failed" message --- js/codeq/login.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'js') diff --git a/js/codeq/login.js b/js/codeq/login.js index 79371be..5f6aa4c 100644 --- a/js/codeq/login.js +++ b/js/codeq/login.js @@ -28,12 +28,12 @@ along with this program. If not, see . */ jqSignupBtn = $('#signup_button'), jqSubmitLoginBtn = $("#submit"), jqLangSelect = jqScreen.find('.lang-select'), - jqDisabledOverlay = $('#disabled'); + jqDisabledOverlay = $('#disabled'), + jqLoginFailed = jqScreen.find('.login-failed'); //the loginCallbackFunction is used here and in the AAI login as well codeq.loginCallbackFunction = function (data) { jqDisabledOverlay.css('display', 'none'); - jqDisabledOverlay.css('cursor', ''); if (data.code !== 0) throw new Error('Login failed, code: ' + data.code + ', message: ' + data.message); //nav signed in... @@ -62,18 +62,14 @@ along with this program. If not, see . */ }; var loginFun = function(){ - jqDisabledOverlay.css('display', ''); - jqDisabledOverlay.css('cursor', 'wait'); + jqLoginFailed.hide(); codeq.comms.connect() .then(function () { return codeq.comms.login($('#username').val(), $('#password').val()); }) .then(codeq.loginCallbackFunction) .fail(function (reason) { - jqDisabledOverlay.css('display', 'none'); - jqDisabledOverlay.css('cursor', ''); - codeq.log.error('Login failed: ' + reason); - alert('Login request failed: ' + reason); + jqLoginFailed.show(); }) .done(); }, @@ -85,6 +81,7 @@ along with this program. If not, see . */ 'enter': function(){ jqNavigationHomeBtn.off('click');//remove the click listener of this element here jqNavBarRight.css('display','none');//hide settings etc. + jqLoginFailed.hide(); $('#signed-in-title').html(''); codeq.samlLogin = false;//remove saml login flag @@ -132,6 +129,7 @@ along with this program. If not, see . */ e.preventDefault(); }); jqNavBarRight.css('display',''); + jqLoginFailed.hide(); } }); })(); -- cgit v1.2.1