summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-10-28 19:57:32 +0200
committerAlon Levy <alon@pobox.com>2014-10-28 19:57:32 +0200
commitc559161ed81a1eac2d2e13d9e734ed97b3174e71 (patch)
tree1e7a2a129cd6f4262537b64eccb9c367db2368f9 /scripts
parent92df118bf77da59a8f350829077846f179d9634c (diff)
make debug ui click handlers only apply to the labels, remove some debug prints
Diffstat (limited to 'scripts')
-rw-r--r--scripts/buttons.js12
-rw-r--r--scripts/rhizicore.js1
2 files changed, 6 insertions, 7 deletions
diff --git a/scripts/buttons.js b/scripts/buttons.js
index bbde2d45..5f406d45 100644
--- a/scripts/buttons.js
+++ b/scripts/buttons.js
@@ -6,13 +6,13 @@ $('.tutorial').click(function(){});
var key="#47989379";
-$('.save').click(function(){
+$('.save a').click(function(){
var json = RZ.graph.save_to_json();
- console.log(json);
+ console.log('saving to local storage ' + json.length + ' bytes');
localStorage.setItem(key, json);
});
-$('.saveToFile').click(function() {
+$('.saveToFile a').click(function() {
var json = RZ.graph.save_to_json();
var filename = 'graph.json';
var blob = new Blob([json], {type: 'application/json'});
@@ -52,7 +52,7 @@ $('.file-load').on('change', function(event) {
reader.readAsText(file, "text/javascript");
});
-$('.local-storage-load').click(function(){
+$('.local-storage-load a').click(function(){
if (!really_load()) {
return;
}
@@ -60,7 +60,7 @@ $('.local-storage-load').click(function(){
RZ.graph.load_from_json(json_blob);
});
-$('.set-user').click(function() {
+$('a.set-user').click(function() {
$('.set-user').hide();
$('.set-user-form').show();
$('.set-user-form').submit(function() {
@@ -74,7 +74,7 @@ $('.set-user').click(function() {
})
});
-$('.save-history').click(function() {
+$('a.save-history').click(function() {
if (RZ.graph.history === undefined) {
throw "History is undefined";
}
diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js
index a1eba12e..4d1a74a0 100644
--- a/scripts/rhizicore.js
+++ b/scripts/rhizicore.js
@@ -542,7 +542,6 @@ function myGraph(el) {
function save_to_json() {
var d = {"nodes":[], "links":[]};
- console.log(nodes);
for(var i = 0 ; i < nodes.length ; i++){
var node = nodes[i];
d['nodes'].push({