From 5369be0397de16464d4394c08b2620fadcdb8dca Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 23 Apr 2013 21:13:01 -0400 Subject: [PATCH] timing out reset codes, enhancing template replace so that a single placeholder can be used multiple times --- public/templates/reset.tpl | 2 +- public/templates/reset_code.tpl | 27 ++++++-- src/templates.js | 3 +- src/user.js | 106 ++++++++++++++++++-------------- src/websockets.js | 8 ++- 5 files changed, 91 insertions(+), 55 deletions(-) diff --git a/public/templates/reset.tpl b/public/templates/reset.tpl index 9952287f4d..17c974c883 100644 --- a/public/templates/reset.tpl +++ b/public/templates/reset.tpl @@ -21,7 +21,7 @@ document.getElementById('reset').onclick = function() { if (inputEl.value.length > 0 && inputEl.value.indexOf('@') !== -1) { - socket.emit('user.send_reset', { email: inputEl.value }); + socket.emit('user:reset.send', { email: inputEl.value }); } else { jQuery('#success').hide(); jQuery(errorEl).show(); diff --git a/public/templates/reset_code.tpl b/public/templates/reset_code.tpl index ca5d63c8ff..8e480b5ea3 100644 --- a/public/templates/reset_code.tpl +++ b/public/templates/reset_code.tpl @@ -5,10 +5,16 @@ Password Changed

-
-
- - + +
+
+
+ + +