--- a/src/js/widgets/annotationsWidget.js Wed Nov 23 12:23:47 2011 +0100
+++ b/src/js/widgets/annotationsWidget.js Wed Nov 23 12:24:27 2011 +0100
@@ -17,13 +17,16 @@
var title = annotation.content.title;
var description = annotation.content.description;
var keywords = "" // FIXME;
- var begin = +annotation.begin;
- var end = +annotation.end;
+ var begin = +annotation.begin / 1000;
+ var end = +annotation.end / 1000;
var duration = +this._serializer.currentMedia().meta["dc:duration"];
- this.selector.find(".Ldt-SaTitle").text(title);
+ 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);
- var startPourcent = parseInt(Math.round((begin*1+(end*1-begin*1)/2) / (duration*1)) / 100);
+ //var startPourcent = parseInt(Math.round((begin*1+(end*1-begin*1)/2) / (duration*1)) / 100);
};
@@ -69,4 +72,4 @@
this._Popcorn = this._Popcorn.code(conf);
}
-};
\ No newline at end of file
+};
--- a/unittests/tests/widgets/annotationsWidget.js Wed Nov 23 12:23:47 2011 +0100
+++ b/unittests/tests/widgets/annotationsWidget.js Wed Nov 23 12:24:27 2011 +0100
@@ -36,7 +36,7 @@
widget.draw();
var annotation = {content: {"title": "title", "description": "description", "keywords": "keywords"}};
widget.displayAnnotation(annotation);
- equal(widget.selector.find(".Ldt-SaTitle").text(), "title", "title set correctly");
+ equal(widget.selector.find(".Ldt-SaTitle").text(), "title - ( NaN:NaN - NaN:NaN )", "title set correctly");
equal(widget.selector.find(".Ldt-SaDescription").text(), "description", "description set correctly");
equal(widget.selector.find(".Ldt-SaKeywordText").text(), "", "keywords field set correctly");
});