updated player.
authorhamidouk
Fri, 16 Dec 2011 17:23:24 +0100
changeset 12 dbcb0dc6a844
parent 11 cdfe29ce64da
child 13 8769a8877aeb
updated player.
web/LdtPlayer-release.js
web/LdtPlayer.css
--- a/web/LdtPlayer-release.js	Fri Dec 16 17:23:13 2011 +0100
+++ b/web/LdtPlayer-release.js	Fri Dec 16 17:23:24 2011 +0100
@@ -8670,7 +8670,7 @@
 };
 
 
-IriSP.annotation_template = "{{! template for an annotation displayed in a segmentWidget }}<div title='{{divTitle}}' id='{{id}}'	class='Ldt-iri-chapter' 	style='left: {{startPourcent}}%;          width: {{endPourcent}}%;          background:#{{hexa_color}};' 	></div>";
+IriSP.annotation_template = "{{! template for an annotation displayed in a segmentWidget }}<div title='{{divTitle}}' id='{{id}}'	class='Ldt-iri-chapter' 	style='left: {{startPourcent}}%;          width: {{endPourcent}}%;          background-color:#{{hexa_color}};' 	></div>";
 IriSP.annotationWidget_template = "{{! template for the annotation widget }}<div class='Ldt-AnnotationsWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-Annotation-DoubleBorder'>      <div class='Ldt-AnnotationContent'>        <div class='Ldt-AnnotationShareIcons'>         <a class='Ldt-fbShare' href=''><img src='{{img_dir}}/facebook.png' alt='share on facebook'></img></a>         <a class='Ldt-TwShare' href=''><img src='{{img_dir}}/twitter.png' alt='share on twitter'></img></a>         <a class='Ldt-GplusShare' href=''><img src='{{img_dir}}/google.png' alt='share on google+'></img></a>      </div>		  <div class='Ldt-SaTitle'></div>	  	<div class='Ldt-SaDescription'></div>    </div>  </div></div>";
 IriSP.annotation_loading_template = "{{! template shown while the annotation widget is loading }}<div id='Ldt-load-container'><div id='Ldt-loader'>&nbsp;</div> Chargement... </div>";
 IriSP.arrowWidget_template = "<div class='Ldt-arrowWidget'></div>";
@@ -8981,8 +8981,7 @@
 		  hex = hexa.charAt(tmp)+hex;
 		  dec = Math.floor(dec/16);
 	 }
-	 hex = hexa.charAt(dec)+hex;
-	 if (hex == "FFCC00"){ hex="";/* by default color of Ldt annotation */ }
+	 hex = hexa.charAt(dec)+hex;	 
 	 return(hex);
 };
 
@@ -10493,12 +10492,20 @@
     }
     
     var divTitle = annotation.content.title.substr(0,55);
-    var color = annotation.content.color
-
-
+
+    if (typeof(annotation.content.color) !== "undefined")
+      var color = annotation.content.color;
+    else
+      var color = annotation.color;
+    
+    var hexa_color = IriSP.DEC_HEXA_COLOR(color);
+    console.log(hexa_color);
+    if (hexa_color === "FFCC00")
+      hexa_color = "333";
+    
     var annotationTemplate = Mustache.to_html(IriSP.annotation_template,
         {"divTitle" : divTitle, "id" : id, "startPourcent" : startPourcent,
-        "endPourcent" : endPourcent, "hexa_color" : IriSP.DEC_HEXA_COLOR(color),
+        "endPourcent" : endPourcent, "hexa_color" : hexa_color,
         "seekPlace" : Math.round(begin/1000)});
 
 
@@ -10538,7 +10545,7 @@
 
 /* restores the view after a search */
 IriSP.SegmentsWidget.prototype.clear = function() {
-  this.selector.children(".Ldt-iri-chapter").css('border','none').animate({opacity:0.3}, 100);
+  //this.selector.children(".Ldt-iri-chapter").css('border','none').animate({opacity:0.3}, 100);
 };
 
 IriSP.SegmentsWidget.prototype.clickHandler = function(annotation) {
@@ -10637,9 +10644,9 @@
 
 /* update the slider and the position marker as time passes */
 IriSP.SliderWidget.prototype.sliderUpdater = function() {
-  if(this.draggingOngoing)
+  if(this.draggingOngoing || this._disableUpdates)
     return;
-
+  
   var time = this._Popcorn.currentTime();
 
   var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000;
@@ -10729,11 +10736,15 @@
 };
 
 // called when the user starts dragging the position indicator
-IriSP.SliderWidget.prototype.positionMarkerDraggingStartedHandler = function(event, ui) {
+IriSP.SliderWidget.prototype.positionMarkerDraggingStartedHandler = function(event, ui) {  
   this.draggingOngoing = true;
 };
 
 IriSP.SliderWidget.prototype.positionMarkerDraggedHandler = function(event, ui) {
+  console.log(ui.offset.left);
+  this._disableUpdate = true; // disable slider position updates while dragging is ongoing.
+  window.setTimeout(IriSP.wrap(this, function() { this._disableUpdate = false; }), 500);
+  
   var width = this.sliderBackground.width();
   var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000;
   var newTime = ((ui.offset.left / width) * duration).toFixed(2);
--- a/web/LdtPlayer.css	Fri Dec 16 17:23:13 2011 +0100
+++ b/web/LdtPlayer.css	Fri Dec 16 17:23:24 2011 +0100
@@ -18,7 +18,6 @@
    }
 
     .Ldt-SegmentsWidget {
-      background-color: #b6b8b7;
       overflow: auto; /* clear the floats */
       margin-top: 1px;
     }
@@ -26,6 +25,7 @@
     .Ldt-iri-chapter{
       float: left;
       height: 10px;
+      border-right: 1px solid white;
     }
 
     .tooltip {