src/js/ui.js
author hamidouk
Fri, 09 Sep 2011 15:13:06 +0200
changeset 31 cbb1425bc769
child 38 94899a565089
permissions -rw-r--r--
begun breaking the code across multiple files.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     1
/* ui.js - ui related functions */
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     2
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     3
/* FIXME: get rid of the chrome here	
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     4
 * INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON ()   */
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     5
IriSP.createInterface = function( width, height, duration ) {
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     6
		
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     7
		IriSP.jQuery( "#Ldt-controler" ).show();
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     8
		//__IriSP.jQuery("#Ldt-Root").css('display','visible');
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     9
		IriSP.trace( "__IriSP.createInterface" , width+","+height+","+duration+"," );
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    10
		
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    11
		IriSP.jQuery( "#Ldt-ShowAnnotation").click( function () { 
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    12
			 //__IriSP.jQuery(this).slideUp(); 
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    13
		} );
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    14
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    15
		var LdtpPlayerY = IriSP.jQuery("#Ldt-PlaceHolder").attr("top");
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    16
		var LdtpPlayerX = IriSP.jQuery("#Ldt-PlaceHolder").attr("left");
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    17
		
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    18
		IriSP.jQuery( "#slider-range-min" ).slider( { //range: "min",
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    19
			value: 0,
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    20
			min: 1,
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    21
			max: duration/1000,//1:54:52.66 = 3600+3240+
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    22
			step: 0.1,
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    23
			slide: function(event, ui) {
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    24
				
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    25
				//__IriSP.jQuery("#amount").val(ui.value+" s");
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    26
				//player.sendEvent('SEEK', ui.value)
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    27
				IriSP.MyApiPlayer.seek(ui.value);
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    28
				//changePageUrlOffset(ui.value);
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    29
				//player.sendEvent('PAUSE')
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    30
			}
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    31
		} );
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    32
		
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    33
		IriSP.trace("__IriSP.createInterface","ICI");
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    34
		IriSP.jQuery("#amount").val(IriSP.jQuery("#slider-range-min").slider("value")+" s");
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    35
		IriSP.jQuery(".Ldt-Control1 button:first").button({
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    36
			icons: {
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    37
				primary: 'ui-icon-play'
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    38
			},
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    39
			text: false
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    40
		}).next().button({
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    41
			icons: {
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    42
				primary: 'ui-icon-seek-next'
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    43
			},
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    44
			 text: false
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    45
		});
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    46
		IriSP.jQuery(".Ldt-Control2 button:first").button({
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    47
			icons: {
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    48
				primary: 'ui-icon-search'//,
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    49
				//secondary: 'ui-icon-volume-off'
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    50
			},
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    51
			text: false
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    52
		}).next().button({
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    53
			icons: {
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    54
				primary: 'ui-icon-volume-on'
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    55
			},
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    56
			 text: false
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    57
		});
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    58
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    59
		// /!\ PB A MODIFIER 
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    60
		//__IriSP.MyTags.draw();
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    61
		IriSP.trace("__IriSP.createInterface","ICI2");
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    62
		IriSP.jQuery( "#ldt-CtrlPlay" ).attr( "style", "background-color:#CD21C24;" );
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    63
		
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    64
		IriSP.jQuery( "#Ldt-load-container" ).hide();
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    65
		
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    66
		if( IriSP.config.gui.mode=="radio" & IriSP.jQuery.browser.msie != true ) {
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    67
			IriSP.jQuery( "#Ldtplayer1" ).attr( "height", "0" );
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    68
		}
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    69
		IriSP.trace( "__IriSP.createInterface" , "3" );
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    70
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    71
		IriSP.trace( "__IriSP.createInterface", "END" );
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    72
		
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    73
	};