From cd9efc989a5a86e610513dac31316193dc41431a Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 28 Oct 2014 12:22:37 +0200 Subject: wip/history zoom --- scripts/history.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'scripts/history.js') diff --git a/scripts/history.js b/scripts/history.js index 5cc77eec..1df562ce 100644 --- a/scripts/history.js +++ b/scripts/history.js @@ -18,7 +18,10 @@ define('history', ['jquery', 'FileSaver', 'consts', 'signal'], function($, saveAs, consts, signal) { -function History(user) { +/* user - username (string) + * svg - svg element for catching zoom events (jquery DOMNode wrapper) + */ +function History(user, svg) { var that = this; this.records = []; this.user = user; @@ -28,6 +31,10 @@ function History(user) { signal.slot(consts.KEYSTROKES, function(obj) { return that.record_keystrokes(obj); }); + // XXX create zoom behavior - then proof to event name change + $(window).on('wheel', function(obj) { + return that.record_zoom(obj); + }); } var ACTION_KEYSTROKES = 'ACTION_KEYSTROKES'; @@ -47,6 +54,13 @@ History.prototype.record = function(d) this.records.push(d); }; +History.prototype.record_zoom = function(d) +{ + console.log('history record zoom'); + console.log(d); + return true; +} + History.prototype.save_to_file = function() { var json = JSON.stringify(this.records, function (k, v) { return v; }, 2); -- cgit v1.3.1