summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/app.js2
-rw-r--r--scripts/history.js16
-rw-r--r--scripts/rhizicore.js2
3 files changed, 17 insertions, 3 deletions
diff --git a/scripts/app.js b/scripts/app.js
index 2ad7d5c0..96b15fcb 100644
--- a/scripts/app.js
+++ b/scripts/app.js
@@ -1,6 +1,6 @@
(function() {
var config = {
- //urlArgs: "bust=" + (new Date()).getTime(), // NOTE: useful for debugging
+ urlArgs: "bust=" + (new Date()).getTime(), // NOTE: useful for debugging
paths: {
jquery: 'external/jquery',
'jquery-ui': 'external/jquery-ui',
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);
diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js
index de823882..a8b091cc 100644
--- a/scripts/rhizicore.js
+++ b/scripts/rhizicore.js
@@ -569,7 +569,7 @@ function myGraph(el) {
function set_user(user) {
this.user = user;
- this.history = new History(this.user);
+ this.history = new History(this.user, $('svg'));
console.log('new user: ' + user);
}
this.set_user = set_user;