Browse files

Channel saving and buttons working

  • Loading branch information...
1 parent 3b058f3 commit edbca944994965853e4dfb984f0478731aed9a05 David Petersen committed Feb 15, 2012
Showing with 5 additions and 7 deletions.
  1. +2 −4 lib/irchandler.js
  2. +3 −3 views/templates.jade
View
6 lib/irchandler.js
@@ -31,12 +31,10 @@ mongoose.connect('mongodb://localhost/subway');
var log_message = function(channelName, msg_object) {
Channel.findOne({name: channelName}, function(err, channel) {
- if(channel){
- channel.messages.push(msg_object);
- } else {
+ if(!channel){
channel = new Channel({name: channelName});
- channel.messages.push(msg_object);
}
+ channel.messages.push(msg_object);
channel.save();
console.log(channel);
});
View
6 views/templates.jade
@@ -42,7 +42,7 @@ script(id="overview_connection", type="text/html")
label(for="connect-nick") Nick
.controls
input#connect-nick(type="text")
- button(id="connect-button", class="btn btn-primary") Connect
+ button(id="connect-button", class="btn btn-primary", type="button") Connect
script(id="overview_settings", type="text/html")
#home_parent
@@ -61,7 +61,7 @@ script(id="overview_login", type="text/html")
label(for="login-password") Password
.controls
input#login-password(type="password")
- button(id="login-button", class="btn btn-primary") Login
+ button(id="login-button", class="btn btn-primary", type="submit") Login
script(id="overview_register", type="text/html")
#home_parent
@@ -75,7 +75,7 @@ script(id="overview_register", type="text/html")
label(for="register-password") Password
.controls
input#register-password(type="password")
- button(id="register-button", class="btn btn-primary") Register
+ button(id="register-button", class="btn btn-primary", type="button") Register
script(id="titlebar", type="text/html")
.titlebar

0 comments on commit edbca94

Please sign in to comment.