39 var _left = _annotation.begin * _scale, |
39 var _left = _annotation.begin * _scale, |
40 _width = ( _annotation.end - _annotation.begin ) * _scale, |
40 _width = ( _annotation.end - _annotation.begin ) * _scale, |
41 _center = _left + _width / 2, |
41 _center = _left + _width / 2, |
42 _fulltext = _annotation.title + ( _annotation.description ? ( '<br/>' + _annotation.description ) : '' ); |
42 _fulltext = _annotation.title + ( _annotation.description ? ( '<br/>' + _annotation.description ) : '' ); |
43 return { |
43 return { |
44 text : _fulltext.replace(/(^.{120,140})[\s].+$/m,'$1…'), |
44 text : _fulltext.replace(/(\n|\r|\r\n)/mg,' ').replace(/(^.{120,140})[\s].+$/m,'$1…'), |
45 color : ( typeof _annotation.color !== "undefined" && _annotation.color ? _annotation.color : _this.colors[_k % _this.colors.length] ), |
45 color : ( typeof _annotation.color !== "undefined" && _annotation.color ? _annotation.color : _this.colors[_k % _this.colors.length] ), |
46 beginseconds : _annotation.begin.getSeconds() , |
46 beginseconds : _annotation.begin.getSeconds() , |
47 left : Math.floor( _left ), |
47 left : Math.floor( _left ), |
48 width : Math.floor( _width ), |
48 width : Math.floor( _width ), |
49 center : Math.floor( _center ), |
49 center : Math.floor( _center ), |