diff options
| author | Alon Levy <alon@pobox.com> | 2014-10-28 17:21:02 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-10-28 17:21:02 +0200 |
| commit | a005563b0d7b6636d79d268cfcf6582071644d36 (patch) | |
| tree | 6476c6781e1d154b6ba415725837d877f7bb1910 /scripts | |
| parent | cd9efc989a5a86e610513dac31316193dc41431a (diff) | |
textanalysis{,.ui}: fix remaining globals, use strict
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/textanalysis.js | 4 | ||||
| -rw-r--r-- | scripts/textanalysis.ui.js | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js index 22f8b16c..a3d875c2 100644 --- a/scripts/textanalysis.js +++ b/scripts/textanalysis.js @@ -417,6 +417,10 @@ var textAnalyser2 = function (newtext, finalize) { graph.update(!finalize && comp.graph_same); } + if (finalize) { + typeStack = []; + } + return ret; } diff --git a/scripts/textanalysis.ui.js b/scripts/textanalysis.ui.js index 4881d83c..75eae67e 100644 --- a/scripts/textanalysis.ui.js +++ b/scripts/textanalysis.ui.js @@ -1,8 +1,11 @@ +"use strict" + 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); +var suggestionChange; function analyzeSentence(sentence, finalize) { @@ -108,7 +111,6 @@ return { text = element.val(); element.val(""); analyzeSentence(text, true); - typeStack = []; } else { suggestionChange = false; } @@ -137,7 +139,6 @@ return { // text changed text = element.val(); analyzeSentence(text, false); - suggestionChange = false; } }, 5); } |
