diff -r c9c502117eb6 -r ff4b567d51f2 web/res/metadataplayer/Transcript.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/res/metadataplayer/Transcript.js Sun Feb 15 00:43:16 2015 +0100 @@ -0,0 +1,37 @@ +/* This widget displays annotations as a transcript */ + +IriSP.Widgets.Transcript = function(player, config) { + IriSP.Widgets.Widget.call(this, player, config); +} + +IriSP.Widgets.Transcript.prototype = new IriSP.Widgets.Widget(); + +IriSP.Widgets.Transcript.prototype.defaults = { + annotation_type: "Caption" + // container: "transcriptContainer" +} + +IriSP.Widgets.Transcript.prototype.template = '
'; + +IriSP.Widgets.Transcript.prototype.annotationTemplate = '{{ content }} '; + +IriSP.Widgets.Transcript.prototype.draw = function() { + var _annotations = this.getWidgetAnnotations(); + var _this = this; + var content; + + _this.renderTemplate(); + content = _this.$.find('.Ldt-TranscriptWidget'); + + _annotations.forEach(function(_a) { + var _data = { + id : _a.id, + content : IriSP.textFieldHtml(_a.title), + begin : _a.begin.toString(), + end : _a.end.toString() + }; + var _html = Mustache.to_html(_this.annotationTemplate, _data); + var _el = IriSP.jQuery(_html); + content.append(_el); + }); +};