added link sharing for created annotations.
--- a/src/js/utils.js Tue Jan 03 16:19:24 2012 +0100
+++ b/src/js/utils.js Tue Jan 03 17:14:01 2012 +0100
@@ -134,6 +134,22 @@
IriSP.__guidCounter += 1;
return prefix + IriSP.__guidCounter;
};
+
+/** returns an url to share on facebook */
+IriSP.mkFbUrl = function(url) {
+ return "http://www.facebook.com/share.php?u=" + "I'm watching " + url;
+};
+
+/** returns an url to share on twitter */
+IriSP.mkTweetUrl = function(url) {
+ return "http://twitter.com/home?status=" + "I'm sharing " + url;
+};
+
+/** returns an url to share on google + */
+IriSP.mkGplusUrl = function(url) {
+ return "";
+};
+
/* for ie compatibility
if (Object.prototype.__defineGetter__&&!Object.defineProperty) {
Object.defineProperty=function(obj,prop,desc) {
--- a/src/js/widgets/createAnnotationWidget.js Tue Jan 03 16:19:24 2012 +0100
+++ b/src/js/widgets/createAnnotationWidget.js Tue Jan 03 17:14:01 2012 +0100
@@ -150,7 +150,15 @@
if (this.cinecast_version) {
this.selector.find(".Ldt-createAnnotation-Title").parent().show();
}
+
+ var twStatus = IriSP.mkTweetUrl(document.location.href);
+ var gpStatus = IriSP.mkGplusUrl(document.location.href);
+ var fbStatus = IriSP.mkFbUrl(document.location.href);
+ this.selector.find(".Ldt-createAnnotation-endScreen-TweetLink").attr("href", twStatus);
+ this.selector.find(".Ldt-createAnnotation-endScreen-FbLink").attr("href", fbStatus);
+ this.selector.find(".Ldt-createAnnotation-endScreen-GplusLink").attr("href", gpStatus);
+
this.selector.find(".Ldt-createAnnotation-endScreen").show();
}
};
\ No newline at end of file
--- a/src/templates/createAnnotationWidget.html Tue Jan 03 16:19:24 2012 +0100
+++ b/src/templates/createAnnotationWidget.html Tue Jan 03 17:14:01 2012 +0100
@@ -28,9 +28,9 @@
Thank you, your annotation has been saved.<br>
Would you like to share it on social networks ?
<div style='margin-top: 12px; text-align: center;'>
- <img src='{{img_dir}}/tweet_button.png' style='margin-right: 20px;'></img>
- <img src='{{img_dir}}/facebook_button.png' style='margin-right: 20px;'></img>
- <img src='{{img_dir}}/gplus_button.png' style='margin-right: 20px;'></img>
+ <a class='Ldt-createAnnotation-endScreen-TweetLink'><img src='{{img_dir}}/tweet_button.png' style='margin-right: 20px;'></img></a>
+ <a class='Ldt-createAnnotation-endScreen-FbLink'><img src='{{img_dir}}/facebook_button.png' style='margin-right: 20px;'></img></a>
+ <a class='Ldt-createAnnotation-endScreen-GplusLink'><img src='{{img_dir}}/gplus_button.png' style='margin-right: 20px;'></img></a>
</div>
</div>
</div>
--- a/src/templates/createAnnotationWidget_festivalCinecast.html Tue Jan 03 16:19:24 2012 +0100
+++ b/src/templates/createAnnotationWidget_festivalCinecast.html Tue Jan 03 17:14:01 2012 +0100
@@ -28,9 +28,9 @@
Thank you, your annotation has been saved.<br>
Would you like to share it on social networks ?
<div style='margin-top: 12px; text-align: center;'>
- <img src='{{img_dir}}/tweet_button.png' style='margin-right: 20px;'></img>
- <img src='{{img_dir}}/facebook_button.png' style='margin-right: 20px;'></img>
- <img src='{{img_dir}}/gplus_button.png' style='margin-right: 20px;'></img>
+ <a class='Ldt-createAnnotation-endScreen-TweetLink'><img src='{{img_dir}}/tweet_button.png' style='margin-right: 20px;'></img></a>
+ <a class='Ldt-createAnnotation-endScreen-FbLink'><img src='{{img_dir}}/facebook_button.png' style='margin-right: 20px;'></img></a>
+ <a class='Ldt-createAnnotation-endScreen-GplusLink'><img src='{{img_dir}}/gplus_button.png' style='margin-right: 20px;'></img></a>
</div>
</div>
</div>