Commit e80992cc by lduarte1991

Annotation Tool: Fixing Table Share bug (2b)

parent 28f5ed1c
...@@ -33,7 +33,7 @@ Annotator.Plugin.Share = (function(_super) { ...@@ -33,7 +33,7 @@ Annotator.Plugin.Share = (function(_super) {
return 'https://www.facebook.com/sharer/sharer.php?s=100&p[url]='+link+'&p[title]='+encodeURIComponent('Open Video Annotation')+'&p[summary]='+noteText; return 'https://www.facebook.com/sharer/sharer.php?s=100&p[url]='+link+'&p[title]='+encodeURIComponent('Open Video Annotation')+'&p[summary]='+noteText;
}, },
'twitter':function(title,link,noteText){ 'twitter':function(title,link,noteText){
return 'https://twitter.com/intent/tweet?original_referer='+link+'&source=tweetbutton&url='+link+ "&via=OpenVideoAnnotation&text=" +encodeURIComponent('I want to share the next Open Video Annotation: '); return 'https://twitter.com/intent/tweet?original_referer='+link+'&source=tweetbutton&url='+link+ "&via=OpenVideoAnnotation&text=" +encodeURIComponent('I want to share the following Open Video Annotation: ');
}, },
'google':function(title,link,noteText){ 'google':function(title,link,noteText){
return 'https://plus.google.com/share?url='+link; return 'https://plus.google.com/share?url='+link;
...@@ -135,8 +135,9 @@ Annotator.Plugin.Share = (function(_super) { ...@@ -135,8 +135,9 @@ Annotator.Plugin.Share = (function(_super) {
return false; return false;
}); });
// Share button // Share button
$(field).find('.share-button-annotator.share-button').click(function() { $(field).find('.share-button-annotator.share-button').click(function(event) {
event.preventDefault(); // disable normal link function so that it doesn't refresh the page event.preventDefault(); // disable normal link function so that it doesn't refresh the page
annotation = share.getAnnotationFromId(event.currentTarget.attributes.annotationid);
var _field = this, var _field = this,
ovaId = annotation.id, ovaId = annotation.id,
title = method == 1?'Share':'Share without saving'; title = method == 1?'Share':'Share without saving';
...@@ -471,6 +472,17 @@ Annotator.Plugin.Share = (function(_super) { ...@@ -471,6 +472,17 @@ Annotator.Plugin.Share = (function(_super) {
regex = null; regex = null;
return URL; return URL;
} }
Share.prototype.getAnnotationFromId = function(ovaId){
var annotationList = this.annotator.plugins.Store.annotations;
var value = undefined;
$.each(annotationList, function(key, val){
if(val.id == ovaId.nodeValue){
value = val;
}
});
return value;
}
Share.prototype.updateViewer = function(field, annotation) { Share.prototype.updateViewer = function(field, annotation) {
this.annotation = annotation; this.annotation = annotation;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment