diff -r 154c049e0c06 -r 19389e221722 src/js/widgets/annotationsWidget.js --- a/src/js/widgets/annotationsWidget.js Thu Dec 15 16:35:48 2011 +0100 +++ b/src/js/widgets/annotationsWidget.js Fri Dec 16 10:41:48 2011 +0100 @@ -12,7 +12,7 @@ this.selector.find(".Ldt-SaKeywordText").text(""); }; -IriSP.AnnotationsWidget.prototype.displayAnnotation = function(annotation) { +IriSP.AnnotationsWidget.prototype.displayAnnotation = function(annotation) { var title = annotation.content.title; var description = annotation.content.description; @@ -20,12 +20,23 @@ var begin = +annotation.begin / 1000; var end = +annotation.end / 1000; var duration = +this._serializer.currentMedia().meta["dc:duration"]; - + var title_templ = "{{title}} - ( {{begin}} - {{end}} )"; var endstr = Mustache.to_html(title_templ, {title: title, begin: IriSP.secondsToTime(begin), end: IriSP.secondsToTime(end)}); this.selector.find(".Ldt-SaTitle").text(endstr); this.selector.find(".Ldt-SaDescription").text(description); + + // update sharing buttons + var defaults = IriSP.widgetsDefaults.AnnotationsWidget; + var text = defaults.share_text; + var fb_link = defaults.fb_link; + var tw_link = defaults.tw_link; + var gplus_link = defaults.gplus_link; + var url = document.location.href + "#a=" + annotation.id; + this.selector.find(".Ldt-fbShare").attr("href", fb_link + IriSP.encodeURI(text) + IriSP.encodeURI(url)); + this.selector.find(".Ldt-TwShare").attr("href", tw_link + IriSP.encodeURI(text) + IriSP.encodeURI(url)); + this.selector.find(".Ldt-GplusShare").attr("href", fb_link + IriSP.encodeURI(text) + IriSP.encodeURI(url)); }; IriSP.AnnotationsWidget.prototype.clearWidget = function() {