From 8e576dbec8a0fb151f12898d1665cc3a886c0eba Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Sat, 30 Mar 2013 11:58:26 +0530 Subject: [PATCH] Enabling annotations for images and links --- static/text-annotation.js | 7 +++++-- static/tree.js | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/static/text-annotation.js b/static/text-annotation.js index bf97412..df55e9e 100755 --- a/static/text-annotation.js +++ b/static/text-annotation.js @@ -57,7 +57,7 @@ var attributes = {}; var onHover = function(event) { var elem = event.currentTarget; //console.log(elem.style); - elem.addEventListener('click', onClick); + elem.addEventListener('click', onClick, false); elem.style.border = '1px solid black'; elem.style.boxShadow = '1px 5px 5px #ccc'; //elem.style.background = 'red'; @@ -73,7 +73,9 @@ var attributes = {}; elem.removeEventListener('click', onClick); }; var onClick = function(event) { - event.stopPropagation(); + console.log(event); + $(event).preventDefault(); + $(event).stopPropagation(); var elem = event.currentTarget; elem.style.border = 'none'; elem.style.boxShadow = ''; @@ -83,6 +85,7 @@ var attributes = {}; user = prompt('Enter your name: '); label = prompt('Enter a label for annotation: '); initAnnotationTree(); + return false; }; diff --git a/static/tree.js b/static/tree.js index 41034c2..3f21c6c 100755 --- a/static/tree.js +++ b/static/tree.js @@ -192,7 +192,7 @@ var sweet = { url: config.indexer + '/submit', data: {'data': JSON.stringify(this.swts)}, success: function() { - $.ajax({ + /*$.ajax({ type: 'POST', url: config.postTweetUrl, data: {'data': JSON.stringify(this.swts)}, @@ -203,7 +203,7 @@ var sweet = { error: function() { $('#fail-posting').show(); } - }); + });*/ $('#posted').show(); var swts = ''; for(var i in sweet.swts) { -- 1.7.10.4