lib/jschat/http/public/javascripts/app/ui/commands.js in jschat-0.3.3 vs lib/jschat/http/public/javascripts/app/ui/commands.js in jschat-0.3.5
- old
+ new
@@ -56,19 +56,20 @@
method: 'post',
parameters: { name: name },
onSuccess: function(response) {
this.displayMessages(response.responseText);
JsChat.user.setName(name);
+ this.updateNames();
}.bind(this),
onFailure: function() {
Display.add_message("Server error: couldn't access: #{url}".interpolate({ url: url }), 'server');
}
});
},
'/names': function() {
- JsChat.Request.get('/names', function(t) { this.displayMessages(t.responseText); }.bind(this));
+ this.updateNames();
},
'/toggle images': function() {
JsChat.user.setHideImages(!JsChat.user.hideImages);
Display.add_message("Hide images set to #{hide}".interpolate({ hide: JsChat.user.hideImages }), 'server');
@@ -84,9 +85,14 @@
},
'/(part|leave)\\s+(.*)': function() {
var room = arguments[0][2];
this.partRoom(room);
+ },
+
+ '/tweet\\s+(.*)': function() {
+ var message = arguments[0][1];
+ this.sendTweet(message);
},
'/quit': function() {
window.location = '/quit';
}