From 67474aa1d4bf1281f48dc3b0936ce7c32edf30d8 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Tue, 2 Aug 2016 17:16:01 +0800 Subject: Update realtime check and refresh event, compress data using LZString UTF16 to minimize network delay --- public/js/index.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'public') diff --git a/public/js/index.js b/public/js/index.js index 7f9c8ad8..87c69770 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2360,6 +2360,8 @@ editor.on('update', function () { }); }); socket.on('check', function (data) { + data = LZString.decompressFromUTF16(data); + data = JSON.parse(data); //console.log(data); updateLastInfo(data); }); @@ -2371,6 +2373,8 @@ var otk = null; var owner = 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); -- cgit v1.2.3