Merge ../its-meta-theme-dark

This commit is contained in:
Daniel Gröber 2018-08-01 13:49:30 +02:00
commit d9b4d6d17d
1 changed files with 15 additions and 3 deletions

View File

@ -28,10 +28,22 @@ var its = (function() {
url.protocol = url.protocol == 'https:' ? 'wss' : 'ws';
url += 'its-open-ws/';
var reconnect_delay = 1000;
var reconnect_giveup = 1000000;
function connect() {
console.log('isitopen: reconnecting');
var ws = new WebSocket(url);
register(ws);
if(reconnect_delay > reconnect_giveup)
return;
setTimeout(function() {
console.log('isitopen: reconnecting');
var ws = new WebSocket(url);
register(ws);
}, reconnect_delay);
reconnect_delay *= 2;
}
function refresh() {