Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed ids on forms, switched to class selectors and scoped all jquery selects to their own template #360

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/views/enrollAccount/enrollAccount.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion client/views/enrollAccount/enrollAccount.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class='alert alert-danger'>{{error}}</div>
{{/if}}
<h3>{{t9n "choosePassword"}}</h3>
<form id='setPassword'>
<form class='set-password'>
<div class="form-group">
<input type="password" name="new-password" class="form-control" value=''>
</div>
Expand Down
4 changes: 2 additions & 2 deletions client/views/forgotPassword/forgotPassword.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion client/views/forgotPassword/forgotPassword.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class='alert alert-danger'>{{error}}</div>
{{/if}}
<h3>{{t9n 'forgotPassword'}}</h3>
<form id='forgotPassword'>
<form class='forgot-password'>
<div class="form-group">
<input type="email" name="forgottenEmail" class="form-control" placeholder="{{t9n 'emailAddress'}}" value=''>
</div>
Expand Down
4 changes: 2 additions & 2 deletions client/views/resetPassword/resetPassword.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion client/views/resetPassword/resetPassword.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class='alert alert-danger'>{{error}}</div>
{{/if}}
<h3>{{t9n "resetYourPassword"}}</h3>
<form id='resetPassword'>
<form class='reset-password'>
<div class="form-group">
<input type="password" name="new-password" class="form-control" value=''>
</div>
Expand Down
6 changes: 3 additions & 3 deletions client/views/signIn/signIn.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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)->
Expand Down
2 changes: 1 addition & 1 deletion client/views/signIn/signIn.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h3>{{t9n "signIn"}}</h3>
</div>
{{/unless}}
{{#if passwordLoginService}}
<form class="entry-form" id='signIn'>
<form class="entry-form sign-in">
<div class="form-group">
<input autofocus name="email" type="{{emailInputType}}" class="form-control" value='{{email}}' placeholder="{{emailPlaceholder}}" autocapitalize="none" autocomplete="off" autocorrect="off">
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/views/signUp/signUp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ AccountsEntry.entrySignUpHelpers = {
}

AccountsEntry.entrySignUpEvents = {
'submit #signUp': (event, t) ->
'submit form.sign-up': (event, t) ->
event.preventDefault()

username =
Expand Down
4 changes: 2 additions & 2 deletions client/views/signUp/signUp.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h3>{{t9n "createAccount"}}</h3>
{{#if passwordLoginService}}
<div class="email-option">
<strong class="line-thru">{{t9n "OR"}}</strong>
<a data-toggle="collapse" href="#signUp">
<a data-toggle="collapse" href="form.sign-up">
{{t9n "signUpWithYourEmailAddress"}}
</a>
</div>
Expand All @@ -28,7 +28,7 @@ <h3>{{t9n "createAccount"}}</h3>
{{/if}}
{{> entryError}}
{{#if passwordLoginService}}
<form class="entry-form {{signupClass}}" id='signUp'>
<form class="entry-form {{signupClass}} sign-up">
{{#if showUsername}}
<div class="form-group">
<label>{{t9n "username"}}</label>
Expand Down