mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Merge branch 'develop' into improve_cookies
This commit is contained in:
commit
aefa617797
63 changed files with 1191 additions and 284 deletions
|
@ -194,40 +194,27 @@ function handshake()
|
|||
// Allow deployers to host Etherpad on a non-root path
|
||||
'path': exports.baseURL + "socket.io",
|
||||
'resource': resource,
|
||||
'max reconnection attempts': 3,
|
||||
'sync disconnect on unload' : false
|
||||
'reconnectionAttempts': 5,
|
||||
'reconnection' : true,
|
||||
'reconnectionDelay' : 1000,
|
||||
'reconnectionDelayMax' : 5000
|
||||
});
|
||||
|
||||
var disconnectTimeout;
|
||||
|
||||
socket.once('connect', function () {
|
||||
sendClientReady(false);
|
||||
});
|
||||
|
||||
socket.on('reconnect', function () {
|
||||
//reconnect is before the timeout, lets stop the timeout
|
||||
if(disconnectTimeout)
|
||||
{
|
||||
clearTimeout(disconnectTimeout);
|
||||
}
|
||||
|
||||
pad.collabClient.setChannelState("CONNECTED");
|
||||
pad.sendClientReady(true);
|
||||
});
|
||||
|
||||
socket.on('disconnect', function (reason) {
|
||||
if(reason == "booted"){
|
||||
pad.collabClient.setChannelState("DISCONNECTED");
|
||||
} else {
|
||||
function disconnectEvent()
|
||||
{
|
||||
pad.collabClient.setChannelState("DISCONNECTED", "reconnect_timeout");
|
||||
}
|
||||
|
||||
pad.collabClient.setChannelState("RECONNECTING");
|
||||
|
||||
disconnectTimeout = setTimeout(disconnectEvent, 20000);
|
||||
}
|
||||
socket.on('reconnecting', function() {
|
||||
pad.collabClient.setChannelState("RECONNECTING");
|
||||
});
|
||||
|
||||
socket.on('reconnect_failed', function(error) {
|
||||
pad.collabClient.setChannelState("DISCONNECTED", "reconnect_timeout");
|
||||
});
|
||||
|
||||
var initalized = false;
|
||||
|
@ -731,6 +718,7 @@ var pad = {
|
|||
var wasConnecting = (padconnectionstatus.getStatus().what == 'connecting');
|
||||
if (newState == "CONNECTED")
|
||||
{
|
||||
padeditor.enable();
|
||||
padconnectionstatus.connected();
|
||||
}
|
||||
else if (newState == "RECONNECTING")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue