summaryrefslogtreecommitdiff
path: root/js/codeq/login.js
diff options
context:
space:
mode:
authorMarko Pušnik <marko.pusnik@guru.si>2015-10-20 17:39:04 +0200
committerMarko Pušnik <marko.pusnik@guru.si>2015-10-20 17:39:04 +0200
commit08e955335ecb65c308dbc68bf0610dce39ce3623 (patch)
tree8b9326f9e6a9c7d4cf5189efca83f56cf3961bd7 /js/codeq/login.js
parentcdfff9e0ab7fc26682218c5c694da4e9d0f4eea5 (diff)
- icons
- any state marker from the URL before everything else loads removed - settings dropdown separator visibility in case of saml login fixed - profile screen: - go back button refactored - name, email field - phone, browser and platform type detection (misc.js) added - mobile apps: - meta viewport and add HandheldFriendly changed - style @-ms-viewport defined - ajaxPrefix and eioHost temporary changed to dev server - android: phonegap whitelistening in config.xml fixed - ios: add hide status bar to config.xml TODO: - WP8 mobile app: test - iOS mobile app: saml login solution (iframe cross domain url not allowed) - "No Content-Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin."
Diffstat (limited to 'js/codeq/login.js')
-rw-r--r--js/codeq/login.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/js/codeq/login.js b/js/codeq/login.js
index 61f248d..db90b43 100644
--- a/js/codeq/login.js
+++ b/js/codeq/login.js
@@ -7,19 +7,21 @@
jqNavigationHomeBtn = $('#navigation-home'),
jqAAILoginBtn = $('#aai_login_button'),
jqSignupBtn = $('#signup_button'),
- jqSubmitLoginBtn = $("#submit");
+ jqSubmitLoginBtn = $("#submit"),
+ jqDisabled = $('#disabled');
//the loginCallbackFunction is used here and in the AAI login as well
codeq.loginCallbackFunction = function (data) {
- $('#disabled').css('display', 'none');
- $('#disabled').css('cursor', '');
+ jqDisabled.css('display', 'none');
+ jqDisabled.css('cursor', '');
if (data.code !== 0) throw new Error('Login failed, code: ' + data.code + ', message: ' + data.message);
//nav signed in...
- $('#signed-in-title').html(data.name||$('#username').val());
+ $('#signed-in-title').html(data.name||data.username||data.email||'undefined');
//merge with profile page
- $('#profileUsername').html($('#username').val());
+ $('#profileUsername').html(data.username||data.email||'undefined');
$('#profileName').html(data.name||'undefined');
+ $('#profileEmail').html(data.email||'undefined');
$('#profileJoined').html(new Date(data.joined).toLocaleString());
$('#profileLastLogin').html(new Date(data["last-login"]).toLocaleString());
@@ -42,19 +44,19 @@
var loginFun = function(){
$('.saml-login-hide').css('display','');//if we login the normal way we want to show the change password buttons. if we enter the saml login they will be hidden
- $('#disabled').css('display', '');
- $('#disabled').css('cursor', 'wait');
+ jqDisabled.css('display', '');
+ jqDisabled.css('cursor', 'wait');
codeq.comms.connect()
.then(function () {
return codeq.comms.login($('#username').val(), $('#password').val());
})
.then(codeq.loginCallbackFunction)
.fail(function (reason) {
- $('#disabled').css('display', 'none');
- $('#disabled').css('cursor', '');
+ jqDisabled.css('display', 'none');
+ jqDisabled.css('cursor', '');
codeq.log.error('Login failed: ' + reason, reason);
alert('Login request failed: ' + reason);
- $('#disabled').css('display', 'none');
+ jqDisabled.css('display', 'none');
})
.done();
},
@@ -85,7 +87,7 @@
});
//$('#modalLogIn').modal();
$("#screen_login").css('display', '');
- $('#disabled').css('display', 'none');
+ jqDisabled.css('display', 'none');
},
'exit' : function(){
//remove the listener from the buttons specific to this page