mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00

Move from using depreciated event declaration style. Still supported not sure if future proof (see https://github.com/meteor/meteor/blob/devel/packages/templating/deftempl ate.js#L184)
33 lines
No EOL
788 B
JavaScript
33 lines
No EOL
788 B
JavaScript
Template.signup.events({
|
|
'click input[type=submit]': function(event){
|
|
event.preventDefault();
|
|
var username = $('#username').val();
|
|
var email = $('#email').val();
|
|
var password = $('#password').val();
|
|
if(!username || !email || !password){
|
|
throwError(i18n.t('Please fill in all fields'));
|
|
return false;
|
|
}
|
|
Accounts.createUser({
|
|
username: username
|
|
, email: email
|
|
, password: password
|
|
}, function(err){
|
|
if(err){
|
|
console.log(err);
|
|
}else{
|
|
Router.go('/');
|
|
}
|
|
});
|
|
},
|
|
|
|
'click #signin': function(){
|
|
Router.go('/signin');
|
|
},
|
|
|
|
'click .twitter-button': function(){
|
|
Meteor.loginWithTwitter(function(){
|
|
Router.go('/');
|
|
});
|
|
}
|
|
}); |