# HG changeset patch # User veltr # Date 1341508272 -7200 # Node ID b431fb1fd4801930840f34b12521c7126c8df839 # Parent e45166859f96d90d30991daa992f9d6e372d8ec8 Corrections on the new Metadataplayer diff -r e45166859f96 -r b431fb1fd480 src/ldt/ldt/ldt_utils/templates/front/front_player.html --- 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(); - } - }); }); {% endblock %} @@ -61,32 +49,8 @@
- - +

{{content.title}}

+
{% include "ldt/ldt_utils/partial/embed_player.html" %}
@@ -94,13 +58,13 @@
-
-

Slides

+
+

{% trans 'All annotations on the media' %}

-
+
{% endblock %} diff -r e45166859f96 -r b431fb1fd480 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html --- 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 } diff -r e45166859f96 -r b431fb1fd480 src/ldt/ldt/static/ldt/css/front_player.css --- 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; -} diff -r e45166859f96 -r b431fb1fd480 src/ldt/ldt/static/ldt/metadataplayer/Annotation.css --- 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; +} + diff -r e45166859f96 -r b431fb1fd480 src/ldt/ldt/static/ldt/metadataplayer/Annotation.js --- 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 :", - share_on: "Partager sur", watching: "Je regarde ", on_site: " sur ", tags_: "Mots-clés :", @@ -20,8 +18,6 @@ excerpt_from: "Extrait de :" }, en: { - share_: "Share:", - share_on: "Share on", watching: "I'm watching ", on_site: " on ", tags_: "Keywords:", @@ -34,6 +30,7 @@ '
' + '
' + '
' + + '
' + '

' + '( - )

' + '

{{l10n.excerpt_from}} ' @@ -42,21 +39,18 @@ + '

' + '
' + '
{{l10n.tags_}}
    ' - + '
    {{l10n.share_}}

    ' - + '' - + '' - + '' - + '

    '; + + ''; 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 '
  • ' + _tag + '
  • '; }).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"); } diff -r e45166859f96 -r b431fb1fd480 src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.css --- 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; diff -r e45166859f96 -r b431fb1fd480 src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.js --- 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 = '
    ' + '