src/js/widgets/segmentsWidget.js
branchpopcorn-port
changeset 222 0f86664b470d
parent 220 6498b89eabcd
child 223 f14172bdea28
equal deleted inserted replaced
221:2a83d308dba6 222:0f86664b470d
    35 
    35 
    36     var begin = Math.round((+ annotation.begin) / 1000);
    36     var begin = Math.round((+ annotation.begin) / 1000);
    37     var end = Math.round((+ annotation.end) / 1000);
    37     var end = Math.round((+ annotation.end) / 1000);
    38     var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000;
    38     var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000;
    39     var id = annotation.id;
    39     var id = annotation.id;
    40     var startPourcent 	= IriSP.timeToPourcent(begin, duration) + onePxPercent * annotations.length * 2;
    40     var startPourcent 	= IriSP.timeToPourcent(begin, duration);
    41     var endPourcent 	= IriSP.timeToPourcent(end, duration) - startPourcent;
    41     
       
    42     /* some sort of collapsing occurs, so we only have to substract one pixel to each box instead of
       
    43        two
       
    44     */
       
    45     var endPourcent 	= IriSP.timeToPourcent(end, duration) - startPourcent - onePxPercent * 1;
       
    46     
       
    47     /* on the other hand, we have to substract one pixel from the first box because it's the only
       
    48        one to have to effective 1px margins */
       
    49     if (i == 0) {
    42 
    50 
       
    51       endPourcent -= onePxPercent;
       
    52     }
       
    53     
    43     var divTitle		= annotation.content.title.substr(0,55);
    54     var divTitle		= annotation.content.title.substr(0,55);
    44     var color = annotation.content.color
    55     var color = annotation.content.color
    45 
    56 
    46 
    57 
    47     var annotationTemplate = Mustache.to_html(IriSP.annotation_template,
    58     var annotationTemplate = Mustache.to_html(IriSP.annotation_template,