summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-08-10 17:30:30 +0300
committerAlon Levy <alon@pobox.com>2014-08-10 17:32:56 +0300
commitc8c4edc2fd30af8ef4b67d56c3c65974ff25e37e (patch)
tree5b0a849a29e59062226612c5864cb3fdff7a0a55
parent5420cd2885f42d6d57e601d378069ac1e400db93 (diff)
more 'use strict' and fallout handling
Just defining some variables instead of them becoming properties on the global object Some whitespace fixes too.
-rw-r--r--scripts/buttons.js1
-rw-r--r--scripts/gant.js7
-rw-r--r--scripts/robot.js14
-rw-r--r--scripts/textanalysis.js8
4 files changed, 18 insertions, 12 deletions
diff --git a/scripts/buttons.js b/scripts/buttons.js
index 56592825..65536f35 100644
--- a/scripts/buttons.js
+++ b/scripts/buttons.js
@@ -1,3 +1,4 @@
+"use strict"
$('.tutorial').click(function(){});
diff --git a/scripts/gant.js b/scripts/gant.js
index 9b7fed4b..a89f9035 100644
--- a/scripts/gant.js
+++ b/scripts/gant.js
@@ -1,3 +1,4 @@
+"use strict"
function checkSwitch(checkswitch) {
@@ -26,7 +27,7 @@ function checkSwitch(checkswitch) {
$('body').scrollLeft(scrollValue);
graphstate = "GANTT";
-
+
graph.update();
$('.status').fadeIn(600);
@@ -95,7 +96,7 @@ function initAxis() {
///update interval
var timeDiff = Math.abs(max.getTime() - min.getTime());
var diffDays = timeDiff / (1000 * 3600 * 24);
- w=Math.round(diffDays*15-100);
+ var w = Math.round(diffDays * 15 - 100);
graphinterval = w / diffDays;
@@ -130,7 +131,7 @@ function initAxis() {
return i * row_height + paddingTop + bar_start_offset;
}
- labelY = function (i) {
+ var labelY = function (i) {
return i * row_height + paddingTop + bar_start_offset + 13;
}
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);
}
-
-
-
+
+
+
}
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js
index 940683a0..b50fd6d0 100644
--- a/scripts/textanalysis.js
+++ b/scripts/textanalysis.js
@@ -1,3 +1,5 @@
+"use strict"
+
var text = "";
var sugg = ["AJAX", "Neo4J", "Rhizi", "Research", "CRI", "SageBionetworks", "Hero.coli", "CSS", "NodeJS", "HTML5", "Angular", "D3", "ProofOfConcept", "Graphs", "CloudComputing", "BigData", "ProblemSolving", "PHP", "Javascript", "BackBone", "Cooperation", "SemanticWeb"];
var typeindex = 0;
@@ -58,7 +60,7 @@ $(document).keydown(function(e) {
if (e.keyCode == 40) {//DOWN
suggestionChange=true;
}
-
+
if (e.keyCode == 9) {//TAB
return false;
}
@@ -265,7 +267,7 @@ function TextAnalyser2(newtext, finalize) {
//EXTERNAL AND CONNECTION CHECKING
var verb = "";
- function ANDconnect(node) {
+ function ANDconnect(node) {
for(var x=0;x<links.length;x++){
if(newlinks[x])if(newlinks[x].replace(/ /g,"")!=="and"){
verb=newlinks[x];
@@ -310,7 +312,7 @@ function TextAnalyser2(newtext, finalize) {
function Unique(newnode) {
- truth = true;
+ var truth = true;
for (var p = 0; p < sugg.length; p++) {
if (sugg[p] === newnode) {
truth = false;