alexyoung (owner)

Revisions

gist: 125775 Download_button fork
public
Public Clone URL: git://gist.github.com/125775.git
Embed All Files: show embed
rhino-jschat-example.js #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
JsChat.Responses = {};
JsChat.Responses.Display = {
  'identified': function(json) {
    print('Identified as: ' + json['name']);
  },
 
  'join': function(json) {
    print('Joined room: ' + json['room']);
  },
 
  'error': function(json) {
    print('[ERROR] ' + json['message']);
  },
 
  'message': function(json) {
    if (json['room']) {
      print('[' + json['room'] + '] <' + json['user'] + '> ' + json['message']);
    }
  }
}