From b239c007f5b7dae085f732a2ce007643e758698c Mon Sep 17 00:00:00 2001 From: LV-426 Date: Thu, 9 Apr 2015 01:48:13 +0300 Subject: rz_mesh.js: rzdoc subscription handling --- src/client/rz_mesh.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/client/rz_mesh.js b/src/client/rz_mesh.js index e32a96b7..a3cb822c 100644 --- a/src/client/rz_mesh.js +++ b/src/client/rz_mesh.js @@ -87,8 +87,24 @@ define([ 'util', 'model/diff', 'model/util', 'socketio'], function(util, model_d rz_mesh_graph_ref.commit_diff__attr(attr_diff); } + function emit__rzdoc_subscribe(rzdoc_name) { + var callback = function(data) { + console.log('ws: rzdoc subscription acked: rzdoc name: \'' + rzdoc_name + '\''); + }; + socket.emit('rzdoc_subscribe', { rzdoc_name: rzdoc_name}, callback); + } + + function emit__rzdoc_unsubscribe(rzdoc_name) { + var callback = function(data) { + console.log('ws: rzdoc un-subscription acked: rzdoc name: \'' + rzdoc_name + '\''); + }; + socket.emit('rzdoc_unsubscribe', { rzdoc_name: rzdoc_name}, callback); + } + return { init : init + emit__rzdoc_subscribe: emit__rzdoc_subscribe, + emit__rzdoc_unsubscribe: emit__rzdoc_unsubscribe, }; }); -- cgit v1.3.1