summaryrefslogtreecommitdiffstats
path: root/projecttemplates/WebFormsRelyingParty
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-10-18 21:42:30 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-10-18 21:42:30 -0700
commit3dd3bf46f212e3bef1541465a01cbe1a1c646598 (patch)
tree9c5709404e0beec9d9c3774b0eaf36457471a761 /projecttemplates/WebFormsRelyingParty
parentd45e6b85b3b85d8043b117f85daef57213031184 (diff)
downloadDotNetOpenAuth-3dd3bf46f212e3bef1541465a01cbe1a1c646598.zip
DotNetOpenAuth-3dd3bf46f212e3bef1541465a01cbe1a1c646598.tar.gz
DotNetOpenAuth-3dd3bf46f212e3bef1541465a01cbe1a1c646598.tar.bz2
Fixed up OpenID OP button to behave (almost) like the others in terms of clicking on it causing the final "login" for the user to happen.
Diffstat (limited to 'projecttemplates/WebFormsRelyingParty')
-rw-r--r--projecttemplates/WebFormsRelyingParty/scripts/LoginPopup.js21
1 files changed, 18 insertions, 3 deletions
diff --git a/projecttemplates/WebFormsRelyingParty/scripts/LoginPopup.js b/projecttemplates/WebFormsRelyingParty/scripts/LoginPopup.js
index 38b7d77..8e6019a 100644
--- a/projecttemplates/WebFormsRelyingParty/scripts/LoginPopup.js
+++ b/projecttemplates/WebFormsRelyingParty/scripts/LoginPopup.js
@@ -24,13 +24,25 @@
}
}
- function showLoginSuccess(userSuppliedIdentifier) {
+ function showLoginSuccess(userSuppliedIdentifier, hide) {
var li = document.getElementById(userSuppliedIdentifier);
if (li) {
- $(li).addClass('loginSuccess');
+ if (hide) {
+ $(li).removeClass('loginSuccess');
+ } else {
+ $(li).addClass('loginSuccess');
+ }
}
}
+ ajaxbox.onStateChanged = function(state) {
+ if (state == "authenticated") {
+ showLoginSuccess('OpenIDButton');
+ } else {
+ showLoginSuccess('OpenIDButton', true); // hide checkmark
+ }
+ };
+
function checkidSetup(identifier, timerBased) {
var retain = !$('#NotMyComputer')[0].selected;
$.cookie('openid_identifier', retain ? identifier : null, { path: '/' });
@@ -86,7 +98,10 @@
// If the user clicked on a button that has the "we're ready to log you in immediately",
// then log them in!
if ($(this).hasClass('loginSuccess')) {
- doLogin($(this)[0].id);
+ // Don't immediately login if the user clicked OpenID and he can't see the identifier box.
+ if ($(this)[0] != $('#OpenIDButton')[0] || $('#OpenIDForm').is(':visible')) {
+ doLogin($(this)[0].id);
+ }
} else if ($(this)[0] != $('#OpenIDButton')[0]) {
// Be sure to hide the openid_identifier text box unless the OpenID button is selected.
checkidSetup($(this)[0].id);