This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

integrating train 2011.10.20

  • Loading branch information...
2 parents 03e2ab0 + fe2a041 commit ab0307daa7459a5907340c2d59dec304553010ea @lloyd lloyd committed Oct 27, 2011
Showing with 677 additions and 408 deletions.
  1. +18 −0 ChangeLog
  2. +20 −0 browserid/app.js
  3. +1 −1 browserid/compress.sh
  4. +0 −1 browserid/lib/email.js
  5. +13 −11 browserid/static/css/style.css
  6. +19 −18 browserid/static/dialog/controllers/authenticate_controller.js
  7. +3 −3 browserid/static/dialog/controllers/checkregistration_controller.js
  8. +4 −1 browserid/static/dialog/controllers/dialog_controller.js
  9. +36 −29 browserid/static/dialog/controllers/page_controller.js
  10. +4 −5 browserid/static/dialog/controllers/pickemail_controller.js
  11. +19 −7 browserid/static/dialog/css/m.css
  12. +47 −38 browserid/static/dialog/css/popup.css
  13. +17 −4 browserid/static/dialog/qunit.html
  14. +14 −14 browserid/static/dialog/resources/error-messages.js
  15. +20 −29 browserid/static/dialog/resources/user.js
  16. +6 −15 browserid/static/dialog/resources/wait-messages.js
  17. +146 −0 browserid/static/dialog/test/qunit/controllers/page_controller_unit_test.js
  18. +14 −5 browserid/static/dialog/test/qunit/qunit.js
  19. 0 browserid/static/dialog/test/qunit/{ → resources}/network_unit_test.js
  20. 0 browserid/static/dialog/test/qunit/{ → resources}/storage_unit_test.js
  21. +80 −57 browserid/static/dialog/test/qunit/{ → resources}/user_unit_test.js
  22. 0 browserid/static/dialog/test/qunit/{ → resources}/validation_unit_test.js
  23. +41 −65 browserid/static/dialog/views/authenticate.ejs
  24. +1 −1 browserid/static/dialog/views/confirmemail.ejs
  25. +41 −58 browserid/static/dialog/views/pickemail.ejs
  26. +2 −0 browserid/static/dialog/views/testBodyTemplate.ejs
  27. +6 −14 browserid/static/include.js
  28. +1 −1 browserid/static/js/pages/manage_account.js
  29. +15 −2 browserid/static/js/pages/signin.js
  30. +1 −0 browserid/static/js/pages/signup.js
  31. +3 −3 browserid/views/about.ejs
  32. +32 −10 browserid/views/dialog.ejs
  33. +1 −1 browserid/views/index.ejs
  34. +1 −1 browserid/views/privacy.ejs
  35. +1 −1 browserid/views/verifyuser.ejs
  36. +1 −1 rp/index.html
  37. +4 −4 verifier/app.js
  38. +45 −8 verifier/lib/certassertion.js
View
@@ -1,3 +1,21 @@
+train-2011.10.20:
+ * android < 3.0 now supported: #461
+ * properly set assertion expiration time to when they expire, not when they're issued: #433, #457, #458
+ * update privacy policy language to jive with new UI: #381
+ * add redirects for old URLs that no longer exist with the new UI: #376
+ * inside the minified include.js, link to uncompressed version for developer convenience and discovery: #432
+ * language tweaks: #437, #444
+ * improve button UI appearance on opera and IE: #435
+ * improve visual feedback for links: #440
+ * UI fixes for > 2 email addresses on iOS: #417
+ * smooth out screen transitions in dialog: #369
+ * improved "check your email" screen on mobile: #462
+ * no auto-caps nor auto-correct for iOS in add email field: #464
+ * improve event listening on input fields: #406
+ * remember email when moving user from signup to sign-in for known email address: #108
+ * don't call sync_emails more than necessary: #434
+ * assertions now include full origin (scheme+host+port). verifier accepts only host+port OR full origin, and returns whatever RP sends for back compat: #82
+
train-2011.10.13:
* fix verification of email in different browser than where verification is initiated: #336
* Android < 3.0 (browsers that can't handle JSON.parse("null")) now blocked explicitly (until we complete support)
View
@@ -137,6 +137,26 @@ function router(app) {
res.render('verifyemail.ejs', {title: 'Verify Email Address', fullpage: false});
});
+ // REDIRECTS
+ REDIRECTS = {
+ "/manage": "/",
+ "/users": "/",
+ "/users/": "/",
+ "/primaries" : "/developers",
+ "/primaries/" : "/developers",
+ "/developers" : "https://github.com/mozilla/browserid/wiki/How-to-Use-BrowserID-on-Your-Site"
+ };
+
+ // set up all the redirects
+ // oh my watch out for scope issues on var url - closure time
+ for (var url in REDIRECTS) {
+ (function(from,to) {
+ app.get(from, function(req, res) {
+ res.redirect(to);
+ });
+ })(url, REDIRECTS[url]);
+ }
+
// register all the WSAPI handlers
wsapi.setup(app);
View
@@ -20,7 +20,7 @@ echo ''
cd static
mv include.js include.orig.js
-$UGLIFY -nc include.orig.js > include.js
+$UGLIFY include.orig.js > include.js
echo ''
echo '****Building dialog HTML, CSS, and JS****'
View
@@ -44,7 +44,6 @@ logger = require('../../libs/logging.js').logger;
/* if smtp parameters are configured, use them */
var smtp_params = config.get('smtp');
-console.log("SMTP", smtp_params);
if (smtp_params && smtp_params.host) {
emailer.SMTP = { host: smtp_params.host };
logger.info("delivering email via SMTP host: " + emailer.SMTP.host);
@@ -79,7 +79,7 @@ a {
text-decoration: none;
}
-a:hover {
+a:hover, button:hover, input[type=submit]:hover {
text-decoration: underline;
}
@@ -315,10 +315,6 @@ div.steps {
border-radius: 5px;
}
-#manage .edit a:hover {
- text-decoration: none;
-}
-
#manageAccounts {
background-color: #37A6FF;
border: 1px solid #37A6FF;
@@ -330,7 +326,8 @@ div.steps {
-o-box-shadow: 0 0 0 1px #76C2FF inset;
box-shadow: 0 0 0 1px #76C2FF inset;
- background-image: -moz-linear-gradient(center top , #76C2FF 0pt, #37A6FF 100%);
+ background-image: -moz-linear-gradient(#76C2FF 0pt, #37A6FF 100%);
+ background-image: -o-linear-gradient(#76C2FF 0pt, #37A6FF 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #76C2FF), color-stop(100%, #37A6FF));
}
@@ -346,7 +343,8 @@ div.steps {
-o-box-shadow: 0 0 5px #003763 inset;
box-shadow: 0 0 5px #003763 inset;
- background-image: -moz-linear-gradient(center top , #3AA7FF 0%, #006EC6 100%);
+ background-image: -moz-linear-gradient(#3AA7FF 0%, #006EC6 100%);
+ background-image: -o-linear-gradient(#3AA7FF 0%, #006EC6 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #3AA7FF), color-stop(100%, #006EC6));
}
@@ -402,7 +400,7 @@ div.steps {
}
button.delete {
- background-color: #37A6FF;
+ background-color: #EA7676;
height: 24px;
vertical-align: middle;
border: 1px solid #B13D3D;
@@ -423,7 +421,8 @@ button.delete {
-o-border-radius: 5px;
border-radius: 5px;
- background-image: -moz-linear-gradient(center top , #EA7676 0pt, #C84343 100%);
+ background-image: -moz-linear-gradient(#EA7676 0%, #C84343 100%);
+ background-image: -o-linear-gradient(#EA7676 0%, #C84343 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #EA7676), color-stop(100%, #C84343));
}
@@ -439,6 +438,7 @@ button.delete:active {
box-shadow: 0 0 5px #003763 inset;
background-image: -moz-linear-gradient(center top , #C84343 0%, #AA3D3D 100%);
+ background-image: -o-linear-gradient(#C84343 0%, #AA3D3D 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #C84343), color-stop(100%, #AA3D3D));
}
@@ -508,7 +508,8 @@ h1 {
-o-border-radius: 5px;
border-radius: 5px;
- background-image: -moz-linear-gradient(center top , #76C2FF 0pt, #37A6FF 100%);
+ background-image: -moz-linear-gradient(#76C2FF 0pt, #37A6FF 100%);
+ background-image: -o-linear-gradient(#76C2FF 0pt, #37A6FF 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #76C2FF), color-stop(100%, #37A6FF));
}
@@ -523,7 +524,8 @@ h1 {
-o-box-shadow: 0 0 5px #003763 inset;
box-shadow: 0 0 5px #003763 inset;
- background-image: -moz-linear-gradient(center top , #3AA7FF 0%, #006EC6 100%);
+ background-image: -moz-linear-gradient(#3AA7FF 0%, #006EC6 100%);
+ background-image: -o-linear-gradient(#3AA7FF 0%, #006EC6 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #3AA7FF), color-stop(100%, #006EC6));
}
@@ -40,20 +40,21 @@
var ANIMATION_TIME = 250,
bid = BrowserID,
user = bid.User,
- validation = bid.Validation;
+ validation = bid.Validation,
+ lastEmail = "";
function checkEmail(el, event) {
var email = $("#email").val(),
self = this;
cancelEvent(event);
- if(!validation.email(email)) {
+ if (!validation.email(email)) {
return;
}
user.isEmailRegistered(email, function onComplete(registered) {
- if(registered) {
+ if (registered) {
enterPasswordState.call(self);
}
else {
@@ -68,12 +69,12 @@
cancelEvent(event);
- if(!validation.email(email)) {
+ if (!validation.email(email)) {
return;
}
user.createUser(email, function(keypair) {
- if(keypair) {
+ if (keypair) {
self.close("user_staged", {
email: email,
keypair: keypair
@@ -92,16 +93,11 @@
cancelEvent(event);
- if(!validation.emailAndPassword(email, pass)) {
+ if (!validation.emailAndPassword(email, pass)) {
return;
}
- user.authenticateAndSync(email, pass,
- function onAuthenticate(authenticated) {
- if (authenticated) {
- self.doWait(bid.Wait.authentication);
- }
- },
+ user.authenticate(email, pass,
function onComplete(authenticated) {
if (authenticated) {
self.close("authenticated", {
@@ -145,7 +141,7 @@
}
function enterEmailState(el, event) {
- if(event && event.which === 13) {
+ if (event && event.which === 13) {
// Enter key, do nothing
return;
}
@@ -193,24 +189,29 @@
init: function(el, options) {
options = options || {};
- this._super({
+ this._super(el, {
bodyTemplate: "authenticate.ejs",
bodyVars: {
- sitename: user.getOrigin(),
- siteicon: "/i/times.gif",
+ sitename: user.getHostname(),
email: options.email || ""
}
});
this.submit = checkEmail;
// If we already have an email address, check if it is valid, if so, show
// password.
- if(options.email) {
+ if (options.email) {
this.submit();
}
},
- "#email keyup": enterEmailState,
+ "#email keyup": function(el, event) {
+ var newEmail = el.val();
+ if (newEmail !== lastEmail) {
+ lastEmail = newEmail;
+ enterEmailState.call(this, el);
+ }
+ },
"#forgotPassword click": forgotPasswordState,
"#cancel_forgot_password click": cancelForgotPassword
});
@@ -42,9 +42,9 @@
PageController.extend("Checkregistration", {}, {
init: function(el, options) {
var me=this;
- me._super({
- bodyTemplate: "confirmemail.ejs",
- bodyVars: {
+ me._super(el, {
+ waitTemplate: "confirmemail.ejs",
+ waitVars: {
email: options.email
}
});
@@ -61,6 +61,9 @@
this.onerror = onerror;
user.setOrigin(origin_url);
+
+ // get the cleaned origin.
+ $("#sitename").text(user.getHostname());
this.doCheckAuth();
@@ -207,7 +210,7 @@
user.checkAuthenticationAndSync(function onSuccess() {},
function onComplete(authenticated) {
if (authenticated) {
- self.doPickEmail();
+ self.doPickEmail();
} else {
self.doAuthenticate();
}
@@ -42,13 +42,23 @@
$.Controller.extend("PageController", {
}, {
- init: function(options) {
+ init: function(el, options) {
+ options = options || {};
+
var me=this,
bodyTemplate = options.bodyTemplate,
- bodyVars = options.bodyVars;
+ bodyVars = options.bodyVars,
+ waitTemplate = options.waitTemplate,
+ waitVars = options.waitVars;
- me.renderTemplates(bodyTemplate, bodyVars);
+ if(bodyTemplate) {
+ me.renderDialog(bodyTemplate, bodyVars);
+ }
+
+ if(waitTemplate) {
+ me.renderWait(waitTemplate, waitVars);
+ }
// XXX move all of these, bleck.
$("form").bind("submit", me.onSubmit.bind(me));
@@ -69,18 +79,32 @@
this._super();
},
- renderTemplates: function(body, body_vars) {
-
+ renderTemplates: function(target, body, body_vars) {
if (body) {
var bodyHtml = $.View("//dialog/views/" + body, body_vars);
- var form = $("#formWrap > form");
- form.html(bodyHtml).hide().fadeIn(ANIMATION_TIME, function() {
- $("body").removeClass("waiting");
- form.find("input").eq(0).focus();
- });
+ target = $(target + " .contents");
+ target.html(bodyHtml).find("input").eq(0).focus();
}
},
+ renderDialog: function(body, body_vars) {
+ this.renderTemplates("#formWrap", body, body_vars);
+ $("body").removeClass("error").removeClass("waiting").addClass("form");
+ $("#wait, #error").stop().fadeOut(ANIMATION_TIME);
+ },
+
+ renderWait: function(body, body_vars) {
+ this.renderTemplates("#wait", body, body_vars);
+ $("body").removeClass("error").removeClass("form").addClass("waiting");
+ $("#wait").stop().css('opacity', 1).hide().fadeIn(ANIMATION_TIME);
+ },
+
+ renderError: function(error_vars) {
+ this.renderTemplates("#error", "wait.ejs", error_vars);
+ $("body").removeClass("waiting").removeClass("form").addClass("error");
+ $("#error").stop().css('opacity', 1).hide().fadeIn(ANIMATION_TIME);
+ },
+
onSubmit: function(event) {
event.stopPropagation();
event.preventDefault();
@@ -100,7 +124,7 @@
},
doWait: function(info) {
- this.renderTemplates("wait.ejs", {title: info.message, message: info.description});
+ this.renderWait("wait.ejs", info);
$("body").addClass("waiting");
},
@@ -112,23 +136,6 @@
}
},
- /**
- * Immediately show the error dialog
- * @method errorDialog
- * @param {object} info - info to use for the error dialog. Should have
- * two fields, message, description.
- */
- errorDialog: function(info) {
- $("form").hide();
-
- $("#error_dialog .title").text(info.message);
- $("#error_dialog .content").text(info.description);
-
- $("body").removeClass("authenticated").addClass("error");
-
- $("#error_dialog").fadeIn(ANIMATION_TIME);
- },
-
/**
* Get a curried function to an error dialog.
* @method getErrorDialog
@@ -137,7 +144,7 @@
*/
getErrorDialog: function(info) {
var self=this;
- return self.errorDialog.bind(self, info);
+ return self.renderError.bind(self, info);
},
onCancel: function(event) {
Oops, something went wrong.

0 comments on commit ab0307d

Please sign in to comment.