diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/rz_core.js | 5 | ||||
| -rw-r--r-- | src/client/rz_mesh.js | 4 | ||||
| -rw-r--r-- | src/client/view/activity.js | 31 |
3 files changed, 37 insertions, 3 deletions
diff --git a/src/client/rz_core.js b/src/client/rz_core.js index 51f7eaec..6f712e8c 100644 --- a/src/client/rz_core.js +++ b/src/client/rz_core.js @@ -1,7 +1,7 @@ "use strict" -define(['jquery', 'd3', 'consts', 'rz_bus', 'util', 'model/graph', 'model/core', 'view/item_info', 'rz_observer', 'view/selection', 'rz_mesh', 'model/diff', "view/graph_view", 'view/svg_input', 'view/filter_menu'], -function($, d3, consts, rz_bus, util, model_graph, model_core, item_info, rz_observer, selection, rz_mesh, model_diff, graph_view, svg_input, filter_menu) { +define(['jquery', 'd3', 'consts', 'rz_bus', 'util', 'model/graph', 'model/core', 'view/item_info', 'rz_observer', 'view/selection', 'rz_mesh', 'model/diff', "view/graph_view", 'view/svg_input', 'view/filter_menu', 'view/activity'], +function($, d3, consts, rz_bus, util, model_graph, model_core, item_info, rz_observer, selection, rz_mesh, model_diff, graph_view, svg_input, filter_menu, activity) { // fix circular module dependency var search; @@ -203,6 +203,7 @@ function init_ws_connection(){ function init() { initDrawingArea(); init_ws_connection(); + activity.init($('.graph-view')); if (rz_config.backend_enabled) { var cur_rzdoc_name = rzdoc__current__get_name(); diff --git a/src/client/rz_mesh.js b/src/client/rz_mesh.js index 82ddc3b3..6ef41cd1 100644 --- a/src/client/rz_mesh.js +++ b/src/client/rz_mesh.js @@ -3,7 +3,8 @@ /** * Manage backend websocket connection */ -define([ 'util', 'model/diff', 'model/util', 'socketio'], function(util, model_diff, model_util, io) { +define([ 'util', 'model/diff', 'model/util', 'socketio', 'view/activity'], +function( util, model_diff, model_util, io, activity) { var ws_server_url = document.location.origin + '/graph'; // socketio namespace @@ -71,6 +72,7 @@ define([ 'util', 'model/diff', 'model/util', 'socketio'], function(util, model_d console.log('ws: rx: ws_diff_merge__topo, committing wire-adapted topo_diff:', topo_diff); + activity.incomingActivityBus.push(topo_diff_spec); rz_mesh_graph_ref.commit_diff__topo(model_diff.new_topo_diff(topo_diff_spec)); } diff --git a/src/client/view/activity.js b/src/client/view/activity.js new file mode 100644 index 00000000..44d3632a --- /dev/null +++ b/src/client/view/activity.js @@ -0,0 +1,31 @@ +define(['jquery', 'Bacon'], +function($, Bacon) { + +var incomingActivityBus = new Bacon.Bus(), + activity_element; + +function init(graph_view) +{ + activity_element = $('<div class="activity-root-div"></div>'); + graph_view.append(activity_element); +} + +function appendActivity(topo_diff_spec) +{ + var new_div = $('<div></div>'); + + new_div.text('' + topo_diff_spec); + activity_element.append(new_div); + // TODO - x button + // TODO - format of text per activity (topo/attr) + // TODO - user data (requires protocol update?) +} + +incomingActivityBus.onValue(appendActivity); + +return { + init: init, + incomingActivityBus: incomingActivityBus, +}; + +}); // close define |
