Merge with upstream. popcorn-port
authorhamidouk
Fri, 27 Jan 2012 17:27:48 +0100
branchpopcorn-port
changeset 741 9925bc81b8a8
parent 740 3b60f3beb521 (diff)
parent 737 c12b9a11102c (current diff)
child 742 c0adb6674be0
child 743 69a9969daa41
Merge with upstream.
--- a/src/js/site.js.templ	Fri Jan 27 16:23:00 2012 +0100
+++ b/src/js/site.js.templ	Fri Jan 27 17:27:48 2012 +0100
@@ -48,12 +48,12 @@
   },
   "createAnnotationWidget" : {
       keywords: ["#faux-raccord", "#mot-clef"],
-       polemic_mode: true, /* enable polemics ? */
+      polemic_mode: true, /* enable polemics ? */
       /* polemics - the corresponding class names defined in the css should be for instance :
          Ldt-createAnnotation-polemic-plusplus for plusplus
          Ldt-createAnnotation-polemic-equalequal for equalequal, etc.
       */
-      polemics: {"++" : "plusplus", "--" : "minusminus", "==" : "equalequal", "??" : "questionquestion"}, 
+      polemics: {"++" : "positive", "--" : "negative", "==" : "reference", "??" : "question"}, 
       cinecast_version: true /* put to false to enable the platform version, true for the festival cinecast one. */
   },
   "SparklineWidget" : {
@@ -71,7 +71,7 @@
                                                                          where to
                                                                          get the 
                                                                          ajax */
-      ajax_granularity: 10000 /* how much ms should we look before and after the
+      ajax_granularity: 10000, /* how much ms should we look before and after the
                                  current timecode */
       
       project_url: IriSP.platform_url + "/ldtplatform/ldt/front/player/" /* the beginning 
--- a/src/js/widgets/sliderWidget.js	Fri Jan 27 16:23:00 2012 +0100
+++ b/src/js/widgets/sliderWidget.js	Fri Jan 27 17:27:48 2012 +0100
@@ -53,26 +53,29 @@
   var time = this._Popcorn.currentTime();
 
   var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000;
-  var percent = ((time / duration) * 100).toFixed(2);
+  var percents = time / duration;
   
   /* we do these complicated calculations to center exactly
      the position Marker */
-  var pixels_to_percents = 100 / this.selector.width(); /* how much is a pixel in percents */
+
+  var divWidth = this.selector.width();
+  var pixels = Math.floor(this.selector.width() * percents);
   var positionMarker_width = this.positionMarker.width();
-  var correction = (pixels_to_percents * positionMarker_width) / 2;
+  var correction = (positionMarker_width / 2);
 
   /* check that we don't leave the left side */
-  var newPos = percent - correction;
+  var newPos = pixels - correction;
   if (newPos <= 0)
     newPos = 0;
   
   /* check that we don't leave the right side */
-  var outPos = percent + correction;
-  if (outPos > 100)
-    newPos = 100;
+  var rightEdgePos = pixels + 1 * correction;
+
+  if (rightEdgePos >= divWidth)
+    newPos = divWidth - 1 * correction - 1;
   
-	this.sliderForeground.css("width", percent + "%");
-	this.positionMarker.css("left", newPos + "%");
+  this.sliderForeground.css("width", pixels + "px");
+  this.positionMarker.css("left", newPos + "px");
 
 };