From f8741870a1dcd066a22545635faac274413b05bd Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Mon, 18 Aug 2014 21:25:20 +0300 Subject: recording: record keystrokes. no strokes recorded for link renames --- scripts/textanalysis.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts/textanalysis.js') diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js index e38422d8..cff5f658 100644 --- a/scripts/textanalysis.js +++ b/scripts/textanalysis.js @@ -22,27 +22,27 @@ $('#textanalyser').autocompleteTrigger({ $("#textanalyser").keypress(function(e) { + if (graph.history !== undefined) { + graph.history.record_keystrokes(KEYSTROKE_WHERE_TEXTANALYSIS, [e.which]); + } if (e.which == 13) { if(!suggestionChange){ text = $('#textanalyser').val(); $('#textanalyser').val(""); TextAnalyser2(text, true); typeStack=[]; - }else{ + } else { suggestionChange=false; } - - return false; + return false; } if (e.which == 37) {//RIGHT - $('body').scrollLeft(0); e.stopPropagation(); return false; } if (e.which == 39) { //LEFT - $('body').scrollLeft(0); e.stopPropagation(); return false; @@ -52,7 +52,9 @@ $("#textanalyser").keypress(function(e) { $(document).keydown(function(e) { - + if (graph.history !== undefined) { + graph.history.record_keystrokes(KEYSTROKE_WHERE_DOCUMENT, [e.KeyCode]); + } if (e.keyCode == 9) {//TAB e.preventDefault(); changeType("down", lastnode); -- cgit v1.3.1