src/js/widgets/annotationsWidget.js
branchpopcorn-port
changeset 842 4ae2247a59f4
parent 838 03b03865eb9b
equal deleted inserted replaced
841:8da49ff273e0 842:4ae2247a59f4
    30     var title = annotation.content.title;
    30     var title = annotation.content.title;
    31     var description = annotation.content.description;
    31     var description = annotation.content.description;
    32     var keywords =  "";
    32     var keywords =  "";
    33     var begin = +annotation.begin / 1000;
    33     var begin = +annotation.begin / 1000;
    34     var end = +annotation.end / 1000;
    34     var end = +annotation.end / 1000;
    35     var duration = this._serializer.getDuration();
    35     var duration = this.getDuration();
    36     var tags = "";
    36     var tags = "";
    37     
    37     
    38     var title_templ = "{{title}} - ( {{begin}} - {{end}} )";
    38     var title_templ = "{{title}} - ( {{begin}} - {{end}} )";
    39     var endstr = Mustache.to_html(title_templ, {title: title, begin: IriSP.secondsToTime(begin), end: IriSP.secondsToTime(end)});
    39     var endstr = Mustache.to_html(title_templ, {title: title, begin: IriSP.secondsToTime(begin), end: IriSP.secondsToTime(end)});
    40 
    40 
    62     tags = IriSP.i18n.getMessage("keywords") + ": " + tags.slice(0, tags.length - 2);
    62     tags = IriSP.i18n.getMessage("keywords") + ": " + tags.slice(0, tags.length - 2);
    63     
    63     
    64     this.selector.find(".Ldt-SaKeywords").text(tags);
    64     this.selector.find(".Ldt-SaKeywords").text(tags);
    65     
    65     
    66     // update sharing buttons
    66     // update sharing buttons
    67     var defaults = IriSP.widgetsDefaults.AnnotationsWidget;
       
    68     var text = defaults.share_text;
       
    69     var fb_link = defaults.fb_link;
       
    70     var tw_link = defaults.tw_link;
       
    71     var gplus_link = defaults.gplus_link;
       
    72     var url = document.location.href + "#id=" + annotation.id;
    67     var url = document.location.href + "#id=" + annotation.id;
    73     this.selector.find(".Ldt-fbShare").attr("href", IriSP.mkFbUrl(url, text));
    68     this.selector.find(".Ldt-fbShare").attr("href", IriSP.mkFbUrl(url, this.share_text));
    74     this.selector.find(".Ldt-TwShare").attr("href", IriSP.mkTweetUrl(url, text));
    69     this.selector.find(".Ldt-TwShare").attr("href", IriSP.mkTweetUrl(url, this.share_text));
    75     this.selector.find(".Ldt-GplusShare").attr("href", IriSP.mkGplusUrl(url, text));
    70     this.selector.find(".Ldt-GplusShare").attr("href", IriSP.mkGplusUrl(url, this.share_text));
    76 };
    71 };
    77 
    72 
    78 IriSP.AnnotationsWidget.prototype.clearWidget = function() {   
    73 IriSP.AnnotationsWidget.prototype.clearWidget = function() {   
    79     /* retract the pane between two annotations */
    74     /* retract the pane between two annotations */
    80     this.selector.find(".Ldt-SaTitle").text("");
    75     this.selector.find(".Ldt-SaTitle").text("");