--- a/web/res/metadataplayer/Segments.js Tue Jul 24 18:01:16 2012 +0200
+++ b/web/res/metadataplayer/Segments.js Wed Jul 25 18:03:07 2012 +0200
@@ -14,7 +14,7 @@
IriSP.Widgets.Segments.prototype.template =
'<div class="Ldt-Segments-List">{{#segments}}'
- + '<div class="Ldt-Segments-Segment Ldt-TraceMe" trace-info="segment-id:{{id}}" segment-id="{{id}}" segment-text="{{text}}" segment-color="{{color}}" center-pos="{{center}}" begin-seconds="{{beginseconds}}"'
+ + '<div class="Ldt-Segments-Segment Ldt-TraceMe" trace-info="segment-id:{{id}}, media-id:{{media_id}}" segment-id="{{id}}" segment-text="{{text}}" segment-color="{{color}}" center-pos="{{center}}" begin-seconds="{{beginseconds}}"'
+ 'style="left:{{left}}px; width:{{width}}px; background:{{color}}"></div>'
+ '{{/segments}}</div>'
+ '<div class="Ldt-Segments-Position"></div>'
@@ -41,13 +41,14 @@
_center = _left + _width / 2,
_fulltext = _annotation.title + ( _annotation.description ? ( '<br/>' + _annotation.description ) : '' );
return {
- text : _fulltext.replace(/(^.{120,140})[\s].+$/,'$1…'),
+ text : _fulltext.replace(/(\n|\r|\r\n)/mg,' ').replace(/(^.{120,140})[\s].+$/m,'$1…'),
color : ( typeof _annotation.color !== "undefined" && _annotation.color ? _annotation.color : _this.colors[_k % _this.colors.length] ),
beginseconds : _annotation.begin.getSeconds() ,
left : Math.floor( _left ),
width : Math.floor( _width ),
center : Math.floor( _center ),
- id : _annotation.id
+ id : _annotation.id,
+ media_id : _annotation.getMedia().id
}
})
}));