From 8e115fb2d3ea7eb34a9c3a4307c32034b39d51b1 Mon Sep 17 00:00:00 2001 From: Owen Date: Tue, 22 Jul 2014 14:44:46 +0300 Subject: Save/UI/gantt changes save now asks you if you're sure if you've build an unsaved graph small changes to UI recommended by Yael took out zooming bug in gantt --- index.html | 4 +++- scripts/buttons.js | 15 ++++++++++----- scripts/gant.js | 8 ++++++-- scripts/rhizicore.js | 41 ++++++++++++++++++++++++++++++++++------- style.css | 10 +++++----- 5 files changed, 58 insertions(+), 20 deletions(-) diff --git a/index.html b/index.html index 5680f2ef..f63ff8c1 100644 --- a/index.html +++ b/index.html @@ -8,13 +8,14 @@ + + - @@ -98,6 +99,7 @@ + diff --git a/scripts/buttons.js b/scripts/buttons.js index 472b58ff..980a51d9 100644 --- a/scripts/buttons.js +++ b/scripts/buttons.js @@ -40,17 +40,22 @@ $('.save').click(function(){ if(j!==links.length-1)jsonsave+=","; } jsonsave+=']}'; - console.log(jsonsave); + console.log(JSON.stringify(jsonsave)); localStorage.setItem(key, JSON.stringify(jsonsave)); }); $('.load').click(function(){ - if (confirm('All unsaved changes will be deleted, are you sure?')) { + var acceptLoad=true; + if (nodes.length>0){ + acceptLoad = confirm('All unsaved changes will be deleted, are you sure?'); + } + + if(acceptLoad){ links=[]; - nodes=[]; - var data = JSON.parse(JSON.parse(localStorage.getItem(key))); - console.log(data); + nodes=[]; + var data = JSON.parse(JSON.parse(localStorage.getItem(key))); + console.log(data); for(var i=0; i1.7){ + threashhold=1; + }else{ + threashhold=2; + } + + if(zoomLevel!==threashhold){ + zoomLevel=threashhold; + + if(zoomLevel===1){ + $('.linklabel').fadeIn(200); + } + if(zoomLevel===2){ + $('.linklabel').fadeOut(200); + } + }*/ + + + + + } @@ -269,7 +295,7 @@ function myGraph(el) { vis.append("rect") .attr("class", "overlay") - .attr("width", w) + .attr("width", w*5) .attr("height", h); $('.overlay').click(mousedown); @@ -280,8 +306,8 @@ function myGraph(el) { .attr("viewBox", "0 -5 10 10") .attr("refX", 23) .attr("refY", -1.8) - .attr("markerWidth", 2.5) - .attr("markerHeight", 2.5) + .attr("markerWidth", 5) + .attr("markerHeight", 5) .attr("orient", "auto") .attr("class","graph") .style("fill", "#aaa") @@ -299,7 +325,7 @@ function myGraph(el) { }) .attr("marker-end", "url(#end)") .on("click", function (d, i) { - $('#textanalyser').val("node("+d.source.id+") -> "+d.name+" -> node("+d.target.id+")"); + //$('#textanalyser').val("node("+d.source.id+") -> "+d.name+" -> node("+d.target.id+")"); });; @@ -591,9 +617,10 @@ function showInfo(d, i) { $('.info').html('Name: '+d.id+'
'); } else { $('.info').html('Name: '+d.id+'
'); + } + $('.info').css("border-color",customColor(d.type)); - } $("#editenddate").datepicker({ inline: true, showOtherMonths: true, diff --git a/style.css b/style.css index 0ca60d12..fdb7ac77 100644 --- a/style.css +++ b/style.css @@ -130,14 +130,14 @@ input:focus { .link { fill: none; stroke: #404040; - stroke-width: 4px; + stroke-width: 2px; z-index:1; } .highlightlink { fill: none; stroke: #EDE275; - stroke-width: 4px; + stroke-width: 2px; z-index:1; pointer-events: none; } @@ -145,7 +145,7 @@ input:focus { .enterlink { fill: none; stroke: #EDE275; - stroke-width: 5px; + stroke-width: 2px; z-index:1; pointer-events: none; } @@ -153,7 +153,7 @@ input:focus { .exitlink { fill: none; stroke: #EDE275; - stroke-width: 4px; + stroke-width: 2px; z-index:1; pointer-events: none; } @@ -254,7 +254,7 @@ input:focus { top:5px; left:10px; margin-left:12px; - font-size: 18px; + font-size: 20px; } .overlay { -- cgit v1.3.1