summaryrefslogtreecommitdiff
path: root/scripts/textanalysis.ui.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-10-26 23:37:31 +0200
committerAlon Levy <alon@pobox.com>2014-10-26 23:37:31 +0200
commit269b643f4aad442302fe4ba17627726fb732af0c (patch)
tree7a3443b6b99b00733fb7dcba9e020a760f9d3726 /scripts/textanalysis.ui.js
parentb3f96efb33d7fc99500147d336ead1536b6b24e9 (diff)
history switch to events; using a single GRAPH_DIFF action. todo - replay; zoom in/out; clicks on nodes/edges
Diffstat (limited to 'scripts/textanalysis.ui.js')
-rw-r--r--scripts/textanalysis.ui.js14
1 files changed, 5 insertions, 9 deletions
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("");