diff -r 7e5174fe9816 -r 5b7d7ab6baff web/res/metadataplayer/Annotation.js --- a/web/res/metadataplayer/Annotation.js Mon May 21 18:53:02 2012 +0200 +++ b/web/res/metadataplayer/Annotation.js Tue May 22 16:47:35 2012 +0200 @@ -12,26 +12,30 @@ share_on: "Partager sur", watching: "Je regarde ", on_site: " sur ", - tags: "Mots-clés :" + tags: "Mots-clés :", + excerpt_from: "Extrait de :" }, "en": { share_on: "Share on", watching: "I'm watching ", on_site: " on ", - tags: "Keywords:" + tags: "Keywords:", + excerpt_from: "Excerpt from:" } } IriSP.Widgets.Annotation.prototype.template = '
' + '
' - + '' - + '' - + '' + + '' + + '' + + '' + '

' + '( - )

' + + '

{{l10n.excerpt_from}} ' + + '( - )

' + '

' - + '
{{l10n.tags}}
    '; + + '
    {{l10n.tags}}
    '; IriSP.Widgets.Annotation.prototype.defaults = { annotation_type : "chap", @@ -78,10 +82,22 @@ var _tags = _annotation.getTagTexts(); if (_tags.length) { var _html = IriSP._(_tags).map(function(_tag) { - return '
  • ' + _tag + '
  • '; + return '
  • ' + _tag + '
  • '; }).join(""); this.$.find(".Ldt-Annotation-Tags").html(_html); this.$.find(".Ldt-Annotation-Tags-Block").removeClass("Ldt-Annotation-NoTags"); + + /* Correct the empty tag bug */ + this.$.find('.Ldt-Annotation-TagLabel').each(function() { + var _el = IriSP.jQuery(this); + if (!_el.text().replace(/(^\s+|\s+$)/g,'')) { + _el.detach(); + } + }); + + this.$.find('.Ldt-Annotation-TagLabel').click(function() { + _this.player.popcorn.trigger("IriSP.search.triggeredSearch", IriSP.jQuery(this).text().replace(/(^\s+|\s+$)/g,'')); + }); } else { this.$.find(".Ldt-Annotation-Tags-Block").addClass("Ldt-Annotation-NoTags"); } @@ -89,6 +105,14 @@ this.$.find(".Ldt-Annotation-Description").html(_annotation.description); this.$.find(".Ldt-Annotation-Begin").html(_annotation.begin.toString()); this.$.find(".Ldt-Annotation-End").html(_annotation.end.toString()); + if (_annotation.elementType === "mashedAnnotation") { + this.$.find('.Ldt-Annotation-Inner').addClass("Ldt-Annotation-isMashup"); + this.$.find(".Ldt-Annotation-MashupMedia").html(_annotation.getMedia().title); + this.$.find(".Ldt-Annotation-MashupBegin").html(_annotation.annotation.begin.toString()); + this.$.find(".Ldt-Annotation-MashupEnd").html(_annotation.annotation.end.toString()); + } else { + this.$.find('.Ldt-Annotation-Inner').removeClass("Ldt-Annotation-isMashup"); + } this.$.find(".Ldt-Annotation-Fb").attr("href", "http://www.facebook.com/share.php?" + IriSP.jQuery.param({ u: _url, t: _text })); this.$.find(".Ldt-Annotation-Twitter").attr("href", "https://twitter.com/intent/tweet?" + IriSP.jQuery.param({ url: _url, text: _text })); this.$.find(".Ldt-Annotation-Gplus").attr("href", "https://plusone.google.com/_/+1/confirm?" + IriSP.jQuery.param({ url: _url, title: _text }));