| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Lingr tools
Revision: 44
Author: dburkes
Date: 20 Feb 2008 14:05:16
Changes:Fix setNickname bug, clean up some syntax warnings
Files:| ... | ...@@ -4,6 +4,6 @@ | |
| 4 | 4 | var txt = r.transport ? r.transport.responseText: r.responseText; |
| 5 | 5 | return __method.call(obj, eval('(' + txt + ')')); |
| 6 | } | |
| 7 | } | |
| 6 | }; | |
| 7 | }; | |
| 8 | 8 | |
| 9 | 9 | Lingr = Class.create(); |
| ... | ...@@ -17,5 +17,5 @@ | |
| 17 | 17 | userMessagesOnly: false, |
| 18 | 18 | clientType: 'human' |
| 19 | } | |
| 19 | }; | |
| 20 | 20 | |
| 21 | 21 | Object.extend(this.options, options || {}); |
| ... | ...@@ -49,7 +49,7 @@ | |
| 49 | 49 | Lingr['callback' + this.callbackNum] = function(json) { |
| 50 | 50 | if (json && json.status == 'ok') { |
| 51 | (options.onSuccess || this.emptyFunction)(json) | |
| 51 | (options.onSuccess || this.emptyFunction)(json); | |
| 52 | 52 | } else { |
| 53 | (options.onFailure || this.emptyFunction)(json) | |
| 53 | (options.onFailure || this.emptyFunction)(json); | |
| 54 | 54 | } |
| 55 | 55 | head.removeChild(script); |
| ... | ...@@ -103,5 +103,5 @@ | |
| 103 | 103 | for(var i=0;i < cookies.length;i++) { |
| 104 | 104 | var c = cookies[i].strip(); |
| 105 | if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); | |
| 105 | if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length,c.length); | |
| 106 | 106 | } |
| 107 | 107 | return null; |
| ... | ...@@ -140,5 +140,5 @@ | |
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | } | |
| 142 | }; | |
| 143 | 143 | |
| 144 | 144 | Lingr.Session = Class.create(); |
| ... | ...@@ -164,5 +164,5 @@ | |
| 164 | 164 | this.lingr.dispatchEvent('ApiFailure', json); |
| 165 | 165 | }.bind(this) |
| 166 | }) | |
| 166 | }); | |
| 167 | 167 | } |
| 168 | 168 | else { |
| ... | ...@@ -178,5 +178,5 @@ | |
| 178 | 178 | this.start(); |
| 179 | 179 | }.bind(this) |
| 180 | }) | |
| 180 | }); | |
| 181 | 181 | } |
| 182 | 182 | }, |
| ... | ...@@ -222,8 +222,8 @@ | |
| 222 | 222 | this.lingr.dispatchEvent('ApiFailure', json); |
| 223 | 223 | }.bind(this) |
| 224 | }) | |
| 224 | }); | |
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | } | |
| 227 | }; | |
| 228 | 228 | |
| 229 | 229 | Lingr.Auth = Class.create(); |
| ... | ...@@ -244,5 +244,5 @@ | |
| 244 | 244 | this.session.lingr.request('post', '/auth/logout', { session: this.session.session }, options); |
| 245 | 245 | } |
| 246 | } | |
| 246 | }; | |
| 247 | 247 | |
| 248 | 248 | Lingr.Room = Class.create(); |
| ... | ...@@ -269,4 +269,7 @@ | |
| 269 | 269 | this.session.lingr.request('post', '/room/enter', params, { |
| 270 | 270 | onSuccess: function(json) { |
| 271 | this.ticket = json.ticket; | |
| 272 | this.counter = json.room.counter; | |
| 273 | ||
| 271 | 274 | this.session.lingr.dispatchEvent('RoomEntered', json.room); |
| 272 | 275 | |
| ... | ...@@ -275,6 +278,4 @@ | |
| 275 | 278 | } |
| 276 | 279 | |
| 277 | this.ticket = json.ticket; | |
| 278 | this.counter = json.room.counter; | |
| 279 | 280 | this.getContext(); |
| 280 | 281 | }.bind(this), |
| ... | ...@@ -282,5 +283,5 @@ | |
| 282 | 283 | this.session.lingr.dispatchEvent('ApiFailure', json); |
| 283 | 284 | }.bind(this) |
| 284 | }) | |
| 285 | }); | |
| 285 | 286 | } |
| 286 | 287 | else { |
| ... | ...@@ -304,5 +305,5 @@ | |
| 304 | 305 | this.session.lingr.dispatchEvent('ApiFailure', json); |
| 305 | 306 | }.bind(this) |
| 306 | }) | |
| 307 | }); | |
| 307 | 308 | }, |
| 308 | 309 | |
| ... | ...@@ -346,10 +347,10 @@ | |
| 346 | 347 | |
| 347 | 348 | if (json.messages && json.messages.length > 0) { |
| 348 | var msgs = json.messages.findAll(function(v, i) { return !this.session.lingr.options.userMessagesOnly || (v.type == 'user') || (v.type == 'private') }.bind(this)); | |
| 349 | var msgs = json.messages.findAll(function(v, i) { return !this.session.lingr.options.userMessagesOnly || (v.type == 'user') || (v.type == 'private'); }.bind(this)); | |
| 349 | 350 | this.session.lingr.dispatchEvent('MessagesReceived', msgs); |
| 350 | 351 | } |
| 351 | 352 | |
| 352 | 353 | if (json.counter) { |
| 353 | this.counter = json.counter | |
| 354 | this.counter = json.counter; | |
| 354 | 355 | } |
| 355 | 356 | |
| ... | ...@@ -398,7 +399,7 @@ | |
| 398 | 399 | this.session.lingr.dispatchEvent('ApiFailure', json); |
| 399 | 400 | }.bind(this) |
| 400 | }) | |
| 401 | }); | |
| 401 | 402 | } |
| 402 | 403 | } |
| 403 | } | |
| 404 | }; | |
| 404 | 405 |