Updated mdplayer with corrections to oaubert changes
authordurandn
Tue, 06 Oct 2015 16:40:59 +0200
changeset 172 fc6cb4ccffc4
parent 171 b4aece5775cd
child 173 2792df95f7c6
Updated mdplayer with corrections to oaubert changes
server/src/remie/static/remie/css/style.css
server/src/remie/static/remie/metadataplayer/AnnotationsList.css
server/src/remie/static/remie/metadataplayer/AnnotationsList.js
server/src/remie/static/remie/metadataplayer/Controller.js
server/src/remie/static/remie/metadataplayer/CreateAnnotation.js
server/src/remie/static/remie/metadataplayer/LdtPlayer-core.js
server/src/remie/static/remie/metadataplayer/Segments.js
server/src/remie/static/remie/metadataplayer/img/external.png
server/src/remie/templates/remie/iframe_segments_group.html
server/src/remie/templates/remie/iframe_segments_preview.html
server/src/remie/templates/remie/iframe_segments_single.html
server/src/remie/templates/remie/iframe_teacher.html
server/src/remieplt/templates/ldt/ldt_utils/partial/embed_player.html
--- a/server/src/remie/static/remie/css/style.css	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/static/remie/css/style.css	Tue Oct 06 16:40:59 2015 +0200
@@ -242,7 +242,10 @@
     height: 30px;
     padding: 0;
     width: 90px;
-    bottom: 14px;
+}
+
+.Ldt-CreateAnnotation-Screen.Ldt-CreateAnnotation-Main .Ldt-CreateAnnotation-SubmitArea{
+	height: 45px;
 }
 
 .Ldt-CreateAnnotation-Screen.Ldt-CreateAnnotation-Main .Ldt-CreateAnnotation-Submit{
@@ -267,6 +270,10 @@
     margin: 8px 0 0;
 }
 
+.Ldt-CreateAnnotation-Times{
+	visibility: hidden;
+}
+
 .Ldt-CreateAnnotation .Ldt-CreateAnnotation-Inner h3{
     display: none;
 }
@@ -341,6 +348,11 @@
     color: #848484;
 }
 
+.Ldt-AnnotationsList-li .Ldt-AnnotationsList-Creator{
+	color: #848484;
+	margin-right: 35px;
+}
+
 .Ldt-AnnotationsList-li.Ldt-TraceMe .Ldt-AnnotationsList-Description{
 	white-space: nowrap; 
 	overflow: hidden; 
@@ -386,8 +398,8 @@
 #player_container #player_container_widget_Segments_7{
     width: 560px !important;
     height: 50px !important;
-    margin: 0 40px !important;
-    top: -31px;
+    margin: 8px 40px !important;
+    top: -55px;
     background-color: #ffffff !important;
 }
 
@@ -435,6 +447,15 @@
     border: none;
 }
 
+.Ldt-Ctrl-Fullscreen-Button,
+.Ldt-Ctrl-Time{
+	visibility: hidden !important;
+}
+
+.Ldt-Ctrl{
+	height: 50px !important
+}
+
 .Ldt-Ctrl .Ldt-Ctrl-Left .Ldt-Ctrl-spacer,
 .Ldt-Ctrl .Ldt-Ctrl-Right .Ldt-Ctrl-spacer{
     background: none;
--- a/server/src/remie/static/remie/metadataplayer/AnnotationsList.css	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/static/remie/metadataplayer/AnnotationsList.css	Tue Oct 06 16:40:59 2015 +0200
@@ -6,7 +6,9 @@
 }
 
 .Ldt-AnnotationsListWidget {
-    border: none; margin: 0; padding: 0;
+    border: none; 
+    margin: 0; 
+    padding: 0;
     overflow: auto;
 }
 .Ldt-AnnotationsListWidget a {
@@ -60,13 +62,14 @@
 }
 .Ldt-AnnotationsList-li.selected {
     background-image: url(img/pinstripe-grey.png);
+    z-index: 1;
 }
 .Ldt-AnnotationsList-ThumbContainer {
     float: left;
     width: 80px;
     height: 50px;
     text-align: center;
-    margin: 10px 2px;
+    margin: 0px 2px 10px 2px;
     box-shadow: #808080 0px 0px 2px;
 }
 .Ldt-AnnotationsList-Thumbnail {
@@ -76,6 +79,16 @@
     margin: 0 auto;
 }
 
+.Ldt-AnnotationsList-External-Icon {
+	background-image: url(img/external.png);
+	z-index: 100;
+	height: 15px;
+	width: 15px;
+	position: relative;
+	bottom: 20px;
+	left: 64px;
+}
+
 .Ldt-AnnotationsList-DeleteButton {
 	margin: 0px;
 	float: right;
@@ -101,25 +114,31 @@
     color: #f7268e;
     text-align: left;
     font-size: 12px;
-    margin: 2px 2px 0 82px;
+    margin: 2px 2px 2px 89px;
 }
-h3.Ldt-AnnotationsList-Title {
+h3.Ldt-AnnotationsList-Title span.Ldt-AnnotationsList-TitleContent{
     color: #0068c4;
     font-size: 13px;
-    margin: 2px 2px 0 82px;
+    margin-left: 5px;
     font-weight: bold;
 }
 
+h3.Ldt-AnnotationsList-Title.Ldt-Annotation-Timecode{	
+    font-size: 13px;
+}
+
 .Ldt-AnnotationsList-Title a {
     color: #0068c4;
 }
 
 .Ldt-AnnotationsList-Creator {
-    color: #aaa;
+    color: #4d90f4;
+    margin-left: 5px;
+    font-size: 13px;
 }
 
 p.Ldt-AnnotationsList-Description {
-    margin: 2px 0 2px 82px;
+    margin: 2px 0 2px 89px;
     font-size: 12px;
     color: #333333;
 }
--- a/server/src/remie/static/remie/metadataplayer/AnnotationsList.js	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/static/remie/metadataplayer/AnnotationsList.js	Tue Oct 06 16:40:59 2015 +0200
@@ -28,6 +28,7 @@
      */
     ajax_granularity : 600000,
     default_thumbnail : "",
+    custom_external_icon : "",
     /*
      * URL when the annotation is not in the current project, e.g.
      * http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/{{media}}/{{project}}/{{annotationType}}#id={{annotation}}
@@ -55,7 +56,7 @@
     editable: false,
     // Id that will be used as localStorage key
     editable_storage: "",
-
+    widget_max_height: 680,
     always_visible : false,
     start_visible: true,
     show_audio : true,
@@ -71,6 +72,7 @@
     annotations_count_header : true,
     show_creation_date : false,
     show_timecode : true,
+    show_end_time : true,
     project_id: "",
     /*
      * Only annotation in the current segment will be displayed. Designed to work with the Segments Widget.
@@ -160,6 +162,7 @@
         confirm_delete_message: "You are about to delete {{ annotation.title }}. Are you sure you want to delete it?",
         confirm_publish_message: "You are about to publish {{ annotation.title }}. Are you sure you want to make it public?",
         tweet_annotation: "Tweet annotation",
+        external_annotation: "This annotation was submitted to another project",
         everyone: "Everyone",
         header: "Annotations for this content",
         segment_filter: "All cuttings",
@@ -185,6 +188,7 @@
         confirm_delete_message: "Vous allez supprimer {{ annotation.title }}. Êtes-vous certain(e) ?",
         confirm_publish_message: "Vous allez publier {{ annotation.title }}. Êtes-vous certain(e) ?",
         tweet_annotation: "Tweeter l'annotation",
+        external_annotation: "Cette annotation a été postée sur un autre projet",
         everyone: "Tous",
         header: "Annotations sur ce contenu",
         segment_filter: "Tous les segments",
@@ -244,8 +248,9 @@
 IriSP.Widgets.AnnotationsList.prototype.annotationTemplate =
     '<li class="Ldt-AnnotationsList-li Ldt-Highlighter-Annotation Ldt-TraceMe" data-annotation="{{ id }}" data-begin="{{ begin_ms }}" data-end="{{ end_ms }}" trace-info="annotation-id:{{id}}, media-id:{{media_id}}" style="{{specific_style}}">'
     + '<div data-annotation="{{ id }}" class="Ldt-AnnotationsList-ThumbContainer Ldt-AnnotationsList-Annotation-Screen Ldt-AnnotationsList-Annotation-ScreenMain">'
-    +   '<a href="{{url}}" draggable="true">'
-    +     '<img title="{{ begin }} - {{ title }}" class="Ldt-AnnotationsList-Thumbnail" src="{{thumbnail}}" />'
+    +   '<a {{#url}}href="{{url}}"{{/url}} draggable="true">'
+    +     '<img title="{{^external}}{{ begin }} - {{ end }}{{/external}}{{#external}}{{l10n.external_annotation}}{{/external}}" class="Ldt-AnnotationsList-Thumbnail" src="{{thumbnail}}" />'
+    +     '{{#external}}<div title="{{l10n.external_annotation}}" class="Ldt-AnnotationsList-External-Icon"></div>{{/external}}'
     +   '</a>'
     + '</div>'
     + '{{#allow_annotations_deletion}}'
@@ -534,8 +539,9 @@
                     )
                     : document.location.href.replace(/#.*$/,'') + '#id=' + _annotation.id + '&t=' + (_annotation.begin / 1000.0)
                     )
-            );
-            var _title = "",
+                ),
+                _external = _annotation.project != _this.source.projectId ? true : false,
+                _title = "",
                 _description = _annotation.description,
                 _thumbnail = (typeof _annotation.thumbnail !== "undefined" && _annotation.thumbnail ? _annotation.thumbnail : _this.default_thumbnail);
             if (_this.show_creator){
@@ -569,7 +575,7 @@
             });
             var _created = false;
             if (_this.show_creation_date) {
-                _created = _annotation.created.toLocaleDateString()+", "+_annotation.created.toLocaleTimeString();
+                _created = _annotation.created.toLocaleDateString()+", "+_annotation.created.toLocaleTimeString().replace(/\u200E/g, '').replace(/^([^\d]*\d{1,2}:\d{1,2}):\d{1,2}([^\d]*)$/, '$1$2');;
             }
             if(this.tags == true){
                 var _tags = _annotation.getTagTexts();
@@ -589,12 +595,15 @@
                 end : _annotation.end.toString(),
                 created : _created,
                 show_timecode : _this.show_timecode,
+                show_end_time : _this.show_end_time,
+                show_title : _this.show_title && _title,
                 thumbnail : _thumbnail,
                 url : _url,
                 tags : _tags,
                 specific_style : (typeof _bgcolor !== "undefined" ? "background-color: " + _bgcolor : ""),
                 l10n: _this.l10n,
                 editable: _this.editable,
+                external: _external,
                 show_publish: _this.show_publish,
                 show_creator: _this.show_creator,
                 show_twitter: _this.show_twitter,
@@ -1039,6 +1048,10 @@
     this.list_$ = this.$.find(".Ldt-AnnotationsList-ul");
     this.widget_$ = this.$.find(".Ldt-AnnotationsListWidget");
     
+    if (this.widget_max_height){
+        this.widget_$.css("max-height", this.widget_max_height)
+    }
+    
     if (this.show_filters){
         if (this.user_filter){
             this.userselect_$ = this.$.find("#Ldt-AnnotationsList-userFilter");
--- a/server/src/remie/static/remie/metadataplayer/Controller.js	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/static/remie/metadataplayer/Controller.js	Tue Oct 06 16:40:59 2015 +0200
@@ -11,6 +11,7 @@
     disable_annotate_btn: false,
     disable_search_btn: false,
     disable_ctrl_f: false,
+    disable_fullscreen : true,
     always_show_search: false,
     enable_quiz_toggle: undefined
 };
@@ -34,7 +35,7 @@
     + '<div class="Ldt-Ctrl-Quiz-Create Ldt-TraceMe" ></div>'
     + '</div>'
     + '<div class="Ldt-Ctrl-Right">'
-    + '<div class="Ldt-Ctrl-Fullscreen-Button Ldt-TraceMe" title="Passer le lecteur en plein-écran"></div>'
+    + '{{^disable_fullscreen}}<div class="Ldt-Ctrl-Fullscreen-Button Ldt-TraceMe" title="Passer le lecteur en plein-écran"></div{{/disable_fullscreen}}'
     + '<div class="Ldt-Ctrl-spacer"></div>'
     + '<div class="Ldt-Ctrl-Time">'
     + '<div class="Ldt-Ctrl-Time-Elapsed" title="{{l10n.elapsed_time}}">00:00</div>'
@@ -104,20 +105,20 @@
 
     if (this.enable_quiz_toggle !== undefined) {
         if (this.enable_quiz_toggle) {
-            $(".Ldt-Ctrl-Quiz-Enable").addClass("Ldt-Ctrl-Quiz-Toggle-Active");
-            $(".Ldt-Ctrl-Quiz-Create").addClass("Ldt-Ctrl-Quiz-Toggle-Active");
+            this.$.find(".Ldt-Ctrl-Quiz-Enable").addClass("Ldt-Ctrl-Quiz-Toggle-Active");
+            this.$.find(".Ldt-Ctrl-Quiz-Create").addClass("Ldt-Ctrl-Quiz-Toggle-Active");
             // this.player.trigger("QuizCreator.show");
-            $("#QuizEditContainer").show();
+            this.$.find("#QuizEditContainer").show();
         }
         else
         {
-            $(".Ldt-Ctrl-Quiz-Enable").removeClass("Ldt-Ctrl-Quiz-Toggle-Active");
-            $(".Ldt-Ctrl-Quiz-Create").removeClass("Ldt-Ctrl-Quiz-Toggle-Active");
+            this.$.find(".Ldt-Ctrl-Quiz-Enable").removeClass("Ldt-Ctrl-Quiz-Toggle-Active");
+            this.$.find(".Ldt-Ctrl-Quiz-Create").removeClass("Ldt-Ctrl-Quiz-Toggle-Active");
             this.player.trigger("QuizCreator.hide");
-            $("#QuizEditContainer").hide();
+            this.$.find("#QuizEditContainer").hide();
         }
     } else {
-            $(".Ldt-Ctrl-Quiz-Enable").hide();
+            this.$.find(".Ldt-Ctrl-Quiz-Enable").hide();
     }
 
     this.$.find(".Ldt-Ctrl-Annotate").click(function() {
--- a/server/src/remie/static/remie/metadataplayer/CreateAnnotation.js	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/static/remie/metadataplayer/CreateAnnotation.js	Tue Oct 06 16:40:59 2015 +0200
@@ -64,6 +64,7 @@
     pause_when_displaying: false,
     custom_send_button: false,
     custom_cancel_button: false,
+    custom_description_placeholder: false,
     preview_mode: false,
 };
 
@@ -137,7 +138,7 @@
     +   '<span title="{{l10n.out_tooltip}}" class="Ldt-CreateAnnotation-Control-Out">Out</span>'
     +   '<span title="{{l10n.play_tooltip}}" class="Ldt-CreateAnnotation-Control-Play">Play</span>'
     + '</div>{{/show_controls}}'
-    + '<textarea class="Ldt-CreateAnnotation-Description Ldt-TraceMe empty" placeholder="{{l10n.type_description}}"></textarea>'
+    + '<textarea class="Ldt-CreateAnnotation-Description Ldt-TraceMe empty" placeholder="{{#custom_description_placeholder}}{{custom_description_placeholder}}{{/custom_description_placeholder}}{{^custom_description_placeholder}}{{l10n.type_description}}{{/custom_description_placeholder}}"></textarea>'
     + '{{#show_creator_field}}<div class="Ldt-CreateAnnotation-Avatar"><img src="{{creator_avatar}}" title="{{creator_name}}"></img></div>{{/show_creator_field}}'
     + '<div class="Ldt-CreateAnnotation-SubmitArea Ldt-TraceMe">'
     +  '{{#preview_mode}}<input type="button" class="Ldt-CreateAnnotation-PreviewSubmit" title="{{l10n.preview_submit}}" value="{{#custom_send_button}}{{custom_send_button}}{{/custom_send_button}}{{^custom_send_button}}{{l10n.submit}}{{/custom_send_button}}" />{{/preview_mode}}'
--- a/server/src/remie/static/remie/metadataplayer/LdtPlayer-core.js	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/static/remie/metadataplayer/LdtPlayer-core.js	Tue Oct 06 16:40:59 2015 +0200
@@ -13,7 +13,7 @@
                                            |_|            |___/         
 
  *  Copyright 2010-2012 Institut de recherche et d'innovation 
- *	contributor(s) : Karim Hamidou, Samuel Huron, Raphael Velt, Thibaut Cavalie
+ *	contributor(s) : Karim Hamidou, Samuel Huron, Raphael Velt, Thibaut Cavalie, Yves-Marie Haussonne, Nicolas Durand, Olivier Aubert
  *	 
  *	contact@iri.centrepompidou.fr
  *	http://www.iri.centrepompidou.fr 
@@ -28,7 +28,7 @@
  *	The fact that you are presently reading this means that you have had
  *	knowledge of the CeCILL-C license and that you accept its terms.
 */
-/* Initialization of the namespace */
+// Metadataplayer - version 0.1/* Initialization of the namespace */
 
 if (typeof window.IriSP === "undefined") {
     window.IriSP = {
@@ -1847,7 +1847,7 @@
                 if (typeof _data.content.img !== "undefined" && _data.content.img.src !== "undefined") {
                     _res.thumbnail = _data.content.img.src;
                 }
-                _res.created = IriSP.Model.isoToDate((_data.meta ? _data.meta['dc:created'] : "") ||_data.created);
+                _res.created = IriSP.Model.isoToDate(_data.created ? _data.created : _data.meta? _data.meta["dc:created"] : "");
                 if (typeof _data.color !== "undefined") {
                     var _c = parseInt(_data.color).toString(16);
                     while (_c.length < 6) {
@@ -1860,7 +1860,8 @@
                 _res.setAnnotationType(_data.meta["id-ref"]);
                 _res.setTags(IriSP._(_data.tags).pluck("id-ref"));
                 _res.keywords = _res.getTagTexts();
-                _res.setBeginEnd(_data.begin, _data.end);
+                _res.setBegin(_data.begin);
+                _res.setEnd(_data.end);
                 _res.creator = _data.meta["dc:creator"] || "";
                 _res.project = _data.meta.project || "";
                 if (typeof _data.meta["dc:source"] !== "undefined" && typeof _data.meta["dc:source"].content !== "undefined") {
--- a/server/src/remie/static/remie/metadataplayer/Segments.js	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/static/remie/metadataplayer/Segments.js	Tue Oct 06 16:40:59 2015 +0200
@@ -18,6 +18,7 @@
     faded_selected_color: "#baf9b5",
     no_tooltip: false,
     use_timerange: false,
+    scale_to_parent: true
 };
 
 IriSP.Widgets.Segments.prototype.template =
@@ -31,7 +32,7 @@
 
 
 IriSP.Widgets.Segments.prototype.do_draw = function (isRedraw) {
-    if (this.width != this.$.parent().width()) {
+    if (this.width != this.$.parent().width() && this.scale_to_parent) {
         // Reset width
         this.width = this.$.parent().width();
         this.$.css({ width : this.width + "px" });
Binary file server/src/remie/static/remie/metadataplayer/img/external.png has changed
--- a/server/src/remie/templates/remie/iframe_segments_group.html	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/templates/remie/iframe_segments_group.html	Tue Oct 06 16:40:59 2015 +0200
@@ -80,6 +80,7 @@
             overlap: 1,
             no_tooltip: true,
             use_timerange: true,
+            scale_to_parent: false
             
         },{
             type: "AnnotationsController",
@@ -122,6 +123,7 @@
             project_id: "{{project_id}}",
             pause_when_displaying: true,
             custom_send_button: "Sauver",
+            custom_description_placeholder: " ",
         },{
             type: "AnnotationsList",
             container: "AnnotationsList_container",
--- a/server/src/remie/templates/remie/iframe_segments_preview.html	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/templates/remie/iframe_segments_preview.html	Tue Oct 06 16:40:59 2015 +0200
@@ -80,6 +80,7 @@
             overlap: 1,
             no_tooltip: true,
             use_timerange: true,
+            scale_to_parent: false
             
         },{
             type: "AnnotationsController",
@@ -119,6 +120,7 @@
             project_id: "{{project_id}}",
             pause_when_displaying: true,
             custom_send_button: "Sauver",
+            custom_description_placeholder: " ",
             preview_mode: true,
         },{
             type: "AnnotationsList",
--- a/server/src/remie/templates/remie/iframe_segments_single.html	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/templates/remie/iframe_segments_single.html	Tue Oct 06 16:40:59 2015 +0200
@@ -79,6 +79,7 @@
             overlap: 1,
             no_tooltip: true,
             use_timerange: true,
+            scale_to_parent: false
             
         },{
             type: "AnnotationsController",
@@ -121,6 +122,7 @@
             project_id: "{{project_id}}",
             pause_when_displaying: true,
             custom_send_button: "Sauver",
+            custom_description_placeholder: " ",
         },{
             type: "AnnotationsList",
             container: "AnnotationsList_container",
--- a/server/src/remie/templates/remie/iframe_teacher.html	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remie/templates/remie/iframe_teacher.html	Tue Oct 06 16:40:59 2015 +0200
@@ -79,6 +79,7 @@
             overlap: 1,
             no_tooltip: true,
             use_timerange: true,
+            scale_to_parent: false
             
         },{
             type: "AnnotationsController",
@@ -120,6 +121,8 @@
             // Change id to a given project id
             project_id: "{{project_id}}",
             pause_when_displaying: true,
+            custom_send_button: "Sauver",
+            custom_description_placeholder: " ",
         },{
             type: "AnnotationsList",
             container: "AnnotationsList_container",
--- a/server/src/remieplt/templates/ldt/ldt_utils/partial/embed_player.html	Fri Oct 02 15:28:29 2015 +0200
+++ b/server/src/remieplt/templates/ldt/ldt_utils/partial/embed_player.html	Tue Oct 06 16:40:59 2015 +0200
@@ -71,6 +71,8 @@
             ajax_granularity : 300000,
             default_thumbnail : '{% static "ldt/css/imgs/video_sequence.png" %}',
             show_audio: true,
+            foreign_url: "{% absurl 'front_player_content' content_iri_id=content.iri_id %}{% templatetag openvariable %}project{% templatetag closevariable %}",
+            show_creation_date: true,
             audio_url_transform: function(url) {
                 return url.replace("ddc_micro_record/","ddc_micro_record/flv:");
             }