src/widgets/Segments.js
branchnew-model
changeset 928 5aadbc9f27cd
parent 926 e47ed8eb75cd
child 930 165f236e42f2
equal deleted inserted replaced
927:977a39c4ee80 928:5aadbc9f27cd
    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&hellip;'),
    44                 text : _fulltext.replace(/(\n|\r|\r\n)/mg,' ').replace(/(^.{120,140})[\s].+$/m,'$1&hellip;'),
    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 ),