From c8c4edc2fd30af8ef4b67d56c3c65974ff25e37e Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 10 Aug 2014 17:30:30 +0300 Subject: more 'use strict' and fallout handling Just defining some variables instead of them becoming properties on the global object Some whitespace fixes too. --- scripts/robot.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts/robot.js') diff --git a/scripts/robot.js b/scripts/robot.js index 71679807..c1631263 100644 --- a/scripts/robot.js +++ b/scripts/robot.js @@ -1,3 +1,5 @@ +"use strict" + var sentence=""; /*sentence+=" #Rhizibot is showing you a #tutorial|"; sentence+="#Rhizi visualizes data with #Graphs and #relationships|"; @@ -43,8 +45,8 @@ setTimeout( Robot, 100 );*/ function Robot(){ - - + + if(counter<=sentence.length){ var text=$('#textanalyser').val(); counter++; @@ -60,7 +62,7 @@ function Robot(){ } }else{ var e = jQuery.Event("keypress"); - e.which = 13; + e.which = 13; e.keyCode = 13; $("#textanalyser").trigger(e); window.setTimeout( Robot, 650/speed ); @@ -68,10 +70,10 @@ function Robot(){ }else{ window.clearInterval(robot); } - - - + + + } -- cgit v1.3.1