# HG changeset patch # User hamidouk # Date 1325607241 -3600 # Node ID 8f483e430f51050d88e5c5cc75849fbd5a941e2e # Parent 5770c64e2ec635d79256fed6a7ff743936bf891c added link sharing for created annotations. diff -r 5770c64e2ec6 -r 8f483e430f51 src/js/utils.js --- 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) { diff -r 5770c64e2ec6 -r 8f483e430f51 src/js/widgets/createAnnotationWidget.js --- 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 diff -r 5770c64e2ec6 -r 8f483e430f51 src/templates/createAnnotationWidget.html --- 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.
Would you like to share it on social networks ?
- - - + + +
diff -r 5770c64e2ec6 -r 8f483e430f51 src/templates/createAnnotationWidget_festivalCinecast.html --- 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.
Would you like to share it on social networks ?
- - - + + +