| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Lingr tools
Revision: 45
Author: dburkes
Date: 26 Jun 2008 12:23:56
Changes:Apply patch from twk (http://nonn-et-twk.net/twk/lingr-js). Enables room password support, as well as full json parameter onRoomEntered
Files:| ... | ...@@ -112,6 +112,6 @@ | |
| 112 | 112 | }, |
| 113 | 113 | |
| 114 | dispatchEvent: function(eventName, json) { | |
| 115 | (this.options['on' + eventName] || this.emptyFunction)(json); | |
| 114 | dispatchEvent: function(eventName) { | |
| 115 | (this.options['on' + eventName] || this.emptyFunction).apply(null, Array.prototype.slice.call(arguments, 1)); | |
| 116 | 116 | }, |
| 117 | 117 | |
| ... | ...@@ -204,5 +204,5 @@ | |
| 204 | 204 | |
| 205 | 205 | enterRoom: function() { |
| 206 | this.room = new Lingr.Room(this, this.lingr.options.roomId, this.lingr.options.nickname); | |
| 206 | this.room = new Lingr.Room(this, this.lingr.options.roomId, this.lingr.options.nickname, this.lingr.options.roomPwd); | |
| 207 | 207 | this.room.enter(); |
| 208 | 208 | }, |
| ... | ...@@ -248,8 +248,9 @@ | |
| 248 | 248 | Lingr.Room = Class.create(); |
| 249 | 249 | Lingr.Room.prototype = { |
| 250 | initialize: function(session, roomId, nickname) { | |
| 250 | initialize: function(session, roomId, nickname, roomPwd) { | |
| 251 | 251 | this.session = session; |
| 252 | 252 | this.roomId = roomId; |
| 253 | 253 | this.nickname = nickname; |
| 254 | this.roomPwd = roomPwd; | |
| 254 | 255 | this.ticket = this.session.lingr.options.ticket; |
| 255 | 256 | }, |
| ... | ...@@ -260,4 +261,5 @@ | |
| 260 | 261 | session: this.session.session, |
| 261 | 262 | id: this.roomId, |
| 263 | password: this.roomPwd, | |
| 262 | 264 | idempotent: true |
| 263 | 265 | }; |
| ... | ...@@ -272,5 +274,5 @@ | |
| 272 | 274 | this.counter = json.room.counter; |
| 273 | 275 | |
| 274 | this.session.lingr.dispatchEvent('RoomEntered', json.room); | |
| 276 | this.session.lingr.dispatchEvent('RoomEntered', json.room, json); | |
| 275 | 277 | |
| 276 | 278 | if (json.occupants) { |