summaryrefslogtreecommitdiff
path: root/scripts/history.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-10-28 12:22:37 +0200
committerAlon Levy <alon@pobox.com>2014-10-28 12:22:37 +0200
commitcd9efc989a5a86e610513dac31316193dc41431a (patch)
treeb276f5b4e67ee7d53951d770778e955aaf2ed2f1 /scripts/history.js
parentd7d34eb2bece8a39fecc3354de0f7d0a6e8827c6 (diff)
wip/history zoom
Diffstat (limited to 'scripts/history.js')
-rw-r--r--scripts/history.js16
1 files changed, 15 insertions, 1 deletions
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);