From fac9202b3d85b57e5df9d121f594edecbf11e4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Bokros?= Date: Mon, 27 Nov 2017 19:01:11 +0100 Subject: [PATCH] Send necessary data in onopen --- src/app/static/ws_listener.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/static/ws_listener.js b/src/app/static/ws_listener.js index de71ca8..9e19225 100644 --- a/src/app/static/ws_listener.js +++ b/src/app/static/ws_listener.js @@ -22,7 +22,18 @@ $('form#anchor_login_event').on('submit', (function (event) { function (data) {} ); })); + +ws.onopen = function () { + ws.send(JSON.stringify({ + 'anchor': 'reset', + 'data': '' })); + // init webide + ws.send(JSON.stringify({ + 'anchor': 'anchor_webide', + 'data': '' + })); +}; ws.onmessage = function (messageEvent) { let message = JSON.parse(messageEvent.data);