web/res/metadataplayer/Annotation.js
changeset 940 843f96e4eebd
parent 828 6030bef81a51
child 955 5171f8825985
--- a/web/res/metadataplayer/Annotation.js	Thu Jul 11 15:30:43 2013 +0200
+++ b/web/res/metadataplayer/Annotation.js	Tue Jul 23 13:14:21 2013 +0200
@@ -13,9 +13,9 @@
     fr: {
         watching: "Je regarde ",
         on_site: " sur ",
-        tags_: "Mots-clés :",
-        description_: "Description :",
-        excerpt_from: "Extrait de :",
+        tags_: "Mots-clés\u00a0:",
+        description_: "Description\u00a0:",
+        excerpt_from: "Extrait de\u00a0:",
         untitled: "Segment sans titre"
     },
     en: {
@@ -34,7 +34,7 @@
     + '<div class="Ldt-Annotation-Inner Ldt-Annotation-Empty{{#start_minimized}} Ldt-Annotation-Minimized{{/start_minimized}}">'
     + '<div class="Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-MaxMinButton"></div>'
     + '{{#show_social}}<div class="Ldt-Annotation-Social Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty"></div>{{/show_social}}'
-    + '<h3 class="Ldt-Annotation-HiddenWhenEmpty">{{#show_annotation_type}}<span class="Ldt-Annotation-Type"></span> » {{/show_annotation_type}}<span class="Ldt-Annotation-Title"></span> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">'
+    + '<h3 class="Ldt-Annotation-HiddenWhenEmpty">{{#show_annotation_type}}<span class="Ldt-Annotation-Type"></span> » {{/show_annotation_type}}<a class="Ldt-Annotation-Title" href="#"></a> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">'
     + '(<span class="Ldt-Annotation-Begin"></span> - <span class="Ldt-Annotation-End"></span>)</span></h3>'
     + '<h3 class="Ldt-Annotation-MashupOrigin Ldt-Annotation-HiddenWhenEmpty">{{l10n.excerpt_from}} <span class="Ldt-Annotation-MashupMedia"></span> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">'
     + '(<span class="Ldt-Annotation-MashupBegin"></span> - <span class="Ldt-Annotation-MashupEnd"></span>)</span></h3>'
@@ -48,6 +48,7 @@
     annotation_type : "chap",
     start_minimized: false,
     show_arrow : true,
+    arrow_position: .5,
     site_name : "Lignes de Temps",
     search_on_tag_click: true,
     show_social: true,
@@ -140,18 +141,27 @@
         _this.$.find(".Ldt-Annotation-Inner").removeClass("Ldt-Annotation-Empty");
         _this.bounds = [ _annotation.begin, _annotation.end ];
         if (_this.arrow) {
-            _this.arrow.moveToTime((_annotation.begin + _annotation.end)/2);
+            _this.arrow.moveToTime((1 - _this.arrow_position) * _annotation.begin + _this.arrow_position * _annotation.end);
         }
         _this.sendBounds();
     }
     
     this.renderTemplate();
     
+    this.$.find(".Ldt-Annotation-Title").click(function() {
+        if (currentAnnotation) {
+            _this.media.setCurrentTime(currentAnnotation.begin);
+        }
+        return false;
+    });
+    
     if (this.show_social) {
         this.insertSubwidget(this.$.find(".Ldt-Annotation-Social"), { type: "Social" }, "socialWidget");
     }
     
-    this.insertSubwidget(this.$.find(".Ldt-Annotation-Arrow"), { type: "Arrow", width: this.width }, "arrow");
+    if (this.show_arrow) {
+        this.insertSubwidget(this.$.find(".Ldt-Annotation-Arrow"), { type: "Arrow", width: this.width }, "arrow");
+    }
     this.onMediaEvent("timeupdate",timeupdate);
     this.onMdpEvent("Annotation.hide","hide");
     this.onMdpEvent("Annotation.show","show");