summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gant.js3
-rw-r--r--scripts/rhizicore.js2
-rw-r--r--scripts/textanalysis.js47
3 files changed, 38 insertions, 14 deletions
diff --git a/scripts/gant.js b/scripts/gant.js
index a89f9035..4b526f59 100644
--- a/scripts/gant.js
+++ b/scripts/gant.js
@@ -2,8 +2,6 @@
function checkSwitch(checkswitch) {
-
-
if (checkswitch.checked) {
vis.selectAll(".gantt").remove();
$('.missingdates').fadeOut(300);
@@ -19,7 +17,6 @@ function checkSwitch(checkswitch) {
} else {
ganttTimer=0;
-
$('.missingdates').fadeIn(300);
graph.recenterZoom();
diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js
index bd31f6f8..978433aa 100644
--- a/scripts/rhizicore.js
+++ b/scripts/rhizicore.js
@@ -323,7 +323,7 @@ function myGraph(el) {
vis = this.vis = d3.select(el).append("svg:svg")
.attr("width", w * 5)
- .attr("height", h * 5)
+ .attr("height", h )
.attr("pointer-events", "all")
.append("g")
.call(zoomObject)
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js
index 31b759d9..9422a095 100644
--- a/scripts/textanalysis.js
+++ b/scripts/textanalysis.js
@@ -35,25 +35,37 @@ $("#textanalyser").keypress(function(e) {
return false;
}
+ if (e.which == 37) {//RIGHT
- if (e.which == 9) {//TAB
- text = $('#textanalyser').val();
- $('#textanalyser').val(text+" ");
+ $('body').scrollLeft(0);
+ e.stopPropagation();
return false;
}
-});
+ if (e.which == 39) { //LEFT
-$(document).keydown(function(e) {
- if (e.keyCode == 37) {//RIGHT
- e.preventDefault();
- changeType("up", lastnode);
+ $('body').scrollLeft(0);
+ e.stopPropagation();
return false;
}
- if (e.keyCode == 39) { //LEFT
+
+});
+
+$(document).keydown(function(e) {
+
+
+ if (e.keyCode == 9) {//TAB
e.preventDefault();
changeType("down", lastnode);
return false;
}
+
+ if (e.keyCode == 37) {//UP
+ $('html, body').scrollLeft(0);
+ }
+ if (e.keyCode == 39) {//DOWN
+ $('html, body').scrollLeft(0);
+ }
+
if (e.keyCode == 38) {//UP
suggestionChange=true;
}
@@ -67,6 +79,21 @@ $(document).keydown(function(e) {
});
+
+function textSelect(inp, s, e) {
+ e = e || s;
+ if (inp.createTextRange) {
+ var r = inp.createTextRange();
+ r.collapse(true);
+ r.moveEnd('character', e);
+ r.moveStart('character', s);
+ r.select();
+ }else if(inp.setSelectionRange) {
+ inp.focus();
+ inp.setSelectionRange(s, e);
+ }
+ }
+
function changeType(arg, id) {
if (arg === 'up') {
if (typeindex < 4) typeindex++;
@@ -249,7 +276,7 @@ function TextAnalyser2(newtext, finalize) {
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('<table><tr><td style="height:28px"></td></tr><tr><td>Use arrows to pick a type</td></tr></table>');
+ $('.typeselection').html('<table><tr><td style="height:28px"></td></tr><tr><td>Use [TAB] key to pick a type</td></tr></table>');
break;
case "NODE":