Corrections on the new Metadataplayer
authorveltr
Thu, 05 Jul 2012 19:11:12 +0200
changeset 696 b431fb1fd480
parent 695 e45166859f96
child 697 062376213732
Corrections on the new Metadataplayer
src/ldt/ldt/ldt_utils/templates/front/front_player.html
src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html
src/ldt/ldt/static/ldt/css/front_player.css
src/ldt/ldt/static/ldt/metadataplayer/Annotation.css
src/ldt/ldt/static/ldt/metadataplayer/Annotation.js
src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.css
src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.js
src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.css
src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.js
src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js
src/ldt/ldt/static/ldt/metadataplayer/Polemic.js
src/ldt/ldt/static/ldt/metadataplayer/Segments.js
src/ldt/ldt/static/ldt/metadataplayer/Slice.css
src/ldt/ldt/static/ldt/metadataplayer/Slice.js
src/ldt/ldt/static/ldt/metadataplayer/Social.css
src/ldt/ldt/static/ldt/metadataplayer/Social.js
src/ldt/ldt/static/ldt/metadataplayer/img/socialbuttons.png
--- a/src/ldt/ldt/ldt_utils/templates/front/front_player.html	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/front/front_player.html	Thu Jul 05 19:11:12 2012 +0200
@@ -40,18 +40,6 @@
             $j("#search_submit").addClass('search_invalid').removeClass('search_valid');
             $j("#search_submit").attr('disabled', 'disabled');
         });
-        $j("#slides_container h2").click(function () {
-            if($j("#slides_container h2").hasClass('triangle_down')){
-            	// We hide the slides
-                $j("#slides_container .triangle_down").addClass('triangle_right').removeClass('triangle_down');
-                $j("#slides_container .Ldt-SlideShare").hide();
-            }
-            else if($j("#slides_container h2").hasClass('triangle_right')){
-                // We show the slides
-                $j("#slides_container .triangle_right").addClass('triangle_down').removeClass('triangle_right');
-                $j("#slides_container .Ldt-SlideShare").show();
-            }
-        });
     });
 </script>
 {% endblock %}
@@ -61,32 +49,8 @@
 
 <!-- Player column -->
 <div id="player_col_g">
-    <ul class="floatlist" id="top_media">
-        <li id="title_media"><h2>{{content.title}}</h2></li>
-        <!--li id="media_share">
-            <ul class="floatlist">
-                <li class="share_li">
-                    <a href="https://twitter.com/share" class="twitter-share-button" data-count="none">Twitter</a>
-                    <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
-                </li>
-                <li class="share_li" style="padding-top: 3px">
-                    <a name="fb_share">Partager</a> 
-                    <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
-                </li>
-                <li class="share_li">
-                    <g:plusone size="medium" annotation="none"></g:plusone>
-                    <script type="text/javascript">
-                      (function() {
-                        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
-                        po.src = 'https://apis.google.com/js/plusone.js';
-                        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
-                      })();
-                    </script>
-                </li>
-            </ul>
-        </li -->
-    </ul>
-    <!--img src="img/placeholder.png" alt="ICI LE PLAYER" width="550" height="420" /-->
+    <h2>{{content.title}}</h2>
+    <hr />
     <div class="ldt_player" id="wrapper_{{player_id}}">
     {% include "ldt/ldt_utils/partial/embed_player.html" %}
     </div>
@@ -94,13 +58,13 @@
 
 <!-- Right column -->
 <div id="player_col_d">
-    <div id="slides_container">
-	        <h2 class="li_h2 triangle_down"><a href="#">Slides</a></h2>
+    <div id="Social_ext"></div>
+    <div id="Slideshare_ext" class="ext_widget">
     </div>
     <div class="li_h2">
         <h2>{% trans 'All annotations on the media' %}</h2>
     </div>
-    <div id="annot_media"></div>
+    <div id="AnnotationsList_ext" class="ext_widget"></div>
 </div>
 {% endblock %}
 
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html	Thu Jul 05 19:11:12 2012 +0200
@@ -34,12 +34,13 @@
                 type: "Slider"
             },{
                 type: "AnnotationsList",
-                container: "annot_media",
+                container: "AnnotationsList_ext",
                 ajax_url: "{% url segment_api_empty %}{% templatetag openvariable %}media{% templatetag closevariable %}/{% templatetag openvariable %}begin{% templatetag closevariable %}/{% templatetag openvariable %}end{% templatetag closevariable %}"
             },{
                 type: "Controller"
             },{
-                type: "Segments"
+                type: "Segments",
+                annotation_type: ["chap","découpage"]
             },{
                 type: "Slice"
             },{
@@ -54,26 +55,35 @@
                 api_endpoint_template: "{% url annotation_api_empty %}{% templatetag openvariable %}id{% templatetag closevariable %}.json",
                 tag_titles: ["#amateur", "#digital-humanities"],
                 creator_name: '{{request.user.username}}',
-                creator_avatar: '{% thumbnail request.user.get_profile.image "48x48" format="PNG" crop="center" as im %}{{WEB_URL}}{{ im.url }}{% endthumbnail %}'
+                creator_avatar: '{% thumbnail request.user.get_profile.image "48x48" format="PNG" crop="center" as im %}{{WEB_URL}}{{ im.url }}{% endthumbnail %}' || "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png"
             },{
                 type: "Slideshare",
-                container: "slides_container",
+                container: "Slideshare_ext",
                 embed_width: 400,
-                embed_height: 334
+                embed_height: 334,
+                annotation_type: "Son"
             },{
                 type: "Mediafragment"
+            },{
+                type: "Social",
+                container: "Social_ext",
+                url: document.location.href.replace(/#.*$/,""),
+                text: document.title
             }
         ]
     },
     player: {
     {% if external_url %}
         video: '{{ external_url }}',
+        type: 'auto',
+    {% else %}
+        streamer: 'rtmp://media.iri.centrepompidou.fr/ddc_player/',
+        type: 'jwplayer',
+        live: true,
+        provider: "rtmp",
     {% endif %}
-        type:'auto',
-        live: true, 
         height: 300, 
-        width: '{{ player_width }}', 
-        provider: "rtmp",
+        width: '{{ player_width }}',
         autostart: true,
         metadata: _metadata
     }
--- a/src/ldt/ldt/static/ldt/css/front_player.css	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/css/front_player.css	Thu Jul 05 19:11:12 2012 +0200
@@ -6,38 +6,6 @@
     width: 550px; border-bottom: 1px solid #484848; margin-bottom: 5px;
 }
 
-#media_share {
-    float: right; margin-top: 5px;
-}
-
-li.share_li {
-    padding: 5px 0 0 5px; height: 20px;
-}
-
-#ann_fleche_cont {
-    width: 550px; height: 21px; overflow: hidden; position: relative;
-}
-
-#ann_fleche {
-    width: 1100px; height: 21px; position: absolute; margin-left: -550px;
-}
-
-#ann_fleche div {
-    float: left; width: 550px; height: 21px;
-}
-
-#ann_fl_left {
-    background:url(./imgs/anarl.png);
-}
-
-#ann_fl_right {
-    background:url(./imgs/anarr.png);
-}
-
-#annotation_bas {
-    float: left; width: 550px; background: url(./imgs/annot_bg.png); margin: 0 0 25px;
-}
-
 .ldt_player {
     position: relative;
 }
@@ -52,31 +20,10 @@
     width: 400px; margin-left: 10px;
 }
 
-#annot_media {
-    width: 400px; margin: 5px 0 10px 10px;
-}
-
-#annot_media li {
-    padding: 5px 0;
-}
-
-#annot_media li.selected {
-    background: url(./imgs/annot_bg.png);
+.ext_widget {
+    width: 400px; margin-left: 10px;
 }
 
-div.une_annot {
-    width: 280px;
-}
-
-.Ldt-SlideShare {
-    margin: 0px 0 10px 10px;
+#Social_ext {
+    float: right; margin: 5px 0 8px 280px; height: 24px;
 }
-.triangle_down {
-    background: url(./imgs/triangle_down.png) left no-repeat;
-}
-.triangle_right {
-    background: url(./imgs/triangle_right.png) left no-repeat;
-}
-.triangle_down a, .triangle_right a {
-    margin-left: 20px;
-}
--- a/src/ldt/ldt/static/ldt/metadataplayer/Annotation.css	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/Annotation.css	Thu Jul 05 19:11:12 2012 +0200
@@ -28,7 +28,12 @@
 }
 
 .Ldt-Annotation-MaxMinButton {
-    float: right; margin: 5px 5px 0; width: 17px; height: 17px; background: url(img/widget-control.png); background-position: 0 -51px; cursor: hand;
+    float: right; margin: 5px 5px 0; width: 17px; height: 17px;
+    background: url(img/widget-control.png); background-position: 0 -51px; cursor: pointer;
+}
+
+.Ldt-Annotation-Social {
+    float: right;
 }
 
 .Ldt-Annotation-MaxMinButton:hover {
@@ -67,34 +72,6 @@
     margin: 5px 0 0 90px; clear: right;
 }
 
-.Ldt-Annotation-Share {
-    display: inline-block; width: 24px; height: 24px; margin: 2px 0 0 2px; background: url(img/socialbuttons.png);
-}
-
-.Ldt-Annotation-Twitter {
-    background-position: 0 0;
-}
-
-.Ldt-Annotation-Twitter:hover {
-    background-position: 0 -24px;
-}
-
-.Ldt-Annotation-Fb {
-    background-position: -24px 0;
-}
-
-.Ldt-Annotation-Fb:hover {
-    background-position: -24px -24px;
-}
-
-.Ldt-Annotation-Gplus {
-    background-position: -48px 0;
-}
-
-.Ldt-Annotation-Gplus:hover {
-    background-position: -48px -24px;
-}
-
 .Ldt-Annotation-Tags-Block {
     font-size: 12px;
 }
@@ -138,3 +115,7 @@
     display: none;
 }
 
+.Ldt-Annotation-EmptyBlock {
+    display: none;
+}
+
--- a/src/ldt/ldt/static/ldt/metadataplayer/Annotation.js	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/Annotation.js	Thu Jul 05 19:11:12 2012 +0200
@@ -1,4 +1,4 @@
-// TODO: Open share links in a small window - Migrate Timeupdate functions to Extract
+// TODO: Migrate Timeupdate functions to Extract
 
 IriSP.Widgets.Annotation = function(player, config) {
     IriSP.Widgets.Widget.call(this, player, config);
@@ -11,8 +11,6 @@
 
 IriSP.Widgets.Annotation.prototype.messages = {
     fr: {
-        share_: "Partager&nbsp;:",
-        share_on: "Partager sur",
         watching: "Je regarde ",
         on_site: " sur ",
         tags_: "Mots-clés&nbsp;:",
@@ -20,8 +18,6 @@
         excerpt_from: "Extrait de&nbsp;:"
     },
     en: {
-        share_: "Share:",
-        share_on: "Share on",
         watching: "I'm watching ",
         on_site: " on ",
         tags_: "Keywords:",
@@ -34,6 +30,7 @@
     '<div class="Ldt-Annotation-Widget {{#show_top_border}}Ldt-Annotation-ShowTop{{/show_top_border}}">'
     + '<div class="Ldt-Annotation-Inner Ldt-Annotation-Empty{{#start_minimized}} Ldt-Annotation-Minimized{{/start_minimized}}">'
     + '<div class="Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-MaxMinButton"></div>'
+    + '<div class="Ldt-Annotation-Social Ldt-Annotation-HiddenWhenMinimized"></div>'
     + '<h3 class="Ldt-Annotation-HiddenWhenEmpty"><span class="Ldt-Annotation-Title"></span> <span class="Ldt-Annotation-Time">'
     + '( <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">'
@@ -42,21 +39,18 @@
     + '<p class="Ldt-Annotation-Labelled Ldt-Annotation-Description"></p></div>'
     + '<div class="Ldt-Annotation-Tags-Block Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Cleared">'
     + '<div class="Ldt-Annotation-Label">{{l10n.tags_}}</div><ul class="Ldt-Annotation-Labelled Ldt-Annotation-Tags"></ul>'
-    + '</div><div class="Ldt-Annotation-Cleared Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty"><div class="Ldt-Annotation-Label">{{l10n.share_}}</div><p class="Ldt-Annotation-Labelled">'
-    + '<a href="#" target="_blank" class="Ldt-Annotation-Share Ldt-Annotation-Fb Ldt-TraceMe" title="{{l10n.share_on}} Facebook"></a>'
-    + '<a href="#" target="_blank" class="Ldt-Annotation-Share Ldt-Annotation-Twitter Ldt-TraceMe" title="{{l10n.share_on}} Twitter"></a>'
-    + '<a href="#" target="_blank" class="Ldt-Annotation-Share Ldt-Annotation-Gplus Ldt-TraceMe" title="{{l10n.share_on}} Google+"></a>'
-    + '</p></div></div></div></div>';
+    + '</div></div></div></div>';
 
 IriSP.Widgets.Annotation.prototype.defaults = {
     annotation_type : "chap",
-    start_minimized: false,
+    start_minimized: true,
     show_top_border : false,
     site_name : "Lignes de Temps"
 }
 
 IriSP.Widgets.Annotation.prototype.draw = function() {
     this.renderTemplate();
+    this.insertSubwidget(this.$.find(".Ldt-Annotation-Social"), "socialWidget", { type: "Social" });
     this.bindPopcorn("timeupdate","onTimeupdate");
     this.bindPopcorn("IriSP.Annotation.hide","hide");
     this.bindPopcorn("IriSP.Annotation.show","show");
@@ -102,7 +96,7 @@
             return '<li class="Ldt-Annotation-TagLabel"><span>' + _tag + '</span></li>';
         }).join("");
         this.$.find(".Ldt-Annotation-Tags").html(_html);
-        this.$.find(".Ldt-Annotation-Tags-Block").removeClass("Ldt-Annotation-NoTags");
+        this.$.find(".Ldt-Annotation-Tags-Block").removeClass("Ldt-Annotation-EmptyBlock");
         
         /* Correct the empty tag bug */
         this.$.find('.Ldt-Annotation-TagLabel').each(function() {
@@ -116,15 +110,15 @@
             _this.player.popcorn.trigger("IriSP.search.triggeredSearch", IriSP.jQuery(this).text().replace(/(^\s+|\s+$)/g,''));
         });
     } else {
-        this.$.find(".Ldt-Annotation-Tags-Block").hide();
+        this.$.find(".Ldt-Annotation-Tags-Block").addClass("Ldt-Annotation-EmptyBlock");
     }
     this.$.find(".Ldt-Annotation-Title").html(_annotation.title);
     var _desc = _annotation.description.replace(/(^\s+|\s+$)/g,'');
     if (_desc) {
-        this.$.find(".Ldt-Annotation-Description-Block").show();
+        this.$.find(".Ldt-Annotation-Description-Block").removeClass("Ldt-Annotation-EmptyBlock");
         this.$.find(".Ldt-Annotation-Description").html(_desc);
     } else {
-        this.$.find(".Ldt-Annotation-Description-Block").hide();
+        this.$.find(".Ldt-Annotation-Description-Block").addClass("Ldt-Annotation-EmptyBlock");
     }
     this.$.find(".Ldt-Annotation-Begin").html(_annotation.begin.toString());
     this.$.find(".Ldt-Annotation-End").html(_annotation.end.toString());
@@ -136,9 +130,9 @@
     } else {
         this.$.find('.Ldt-Annotation-Inner').removeClass("Ldt-Annotation-isMashup");
     }
-    this.$.find(".Ldt-Annotation-Fb").attr("href", "http://www.facebook.com/share.php?" + IriSP.jQuery.param({ u: _url, t: _text }));
-    this.$.find(".Ldt-Annotation-Twitter").attr("href", "https://twitter.com/intent/tweet?" + IriSP.jQuery.param({ url: _url, text: _text }));
-    this.$.find(".Ldt-Annotation-Gplus").attr("href", "https://plusone.google.com/_/+1/confirm?" + IriSP.jQuery.param({ url: _url, title: _text }));
+    if (typeof this.socialWidget !== "undefined") {
+        this.socialWidget.updateUrls(_url, _text);
+    }
     this.$.find(".Ldt-Annotation-Inner").removeClass("Ldt-Annotation-Empty");
 }
 
--- a/src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.css	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.css	Thu Jul 05 19:11:12 2012 +0200
@@ -21,7 +21,7 @@
     min-height: 60px;
 }
 .Ldt-AnnotationsList-li:hover {
-    background: url(img/pinstripe-grey.png);
+    background: url(img/pinstripe-grey.png) !important;
 }
 .Ldt-AnnotationsList-highlight {
     background: #F7268E;
@@ -59,7 +59,7 @@
 p.Ldt-AnnotationsList-Description {
     margin: 2px 0 2px 82px;
     font-size: 12px;
-    color: #666666;
+    color: #333333;
 }
 ul.Ldt-AnnotationsList-Tags {
     list-style: none;
--- a/src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.js	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.js	Thu Jul 05 19:11:12 2012 +0200
@@ -27,14 +27,27 @@
     annotation_type : false,
     refresh_interval : 0,
     limit_count : 10,
-    newest_first : false
+    newest_first : false,
+    polemics : [{
+        keyword: "++",
+        background_color: "#c9ecc6"
+    },{
+        keyword: "--",
+        background_color: "#f9c5c6"
+    },{
+        keyword: "??",
+        background_color: "#cec5f9"
+    },{
+        keyword: "==",
+        background_color: "#f9f4c6"
+    }]
 };
 
 IriSP.Widgets.AnnotationsList.prototype.template =
     '<div class="Ldt-AnnotationsListWidget">'
     + '<ul class="Ldt-AnnotationsList-ul">'
     + '{{#annotations}}'
-    + '<li class="Ldt-AnnotationsList-li Ldt-TraceMe" trace-info="annotation-id:{{id}}">'
+    + '<li class="Ldt-AnnotationsList-li Ldt-TraceMe" trace-info="annotation-id:{{id}}" style="{{specific_style}}">'
     + '<div class="Ldt-AnnotationsList-ThumbContainer">'
     + '<a href="{{url}}">'
     + '<img class="Ldt-AnnotationsList-Thumbnail" src="{{thumbnail}}" />'
@@ -175,7 +188,7 @@
                             : '#id=' + _annotation.id
                             )
                     );
-                    var _title = _annotation.title.replace(_annotation.description,''),
+                    var _title = (_annotation.title || "").replace(_annotation.description,''),
                         _description = _annotation.description;
                     if (!_annotation.title) {
                         _title = _annotation.creator;
@@ -184,6 +197,13 @@
                         _description = _annotation.title;
                         _title = _annotation.creator;
                     }
+                    var _bgcolor;
+                    IriSP._(_this.polemics).each(function(_polemic) {
+                        var _rgxp = IriSP.Model.regexpFromTextOrArray(_polemic.keyword);
+                        if (_rgxp.test(_title + " " + _description)) {
+                            _bgcolor = _polemic.background_color;
+                        }
+                    });
                     var _res = {
                         id : _annotation.id,
                         title : _title,
@@ -192,7 +212,8 @@
                         end : _annotation.end.toString(),
                         thumbnail : typeof _annotation.thumbnail !== "undefined" && _annotation.thumbnail ? _annotation.thumbnail : _this.default_thumbnail,
                         url : _url,
-                        tags : _annotation.getTagTexts()
+                        tags : _annotation.getTagTexts(),
+                        specific_style : (typeof _bgcolor !== "undefined" ? "background: " + _bgcolor : "")
                     }
                     return _res;
             }),
--- a/src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.css	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.css	Thu Jul 05 19:11:12 2012 +0200
@@ -17,9 +17,11 @@
 }
 
 .Ldt-CreateAnnotation-Inner h3 {
-    margin: 5px 0;
-    font-size: 14px;
-    font-weight: bold;
+    margin: 5px 0; font-size: 14px; font-weight: bold; text-align: right;
+}
+
+.Ldt-CreateAnnotation-h3Left {
+    float: left;
 }
 
 .Ldt-CreateAnnotation-Main {
@@ -27,7 +29,6 @@
 }
 
 .Ldt-CreateAnnotation-Title, .Ldt-CreateAnnotation-Creator {
-    margin-right: 2px;
     font-size: 14px;
     font-weight: bold;
     color: #0068c4;
@@ -63,7 +64,7 @@
     height: 56px;
     padding: 2px;
     resize: none;
-    width: 520px;
+    width: 460px;
     border: 1px solid #666666;
     border-radius: 2px;
 }
--- a/src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.js	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.js	Thu Jul 05 19:11:12 2012 +0200
@@ -10,10 +10,10 @@
     show_title_field : false, /* For the moment, titles can't be sent to ldtplatform */
     show_creator_field : true,
     start_visible : true,
-    always_visible : true,
+    always_visible : false,
     sync_on_slice_widget : true, /* If false, syncs on current timecode */
     takeover_arrow : false,
-    minimize_annotation_widget : false,
+    minimize_annotation_widget : true,
     creator_name : "",
     creator_avatar : "",
     tags : false,
@@ -92,11 +92,11 @@
 IriSP.Widgets.CreateAnnotation.prototype.template =
     '<div class="Ldt-CreateAnnotation"><div class="Ldt-CreateAnnotation-Inner">'
     + '<form class="Ldt-CreateAnnotation-Screen Ldt-CreateAnnotation-Main">'
-    + '<h3>{{#show_title_field}}<input class="Ldt-CreateAnnotation-Title" placeholder="{{l10n.type_title}}" />{{/show_title_field}}'
+    + '<h3><span class="Ldt-CreateAnnotation-h3Left">{{#show_title_field}}<input class="Ldt-CreateAnnotation-Title" placeholder="{{l10n.type_title}}" />{{/show_title_field}}'
     + '{{^show_title_field}}<span class="Ldt-CreateAnnotation-NoTitle">{{l10n.no_title}} </span>{{/show_title_field}}'
     + ' <span class="Ldt-CreateAnnotation-Times">{{#sync_on_slice_widget}}{{l10n.from_time}} {{/sync_on_slice_widget}}{{^sync_on_slice_widget}}{{l10n.at_time}} {{/sync_on_slice_widget}} <span class="Ldt-CreateAnnotation-Begin">00:00</span>'
-    + '{{#sync_on_slice_widget}} {{l10n.to_time}} <span class="Ldt-CreateAnnotation-End">00:00</span>{{/sync_on_slice_widget}}</span></h3>'
-    + '{{#show_creator_field}}<h3>{{l10n.your_name_}} <input class="Ldt-CreateAnnotation-Creator" value="{{creator_name}}" /></h3>{{/show_creator_field}}'
+    + '{{#sync_on_slice_widget}} {{l10n.to_time}} <span class="Ldt-CreateAnnotation-End">00:00</span>{{/sync_on_slice_widget}}</span></span>'
+    + '{{#show_creator_field}}{{l10n.your_name_}} <input class="Ldt-CreateAnnotation-Creator" value="{{creator_name}}" /></h3>{{/show_creator_field}}'
     + '<textarea class="Ldt-CreateAnnotation-Description" placeholder="{{l10n.type_description}}"></textarea>'
     + '<div class="Ldt-CreateAnnotation-Avatar"><img src="{{creator_avatar}}" title="{{creator_name}}"></img></div>'
     + '<input type="submit" class="Ldt-CreateAnnotation-Submit" value="{{l10n.submit}}" />'
--- a/src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js	Thu Jul 05 19:11:12 2012 +0200
@@ -153,7 +153,6 @@
 IriSP.Metadataplayer.prototype.onVideoDataLoaded = function() {
     
     /* Setting default media from metadata */
-    /* Getting video URL from metadata if it's not in the player config options */
    
     if (typeof this.videoData !== "undefined") {
         
@@ -181,11 +180,12 @@
         
         this.videoData.currentMedia = _media;
         
+        /* Getting video URL from metadata if it's not in the player config options */
+        
         if (typeof _media !== "undefined" && typeof _media.video !== "undefined" && typeof this.config.player.video === "undefined") {
             this.config.player.video = _media.video;
-            if (typeof _media.streamer !== "undefined") {
+            if (typeof this.config.player.streamer == "undefined" && typeof _media.streamer !== "undefined") {
                 this.config.player.streamer = _media.streamer;
-                this.config.player.video = _media.video.replace(_media.streamer,'');
             }
         }
         
@@ -258,8 +258,12 @@
             var opts = IriSP.jQuery.extend({}, this.config.player);
             delete opts.container;
             delete opts.type;
+            if (typeof opts.streamer !== "undefined") {
+                opts.video = opts.video.replace(opts.streamer,"");
+            }
             opts.file = opts.video;
             delete opts.video;
+            delete opts.metadata;
 
             if(!opts.hasOwnProperty("flashplayer")) {
                 opts.flashplayer = IriSP.getLib("jwPlayerSWF");
@@ -1478,18 +1482,6 @@
     this.$ = IriSP.jQuery('#' + this.container);
     this.$.addClass("Ldt-TraceMe Ldt-Widget").attr("widget-type", _type);
     
-    /* Does the widget require other widgets ? */
-    if (typeof this.requires !== "undefined") {
-        for (var _i = 0; _i < this.requires.length; _i++) {
-            var _subconfig = this.requires[_i];
-            _subconfig.container = IriSP._.uniqueId(this.container + '_' + _subconfig.type + '_');
-            this.$.append(IriSP.jQuery('<div>').attr("id",_subconfig.container));
-            this.player.loadWidget(_subconfig, function(_widget) {
-                _this[_subconfig.type.replace(/^./,function(_s){return _s.toLowerCase();})] = _widget
-            });
-        }
-    }
-    
     this.l10n = (
         typeof this.messages[IriSP.language] !== "undefined"
         ? this.messages[IriSP.language]
@@ -1544,6 +1536,19 @@
     });
 }
 
+IriSP.Widgets.Widget.prototype.insertSubwidget = function(_selector, _propname, _widgetoptions) {
+    var _id = _selector.attr("id"),
+        _this = this;
+    if (typeof _id == "undefined") {
+        _id = IriSP._.uniqueId(this.container + '_sub_widget_' + _widgetoptions.type);
+        _selector.attr("id", _id);
+    }
+    _widgetoptions.container = _id;
+    _this.player.loadWidget(_widgetoptions, function(_widget) {
+        _this[_propname] = _widget;
+    });
+}
+
 /**
  * This method responsible of drawing a widget on screen.
  */
@@ -1809,18 +1814,25 @@
 IriSP.PopcornReplacement.jwplayer = function(container, options) {
     /* appel du parent pour initialiser les structures communes à tous les players */
     IriSP.PopcornReplacement.player.call(this, container, options);
-  
-    this.media.duration = options.duration; /* optional */
+    
+    if (options.autostart) {
+        this.media.paused = false;
+        this.trigger("play");
+    }
  
     var _player = jwplayer(this.container),
-        _this = this;
+        _this = this,
+        _seekPause = false;
   
   /* Définition des fonctions de l'API -  */
     this.playerFns = {
         play: function() { return _player.play(true); },
         pause: function() { return _player.pause(true); },
         getPosition: function() { return _player.getPosition(); },
-        seek: function(pos) { return _player.seek(pos); },
+        seek: function(pos) {
+            _seekPause = _this.media.paused;
+            return _player.seek(pos);
+        },
         getMute: function() { return _player.getMute() },
         setMute: function(p) { return _player.setMute(p); },
         getVolume: function() { return _player.getVolume() / 100; },
@@ -1832,15 +1844,22 @@
             _this.trigger("loadedmetadata");
         },
         onTime:   function() {
-            if (_this.media.paused && _player.getState() === "PLAYING") {
-                _this.media.paused = false;
-                _this.trigger("play");
+            if (_seekPause) {
+                _player.pause(true);
+                _seekPause = false;
+            } else {
+                if (_this.media.paused && _player.getState() === "PLAYING") {
+                    _this.media.paused = false;
+                    _this.trigger("play");
+                }
             }
             _this.trigger("timeupdate");
         },
         onPlay:   function() {
-            _this.media.paused = false;
-            _this.trigger("play");
+            if (!_seekPause) {
+                _this.media.paused = false;
+                _this.trigger("play");
+            }
         },
         onPause:  function() {
             _this.media.paused = true;
@@ -2439,7 +2458,7 @@
             var _anndata = _data.annotations[0],
                 _ann = new IriSP.Model.Annotation(_anndata.id, _source);
             _ann.description = _anndata.content.data || "";
-            _ann.title = _data.creator;
+            _ann.title = _data.creator || "";
             _ann.created = new Date(_data.meta.created);
             _ann.setMedia(_anndata.media, _source);
             var _anntypes = _source.getAnnotationTypes(true).searchByTitle(_anndata.type_title);
--- a/src/ldt/ldt/static/ldt/metadataplayer/Polemic.js	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/Polemic.js	Thu Jul 05 19:11:12 2012 +0200
@@ -40,11 +40,6 @@
             "keywords" : [ "?" ],
             "color" : "#036AAE"
         }
-    ],
-    requires : [
-        {
-            type: "Tooltip"
-        }
     ]
 };
 
@@ -287,6 +282,10 @@
         var _x = _e.pageX - _this.$zone.offset().left;
         _this.player.popcorn.currentTime(_this.source.getDuration().getSeconds() * _x / _this.width);
     });
+    
+    this.$.append('<div class="Ldt-Polemic-Tooltip"></div>');
+    
+    this.insertSubwidget(this.$.find(".Ldt-Polemic-Tooltip"), "tooltip", { type: "Tooltip" });
 }
 
 IriSP.Widgets.Polemic.prototype.onTimeupdate = function() {
--- a/src/ldt/ldt/static/ldt/metadataplayer/Segments.js	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/Segments.js	Thu Jul 05 19:11:12 2012 +0200
@@ -9,11 +9,6 @@
 IriSP.Widgets.Segments.prototype.defaults = {
     annotation_type : "chap",
     colors: ["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],
-    requires : [
-        {
-            type: "Tooltip"
-        }
-    ],
     height: 10
 };
 
@@ -22,7 +17,8 @@
     + '<div class="Ldt-Segments-Segment Ldt-TraceMe" trace-info="segment-id:{{id}}" segment-id="{{id}}" segment-text="{{text}}" segment-color="{{color}}" center-pos="{{center}}" begin-seconds="{{beginseconds}}"'
     + 'style="left:{{left}}px; width:{{width}}px; background:{{color}}"></div>'
     + '{{/segments}}</div>'
-    + '<div class="Ldt-Segments-Position"></div>';
+    + '<div class="Ldt-Segments-Position"></div>'
+    + '<div class="Ldt-Segments-Tooltip"></div>';
 
 IriSP.Widgets.Segments.prototype.draw = function() {
     this.bindPopcorn("IriSP.search", "onSearch");
@@ -55,6 +51,7 @@
             }
         })
     }));
+    this.insertSubwidget(this.$.find(".Ldt-Segments-Tooltip"), "tooltip", { type: "Tooltip" });
     this.$segments = this.$.find('.Ldt-Segments-Segment');
     
     this.$segments.mouseover(function() {
--- a/src/ldt/ldt/static/ldt/metadataplayer/Slice.css	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/Slice.css	Thu Jul 05 19:11:12 2012 +0200
@@ -5,7 +5,8 @@
 }
 
 .Ldt-Slice .ui-slider-handle {
-    width: 7px; height: 20px; top: 0; border: none; margin: 0; padding: 0; background: url(img/slice-handles.png); border-radius: 0;
+    width: 7px; height: 20px; top: 0; border: none; margin: 0; padding: 0;
+    background: url(img/slice-handles.png); border-radius: 0; cursor: pointer;
 }
 
 .ui-slider-handle.Ldt-Slice-left-handle {
--- a/src/ldt/ldt/static/ldt/metadataplayer/Slice.js	Wed Jul 04 19:20:17 2012 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/Slice.js	Thu Jul 05 19:11:12 2012 +0200
@@ -4,13 +4,13 @@
 
 IriSP.Widgets.Slice = function(player, config) {
     IriSP.Widgets.Widget.call(this, player, config);
+    this.sliding = false;
 };
 
 IriSP.Widgets.Slice.prototype = new IriSP.Widgets.Widget();
 
 IriSP.Widgets.Slice.prototype.defaults = {
     start_visible : false,
-    pause_on_change : true,
     live_update : true
         /* Shall the bounds change each time
         the Annotation Widget sends an update (true)
@@ -29,7 +29,8 @@
     this.min = 0;
     this.max = this.source.getDuration().valueOf();
     
-    var _this = this;
+    var _this = this,
+        _currentTime;
     
     this.$slider.slider({
         range: true,
@@ -44,9 +45,18 @@
             _this.player.popcorn.trigger("IriSP.Slice.boundsChanged",[ui.values[0], ui.values[1]]);
         },
         start: function() {
-            if (_this.pause_on_change && !_this.player.popcorn.media.paused) {
+            _this.sliding = true;
+            if (!_this.player.popcorn.media.paused) {
                 _this.player.popcorn.pause();
             }
+            _currentTime = _this.player.popcorn.currentTime();
+        },
+        slide: function(event, ui) {
+            _this.player.popcorn.currentTime(ui.value / 1000);
+        },
+        stop: function() {
+            _this.sliding = false;
+            _this.player.popcorn.currentTime(_currentTime);
         }
     });
     this.$slider.find(".ui-slider-handle:first").addClass("Ldt-Slice-left-handle");
@@ -74,9 +84,11 @@
 }
 
 IriSP.Widgets.Slice.prototype.storeBounds = function(_values) {
-    this.min = _values[0];
-    this.max = _values[1];
-    if (this.live_update) {
-        this.$slider.slider("values", [this.min, this.max]);
+    if (!this.sliding && !this.player.popcorn.media.paused && (this.min != _values[0] || this.max != _values[1])) {
+        this.min = _values[0];
+        this.max = _values[1];
+        if (this.live_update) {
+            this.$slider.slider("values", [this.min, this.max]);
+        }
     }
 }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ldt/ldt/static/ldt/metadataplayer/Social.css	Thu Jul 05 19:11:12 2012 +0200
@@ -0,0 +1,35 @@
+.Ldt-Social a {
+    display: inline-block; width: 24px; height: 24px; margin: 2px 0 0 2px; background: url(img/socialbuttons.png);
+}
+
+a.Ldt-Social-Twitter {
+    background-position: 0 0;
+}
+
+a.Ldt-Social-Twitter:hover {
+    background-position: 0 -24px;
+}
+
+a.Ldt-Social-Fb {
+    background-position: -24px 0;
+}
+
+a.Ldt-Social-Fb:hover {
+    background-position: -24px -24px;
+}
+
+a.Ldt-Social-Gplus {
+    background-position: -48px 0;
+}
+
+a.Ldt-Social-Gplus:hover {
+    background-position: -48px -24px;
+}
+
+a.Ldt-Social-Mail {
+    background-position: -72px 0;
+}
+
+a.Ldt-Social-Mail:hover {
+    background-position: -72px -24px;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ldt/ldt/static/ldt/metadataplayer/Social.js	Thu Jul 05 19:11:12 2012 +0200
@@ -0,0 +1,45 @@
+// TODO: Open share links in a small window
+
+IriSP.Widgets.Social = function(player, config) {
+    IriSP.Widgets.Widget.call(this, player, config);
+}
+
+IriSP.Widgets.Social.prototype = new IriSP.Widgets.Widget();
+
+IriSP.Widgets.Social.prototype.defaults = {
+    text: "",
+    url: "",
+    show_twitter: true,
+    show_fb: true,
+    show_gplus: true,
+    show_mail: true
+}
+
+IriSP.Widgets.Social.prototype.template =
+    '<span class="Ldt-Social">{{#show_fb}}<a href="#" target="_blank" class="Ldt-Social-Fb Ldt-TraceMe" title="{{l10n.share_on}} Facebook"></a>{{/show_fb}}'
+    + '{{#show_twitter}}<a href="#" target="_blank" class="Ldt-Social-Twitter Ldt-TraceMe" title="{{l10n.share_on}} Twitter"></a>{{/show_twitter}}'
+    + '{{#show_gplus}}<a href="#" target="_blank" class="Ldt-Social-Gplus Ldt-TraceMe" title="{{l10n.share_on}} Google+"></a>{{/show_gplus}}'
+    + '{{#show_mail}}<a href="#" target="_blank" class="Ldt-Social-Mail Ldt-TraceMe" title="{{l10n.share_mail}}"></a>{{/show_mail}}</span>';
+
+IriSP.Widgets.Social.prototype.messages = {
+    "fr": {
+        share_on: "Partager sur",
+        share_mail: "Envoyer par courriel"
+    },
+    "en" : {
+        share_on: "Share on",
+        share_mail: "Share by e-mail"
+    }
+}
+
+IriSP.Widgets.Social.prototype.draw = function() {
+    this.renderTemplate();
+    this.updateUrls(this.url, this.text);
+}
+
+IriSP.Widgets.Social.prototype.updateUrls = function(_url, _text) {
+    this.$.find(".Ldt-Social-Fb").attr("href", "http://www.facebook.com/share.php?" + IriSP.jQuery.param({ u: _url, t: _text }));
+    this.$.find(".Ldt-Social-Twitter").attr("href", "https://twitter.com/intent/tweet?" + IriSP.jQuery.param({ url: _url, text: _text }));
+    this.$.find(".Ldt-Social-Gplus").attr("href", "https://plusone.google.com/_/+1/confirm?" + IriSP.jQuery.param({ url: _url, title: _text }));
+    this.$.find(".Ldt-Social-Mail").attr("href", "mailto:?" + IriSP.jQuery.param({ subject: _text, body: _text + ": " + _url }));
+}
Binary file src/ldt/ldt/static/ldt/metadataplayer/img/socialbuttons.png has changed