Commit 8e576dbec8a0fb151f12898d1665cc3a886c0eba

Enabling annotations for images and links
  • Diff rendering mode:
  • inline
  • side by side

static/text-annotation.js

57 var onHover = function(event) {57 var onHover = function(event) {
58 var elem = event.currentTarget;58 var elem = event.currentTarget;
59 //console.log(elem.style);59 //console.log(elem.style);
60 elem.addEventListener('click', onClick);
60 elem.addEventListener('click', onClick, false);
61 elem.style.border = '1px solid black';61 elem.style.border = '1px solid black';
62 elem.style.boxShadow = '1px 5px 5px #ccc';62 elem.style.boxShadow = '1px 5px 5px #ccc';
63 //elem.style.background = 'red';63 //elem.style.background = 'red';
73 elem.removeEventListener('click', onClick);73 elem.removeEventListener('click', onClick);
74 };74 };
75 var onClick = function(event) {75 var onClick = function(event) {
76 event.stopPropagation();
76 console.log(event);
77 $(event).preventDefault();
78 $(event).stopPropagation();
77 var elem = event.currentTarget;79 var elem = event.currentTarget;
78 elem.style.border = 'none';80 elem.style.border = 'none';
79 elem.style.boxShadow = '';81 elem.style.boxShadow = '';
85 user = prompt('Enter your name: ');85 user = prompt('Enter your name: ');
86 label = prompt('Enter a label for annotation: ');86 label = prompt('Enter a label for annotation: ');
87 initAnnotationTree();87 initAnnotationTree();
88 return false;
88 };89 };
8990
9091

static/tree.js

192 url: config.indexer + '/submit',192 url: config.indexer + '/submit',
193 data: {'data': JSON.stringify(this.swts)},193 data: {'data': JSON.stringify(this.swts)},
194 success: function() {194 success: function() {
195 $.ajax({
195 /*$.ajax({
196 type: 'POST',196 type: 'POST',
197 url: config.postTweetUrl,197 url: config.postTweetUrl,
198 data: {'data': JSON.stringify(this.swts)},198 data: {'data': JSON.stringify(this.swts)},
203 error: function() {203 error: function() {
204 $('#fail-posting').show();204 $('#fail-posting').show();
205 }205 }
206 });
206 });*/
207 $('#posted').show();207 $('#posted').show();
208 var swts = '';208 var swts = '';
209 for(var i in sweet.swts) {209 for(var i in sweet.swts) {