diff options
| author | Alon Levy <alon@pobox.com> | 2014-10-29 15:40:58 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-10-29 15:41:16 +0200 |
| commit | 00b33bbf1cef68c3d6c86fe8fd22c0d172743f07 (patch) | |
| tree | 404e7ded4a88387c157c8aae1ee7661795b38797 | |
| parent | 5d7b3d1e22757c1b9cc9753120eaba97916de13a (diff) | |
fix multiple warnings from zed (zedapp.org)
css:
use 0 instead of 0px (0 doesn't need a unit)
fallback rgb(r,g,b) for rgba
code:
missing semicolons
don't use initial caps for a function name
unused variables
| -rw-r--r-- | scripts/textanalysis.js | 38 | ||||
| -rw-r--r-- | ui.css | 17 |
2 files changed, 25 insertions, 30 deletions
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js index a3d875c2..ab16709e 100644 --- a/scripts/textanalysis.js +++ b/scripts/textanalysis.js @@ -1,14 +1,10 @@ -"use strict" +"use strict"; define('textanalysis', [], function() { var typeindex = 0; var nodetypes = ["person", "project", "skill", "deliverable", "objective"]; -var suggestionChange=false; -var sentenceStack = []; var typeStack = []; -var ExecutionStack = []; - var lastnode; var sugg = {}; // suggestions for autocompletion of node names @@ -31,7 +27,7 @@ function autocompleteCallback(request, response_callback) var ret = []; if (request.term === "" || request.term) { for (var name in sugg) { - if (name.indexOf(request.term) == 0) { + if (name.indexOf(request.term) === 0) { ret.push(name); } } @@ -118,7 +114,7 @@ function tokenize(text, node_token, quote) if (subsegment[k] && subsegment[k]!==quoteword.replace(/ /g, "")) { quoteword += subsegment[k]; } - sentence.push(quoteword.replace(RegExp(quote, 'g'), "")); + sentence.push(quoteword.replace(new RegExp(quote, 'g'), "")); } else { sentence.push(subsegment[k]); } @@ -154,16 +150,14 @@ var textAnalyser2 = function (newtext, finalize) { var linkindex = 0; var nodeindex = 0; var orderStack = []; - var quoteword = ""; - var ANDcase = false; - var ANDcount = 0; + var and_count = 0; var prefix = ""; var ret = {'nodes': [], 'links': []}; var m; var word; var completeSentence; var typesetter, starGraph; - var l, n, j; + var n; var link_hash = {}; var yell_bug = false; // TODO: fix both issues var NODE = "NODE"; @@ -208,7 +202,7 @@ var textAnalyser2 = function (newtext, finalize) { case ",": case "&": sentence[m] = "and"; - ANDcount++; + and_count++; //orderStack.push("AND"); default: if (orderStack[orderStack.length - 1] === START) { @@ -236,8 +230,8 @@ var textAnalyser2 = function (newtext, finalize) { } } - starGraph = (newlinks.length - ANDcount) >= 3 || - ((newlinks.length - ANDcount >= 1) && + starGraph = (newlinks.length - and_count) >= 3 || + ((newlinks.length - and_count >= 1) && newlinks.length > 2 && orderStack.length > 1 && orderStack[orderStack.length - 1] != NODE); @@ -276,7 +270,7 @@ var textAnalyser2 = function (newtext, finalize) { typesetter = ""; if (finalize === true) { typesetter = "perm"; - for (var n = 0; n < newnodes.length; n++) { + for (n = 0; n < newnodes.length; n++) { autoSuggestAddName(newnodes[n]); } } else { @@ -318,7 +312,7 @@ var textAnalyser2 = function (newtext, finalize) { addNode("new node", typeStack[nodeindex], "temp"); if (!starGraph) { addLink(newnodes[nodeindex - 1], "new node", newlinks[linkindex], "temp"); - ANDconnect("new node"); + and_connect("new node"); } ret.state = ANALYSIS_NODE_START; break; @@ -327,7 +321,7 @@ var textAnalyser2 = function (newtext, finalize) { addNode(newnodes[nodeindex], typeStack[nodeindex], typesetter); if (!starGraph) { addLink(newnodes[nodeindex - 1], newnodes[nodeindex], newlinks[linkindex], typesetter); - ANDconnect(newnodes[nodeindex]); + and_connect(newnodes[nodeindex]); } break; case LINK: @@ -335,14 +329,14 @@ var textAnalyser2 = function (newtext, finalize) { addNode("new node", "empty", "temp"); if (!starGraph) { addLink(newnodes[nodeindex - 1], "new node", newlinks[linkindex], "temp"); - ANDconnect("new node"); + and_connect("new node"); } ret.state = ANALYSIS_LINK; break; } //EXTERNAL AND CONNECTION CHECKING - function ANDconnect(node) { + function and_connect(node) { var verb; for(var x=0;x<newlinks.length;x++){ if(newlinks[x])if(newlinks[x].replace(/ /g,"")!=="and"){ @@ -369,7 +363,7 @@ var textAnalyser2 = function (newtext, finalize) { } } - ret.drop_conjugator_links = ANDcount < linkindex; + ret.drop_conjugator_links = and_count < linkindex; //FOR THE EXTERNAL ARROW-TYPE CHANGER lastnode = newnodes[nodeindex]; @@ -415,14 +409,14 @@ var textAnalyser2 = function (newtext, finalize) { } //UPDATE GRAPH ONCE graph.update(!finalize && comp.graph_same); - } + }; if (finalize) { typeStack = []; } return ret; -} +}; return { autocompleteCallback:autocompleteCallback, @@ -60,6 +60,7 @@ } .ui-datepicker { + background-color: rgb(17,17,17); background-color: rgba(17,17,17,0.9); width: 217px; height: auto; @@ -67,9 +68,9 @@ font-size: 9pt; border: 1px solid; - -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, .5); - -moz-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, .5); - box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, .5); + -webkit-box-shadow: 0 0 10px 0 rgba(0, 0, 0, .5); + -moz-box-shadow: 0 0 10px 0 rgba(0, 0, 0, .5); + box-shadow: 0 0 10px 0 rgba(0, 0, 0, .5); } @@ -84,16 +85,16 @@ } .ui-datepicker-next { float: right; - background-position: center 0px; + background-position: center 0; } .ui-datepicker-header { color: #e0e0e0; font-weight: bold; - -webkit-box-shadow: inset 0px 1px 1px 0px rgba(250, 250, 250, 2); - -moz-box-shadow: inset 0px 1px 1px 0px rgba(250, 250, 250, .2); - box-shadow: inset 0px 1px 1px 0px rgba(250, 250, 250, .2); - text-shadow: 1px -1px 0px #000; + -webkit-box-shadow: inset 0 1px 1px 0 rgba(250, 250, 250, 2); + -moz-box-shadow: inset 0 1px 1px 0 rgba(250, 250, 250, .2); + box-shadow: inset 0 1px 1px 0 rgba(250, 250, 250, .2); + text-shadow: 1px -1px 0 #000; filter: dropshadow(color=#000, offx=1, offy=-1); line-height: 30px; border-width: 1px 0 0 0; |
