From f12de62b41dba98203899144d8a3dd6e60885905 Mon Sep 17 00:00:00 2001
From: Shane Tomlinson <stomlinson@mozilla.com>
Date: Wed, 28 Sep 2011 13:10:49 +0100
Subject: [PATCH] Getting rid of jshint errors, adding XXX todos.

---
 .../controllers/authenticate_controller.js    | 20 +++++++++++++------
 .../checkregistration_controller.js           |  4 +++-
 .../controllers/pickemail_controller.js       |  2 +-
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/browserid/static/dialog/controllers/authenticate_controller.js b/browserid/static/dialog/controllers/authenticate_controller.js
index b5d297d07..5b25d8094 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 8e86c5d04..6db72dc1d 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 893fa3a3c..f31b038c8 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) {
-- 
GitLab