From eb719ddd586c61d1d99030d1bb1a201b29aa91cf Mon Sep 17 00:00:00 2001 From: Kevin Bennett Date: Fri, 27 Mar 2015 15:22:48 +0800 Subject: [PATCH] removed ids on forms and scoped all jquery finds to template --- client/views/enrollAccount/enrollAccount.coffee | 4 ++-- client/views/enrollAccount/enrollAccount.html | 2 +- client/views/forgotPassword/forgotPassword.coffee | 4 ++-- client/views/forgotPassword/forgotPassword.html | 2 +- client/views/resetPassword/resetPassword.coffee | 4 ++-- client/views/resetPassword/resetPassword.html | 2 +- client/views/signIn/signIn.coffee | 6 +++--- client/views/signIn/signIn.html | 2 +- client/views/signUp/signUp.coffee | 2 +- client/views/signUp/signUp.html | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/client/views/enrollAccount/enrollAccount.coffee b/client/views/enrollAccount/enrollAccount.coffee index 1e5bc725..a8e5aab1 100644 --- a/client/views/enrollAccount/enrollAccount.coffee +++ b/client/views/enrollAccount/enrollAccount.coffee @@ -6,9 +6,9 @@ Template.entryEnrollAccount.helpers Template.entryEnrollAccount.events - 'submit #setPassword': (event) -> + 'submit form.set-password': (event, template) -> event.preventDefault() - password = $('input[type="password"]').val() + password = template.$('input[type="password"]').val() passwordErrors = do (password)-> errMsg = [] diff --git a/client/views/enrollAccount/enrollAccount.html b/client/views/enrollAccount/enrollAccount.html index f7075583..e883d064 100644 --- a/client/views/enrollAccount/enrollAccount.html +++ b/client/views/enrollAccount/enrollAccount.html @@ -11,7 +11,7 @@
{{error}}
{{/if}}

{{t9n "choosePassword"}}

-
+
diff --git a/client/views/forgotPassword/forgotPassword.coffee b/client/views/forgotPassword/forgotPassword.coffee index 8413b504..86ea6f0b 100644 --- a/client/views/forgotPassword/forgotPassword.coffee +++ b/client/views/forgotPassword/forgotPassword.coffee @@ -5,9 +5,9 @@ Template.entryForgotPassword.helpers AccountsEntry.settings.logo Template.entryForgotPassword.events - 'submit #forgotPassword': (event) -> + 'submit form.forgot-password': (event, template) -> event.preventDefault() - Session.set('email', $('input[name="forgottenEmail"]').val()) + Session.set('email', template.$('input[name="forgottenEmail"]').val()) if Session.get('email').length is 0 Session.set('entryError', 'Email is required') diff --git a/client/views/forgotPassword/forgotPassword.html b/client/views/forgotPassword/forgotPassword.html index 6e0376e2..96e05d48 100644 --- a/client/views/forgotPassword/forgotPassword.html +++ b/client/views/forgotPassword/forgotPassword.html @@ -11,7 +11,7 @@
{{error}}
{{/if}}

{{t9n 'forgotPassword'}}

- +
diff --git a/client/views/resetPassword/resetPassword.coffee b/client/views/resetPassword/resetPassword.coffee index 352a0225..a570b17c 100644 --- a/client/views/resetPassword/resetPassword.coffee +++ b/client/views/resetPassword/resetPassword.coffee @@ -6,9 +6,9 @@ Template.entryResetPassword.helpers Template.entryResetPassword.events - 'submit #resetPassword': (event) -> + 'submit form.reset-password': (event, template) -> event.preventDefault() - password = $('input[type="password"]').val() + password = template.$('input[type="password"]').val() passwordErrors = do (password)-> errMsg = [] diff --git a/client/views/resetPassword/resetPassword.html b/client/views/resetPassword/resetPassword.html index 80372f7f..a68ee5e9 100644 --- a/client/views/resetPassword/resetPassword.html +++ b/client/views/resetPassword/resetPassword.html @@ -11,7 +11,7 @@
{{error}}
{{/if}}

{{t9n "resetYourPassword"}}

- +
diff --git a/client/views/signIn/signIn.coffee b/client/views/signIn/signIn.coffee index 8abf60a1..cf35b3a1 100644 --- a/client/views/signIn/signIn.coffee +++ b/client/views/signIn/signIn.coffee @@ -27,16 +27,16 @@ AccountsEntry.entrySignInHelpers = { } AccountsEntry.entrySignInEvents = { - 'submit #signIn': (event) -> + 'submit form.entry-form.sign-in': (event, template) -> event.preventDefault() - email = $('input[name="email"]').val() + email = template.$('input[name="email"]').val() if (AccountsEntry.isStringEmail(email) and AccountsEntry.settings.emailToLower) or (not AccountsEntry.isStringEmail(email) and AccountsEntry.settings.usernameToLower) email = email.toLowerCase() Session.set('email', email) - Session.set('password', $('input[name="password"]').val()) + Session.set('password', template.$('input[name="password"]').val()) Session.set 'talkingToServer', true Meteor.loginWithPassword(Session.get('email'), Session.get('password'), (error)-> diff --git a/client/views/signIn/signIn.html b/client/views/signIn/signIn.html index ac4a51a5..c545e6e3 100644 --- a/client/views/signIn/signIn.html +++ b/client/views/signIn/signIn.html @@ -26,7 +26,7 @@

{{t9n "signIn"}}

{{/unless}} {{#if passwordLoginService}} - +
diff --git a/client/views/signUp/signUp.coffee b/client/views/signUp/signUp.coffee index 77c47a58..17c6087e 100644 --- a/client/views/signUp/signUp.coffee +++ b/client/views/signUp/signUp.coffee @@ -49,7 +49,7 @@ AccountsEntry.entrySignUpHelpers = { } AccountsEntry.entrySignUpEvents = { - 'submit #signUp': (event, t) -> + 'submit form.sign-up': (event, t) -> event.preventDefault() username = diff --git a/client/views/signUp/signUp.html b/client/views/signUp/signUp.html index 7e59bc78..2618b39f 100644 --- a/client/views/signUp/signUp.html +++ b/client/views/signUp/signUp.html @@ -17,7 +17,7 @@

{{t9n "createAccount"}}

{{#if passwordLoginService}} @@ -28,7 +28,7 @@

{{t9n "createAccount"}}

{{/if}} {{> entryError}} {{#if passwordLoginService}} - + {{#if showUsername}}