summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-02-18 16:08:33 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-02-18 16:08:33 +0100
commit112ec25e5a2126578b670921614ab2857e473adb (patch)
treeb41550a04033298c68e7baeb9423e0f105d10510 /js
parent0bd77f137dfcdcec2d9fd14926c5c85961c2b23a (diff)
Translate and improve "login failed" message
Diffstat (limited to 'js')
-rw-r--r--js/codeq/login.js14
1 files changed, 6 insertions, 8 deletions
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 <http://www.gnu.org/licenses/>. */
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 <http://www.gnu.org/licenses/>. */
};
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 <http://www.gnu.org/licenses/>. */
'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 <http://www.gnu.org/licenses/>. */
e.preventDefault();
});
jqNavBarRight.css('display','');
+ jqLoginFailed.hide();
}
});
})();