summaryrefslogtreecommitdiff
path: root/scripts/textanalysis.js
diff options
context:
space:
mode:
authorOwen <despito@MacBook-Pro-de-Despito.local>2014-08-05 17:14:01 +0300
committerOwen <despito@MacBook-Pro-de-Despito.local>2014-08-05 17:14:01 +0300
commitd81197849358f2482dbb46113f87beedee02f072 (patch)
treec0807331a2bd4aade55f2f877a08d98aedc1920f /scripts/textanalysis.js
parentce133cae340bf077a3cc1222257638392681a118 (diff)
Multiple Issues fixed
Resizeable task bar Deliverable state combo box Edit node submit bug fix Code cleaup
Diffstat (limited to 'scripts/textanalysis.js')
-rw-r--r--scripts/textanalysis.js37
1 files changed, 20 insertions, 17 deletions
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js
index af236170..3b97ee71 100644
--- a/scripts/textanalysis.js
+++ b/scripts/textanalysis.js
@@ -18,14 +18,20 @@ $('#textanalyser').autocompleteTrigger({
source: sugg
});
-$('#textanalyser').submit(function() {
- //finalize text input, empty
- text = $('#textanalyser').val();
- $('#textanalyser').val("");
- TextAnalyser2(text, true);
- typeStack=[];
+$("#textanalyser").keypress(function(e) {
+ if (e.which == 13) {
+ if(!suggestionChange){
+ text = $('#textanalyser').val();
+ $('#textanalyser').val("");
+ TextAnalyser2(text, true);
+ typeStack=[];
+ }else{
+ suggestionChange=false;
+ }
+
return false;
+ }
});
$(document).keydown(function(e) {
@@ -46,18 +52,13 @@ $(document).keydown(function(e) {
suggestionChange=true;
}
- if (e.keyCode == 13) {
- if(!suggestionChange){
- text = $('#textanalyser').val();
- $('#textanalyser').val("");
- TextAnalyser2(text, true);
- typeStack=[];
- }else{
- suggestionChange=false;
- }
+
+ if (e.keyCode == 9) {//TAB
+ text = $('#textanalyser').val();
+ $('#textanalyser').val(text+" ");
return false;
-
}
+
});
function changeType(arg, id) {
@@ -82,6 +83,8 @@ window.setInterval(function() {
if ($('#textanalyser').val() != text) {
$('.typeselection').css('top', -300);
$('.typeselection').css('left', 0);
+
+ if(text.length*8>300)$('#textanalyser').css('width',text.length*8);
// text changed
text = $('#textanalyser').val();
TextAnalyser2(text, false);
@@ -296,4 +299,4 @@ function Unique(newnode) {
}
}
return truth;
-} \ No newline at end of file
+}