diff --git a/browserid/static/dialog/controllers/authenticate_controller.js b/browserid/static/dialog/controllers/authenticate_controller.js index b5d297d073a1c7ed5fc8485be006cc9ed2e750c4..5b25d8094c4b4a5b405cd8d7bd1bbfb8814fcfa0 100644 --- a/browserid/static/dialog/controllers/authenticate_controller.js +++ b/browserid/static/dialog/controllers/authenticate_controller.js @@ -37,11 +37,10 @@ (function() { "use strict"; - var ANIMATION_TIME = 250; - // XXX this needs changed so that the create account/authenticate flow is - // cleaner. Right now we are trying to authenticate on every "enter" press, - // this is no good. - var network = BrowserIDNetwork, + // XXX - Push what we can of BrowserIDNetwork into BrowserIDIdentities. + + var ANIMATION_TIME = 250, + network = BrowserIDNetwork, identities = BrowserIDIdentities; function animateSwap(fadeOutSelector, fadeInSelector, callback) { @@ -97,6 +96,7 @@ self = this; if(!email) { + // XXX error screen return; } @@ -124,6 +124,7 @@ email = $("#email").val(); if(!email) { + // XXX error screen return; } @@ -146,6 +147,7 @@ self = this; if(!(email && pass)) { + // XXX error screen return; } @@ -153,13 +155,16 @@ function onAuthenticate(authenticated) { if (authenticated) { self.doWait(BrowserIDWait.authentication); + } + else { + // XXX error screen } }, function onComplete(authenticated) { if (authenticated) { self.close("authenticated"); } else { - //self.find("#cannot_authenticate").hide().fadeIn(400); + // XXX error screen. } }, self.getErrorDialog(BrowserIDErrors.authentication) @@ -176,6 +181,9 @@ email: email }); } + else { + // XXX error screen. + } }, function onFailure() { }); diff --git a/browserid/static/dialog/controllers/checkregistration_controller.js b/browserid/static/dialog/controllers/checkregistration_controller.js index 8e86c5d04cc1b7f4f968a8604a1d6ab5c9da0559..6db72dc1d25e68ab6abc8b13772f0d5843ab29b3 100644 --- a/browserid/static/dialog/controllers/checkregistration_controller.js +++ b/browserid/static/dialog/controllers/checkregistration_controller.js @@ -1,5 +1,5 @@ /*jshint browser:true, jQuery: true, forin: true, laxbreak:true */ -/*global BrowserIDNetwork: true, BrowserIDWait:true, BrowserIDErrors: true, PageController: true */ +/*global BrowserIDIdentities: true, BrowserIDNetwork: true, BrowserIDErrors: true, PageController: true */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -54,6 +54,8 @@ setupRegCheck: function() { // Try this every 3 seconds until registration is good. + // XXX push this polling into BrowserIDIdentities and then we + // can get rid of the dependency on BrowserIDNetwork var me=this, poll = function() { BrowserIDNetwork[me.verifier](me.email, function(status) { diff --git a/browserid/static/dialog/controllers/pickemail_controller.js b/browserid/static/dialog/controllers/pickemail_controller.js index 893fa3a3c656ff89c79a5a9289843b87f34d9f50..f31b038c81abf4b97b97c8edc65070063b6bb1d4 100644 --- a/browserid/static/dialog/controllers/pickemail_controller.js +++ b/browserid/static/dialog/controllers/pickemail_controller.js @@ -71,7 +71,7 @@ addEmail: function() { var email = $("#newEmail").val(), - me=this;; + me=this; if (email) { BrowserIDIdentities.addEmail(email, function(keypair) {