# HG changeset patch # User hamidouk # Date 1315841175 -7200 # Node ID 94899a565089133f74fb9cefafec768d27d8c87c # Parent 817bdedf83d75a5a2dda1eadd0f77e11341b95a5 moving ui-specific code from site.js to ui.js diff -r 817bdedf83d7 -r 94899a565089 src/js/site.js --- a/src/js/site.js Mon Sep 12 17:25:40 2011 +0200 +++ b/src/js/site.js Mon Sep 12 17:26:15 2011 +0200 @@ -48,156 +48,3 @@ module:null }; -//Player Variable -/* FIXME: use an sharing library */ -IriSP.LdtShareTool = ""+ -"\n "+ -"\n  "+ -"\n  "+ -"\n  "; - -/* FIXME: move the function out of this file to ui.js*/ -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( - "
\n"+ - " \n"+ - "
\n"+ - "
"); - IriSP.trace("__IriSP.createHtml",IriSP.config.gui.container); - - IriSP.jQuery( "
\n"+ - "
\n"+ - " Get flash to see this player \n"+ - "
\n"+ - "
\n"+ - "
\n"+ - " \n"+ - " \n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - " \n"+ - " \n"+ - "
\n"+ - "
 \;
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - " \n"+ - " "+IriSP.LdtShareTool+"\n"+ - " \n"+ - "
\n"+ - "
"+ - "
"+ - //"
Mots clefs :
"+ - "
"+ - "
").appendTo("#"+IriSP.config.gui.container); - // special tricks 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") { - - IriSP.jQuery( "
\n"+ - " \n"+ - "
\n"+ - "
\n"+ - "
\n"+ - " Get flash to see this player \n"+ - "
\n"+ - - "
\n"+ - "
\n"+ - " \n"+ - " \n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - " \n"+ - " \n"+ - "
\n"+ - "
 \;
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - "
\n"+ - " \n"+ - " "+IriSP.LdtShareTool+"\n"+ - " \n"+ - "
\n"+ - "
"+ - "
"+ - //"
Mots clefs :
"+ - "
"+ - "
").appendTo("#"+IriSP.config.gui.container); - - } - - - IriSP.trace("__IriSP.createHtml",IriSP.jQuery.browser.msie+" "+IriSP.jQuery.browser.version); - IriSP.trace("__IriSP.createHtml","end"); - 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("
 
Chargement...
").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(); - } - -}; - diff -r 817bdedf83d7 -r 94899a565089 src/js/ui.js --- a/src/js/ui.js Mon Sep 12 17:25:40 2011 +0200 +++ b/src/js/ui.js Mon Sep 12 17:26:15 2011 +0200 @@ -1,7 +1,66 @@ /* ui.js - ui related functions */ -/* FIXME: get rid of the chrome here - * INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON () */ +/* 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); + } + + /* FIXME : move it elsewhere */ + IriSP.trace("__IriSP.createHtml",IriSP.jQuery.browser.msie+" "+IriSP.jQuery.browser.version); + IriSP.trace("__IriSP.createHtml","end"); + 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();