updated player version. disabled minified player.
authorhamidouk
Fri, 03 Feb 2012 10:22:11 +0100
changeset 518 5e8b72d30bd8
parent 513 d7a40f4dc38b
child 519 c39f905103d3
updated player version. disabled minified player.
src/ldt/ldt/ldt_utils/templates/front/front_player.html
src/ldt/ldt/static/ldt/js/LdtPlayer-release.js
--- a/src/ldt/ldt/ldt_utils/templates/front/front_player.html	Thu Feb 02 16:12:46 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/front/front_player.html	Fri Feb 03 10:22:11 2012 +0100
@@ -17,7 +17,7 @@
 <script type="text/javascript">
     var $j = jQuery.noConflict();
 </script>
-<script type="text/javascript" src="{{LDT_MEDIA_PREFIX}}js/LdtPlayer.min.js"></script>
+<script type="text/javascript" src="{{LDT_MEDIA_PREFIX}}js/LdtPlayer-release.js"></script>
 <script type="text/javascript">
     __IriSP.lib = {
         jQuery:"{{LDT_MEDIA_PREFIX}}js/jquery.min.js",
--- a/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js	Thu Feb 02 16:12:46 2012 +0100
+++ b/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js	Fri Feb 03 10:22:11 2012 +0100
@@ -1092,7 +1092,7 @@
 IriSP.annotation_loading_template = "{{! template shown while the annotation widget is loading }}<div id='Ldt-load-container'><div id='Ldt-loader'>&nbsp;</div> Chargement... </div>";
 IriSP.annotationsListWidget_template = "{{! template for the annotation list widget }}<div class='Ldt-AnnotationsListWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-Annotation-DoubleBorder'>    <ul>    {{#annotations}}      <li>        {{! if the url is not present, it means that the annotation exists             in the current project }}        {{^url}}        <a href='#id={{id}}'>        {{/url}}        {{! otherwise link to url }}        {{#url}}        <a href='{{url}}#id={{id}}'>        {{/url}}          <div style='overflow: auto; margin-top: 5px; margin-bottom: 5px;'>            <div class='Ldt-AnnotationsList-Caption'>              <img src='http://i.imgur.com/aoUlC.jpg'></img>            </div>            <div class='Ldt-AnnotationsList-Duration'>{{begin}} - {{end}}</div>            <div class='Ldt-AnnotationsList-Title'>{{title}}</div>            <div class='Ldt-AnnotationsList-Description'>{{desc}}</div>          </div>        </a>      </li>    {{/annotations}}    </ul>  </div></div>";
 IriSP.arrowWidget_template = "<div class='Ldt-arrowWidget'></div>";
-IriSP.createAnnotationWidget_template = "{{! template for the annotation creation widget }}<div class='Ldt-createAnnotationWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-createAnnotation-DoubleBorder'>    <div class='Ldt-createAnnotation-startScreen'>      <div style='margin-bottom: 7px; overflow: auto;'>        <div class='Ldt-createAnnotation-Title'></div>        <div class='Ldt-createAnnotation-TimeFrame'></div>        {{^cinecast_version}}          <div class='Ldt-createAnnotation-Minimize' title='Cancel'></img>        {{/cinecast_version}}      </div>            <div class='Ldt-createAnnotation-Container'>        <textarea class='Ldt-createAnnotation-Description'></textarea>        <div class='Ldt-createAnnotation-profileArrow'>                  </div>        <div class='Ldt-createAnnotation-userAvatar'>        {{^user_avatar}}          <img src='https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png'></img>        {{/user_avatar}}        {{#user_avatar}}          <img src='{{ user_avatar }}'></img>        {{/user_avatar}}        </div>      </div>      <div class='Ldt-createAnnotation-submitButton'>        <div style='position: absolute; bottom: 5px; right: 5px;'>Submit</div>      </div>      <div class='Ldt-createAnnotation-keywords'>        Add keywords :             </div>      {{#polemic_mode}}      <div class='Ldt-createAnnotation-polemics'>        Add polemic keywords           </div>      {{/polemic_mode}}    </div>    <div class='Ldt-createAnnotation-waitScreen' style='display: none; text-align: center'>      <img src='{{img_dir}}/spinner.gif'></img>      Please wait while your request is being processed...    </div>        <div class='Ldt-createAnnotation-endScreen' style='display: none'>      Thank you, your annotation has been saved.<br>      Would you like to share it on social networks ?      <div style='margin-top: 12px; text-align: center;'>          <a target='_blank' class='Ldt-createAnnotation-endScreen-TweetLink'><img src='{{img_dir}}/tweet_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-FbLink'><img src='{{img_dir}}/facebook_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-GplusLink'><img src='{{img_dir}}/gplus_button.png' style='margin-right: 20px;'></img></a>                          </div>    </div>  </div></div>";
+IriSP.createAnnotationWidget_template = "{{! template for the annotation creation widget }}<div class='Ldt-createAnnotationWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-createAnnotation-DoubleBorder'>    <div class='Ldt-createAnnotation-startScreen'>      <div style='margin-bottom: 7px; overflow: auto;'>        <div class='Ldt-createAnnotation-Title'></div>        <div class='Ldt-createAnnotation-TimeFrame'></div>        {{^cinecast_version}}          <div class='Ldt-createAnnotation-Minimize' title='Cancel'></img>        {{/cinecast_version}}      </div>            <div class='Ldt-createAnnotation-Container'>        <textarea class='Ldt-createAnnotation-Description'></textarea>        <div class='Ldt-createAnnotation-profileArrow'>                  </div>        <div class='Ldt-createAnnotation-userAvatar'>        {{^user_avatar}}          <img src='https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png'></img>        {{/user_avatar}}        {{#user_avatar}}          <img src='{{ user_avatar }}'></img>        {{/user_avatar}}        </div>      </div>      <div class='Ldt-createAnnotation-submitButton'>        <div style='position: absolute; bottom: 5px; right: 5px;'>Submit</div>      </div>      <div class='Ldt-createAnnotation-keywords'>        Add keywords :             </div>      {{#polemic_mode}}      <div class='Ldt-createAnnotation-polemics'>        Add polemic keywords           </div>      {{/polemic_mode}}    </div>    <div class='Ldt-createAnnotation-waitScreen' style='display: none; text-align: center'>      <img src='{{img_dir}}/spinner.gif'></img>      Please wait while your request is being processed...    </div>    <div class='Ldt-createAnnotation-errorScreen' style='display: none; text-align: center'>      An error happened while contacting the server. Your annotation has not been saved.    </div>        <div class='Ldt-createAnnotation-endScreen' style='display: none'>      Thank you, your annotation has been saved.<br>      Would you like to share it on social networks ?      <div style='margin-top: 12px; text-align: center;'>          <a target='_blank' class='Ldt-createAnnotation-endScreen-TweetLink'><img src='{{img_dir}}/tweet_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-FbLink'><img src='{{img_dir}}/facebook_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-GplusLink'><img src='{{img_dir}}/gplus_button.png' style='margin-right: 20px;'></img></a>                          </div>    </div>  </div></div>";
 IriSP.createAnnotationWidget_festivalCinecast_template = "{{! template for the annotation creation widget specific for the cinecast festival}}<div class='Ldt-createAnnotationWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-createAnnotation-DoubleBorder'>    <div style='margin-bottom: 7px; overflow: auto;'>      <div class='Ldt-createAnnotation-Title'></div>      <div class='Ldt-createAnnotation-TimeFrame'></div>    </div>        <div class='Ldt-createAnnotation-Container'>      <textarea class='Ldt-createAnnotation-Description'></textarea>      <div class='Ldt-createAnnotation-profileArrow'>        <img src='{{img_dir}}/annotate_arrow.png'></img>      </div>      <div class='Ldt-createAnnotation-userAvatar'>                <img src='https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png'></img>      </div>    </div>        <div class='Ldt-createAnnotation-keywords'>      Add keywords :           </div>              <div class='Ldt-createAnnotation-submitButton'>      <div style='position: absolute; bottom: 10pt; right: 11pt;'>Submit</div>    </div>        <div class='Ldt-createAnnotation-endScreen' style='display: none'>      Thank you, your annotation has been saved.<br>      Would you like to share it on social networks ?      <div style='margin-top: 12px; text-align: center;'>          <a target='_blank' class='Ldt-createAnnotation-endScreen-TweetLink'><img src='{{img_dir}}/tweet_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-FbLink'><img src='{{img_dir}}/facebook_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-GplusLink'><img src='{{img_dir}}/gplus_button.png' style='margin-right: 20px;'></img></a>                          </div>    </div>  </div></div>";
 IriSP.createAnnotation_errorMessage_template = "<p class='Ldt-createAnnotation-errorMessage'>  You must enter text to submit an annotation</p>";
 IriSP.overlay_marker_template = "{{! the template for the small bars which is z-indexed over our segment widget }}<div class='Ldt-SegmentPositionMarker' style='background-color: #F7268E;'></div>";
@@ -1740,135 +1740,6 @@
   };
 }
 
-/* ui.js - ui related functions */
-
-/* FIXME: use an sharing library */
-IriSP.LdtShareTool = IriSP.share_template; /* the contents come from share.html */
-
-IriSP.createPlayerChrome = function(){
-	var width = IriSP.config.gui.width;
-	var height = IriSP.config.gui.height;
-	var heightS = IriSP.config.gui.height-20;
-	
-	// AUDIO  */
-	// PB dans le html : ; 
-	IriSP.trace( "__IriSP.createMyHtml",IriSP.config.gui.container );
-
-	
-	/* FIXME : factor this in another file */
-	if( IriSP.config.gui.mode=="radio" ){
-
-		IriSP.jQuery( "#"+IriSP.config.gui.container ).before(IriSP.search_template);
-		var radioPlayer = Mustache.to_html(IriSP.radio_template, {"share_template" : IriSP.share_template});
-		IriSP.jQuery(radioPlayer).appendTo("#"+IriSP.config.gui.container);
-
-		// special tricks for IE 7
-		if (IriSP.jQuery.browser.msie==true && IriSP.jQuery.browser.version=="7.0"){
-			//LdtSearchContainer
-			//__IriSP.jQuery("#LdtPlayer").attr("margin-top","50px");
-			IriSP.jQuery("#Ldt-Root").css("padding-top","25px");
-			IriSP.trace("__IriSP.createHtml","IE7 SPECIAL ");
-		}
-	} else if(IriSP.config.gui.mode=="video") {
-	
-		var videoPlayer = Mustache.to_html(IriSP.video_template, {"share_template" : IriSP.share_template, "heightS" : heightS});
-		IriSP.jQuery(videoPlayer).appendTo("#"+IriSP.config.gui.container);
-	}
-	
-	IriSP.jQuery("#Ldt-Annotations").width(width-(75*2));
-	IriSP.jQuery("#Ldt-Show-Arrow-container").width(width-(75*2));
-	IriSP.jQuery("#Ldt-ShowAnnotation-audio").width(width-10);
-	IriSP.jQuery("#Ldt-ShowAnnotation-video").width(width-10);
-	IriSP.jQuery("#Ldt-SaKeyword").width(width-10);
-	IriSP.jQuery("#Ldt-controler").width(width-10);
-	IriSP.jQuery("#Ldt-Control").attr("z-index","100");
-	IriSP.jQuery("#Ldt-controler").hide();
-	
-	IriSP.jQuery(IriSP.annotation_loading_template).appendTo("#Ldt-ShowAnnotation-audio");
-
-	if(IriSP.config.gui.mode=='radio'){
-		IriSP.jQuery("#Ldt-load-container").attr("width",IriSP.config.gui.width);
-	}
-	// Show or not the output
-	if(IriSP.config.gui.debug===true){
-		IriSP.jQuery("#Ldt-output").show();
-	} else {
-		IriSP.jQuery("#Ldt-output").hide();
-	}
-	
-};
-
-
-/* create the buttons and the slider   */
-IriSP.createInterface = function( width, height, duration ) {
-		
-		IriSP.jQuery( "#Ldt-controler" ).show();
-		//__IriSP.jQuery("#Ldt-Root").css('display','visible');
-		IriSP.trace( "__IriSP.createInterface" , width+","+height+","+duration+"," );
-		
-		IriSP.jQuery( "#Ldt-ShowAnnotation").click( function () { 
-			 //__IriSP.jQuery(this).slideUp(); 
-		} );
-
-		var LdtpPlayerY = IriSP.jQuery("#Ldt-PlaceHolder").attr("top");
-		var LdtpPlayerX = IriSP.jQuery("#Ldt-PlaceHolder").attr("left");
-		
-		IriSP.jQuery( "#slider-range-min" ).slider( { //range: "min",
-			value: 0,
-			min: 1,
-			max: duration/1000,//1:54:52.66 = 3600+3240+
-			step: 0.1,
-			slide: function(event, ui) {
-				
-				//__IriSP.jQuery("#amount").val(ui.value+" s");
-				//player.sendEvent('SEEK', ui.value)
-				IriSP.MyApiPlayer.seek(ui.value);
-				//changePageUrlOffset(ui.value);
-				//player.sendEvent('PAUSE')
-			}
-		} );
-		
-		IriSP.trace("__IriSP.createInterface","ICI");
-		IriSP.jQuery("#amount").val(IriSP.jQuery("#slider-range-min").slider("value")+" s");
-		IriSP.jQuery(".Ldt-Control1 button:first").button({
-			icons: {
-				primary: 'ui-icon-play'
-			},
-			text: false
-		}).next().button({
-			icons: {
-				primary: 'ui-icon-seek-next'
-			},
-			 text: false
-		});
-		IriSP.jQuery(".Ldt-Control2 button:first").button({
-			icons: {
-				primary: 'ui-icon-search'//,
-				//secondary: 'ui-icon-volume-off'
-			},
-			text: false
-		}).next().button({
-			icons: {
-				primary: 'ui-icon-volume-on'
-			},
-			 text: false
-		});
-
-		// /!\ PB A MODIFIER 
-		//__IriSP.MyTags.draw();
-		IriSP.trace("__IriSP.createInterface","ICI2");
-		IriSP.jQuery( "#ldt-CtrlPlay" ).attr( "style", "background-color:#CD21C24;" );
-		
-		IriSP.jQuery( "#Ldt-load-container" ).hide();
-		
-		if( IriSP.config.gui.mode=="radio" & IriSP.jQuery.browser.msie != true ) {
-			IriSP.jQuery( "#Ldtplayer1" ).attr( "height", "0" );
-		}
-		IriSP.trace( "__IriSP.createInterface" , "3" );
-
-		IriSP.trace( "__IriSP.createInterface", "END" );
-		
-	};
 /* the widget classes and definitions */
 
 /**
@@ -3087,6 +2958,11 @@
   this.selector.find(".Ldt-createAnnotation-waitScreen").show();  
 };
 
+IriSP.createAnnotationWidget.prototype.showErrorScreen = function() {
+  this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
+  this.selector.find(".Ldt-createAnnotation-errorScreen").show();  
+};
+
 IriSP.createAnnotationWidget.prototype.showEndScreen = function(annotation) {
   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
   
@@ -3245,7 +3121,7 @@
       error: 
               function(jqXHR, textStatus, errorThrown) { 
                             console.log("an error occured while contacting " 
-                            + url + " and sending " + jsonString + textStatus ); } });
+                            + url + " and sending " + jsonString + textStatus ); _this.showErrorScreen(); } });
 };IriSP.HelloWorldWidget = function(Popcorn, config, Serializer) {
   IriSP.Widget.call(this, Popcorn, config, Serializer);
 }
@@ -3258,7 +3134,7 @@
         .css({
             "text-align" : "center",
             "padding": "10px 0",
-            "font-size" : "14px",
+            "font-size" : "14px"
         });
         
     console.log(this);
@@ -4598,23 +4474,23 @@
             {
                 "keywords" : [ "++" ],
                 "description" : "positif",
-                "color" : "#1D973D",
+                "color" : "#1D973D"
             },
             {
                 "keywords" : [ "--" ],
                 "description" : "negatif",
-                "color" : "#CE0A15",
+                "color" : "#CE0A15"
             },
             {
                 "keywords" : [ "==" ],
                 "description" : "reference",
-                "color" : "#C5A62D",   
+                "color" : "#C5A62D"  
             },
             {
                 "keywords" : [ "??" ],
                 "description" : "question",
-                "color" : "#036AAE",
-            },
+                "color" : "#036AAE"
+            }
         ],
         _defaultDefColor = "#585858";
     this.height =  this._config.height || 50;
@@ -4687,7 +4563,7 @@
             if (!this.isStreamGraph) {
                 this.paper.rect(i * _width, _base, _width - 1, _h ).attr({
                     "stroke" : "none",
-                    "fill" : this.defaultcolorconf,
+                    "fill" : this.defaultcolorconf
                 });
             }
            _paths[0].push(_base);
@@ -4697,7 +4573,7 @@
                 if (!this.isStreamGraph) {
                     this.paper.rect(i * _width, _base, _width - 1, _h ).attr({
                         "stroke" : "none",
-                        "fill" : this.tagconf[j].color,
+                        "fill" : this.tagconf[j].color
                     });
                 }
                 _paths[j+1].push(_base);
@@ -4724,7 +4600,7 @@
             },'') + 'L' + this.width + ' ' + _paths[j][_paths[j].length - 1] + 'L' + this.width + ' ' + this.height + 'L0 ' + this.height;
             this.paper.path(_d).attr({
                 "stroke" : "none",
-                "fill" : (j ? this.tagconf[j-1].color : this.defaultcolorconf),
+                "fill" : (j ? this.tagconf[j-1].color : this.defaultcolorconf)
             });
         }
     }
@@ -4732,13 +4608,13 @@
         .attr({
             "stroke" : "none",
             "fill" : "#ff00ff",
-            "opacity" : 0,
+            "opacity" : 0
         })
     this.rectangleProgress = this.paper.rect(0,0,0,this.height)
         .attr({
             "stroke" : "none",
             "fill" : "#808080",
-            "opacity" : .3,
+            "opacity" : .3
         });
     this.ligneProgress = this.paper.path("M0 0L0 "+this.height).attr({"stroke":"#ff00ff", "line-width" : 2})
     
@@ -4759,7 +4635,7 @@
         .mouseout(function() {
             _this.TooltipWidget.hide();
             _this.rectangleFocus.attr({
-                "opacity" : 0,
+                "opacity" : 0
             })
         })
 }
@@ -4768,10 +4644,10 @@
     var _currentTime = this._Popcorn.currentTime(),
         _x = (1000 * _currentTime / this.duration) * this.width;
     this.rectangleProgress.attr({
-        "width" : _x,
+        "width" : _x
     });
     this.ligneProgress.attr({
-        "path" : "M" + _x + " 0L" + _x + " " + this.height,
+        "path" : "M" + _x + " 0L" + _x + " " + this.height
     })
 }
 
@@ -4803,7 +4679,7 @@
     this.TooltipWidget.selector.find(".tip").html(_html);
     this.rectangleFocus.attr({
         "x" : _segment * _width,
-        "opacity" : .4,
+        "opacity" : .4
     })
 }
 
@@ -4843,7 +4719,7 @@
         .map(function(_v, _k) {
             return {
                 "word" : _k,
-                "count" : _v,
+                "count" : _v
             }
         })
         .filter(function(_v) {