mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-03 08:28:54 -04:00
Remove manual LZString compression for partial socket io event data
This commit is contained in:
parent
e65e09215a
commit
c904083d1f
5 changed files with 3 additions and 22 deletions
|
@ -2645,8 +2645,6 @@ editor.on('update', function () {
|
|||
});
|
||||
});
|
||||
socket.on('check', function (data) {
|
||||
data = LZString.decompressFromUTF16(data);
|
||||
data = JSON.parse(data);
|
||||
//console.log(data);
|
||||
updateInfo(data);
|
||||
});
|
||||
|
@ -2656,8 +2654,6 @@ socket.on('permission', function (data) {
|
|||
var docmaxlength = null;
|
||||
var permission = null;
|
||||
socket.on('refresh', function (data) {
|
||||
data = LZString.decompressFromUTF16(data);
|
||||
data = JSON.parse(data);
|
||||
//console.log(data);
|
||||
docmaxlength = data.docmaxlength;
|
||||
editor.setOption("maxLength", docmaxlength);
|
||||
|
@ -2704,8 +2700,6 @@ var CodeMirrorAdapter = ot.CodeMirrorAdapter;
|
|||
var cmClient = null;
|
||||
|
||||
socket.on('doc', function (obj) {
|
||||
obj = LZString.decompressFromUTF16(obj);
|
||||
obj = JSON.parse(obj);
|
||||
var body = obj.str;
|
||||
var bodyMismatch = editor.getValue() !== body;
|
||||
var havePendingOperation = cmClient && Object.keys(cmClient.state).length > 0;
|
||||
|
@ -2766,8 +2760,6 @@ socket.on('operation', function () {
|
|||
});
|
||||
|
||||
socket.on('online users', function (data) {
|
||||
data = LZString.decompressFromUTF16(data);
|
||||
data = JSON.parse(data);
|
||||
if (debug)
|
||||
console.debug(data);
|
||||
onlineUsers = data.users;
|
||||
|
|
2
public/vendor/ot/ot.min.js
vendored
2
public/vendor/ot/ot.min.js
vendored
File diff suppressed because one or more lines are too long
3
public/vendor/ot/socketio-adapter.js
vendored
Normal file → Executable file
3
public/vendor/ot/socketio-adapter.js
vendored
Normal file → Executable file
|
@ -24,8 +24,6 @@ ot.SocketIOAdapter = (function () {
|
|||
self.trigger('selection', clientId, selection);
|
||||
});
|
||||
socket.on('operations', function (head, operations) {
|
||||
operations = LZString.decompressFromUTF16(operations);
|
||||
operations = JSON.parse(operations);
|
||||
self.trigger('operations', head, operations);
|
||||
});
|
||||
socket.on('selection', function (clientId, selection) {
|
||||
|
@ -37,7 +35,6 @@ ot.SocketIOAdapter = (function () {
|
|||
}
|
||||
|
||||
SocketIOAdapter.prototype.sendOperation = function (revision, operation, selection) {
|
||||
operation = LZString.compressToUTF16(JSON.stringify(operation));
|
||||
this.socket.emit('operation', revision, operation, selection);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue