From 269b643f4aad442302fe4ba17627726fb732af0c Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 26 Oct 2014 23:37:31 +0200 Subject: history switch to events; using a single GRAPH_DIFF action. todo - replay; zoom in/out; clicks on nodes/edges --- scripts/textanalysis.ui.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'scripts/textanalysis.ui.js') diff --git a/scripts/textanalysis.ui.js b/scripts/textanalysis.ui.js index bafc5134..4881d83c 100644 --- a/scripts/textanalysis.ui.js +++ b/scripts/textanalysis.ui.js @@ -1,4 +1,5 @@ -define('textanalysis.ui', ['autocomplete', 'rhizicore', 'textanalysis', 'history'], function(autocomplete, RZ, textanalysis, history) { +define('textanalysis.ui', ['autocomplete', 'rhizicore', 'textanalysis', 'signal', 'consts'], + function(autocomplete, RZ, textanalysis, signal, consts) { var text = ""; // Last text of sentence var element_name = '#textanalyser'; var element = $(element_name); @@ -74,10 +75,7 @@ return { }); $(document).keydown(function(e) { - - if (RZ.graph.history !== undefined) { - RZ.graph.history.record_keystrokes(history.KEYSTROKE_WHERE_DOCUMENT, [e.KeyCode]); - } + signal.signal(consts.KEYSTROKES, [{where: consts.KEYSTROKE_WHERE_DOCUMENT, keys: [e.keyCode]}]); if (e.keyCode == 9) {//TAB e.preventDefault(); changeType(e.shiftKey ? "up" : "down", textanalysis.lastnode()); @@ -104,10 +102,8 @@ return { }); element.keypress(function(e) { - if (RZ.graph.history !== undefined) { - RZ.graph.history.record_keystrokes(history.KEYSTROKE_WHERE_TEXTANALYSIS, [e.which]); - } - if (e.which == 13) { + signal.signal(consts.KEYSTROKES, [{where: consts.KEYSTROKE_WHERE_TEXTANALYSIS, keys:[e.which]}]); + if (e.which == 13) { if(!suggestionChange) { text = element.val(); element.val(""); -- cgit v1.3.1