diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-14 08:10:20 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-14 08:10:20 -0700 |
commit | 36af9b48010a71be8b8dd128ccf10dc8c4e69b7c (patch) | |
tree | 58033f5b56430998923a6012ea9109b83fef0479 /projecttemplates/WebFormsRelyingParty/scripts | |
parent | d2d1d028b420408da361b7607a079e8ba0eb14a4 (diff) | |
download | DotNetOpenAuth-36af9b48010a71be8b8dd128ccf10dc8c4e69b7c.zip DotNetOpenAuth-36af9b48010a71be8b8dd128ccf10dc8c4e69b7c.tar.gz DotNetOpenAuth-36af9b48010a71be8b8dd128ccf10dc8c4e69b7c.tar.bz2 |
Optimization to avoid repeated searches for the openid_identifier control.
Diffstat (limited to 'projecttemplates/WebFormsRelyingParty/scripts')
-rw-r--r-- | projecttemplates/WebFormsRelyingParty/scripts/LoginPopup.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/projecttemplates/WebFormsRelyingParty/scripts/LoginPopup.js b/projecttemplates/WebFormsRelyingParty/scripts/LoginPopup.js index 957d7e2..5bde5a3 100644 --- a/projecttemplates/WebFormsRelyingParty/scripts/LoginPopup.js +++ b/projecttemplates/WebFormsRelyingParty/scripts/LoginPopup.js @@ -1,12 +1,13 @@ $(function() { - $('#openid_identifier')[0].value = $.cookie('openid_identifier') || ''; + var ajaxbox = $('#openid_identifier')[0]; + ajaxbox.value = $.cookie('openid_identifier') || ''; - if ($('#openid_identifier')[0].value.length > 0) { + if (ajaxbox.value.length > 0) { var ops = $('ul.OpenIdProviders li'); ops.addClass('grayedOut'); var matchFound = false; ops.each(function(i, li) { - if (li.id == $('#openid_identifier')[0].value) { + if (li.id == ajaxbox.value) { $(li) .removeClass('grayedOut') .addClass('focused'); @@ -54,7 +55,7 @@ }); }); $('#OpenIdLoginButton').click(function() { - doLogin($('#openid_identifier')[0].value); + doLogin(ajaxbox.value); }); // Make popup window close on escape (the dialog style is already taken care of) @@ -70,7 +71,7 @@ } var rate = NaN; - var lastValue = $('#openid_identifier')[0].value; + var lastValue = ajaxbox.value; var keyPresses = 0; var startTime = null; var lastKeyPress = null; @@ -90,7 +91,7 @@ function discover() { cancelTimer(); - var id = $('#openid_identifier')[0].value; + var id = ajaxbox.value; log(id + ": discover() invoked"); if (identifierSanityCheck(id)) { log(id + ": discovering"); @@ -136,7 +137,7 @@ if (e.keyCode == $.ui.keyCode.ENTER) { discover(); } else { - var newValue = $('#openid_identifier')[0].value; + var newValue = ajaxbox.value; if (lastValue != newValue) { if (newValue.length == 0) { reset(); |