src/js/widgets/segmentsWidget.js
branchpopcorn-port
changeset 836 526f91f5253e
parent 835 a8af9da7c622
child 842 4ae2247a59f4
--- a/src/js/widgets/segmentsWidget.js	Tue Mar 20 21:17:48 2012 +0100
+++ b/src/js/widgets/segmentsWidget.js	Wed Mar 21 16:43:25 2012 +0100
@@ -81,7 +81,9 @@
     
     var divTitle = this.cinecast_version
         ? annotation.content.data
-        : IriSP.clean_substr(annotation.content.title + " -<br>" + annotation.content.description, 0, 132) + "...";
+        : annotation.content.title + ( annotation.content.title ? "<br />" : "" ) + annotation.content.description.replace(/(^.{120,140})[\s].+$/,'$1&hellip;');
+    
+    var thumbUrl = annotation.meta.thumbnail || '';
     
     var hexa_color = typeof(annotation.content.color) !== "undefined"
         ? '#' + IriSP.DEC_HEXA_COLOR(annotation.content.color)
@@ -100,7 +102,7 @@
     var annotationTemplate = Mustache.to_html(IriSP.annotation_template,
         {"divTitle" : divTitle, "id" : id, "startPixel" : startPixel,
         "pxWidth" : pxWidth, "hexa_color" : hexa_color,
-        "seekPlace" : Math.round(begin/1000)});
+        "seekPlace" : Math.round(begin/1000), "thumbnailUrl": thumbUrl});
 
         
     this.selector.append(annotationTemplate);
@@ -134,7 +136,9 @@
             var divObject = IriSP.jQuery(this);
             divObject.fadeTo(0,1);
             var offset_x = divObject.position().left + divObject.outerWidth() / 2;
-            self.TooltipWidget.show(divObject.attr("title"), IriSP.jQuery(this).css("background-color"), offset_x, 0);
+            var thumb = divObject.attr("thumbnail-url");
+            var txt = divObject.attr("title") + (thumb && thumb.length ? '<br /><img src="' + thumb + '" />' : '');
+            self.TooltipWidget.show(txt, IriSP.jQuery(this).css("background-color"), offset_x, 0);
         })
         .mouseout(function(){
             IriSP.jQuery(this).fadeTo(0,.5);