diff -r c9c502117eb6 -r ff4b567d51f2 web/res/metadataplayer/AnnotationsList.js --- a/web/res/metadataplayer/AnnotationsList.js Fri Feb 13 13:14:15 2015 +0100 +++ b/web/res/metadataplayer/AnnotationsList.js Sun Feb 15 00:43:16 2015 +0100 @@ -29,6 +29,8 @@ limit_count : 20, newest_first : false, show_audio: true, + show_creator: false, + show_controls: false, polemics : [{ keyword: "++", background_color: "#c9ecc6" @@ -58,15 +60,16 @@ IriSP.Widgets.AnnotationsList.prototype.template = '
' + '{{#show_audio}}
{{/show_audio}}' + + '{{#show_controls}}
Previous | Next
{{/show_controls}}' + '' + '
'; IriSP.Widgets.AnnotationsList.prototype.annotationTemplate = - '
  • ' + '
  • ' + '
    ' + '' - + '' + + '' + '' + '
    ' + '
    {{begin}} - {{end}}
    ' @@ -183,15 +186,19 @@ : document.location.href.replace(/#.*$/,'') + '#id=' + _annotation.id ) ); - var _title = (_annotation.title || "").replace(_annotation.description,''), + var _title = "", _description = _annotation.description, _thumbnail = (typeof _annotation.thumbnail !== "undefined" && _annotation.thumbnail ? _annotation.thumbnail : _this.default_thumbnail); - if (!_annotation.title) { - _title = _annotation.creator; + // Update : display creator + if (_annotation.creator && _this.show_creator) { + _title = _annotation.creator; } - if (!_annotation.description && _annotation.creator) { - _description = _annotation.title; - _title = _annotation.creator; + if (_annotation.title) { + var tempTitle = _annotation.title; + if( tempTitle.substr(0, _title.length + 1) == (_title + ":") ){ + _title = ""; + } + _title = _title + ( (_title=="") ? "" : ": ") + _annotation.title; } var _bgcolor; IriSP._(_this.polemics).each(function(_polemic) { @@ -203,16 +210,23 @@ var _data = { id : _annotation.id, media_id : _annotation.getMedia().id, + atitle: IriSP.textFieldHtml(_annotation.title), htitle : IriSP.textFieldHtml(_title), hdescription : IriSP.textFieldHtml(_description), begin : _annotation.begin.toString(), end : _annotation.end.toString(), + begin_ms : _annotation.begin.milliseconds, + end_ms : _annotation.end.milliseconds, thumbnail : _thumbnail, url : _url, tags : _annotation.getTagTexts(), specific_style : (typeof _bgcolor !== "undefined" ? "background-color: " + _bgcolor : ""), l10n: _this.l10n }; + if (_this.show_controls) { + _this.$.find(".Ldt-AnnotationsList-Control-Prev").on("click", function (e) { e.preventDefault(); _this.navigate(-1); }); + _this.$.find(".Ldt-AnnotationsList-Control-Next").on("click", function (e) { e.preventDefault(); _this.navigate(+1); }); + } if (_this.show_audio && _annotation.audio && _annotation.audio.href && _annotation.audio.href != "null") { _data.audio = true; if (!_this.jwplayers[_annotation.id]) {