Merge branch 'master' of github.com:xwiki-labs/cryptpad

pull/1/head
ansuz 8 years ago
commit f47a6f1cbb

@ -224,10 +224,11 @@ define([
return {
failed: function () {
connected = false;
userListElement.textContent = '';
userListElement.textContent = 'Disconnected';
lagElement.textContent = '';
},
reconnecting: function () {
reconnecting: function (userId) {
myUserName = userId;
connected = false;
userListElement.textContent = Messages.reconnecting;
lagElement.textContent = '';

@ -599,6 +599,18 @@ define([
Cryptpad.alert(Messages.disconnectAlert);
};
var onConnectionChange = realtimeOptions.onConnectionChange = function (info) {
setEditable(info.state);
toolbar.failed();
if (info.state) {
initializing = true;
toolbar.reconnecting(info.myId);
Cryptpad.findOKButton().click();
} else {
Cryptpad.alert(Messages.disconnectAlert);
}
};
var onLocal = realtimeOptions.onLocal = function () {
if (initializing) { return; }

@ -74,10 +74,19 @@ define([
};
var onAbort = config.onAbort = function (info) {
$textarea.attr('disabled', true);
setEditable(false);
window.alert("Server Connection Lost");
};
var onConnectionChange = config.onConnectionChange = function (info) {
if (info.state) {
initializing = true;
} else {
setEditable(false);
window.alert("Server Connection Lost. Trying to reconnect...");
}
};
var rt = Realtime.start(config);
['cut', 'paste', 'change', 'keyup', 'keydown', 'select', 'textInput']

Loading…
Cancel
Save