src/js/ui.js
changeset 38 94899a565089
parent 31 cbb1425bc769
child 72 c4a36ea700d4
equal deleted inserted replaced
37:817bdedf83d7 38:94899a565089
     1 /* ui.js - ui related functions */
     1 /* ui.js - ui related functions */
     2 
     2 
     3 /* FIXME: get rid of the chrome here	
     3 /* FIXME: use an sharing library */
     4  * INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON ()   */
     4 IriSP.LdtShareTool = IriSP.share_template; /* the contents come from share.html */
       
     5 
       
     6 IriSP.createPlayerChrome = function(){
       
     7 	var width = IriSP.config.gui.width;
       
     8 	var height = IriSP.config.gui.height;
       
     9 	var heightS = IriSP.config.gui.height-20;
       
    10 	
       
    11 	// AUDIO  */
       
    12 	// PB dans le html : ; 
       
    13 	IriSP.trace( "__IriSP.createMyHtml",IriSP.config.gui.container );
       
    14 
       
    15 	
       
    16 	/* FIXME : factor this in another file */
       
    17 	if( IriSP.config.gui.mode=="radio" ){
       
    18 
       
    19 		IriSP.jQuery( "#"+IriSP.config.gui.container ).before(IriSP.search_template);
       
    20 		var radioPlayer = Mustache.to_html(IriSP.radio_template, {"share_template" : IriSP.share_template});
       
    21 		IriSP.jQuery(radioPlayer).appendTo("#"+IriSP.config.gui.container);
       
    22 
       
    23 		// special tricks for IE 7
       
    24 		if (IriSP.jQuery.browser.msie==true && IriSP.jQuery.browser.version=="7.0"){
       
    25 			//LdtSearchContainer
       
    26 			//__IriSP.jQuery("#LdtPlayer").attr("margin-top","50px");
       
    27 			IriSP.jQuery("#Ldt-Root").css("padding-top","25px");
       
    28 			IriSP.trace("__IriSP.createHtml","IE7 SPECIAL ");
       
    29 		}
       
    30 	} else if(IriSP.config.gui.mode=="video") {
       
    31 	
       
    32 		var videoPlayer = Mustache.to_html(IriSP.video_template, {"share_template" : IriSP.share_template, "heightS" : heightS});
       
    33 		IriSP.jQuery(videoPlayer).appendTo("#"+IriSP.config.gui.container);
       
    34 	}
       
    35 	
       
    36 	/* FIXME : move it elsewhere */
       
    37 	IriSP.trace("__IriSP.createHtml",IriSP.jQuery.browser.msie+" "+IriSP.jQuery.browser.version);		
       
    38 	IriSP.trace("__IriSP.createHtml","end");
       
    39 	IriSP.jQuery("#Ldt-Annotations").width(width-(75*2));
       
    40 	IriSP.jQuery("#Ldt-Show-Arrow-container").width(width-(75*2));
       
    41 	IriSP.jQuery("#Ldt-ShowAnnotation-audio").width(width-10);
       
    42 	IriSP.jQuery("#Ldt-ShowAnnotation-video").width(width-10);
       
    43 	IriSP.jQuery("#Ldt-SaKeyword").width(width-10);
       
    44 	IriSP.jQuery("#Ldt-controler").width(width-10);
       
    45 	IriSP.jQuery("#Ldt-Control").attr("z-index","100");
       
    46 	IriSP.jQuery("#Ldt-controler").hide();
       
    47 	
       
    48 	IriSP.jQuery(IriSP.annotation_loading_template).appendTo("#Ldt-ShowAnnotation-audio");
       
    49 
       
    50 	if(IriSP.config.gui.mode=='radio'){
       
    51 		IriSP.jQuery("#Ldt-load-container").attr("width",IriSP.config.gui.width);
       
    52 	}
       
    53 	// Show or not the output
       
    54 	if(IriSP.config.gui.debug===true){
       
    55 		IriSP.jQuery("#Ldt-output").show();
       
    56 	} else {
       
    57 		IriSP.jQuery("#Ldt-output").hide();
       
    58 	}
       
    59 	
       
    60 };
       
    61 
       
    62 
       
    63 /* create the buttons and the slider   */
     5 IriSP.createInterface = function( width, height, duration ) {
    64 IriSP.createInterface = function( width, height, duration ) {
     6 		
    65 		
     7 		IriSP.jQuery( "#Ldt-controler" ).show();
    66 		IriSP.jQuery( "#Ldt-controler" ).show();
     8 		//__IriSP.jQuery("#Ldt-Root").css('display','visible');
    67 		//__IriSP.jQuery("#Ldt-Root").css('display','visible');
     9 		IriSP.trace( "__IriSP.createInterface" , width+","+height+","+duration+"," );
    68 		IriSP.trace( "__IriSP.createInterface" , width+","+height+","+duration+"," );