Skip to content

Commit

Permalink
Channel saving and buttons working
Browse files Browse the repository at this point in the history
  • Loading branch information
David Petersen authored and David Petersen committed Feb 15, 2012
1 parent 3b058f3 commit edbca94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions lib/irchandler.js
Expand Up @@ -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);
});
Expand Down
6 changes: 3 additions & 3 deletions views/templates.jade
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit edbca94

Please sign in to comment.