diff --git a/authority/server/wsapi.js b/authority/server/wsapi.js index e85187e29591f612af3c2962fc4ae8aae6ea3b2a..ed7549d4c5e6bc4fdb3bda009a4b8cf0a7fb1eb7 100644 --- a/authority/server/wsapi.js +++ b/authority/server/wsapi.js @@ -9,8 +9,7 @@ exports.have_email = function(req, resp) { console.log("have_email for " + email + ": " + haveit); - // 200 means we have the email, 404 means no - resp.writeHead(haveit ? 200 : 404, {"Content-Type": "application/json"}); + resp.writeHead(200, {"Content-Type": "application/json"}); resp.write(JSON.stringify(haveit)); resp.end(); }; \ No newline at end of file diff --git a/authority/static/dialog/index.html b/authority/static/dialog/index.html index df94498c4bc19608b9bf38979dee325c81ec7a07..fc3dadfc3f5001dee57c1cdbba1e7786b9c0a9a6 100644 --- a/authority/static/dialog/index.html +++ b/authority/static/dialog/index.html @@ -70,10 +70,6 @@ <form id="identities" name="identities"> </form> </div> - <div id="logo"><img src="mozilla.png"></div> -</div> -<div id="create_dialog" class="dialog"> -zxcvzxcvHI MOM </div> <div id="bottom-bar"> <button id="back">Go Back</button> diff --git a/authority/static/dialog/main.js b/authority/static/dialog/main.js index c3d3debacbafff2c1dd33a2eac4934fb5c4a28e4..72ff2f6f702937ae89c906d1e7444bac828e84bb 100644 --- a/authority/static/dialog/main.js +++ b/authority/static/dialog/main.js @@ -125,6 +125,7 @@ // check the email address var email = $("#create_dialog input:eq(0)").val(); + $("#create_dialog div.note:eq(0)").empty(); if (typeof email === 'string' && email.length) { var valid = checkedEmails[email]; if (typeof valid === 'boolean') { @@ -139,19 +140,23 @@ if (emailCheckState !== 'querying') { if (emailCheckState) window.clearTimeout(emailCheckState); emailCheckState = setTimeout(function() { - // XXX: this is where we should actually bounce off the server and enter the 'querying' state - // for now, we just call it valid - checkedEmails[nextEmailToCheck] = true; - emailCheckState = undefined; - checkInput(); - }, 500); + emailCheckState = 'querying'; + var checkingNow = nextEmailToCheck; + // bounce off the server and enter the 'querying' state + $.get('/wsapi/have_email?email=' + encodeURIComponent(checkingNow), null, + function(data, textStatus, jqXHR) { + checkedEmails[checkingNow] = !JSON.parse(data); + emailCheckState = undefined; + checkInput(); + }); + }, 700); + } else { + $("#create_dialog div.note:eq(0)").html($('<span class="warning"/>').text("Checking address")); } nextEmailToCheck = email; $("#submit").addClass("disabled"); - $("#create_dialog div.note:eq(0)").html($('<span class="warning"/>').text("Checking address")); } } else { - $("#create_dialog div.note:eq(0)").empty(); $("#submit").addClass("disabled"); } @@ -228,7 +233,4 @@ }); } }); - - $(".sitename").text("somesite.com"); - runSignInDialog(); })(); \ No newline at end of file