From 08e955335ecb65c308dbc68bf0610dce39ce3623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Pu=C5=A1nik?= Date: Tue, 20 Oct 2015 17:39:04 +0200 Subject: - 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." --- js/codeq/login.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'js/codeq/login.js') 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 -- cgit v1.2.1