diff options
Diffstat (limited to 'src/history.js')
| -rw-r--r-- | src/history.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/history.js b/src/history.js index a6a02ec3..37e96718 100644 --- a/src/history.js +++ b/src/history.js @@ -31,6 +31,7 @@ function History(user, graph, transform_element) { return that.record_graph_diff(obj) }); rz_bus.ui_key.onValue(that.record_keystrokes.bind(that)); + rz_bus.ui_input.onValue(that.record_input.bind(that)); // XXX create zoom behavior - then proof to event name change $(window).on('wheel.history', function(obj) { that.record_zoom(obj); @@ -39,6 +40,7 @@ function History(user, graph, transform_element) { } var ACTION_KEYSTROKES = 'ACTION_KEYSTROKES'; +var ACTION_INPUT = 'ACTION_INPUT'; var ACTION_GRAPH_DIFF = 'ACTION_GRAPH_DIFF'; var ACTION_ZOOM = 'ACTION_ZOOM'; @@ -126,6 +128,18 @@ History.prototype.record_keystrokes = function(obj) }); } +History.prototype.record_input = function(obj) +{ + var where = obj.where, + input = obj.input; + + if (where === undefined || input === undefined || input.length === undefined || typeof input !== 'string') { + console.log('invalid arguments'); + return; + } + this.record(ACTION_INPUT, {where: where, input: input}); +} + return { History:History, KEYSTROKE_WHERE_TEXTANALYSIS:KEYSTROKE_WHERE_TEXTANALYSIS, |
