From 429aa1275acdd7ad2776ae6d2596d16e10f0c09f Mon Sep 17 00:00:00 2001 From: Owen Date: Sun, 10 Aug 2014 18:38:31 +0300 Subject: Issue #31 --- scripts/textanalysis.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'scripts/textanalysis.js') diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js index b50fd6d0..31b759d9 100644 --- a/scripts/textanalysis.js +++ b/scripts/textanalysis.js @@ -88,8 +88,6 @@ function changeType(arg, id) { window.setInterval(function() { if ($('#textanalyser').val() != text) { - $('.typeselection').css('top', -300); - $('.typeselection').css('left', 0); if(text.length*8>500)$('#textanalyser').css('width',text.length*8+20); // text changed @@ -250,6 +248,9 @@ function TextAnalyser2(newtext, finalize) { graph.addNode("new node", typeStack[nodeindex], "temp"); if (!abnormalGraph){graph.addLink(newnodes[nodeindex - 1], "new node", newlinks[linkindex], "temp"); ANDconnect("new node");} + $('.typeselection').css({top:window.innerHeight/2-115,left:window.innerWidth/2-325}); + $('.typeselection').html('
Use arrows to pick a type
'); + break; case "NODE": typeStack[nodeindex]=nodetypes[typeindex]; @@ -262,6 +263,9 @@ function TextAnalyser2(newtext, finalize) { graph.addNode("new node", "empty", "temp"); if (!abnormalGraph){ graph.addLink(newnodes[nodeindex - 1], "new node", newlinks[linkindex], "temp"); ANDconnect("new node");} + + $('.typeselection').css('top', -300); + $('.typeselection').css('left', 0); break; } @@ -298,13 +302,18 @@ function TextAnalyser2(newtext, finalize) { } graph.addNode(completeSentence, "chainlink", typesetter); for (var n = 0; n < newnodes.length; n++) { - graph.addLink(newnodes[n], completeSentence, verb, typesetter); + graph.addLink(newnodes[n], completeSentence, "", typesetter); } } //FOR THE EXTERNAL ARROW-TYPE CHANGER lastnode = newnodes[nodeindex]; + if(finalize){ + $('.typeselection').css('top', -300); + $('.typeselection').css('left', 0); + } + //UPDATE GRAPH ONCE graph.update(); } -- cgit v1.3.1