fix lobby bug for anons

This commit is contained in:
Thibault Duplessis 2013-06-05 21:47:20 +02:00
parent 7bdff5e676
commit dcd37084aa
2 changed files with 21 additions and 19 deletions

View file

@ -7,7 +7,7 @@ import controllers.routes
trait AssetHelper {
val assetVersion = 35
val assetVersion = 36
def cssTag(name: String) = css("stylesheets/" + name)

View file

@ -12,21 +12,21 @@ var lichess_sri = Math.random().toString(36).substring(5); // 8 chars
//////////////////
// websocket.js //
//////////////////
var strongSocketDefaults = {
events: {},
params: {
sri: lichess_sri
},
options: {
name: "unnamed",
offlineDelay: 7000, // time before announcing the user they are offline
pingMaxLag: 7000, // time to wait for pong before reseting the connection
pingDelay: 1000, // time between pong and ping
lagTag: false, // jQuery object showing ping lag
ignoreUnknownMessages: false
}
};
events: {},
params: {
sri: lichess_sri
},
options: {
name: "unnamed",
offlineDelay: 7000, // time before announcing the user they are offline
pingMaxLag: 7000, // time to wait for pong before reseting the connection
pingDelay: 1000, // time between pong and ping
lagTag: false, // jQuery object showing ping lag
ignoreUnknownMessages: false
}
};
var strongSocket = function(url, version, settings) {
var self = this;
@ -263,7 +263,7 @@ var lichess_sri = Math.random().toString(36).substring(5); // 8 chars
if ($tag.length && e) {
var prev = parseInt($tag.text()) || Math.min(0, (e - 10));
var interv = lichess.socket.pingInterval() / 4;
_.each([0,1,2,3], function(it) {
_.each([0, 1, 2, 3], function(it) {
setTimeout(function() {
$tag.text(Math.round(((prev * (3 - it)) + (e * (it + 1))) / 4));
}, Math.round(it * interv));
@ -1957,9 +1957,11 @@ var lichess_sri = Math.random().toString(36).substring(5); // 8 chars
function resizeTimeline() {
var max = $('#lichess').offset().top + 516;
var pos = $timeline.offset().top;
while (pos + $timeline.outerHeight() > max) {
$timeline.find('div.entry:last').remove();
if ($timeline.length) {
var pos = $timeline.offset().top;
while (pos + $timeline.outerHeight() > max) {
$timeline.find('div.entry:last').remove();
}
}
}
resizeTimeline();