# HG changeset patch # User hamidouk # Date 1324307054 -3600 # Node ID 0bb36c79836c7ddea159aeb4943d44ad16fce784 # Parent 1c225a39a3b1326b9b808ab9c298911688c1e858 fixed positioning bug. diff -r 1c225a39a3b1 -r 0bb36c79836c src/css/LdtPlayer.css --- a/src/css/LdtPlayer.css Mon Dec 19 15:25:48 2011 +0100 +++ b/src/css/LdtPlayer.css Mon Dec 19 16:04:14 2011 +0100 @@ -18,7 +18,7 @@ } .Ldt-SegmentsWidget { - overflow: auto; /* clear the floats */ + /* overflow: auto; /* clear the floats */ margin-top: 1px; } @@ -28,6 +28,13 @@ border-right: 1px solid white; } + .Ldt-SegmentPositionMarker { + position: absolute; + z-index: 100; + width: 1px; + height: 10px; + background-color: white; + } .tooltip { display:none; background:transparent url(imgs/white_arrow_mini.png); @@ -358,14 +365,6 @@ border-right: 1px solid white; } - .positionMarker { - position: absolute; - z-index: 100; - width: 1px; - height: 20px; - background-color: white; - } - /* tweet Widget */ .Ldt-tweetWidget { font-size: 12px; diff -r 1c225a39a3b1 -r 0bb36c79836c src/js/widgets/segmentsWidget.js --- a/src/js/widgets/segmentsWidget.js Mon Dec 19 15:25:48 2011 +0100 +++ b/src/js/widgets/segmentsWidget.js Mon Dec 19 16:04:14 2011 +0100 @@ -58,15 +58,14 @@ var end = Math.round((+ annotation.end) / 1000); var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000; var id = annotation.id; - var startPourcent = IriSP.timeToPourcent(begin, duration) + onePxPercent; + var startPourcent = IriSP.timeToPourcent(begin, duration); - /* some sort of collapsing occurs, so we only have to substract one pixel to each box instead of - two + /* surprisingly, the following code doesn't work on webkit - for some reason, most of the + boxes are 3 pixels smaller. */ - var endPourcent = IriSP.timeToPourcent(end, duration) - startPourcent - onePxPercent * 1.5; - - /* on the other hand, we have to substract one pixel from the first box because it's the only - one to have to effective 1px margins */ + var endPourcent = Math.floor(IriSP.timeToPourcent(end, duration) - startPourcent); + var endPixel = Math.floor(this.selector.parent().width() * (endPourcent / 100)) - 2; + if (i == 0) { endPourcent -= onePxPercent; @@ -88,10 +87,9 @@ var annotationTemplate = Mustache.to_html(IriSP.annotation_template, {"divTitle" : divTitle, "id" : id, "startPourcent" : startPourcent, - "endPourcent" : endPourcent, "hexa_color" : hexa_color, + "endPixel" : endPixel, "hexa_color" : hexa_color, "seekPlace" : Math.round(begin/1000)}); - this.selector.append(annotationTemplate); // IriSP.jQuery("#" + id).tooltip({ effect: 'slide'}); @@ -176,6 +174,7 @@ IriSP.SegmentsWidget.prototype.positionUpdater = function() { var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000; var time = this._Popcorn.currentTime(); + //var position = ((time / duration) * 100).toFixed(2); var position = ((time / duration) * 100).toFixed(2); this.positionMarker.css("left", position + "%"); diff -r 1c225a39a3b1 -r 0bb36c79836c src/templates/annotation.html --- a/src/templates/annotation.html Mon Dec 19 15:25:48 2011 +0100 +++ b/src/templates/annotation.html Mon Dec 19 16:04:14 2011 +0100 @@ -2,7 +2,7 @@