web/res/metadataplayer/src/js/LdtPlayer.js
author Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Mon, 25 Jul 2011 18:50:20 +0200
changeset 229 74c9ddc3640b
parent 203 8124cde38141
child 383 f9347f6653b3
permissions -rwxr-xr-x
a lot of changes in the web file organization. add folder, archive...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
     1
/* 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
     2
 * 	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
     3
 *	Copyright 2010 Institut de recherche et d'innovation 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
     4
 *	contributor(s) : Samuel Huron 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
     5
 *	 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
     6
 *	contact@iri.centrepompidou.fr
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
     7
 *	http://www.iri.centrepompidou.fr 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
     8
 *	 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
     9
 *	This software is a computer program whose purpose is to show and add annotations on a video .
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    10
 *	This software is governed by the CeCILL-C license under French law and
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    11
 *	abiding by the rules of distribution of free software. You can  use, 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    12
 *	modify and/ or redistribute the software under the terms of the CeCILL-C
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    13
 *	license as circulated by CEA, CNRS and INRIA at the following URL
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    14
 *	"http://www.cecill.info". 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    15
 *	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    16
 *	The fact that you are presently reading this means that you have had
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    17
 *	knowledge of the CeCILL-C license and that you accept its terms.
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    18
*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    19
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    20
if(window.__IriSP === undefined ){ var __IriSP={};}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    21
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    22
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    23
// Player Configuration 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    24
__IriSP.config = undefined;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    25
__IriSP.configDefault = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    26
		metadata:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    27
			format:'cinelab',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    28
			src:'http://exp.iri.centrepompidou.fr/franceculture/franceculture/ldt/cljson/id/ef4dcc2e-8d3b-11df-8a24-00145ea4a2be',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    29
			load:'jsonp'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    30
		},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    31
		gui:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    32
			width:650,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    33
			height:0,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    34
			mode:'radio',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    35
			container:'LdtPlayer',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    36
			debug:false, 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    37
			css:'../src/css/LdtPlayer.css'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    38
		},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    39
		player:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    40
			type:'jwplayer',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    41
			src:'../res/swf/player.swf',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    42
			params:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    43
				allowfullscreen:"true", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    44
				allowscriptaccess:"always",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    45
				wmode:"transparent"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    46
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    47
			flashvars:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    48
				//Jw player 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    49
				streamer:"streamer",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    50
				file:"file", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    51
				live:"true",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    52
				autostart:"true",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    53
				controlbar:"none",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    54
				playerready:"__IriSP.playerReady",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    55
				// Vimeo
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    56
				js_api: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    57
				js_onLoad:"__IriSP.playerReady",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    58
				js_swf_id:"Ldtplayer1",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    59
				show_title: 0,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    60
				clip_id: "video_id",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    61
				show_portrait: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    62
				show_byline: 0
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    63
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    64
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    65
			attributes:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    66
				id:"Ldtplayer1",  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    67
				name:"Ldtplayer1"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    68
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    69
		},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    70
		module:null
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    71
	};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    72
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    73
__IriSP.lib = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    74
			jQuery:"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    75
			jQueryUI:"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    76
			jQueryToolTip:"http://cdn.jquerytools.org/1.2.4/all/jquery.tools.min.js",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    77
			swfObject:"http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    78
			cssjQueryUI:"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    79
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    80
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    81
// Player Variable
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    82
__IriSP.LdtShareTool = ""+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    83
"\n<a onclick=\"__IriSP.MyApiPlayer.share('delicious');\" title='partager avec delicious'><span class='share shareDelicious'>&nbsp;</span></a>"+		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    84
"\n<a onclick=\"__IriSP.MyApiPlayer.share('facebook');\" title='partager avec facebook'> <span class='share shareFacebook'>&nbsp;</span></a>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    85
"\n<a onclick=\"__IriSP.MyApiPlayer.share('twitter');\" title='partager avec twitter'>  <span class='share shareTwitter'>&nbsp;</span></a>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    86
"\n<a onclick=\"__IriSP.MyApiPlayer.share('myspace');\" title='partager avec Myspace'>  <span class='share shareMySpace'>&nbsp;</span></a>";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    87
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    88
// Official instance - to refactor ?
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    89
__IriSP.MyLdt 		= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    90
__IriSP.MyTags 		= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    91
__IriSP.MyApiPlayer	= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    92
__IriSP.player		= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    93
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    94
// genral var (old code) - to refactor 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    95
__IriSP.Durration		= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    96
__IriSP.playerLdtWidth	= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    97
__IriSP.playerLdtHeight	= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    98
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
    99
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   100
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   101
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   102
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   103
__IriSP.init = function (config){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   104
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   105
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   106
		if(config === null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   107
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   108
			__IriSP.config 			 = __IriSP.configDefault;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   109
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   110
		} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   111
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   112
			__IriSP.config 			 = config;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   113
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   114
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   115
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   116
			if (__IriSP.config.player.params == null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   117
			__IriSP.config.player.params = __IriSP.configDefault.player.params;}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   118
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   119
			if (__IriSP.config.player.flashvars == null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   120
			__IriSP.config.player.flashvars = __IriSP.configDefault.player.flashvars;}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   121
			if (__IriSP.config.player.attributes == null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   122
			__IriSP.config.player.attributes = __IriSP.configDefault.player.attributes;}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   123
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   124
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   125
		var metadataSrc 		 = __IriSP.config.metadata.src;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   126
		var guiContainer		 = __IriSP.config.gui.container;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   127
		var guiMode				 = __IriSP.config.gui.mode;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   128
		var guiLdtShareTool		 = __IriSP.LdtShareTool;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   129
		// Localize jQuery variable
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   130
		__IriSP.jQuery = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   131
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   132
		/******** Load jQuery if not present *********/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   133
		if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.2') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   134
			var script_tag = document.createElement('script');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   135
			script_tag.setAttribute("type","text/javascript");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   136
			script_tag.setAttribute("src",__IriSP.lib.jQuery);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   137
				//"http://cdn.jquerytools.org/1.2.4/full/jquery.tools.min.js");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   138
			script_tag.onload = scriptLibHandler;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   139
			script_tag.onreadystatechange = function () { // Same thing but for IE
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   140
				if (this.readyState == 'complete' || this.readyState == 'loaded') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   141
					scriptLibHandler();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   142
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   143
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   144
			};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   145
			// Try to find the head, otherwise default to the documentElement
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   146
			(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   147
		} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   148
			// The jQuery version on the window is the one we want to use
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   149
			 __IriSP.jQuery = window.jQuery;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   150
			scriptLibHandler();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   151
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   152
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   153
		/******** Called once jQuery has loaded ******/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   154
		function scriptLibHandler() {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   155
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   156
			var script_jqUi_tooltip = document.createElement('script');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   157
			script_jqUi_tooltip.setAttribute("type","text/javascript");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   158
			script_jqUi_tooltip.setAttribute("src",__IriSP.lib.jQueryToolTip);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   159
			script_jqUi_tooltip.onload = scriptLoadHandler;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   160
			script_jqUi_tooltip.onreadystatechange = function () { // Same thing but for IE
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   161
				if (this.readyState == 'complete' || this.readyState == 'loaded') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   162
					scriptLoadHandler("jquery.tools.min.js loded");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   163
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   164
			};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   165
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   166
			var script_swfObj = document.createElement('script');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   167
			script_swfObj.setAttribute("type","text/javascript");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   168
			script_swfObj.setAttribute("src",__IriSP.lib.swfObject);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   169
			script_swfObj.onload = scriptLoadHandler;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   170
			script_swfObj.onreadystatechange = function () { // Same thing but for IE
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   171
				if (this.readyState == 'complete' || this.readyState == 'loaded') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   172
					scriptLoadHandler("swfobject.js loded");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   173
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   174
			};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   175
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   176
			var script_jqUi = document.createElement('script');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   177
			script_jqUi.setAttribute("type","text/javascript");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   178
			script_jqUi.setAttribute("src",__IriSP.lib.jQueryUI);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   179
			script_jqUi.onload = scriptLoadHandler;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   180
			script_jqUi.onreadystatechange = function () { // Same thing but for IE
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   181
				if (this.readyState == 'complete' || this.readyState == 'loaded') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   182
					scriptLoadHandler("jquery-ui.min.js loded");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   183
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   184
			};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   185
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   186
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   187
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   188
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   189
			(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_jqUi_tooltip);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   190
			(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_jqUi);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   191
			(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_swfObj);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   192
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   193
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   194
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   195
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   196
		/******** Called once all lib are loaded ******/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   197
		var loadLib = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   198
		function scriptLoadHandler(Mylib) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   199
			//alert(Mylib);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   200
			loadLib +=1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   201
			if(loadLib===3){ 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   202
				main(); 			  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   203
			}else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   204
				// __IriSP.jQuery('#'+__IriSP.config.gui.container).html("Loading library ...");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   205
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   206
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   207
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   208
		/******** Our main function ********/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   209
		function main() { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   210
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   211
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   212
			//  Make __IriSP.jQuery and restore window.jQuery 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   213
			__IriSP.jQuery = window.jQuery.noConflict(true);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   214
			// Call MY Jquery
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   215
			__IriSP.jQuery(document).ready(function($) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   216
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   217
				/******* Load CSS *******/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   218
				var css_link_jquery = __IriSP.jQuery("<link>", { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   219
					rel: "stylesheet", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   220
					type: "text/css", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   221
					href: __IriSP.lib.cssjQueryUI,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   222
					'class': "dynamic_css"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   223
				});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   224
				var css_link_custom = __IriSP.jQuery("<link>", { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   225
					rel: "stylesheet", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   226
					type: "text/css", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   227
					href: __IriSP.config.gui.css,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   228
					'class': "dynamic_css"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   229
				});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   230
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   231
				css_link_jquery.appendTo('head');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   232
				css_link_custom.appendTo('head');   
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   233
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   234
				// to see dynamicly loaded css on IE
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   235
				if ($.browser.msie) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   236
					$('.dynamic_css').clone().appendTo('head');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   237
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   238
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   239
				//__IriSP.trace("main","ready createMyHtml");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   240
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   241
				__IriSP.createMyHtml();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   242
				//__IriSP.trace("main","end createMyHtml");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   243
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   244
				/******* Load Metadata *******/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   245
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   246
				__IriSP.jQuery.ajax({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   247
					  dataType: __IriSP.config.metadata.load,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   248
					  url:metadataSrc,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   249
					  success : function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   250
					  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   251
							__IriSP.trace("ajax","success");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   252
							
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   253
							// START PARSING ----------------------- 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   254
							if(json === ""){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   255
								alert("ERREUR DE CHARGEMENT JSON");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   256
							} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   257
							  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   258
							  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   259
								// # CREATE MEDIA  							//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   260
								// # JUSTE ONE PLAYER FOR THE MOMENT		//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   261
								//__IriSP.jQuery("<div></div>").appendTo("#output");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   262
								var MyMedia = new  __IriSP.Media(
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   263
																	json.medias[0].id,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   264
																	json.medias[0].href,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   265
																	json.medias[0]['meta']['dc:duration'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   266
																	json.medias[0]['dc:title'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   267
																	json.medias[0]['dc:description']);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   268
								
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   269
								__IriSP.trace("__IriSP.MyApiPlayer",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   270
																	__IriSP.config.gui.width+"   "
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   271
																	+ __IriSP.config.gui.height + " "
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   272
																	+ json.medias[0].href + " "
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   273
																	+ json.medias[0]['meta']['dc:duration'] + " "
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   274
																	+ json.medias[0]['meta']['item']['value']);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   275
								
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   276
								// Create APIplayer
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   277
								__IriSP.MyApiPlayer = new __IriSP.APIplayer(
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   278
																	__IriSP.config.gui.width,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   279
																	__IriSP.config.gui.height,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   280
																	json.medias[0].href,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   281
																	json.medias[0]['meta']['dc:duration'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   282
																	json.medias[0]['meta']['item']['value']);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   283
							
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   284
								// # CREATE THE FIRST LINE  				//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   285
								__IriSP.trace("__IriSP.init.main","__IriSP.Ligne");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   286
								__IriSP.MyLdt = new __IriSP.Ligne (
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   287
																	json['annotation-types'][0].id,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   288
																	json['annotation-types'][0]['dc:title'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   289
																	json['annotation-types'][0]['dc:description'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   290
																	json.medias[0]['meta']['dc:duration']);			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   291
								
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   292
								// CREATE THE TAG CLOUD 					//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   293
								__IriSP.trace("__IriSP.init.main","__IriSP.Tags");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   294
								__IriSP.MyTags =  new __IriSP.Tags (json.tags);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   295
							
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   296
								// CREATE THE ANNOTATIONS  				    //
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   297
								// JUSTE FOR THE FIRST TYPE   			 	//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   298
								__IriSP.jQuery.each(json.annotations, function(i,item) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   299
									if (item.meta['id-ref'] == __IriSP.MyLdt.id) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   300
										//__IriSP.trace("__IriSP.init.main","__IriSP.MyLdt.addAnnotation");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   301
										__IriSP.MyLdt.addAnnotation(item);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   302
									}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   303
										//MyTags.addAnnotation(item);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   304
								});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   305
								__IriSP.jQuery.each(json.lists, function(i,item) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   306
									__IriSP.trace("lists","");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   307
								});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   308
								__IriSP.jQuery.each(json.views, function(i,item) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   309
									__IriSP.trace("views","");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   310
								});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   311
							}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   312
							// END PARSING ----------------------- //  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   313
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   314
										
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   315
					},error : function(data){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   316
						  alert("ERROR : "+data);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   317
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   318
				  });	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   319
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   320
			ChartTimeLine();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   321
			});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   322
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   323
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   324
};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   325
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   326
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   327
__IriSP.createMyHtml = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   328
		var width = __IriSP.config.gui.width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   329
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   330
		// AUDIO  */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   331
		// PB dans le html : ; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   332
		if(__IriSP.config.gui.mode=="radio"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   333
		__IriSP.jQuery(  "<div id='Ldt-Root'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   334
			"	<div id='Ldt-PlaceHolder'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   335
			"		<a href='http://www.adobe.com/go/getflashplayer'>Nécessite Flash player</a> Veuillez patienter durant le chargement du média	\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   336
			"	</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   337
			"	<div id='Ldt-controler' class='demo'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   338
			"		<div class='Ldt-Control1' >\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   339
			"			<button id='ldt-CtrlPlay' onclick='__IriSP.MyApiPlayer.play()'>Lecture / Pause </button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   340
			"			<button id='ldt-CtrlNext' onclick='__IriSP.MyLdt.nextAnnotation()'>Suivant</button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   341
			"		</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   342
			"		<div id='Ldt-Annotations' class='ui-slider'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   343
			"			<div id='slider-range-min'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   344
			"	</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   345
			"		<div class='Ldt-Control2'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   346
			"			<button id='ldt-CtrlLink'> Partager </button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   347
			"			<button id='ldt-CtrlSound' onclick='__IriSP.MyApiPlayer.mute()'>Sound</button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   348
			"		</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   349
			"  <div class='cleaner'>&nbsp\;</div> \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   350
			"  <div id='Ldt-Show-Arrow-container'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   351
			"  	<div id='Ldt-Show-Arrow'> </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   352
			"  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   353
			"</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   354
			"<div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   355
			" <div id='ldt-Show'> </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   356
			"	<div id='Ldt-ShowAnnotation-audio' class='demo' >\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   357
			"		<div id='Ldt-SaTitle'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   358
			"		<div id='Ldt-SaDescription'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   359
			" 		<div class='cleaner'><!--&nbsp\;--></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   360
			" </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   361
			" <div id='Ldt-SaKeyword'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   362
			" <div id='Ldt-SaKeywordText'>  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   363
			" <div class='cleaner'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   364
			" <div id='Ldt-SaShareTools'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   365
			" \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   366
			" "+__IriSP.LdtShareTool+"\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   367
			" \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   368
			"  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   369
			" <div class='cleaner'></div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   370
			"</div>  "+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   371
			//"<div id='Ldt-Tags'> Mots clefs : </div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   372
			"</div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   373
			"<div id='Ldt-output'></div>").appendTo("#"+__IriSP.config.gui.container);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   374
		} else if(__IriSP.config.gui.mode=="video") {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   375
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   376
			__IriSP.jQuery(  "<div id='Ldt-Root'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   377
			"	<div id='Ldt-PlaceHolder'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   378
			"		<a href='http://www.adobe.com/go/getflashplayer'>Get flash</a> to see this player	\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   379
			"	</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   380
			"	<div id='Ldt-controler' class='demo'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   381
			"		<div class='Ldt-Control1' >\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   382
			"			<button id='ldt-CtrlPlay' onclick='__IriSP.MyApiPlayer.play()'>Lecture / Pause </button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   383
			"			<button id='ldt-CtrlNext' onclick='__IriSP.MyLdt.nextAnnotation()'>Suivant</button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   384
			"		</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   385
			"		<div id='Ldt-Annotations' class='ui-slider'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   386
			"			<div id='slider-range-min'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   387
			"	</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   388
			"		<div class='Ldt-Control2'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   389
			"			<button id='ldt-CtrlLink'> Partager </button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   390
			"			<button id='ldt-CtrlSound' onclick='__IriSP.MyApiPlayer.mute()'>Sound</button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   391
			"		</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   392
			"  <div class='cleaner'>&nbsp\;</div> \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   393
			"  <div id='Ldt-Show-Arrow-container'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   394
			"  	<div id='Ldt-Show-Arrow'> </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   395
			"  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   396
			"</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   397
			"<div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   398
			" <div id='ldt-Show'> </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   399
			"	<div id='Ldt-ShowAnnotation-audio' class='demo' >\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   400
			"		<div id='Ldt-SaTitle'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   401
			"		<div id='Ldt-SaDescription'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   402
			" 		<div class='cleaner'><!--&nbsp\;--></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   403
			" </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   404
			" <div id='Ldt-SaKeyword'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   405
			" <div id='Ldt-SaKeywordText'>  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   406
			" <div class='cleaner'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   407
			" <div id='Ldt-SaShareTools'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   408
			" \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   409
			" "+__IriSP.LdtShareTool+"\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   410
			" \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   411
			"  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   412
			" <div class='cleaner'></div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   413
			"</div>  "+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   414
			//"<div id='Ldt-Tags'> Mots clefs : </div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   415
			"</div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   416
			"<div id='Ldt-output'></div>").appendTo("#"+__IriSP.config.gui.container);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   417
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   418
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   419
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   420
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   421
		__IriSP.trace("__IriSP.createHtml","end");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   422
		__IriSP.jQuery("#Ldt-Annotations").width(width-(75*2));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   423
		__IriSP.jQuery("#Ldt-Show-Arrow-container").width(width-(75*2));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   424
		__IriSP.jQuery("#Ldt-ShowAnnotation-audio").width(width-10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   425
		__IriSP.jQuery("#Ldt-ShowAnnotation-video").width(width-10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   426
		__IriSP.jQuery("#Ldt-SaKeyword").width(width-10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   427
		__IriSP.jQuery("#Ldt-controler").width(width-10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   428
		__IriSP.jQuery("#Ldt-Control").attr("z-index","100");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   429
		__IriSP.jQuery("#Ldt-controler").hide();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   430
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   431
		__IriSP.jQuery("<div id='Ldt-load-container'><div id='Ldt-loader'>&nbsp;</div> Chargement... </div>").appendTo("#Ldt-ShowAnnotation-audio");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   432
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   433
		if(__IriSP.config.gui.mode=='radio'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   434
			__IriSP.jQuery("#Ldt-load-container").attr("width",__IriSP.config.gui.width);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   435
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   436
		// Show or not the output
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   437
		if(__IriSP.config.gui.debug===true){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   438
			__IriSP.jQuery("#Ldt-output").show();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   439
		} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   440
			__IriSP.jQuery("#Ldt-output").hide();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   441
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   442
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   443
};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   444
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   445
__IriSP.Media = function (id,url,duration,title,description){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   446
		this.id 		 = id;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   447
		this.url 		 = url;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   448
		this.title 		 = title;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   449
		this.description = description;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   450
		this.duration 	 = duration;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   451
		this.lignes 	  	= new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   452
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   453
		__IriSP.trace("__IriSP.Media","Media ID : "+id);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   454
		__IriSP.trace("__IriSP.Media","Media URL : "+url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   455
		__IriSP.trace("__IriSP.Media","Media title : "+title);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   456
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   457
__IriSP.Media.prototype.createPlayerMedia = function (width,height,MyStreamer,MySwfPath){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   458
		__IriSP.MyApiPlayer = new __IriSP.APIplayer(width,height,this.url,this.duration,MyStreamer,MySwfPath);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   459
		//createPlayer(width,height,this.url,this.duration,MyStreamer,MySwfPath);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   460
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   461
__IriSP.Media.prototype.getMediaDuration = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   462
		return (this.duration);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   463
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   464
__IriSP.Media.prototype.getMediaTitle = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   465
		return (this.title);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   466
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   467
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   468
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   469
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   470
/* 	INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON ()   */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   471
__IriSP.createInterface = function(width,height,duration){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   472
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   473
		__IriSP.jQuery("#Ldt-controler").show();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   474
		__IriSP.trace("__IriSP.createInterface",width+","+height+","+duration+",");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   475
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   476
		__IriSP.jQuery("#Ldt-ShowAnnotation").click(function () { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   477
		});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   478
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   479
		var LdtpPlayerY = __IriSP.jQuery("#Ldt-PlaceHolder").attr("top");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   480
		var LdtpPlayerX = __IriSP.jQuery("#Ldt-PlaceHolder").attr("left");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   481
		__IriSP.jQuery("#slider-range-min").slider({ //range: "min",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   482
			value: 0,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   483
			min: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   484
			max: duration/1000,//1:54:52.66 = 3600+3240+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   485
			step: 0.1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   486
			slide: function(event, ui) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   487
				__IriSP.MyApiPlayer.seek(ui.value);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   488
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   489
		});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   490
		__IriSP.trace("__IriSP.createInterface","ICI");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   491
		__IriSP.jQuery("#amount").val(__IriSP.jQuery("#slider-range-min").slider("value")+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   492
		__IriSP.jQuery(".Ldt-Control1 button:first").button({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   493
			icons: {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   494
				primary: 'ui-icon-play'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   495
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   496
			text: false
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   497
		}).next().button({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   498
			icons: {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   499
				primary: 'ui-icon-seek-next'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   500
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   501
			 text: false
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   502
		});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   503
		__IriSP.jQuery(".Ldt-Control2 button:first").button({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   504
			icons: {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   505
				primary: 'ui-icon-transferthick-e-w'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   506
				//secondary: 'ui-icon-volume-off'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   507
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   508
			text: false
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   509
		}).next().button({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   510
			icons: {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   511
				primary: 'ui-icon-volume-on'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   512
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   513
			 text: false
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   514
		});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   515
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   516
		// /!\ PB A MODIFIER 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   517
		//__IriSP.MyTags.draw();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   518
		__IriSP.trace("__IriSP.createInterface","ICI2");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   519
		__IriSP.jQuery("#ldt-CtrlPlay").attr("style","background-color:#CD21C24;");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   520
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   521
		__IriSP.jQuery("#Ldt-load-container").hide();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   522
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   523
		if(__IriSP.config.gui.mode=="radio" & __IriSP.jQuery.browser.msie!=true){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   524
			__IriSP.jQuery("#Ldtplayer1").attr("height","0");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   525
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   526
		__IriSP.trace("__IriSP.createInterface","3");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   527
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   528
		__IriSP.trace("__IriSP.createInterface","END");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   529
		
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   530
	};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   531
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   532
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   533
/*  API player - work in progress ... need refactoring of code */ 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   534
__IriSP.APIplayer = function (width,height,url,duration,streamerPath,MySwfPath){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   535
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   536
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   537
		this.player 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   538
		this.hashchangeUpdate 	= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   539
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   540
		this.width				= width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   541
		this.height				= height;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   542
		this.url				= url;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   543
		this.duration			= duration;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   544
		this.streamerPath		= streamerPath;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   545
		this.MySwfPath			= MySwfPath;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   546
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   547
		__IriSP.MyApiPlayer		= this;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   548
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   549
		__IriSP.createPlayer(this.url,this.streamerPath);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   550
		__IriSP.trace("__IriSP.APIplayer","__IriSP.createPlayer");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   551
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   552
	//__IriSP.config.player
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   553
	/*
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   554
	- dailymotion  // &enableApi=1&chromeless=1
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   555
	- youtube 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   556
	- html5
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   557
	- flowplayer 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   558
	- jwplayer
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   559
	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   560
		
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   561
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   562
__IriSP.APIplayer.prototype.ready = function(player){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   563
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   564
	__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady"," __IriSP.createInterface");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   565
	__IriSP.createInterface(this.width,this.height,this.duration);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   566
	__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady","END  __IriSP.createInterface");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   567
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   568
	// hashchange EVENT
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   569
	if (window.addEventListener){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   570
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   571
	// pour FIREFOX  hashchange EVENT
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   572
		window.addEventListener("hashchange", function() {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   573
		  var url = window.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   574
		  var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   575
		  __IriSP.trace("__IriSP.APIplayer.prototype.ready",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   576
		  if(__IriSP.MyApiPlayer.hashchangeUpdate==null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   577
			__IriSP.MyApiPlayer.seek(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   578
		  }else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   579
			__IriSP.MyApiPlayer.hashchangeUpdate=null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   580
		  }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   581
		}, false);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   582
	 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   583
	} 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   584
	else if (window.attachEvent){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   585
	// FOR IE hashchange EVENT
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   586
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   587
		window.attachEvent("onhashchange", function() {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   588
		  __IriSP.trace("hashchange",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   589
		  var url = window.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   590
		  var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   591
		  if(__IriSP.MyApiPlayer.hashchangeUpdate==null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   592
			__IriSP.MyApiPlayer.seek(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   593
		  }else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   594
			__IriSP.MyApiPlayer.hashchangeUpdate=null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   595
		  }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   596
		}, false);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   597
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   598
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   599
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   600
__IriSP.APIplayer.prototype.pause = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   601
	this.hashchangeUpdate = true;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   602
	__IriSP.player.sendEvent('PAUSE');
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   603
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   604
__IriSP.APIplayer.prototype.play  = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   605
	this.hashchangeUpdate = true;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   606
	__IriSP.trace("__IriSP.config.player.type",__IriSP.config.player.type);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   607
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   608
	if(__IriSP.config.player.type=='jwplayer'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   609
		__IriSP.trace("jw",status);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   610
		__IriSP.player.sendEvent('PLAY');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   611
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   612
	} else if(__IriSP.config.player.type=='dailymotion' || __IriSP.config.player.type=='youtube'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   613
		__IriSP.trace("youtube",status);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   614
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   615
		__IriSP.trace("__IriSP.APIplayer.prototype.play.status",status);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   616
		if (status!=1){	__IriSP.player.playVideo();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   617
		}else{__IriSP.player.pauseVideo();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   618
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   619
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   620
	} else if(__IriSP.config.player.type=='vimeo') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   621
		__IriSP.trace("vimeo",status);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   622
		var status = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   623
		if (status!=1){__IriSP.player.api_play();
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   624
		}else{__IriSP.player.remote(moogaloop, 'api_pause');
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   625
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   626
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   627
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   628
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   629
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   630
__IriSP.APIplayer.prototype.mute  = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   631
	__IriSP.player.sendEvent('MUTE');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   632
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   633
	//alert(__IriSP.jQuery(".ui-icon-volume-on").css("background-position-x"));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   634
	if (__IriSP.jQuery(".ui-icon-volume-on").css("background-position")=="-144px -160px"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   635
		__IriSP.jQuery(".ui-icon-volume-on").css("background-position","-130px -160px");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   636
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   637
		__IriSP.jQuery(".ui-icon-volume-on").css("background-position","-144px -160px");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   638
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   639
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   640
__IriSP.APIplayer.prototype.share = function(network){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   641
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   642
	var MyMessage = encodeURIComponent("J'écoute Les Retours du Dimanche : ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   643
	var MyURLNow = window.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   644
	var shareURL;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   645
	//alert(network+" : "+MyURLNow);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   646
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   647
	if(network == "facebook"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   648
			shareURL = "http://www.facebook.com/share.php?u=";			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   649
		}else if(network == "twitter"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   650
			shareURL  = "http://twitter.com/home?status="+MyMessage;	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   651
		}else if(network == "myspace"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   652
			shareURL ="http://www.myspace.com/Modules/PostTo/Pages/?u=";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   653
		}else if(network == "delicious"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   654
			shareURL = "http://delicious.com/save?url=";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   655
		}else if(network == "JameSpot"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   656
			shareURL = "http://www.jamespot.com/?action=spotit&u=";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   657
			//alert(network+" non actif pour l'instant : "+MyURLNow);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   658
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   659
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   660
	window.open(shareURL+encodeURIComponent(MyURLNow));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   661
	//window.location.href = shareURL+encodeURIComponent(MyURLNow);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   662
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   663
__IriSP.APIplayer.prototype.seek  = function (time){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   664
	__IriSP.trace("__IriSP.APIplayer.prototype.seek",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   665
	if(__IriSP.config.player.type=='jwplayer'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   666
		__IriSP.player.sendEvent('SEEK', time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   667
	} else if(__IriSP.config.player.type=='dailymotion'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   668
			|| __IriSP.config.player.type=='youtube') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   669
		__IriSP.player.seekTo(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   670
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   671
	this.changePageUrlOffset(time);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   672
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   673
__IriSP.APIplayer.prototype.update = function (time){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   674
	this.hashchangeUpdate = true;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   675
	__IriSP.player.sendEvent('SEEK', time);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   676
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   677
__IriSP.APIplayer.prototype.changePageUrlOffset = function (time) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   678
	//alert(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   679
  __IriSP.trace("__IriSP.APIplayer.prototype.changePageUrlOffset","CHANGE URL "+time);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   680
  window.location.hash = __IriSP.addTimeFragment(window.location.hash,time);
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   681
  window.location.href =  window.location.href;
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   682
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   683
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   684
/* MEDIA FRAGMENT FUNCTION */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   685
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   686
__IriSP.jumpToTimeoffset = function (form) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   687
	var time = form.time.value;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   688
	__IriSP.MyApiPlayer.changePageUrlOffset(time);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   689
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   690
__IriSP.retrieveTimeFragment = function (url) {
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   691
  var pageoffset = "";
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   692
  var offsettime = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   693
  
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   694
  url_components = url.split("#");
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   695
  
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   696
  if (url_components.length > 1){
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   697
	anchors = url_components[1];
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   698
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   699
	anchors_components = [];
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   700
	if(anchors.indexOf(";")>=0) {
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   701
		anchors_components = anchors.split(";");
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   702
	}
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   703
	else if (anchors.indexOf("&")>=0) {
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   704
		anchors_components = anchors.split("&");
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   705
	}
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 203
diff changeset
   706
	else {
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 203
diff changeset
   707
		anchors_components = [anchors];
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 203
diff changeset
   708
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   709
	
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   710
	var len = anchors_components.length;
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   711
	for(var i=0;i<len;i++) {
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   712
		comp = anchors_components[i];
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   713
		if(comp.indexOf("t=") === 0) {
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   714
			pageoffset = comp;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   715
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   716
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   717
	if (pageoffset.substring(2) != null) {
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   718
		offsettime = pageoffset.substring(2);
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   719
	}
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   720
  }
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   721
  return offsettime;
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   722
};
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   723
__IriSP.addTimeFragment = function (hash_part,time) {
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   724
	
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   725
	if (time.length === 0) {
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   726
		return hash_part;
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   727
	}
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   728
	var t_pos = hash_part.indexOf("t=");
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   729
	var res = "";
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   730
	if (t_pos >= 0) {
203
8124cde38141 - add white list on user to filter tweets
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   731
		res = hash_part.replace(/t=[\d.]*/, "t="+time);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   732
	}
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   733
	else {
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   734
		res = hash_part;
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   735
		if(res.length === 0) {
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   736
			res = "#";
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   737
		}
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   738
		if(hash_part.length > 0 && hash_part !=="#" ) {
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   739
			res = res + "&";
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   740
		}
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   741
		res = res + "t="+time;
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   742
	}
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   743
	return res;
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   744
};
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   745
  
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   746
__IriSP.ignoreTimeFragment = function(url){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   747
 if (url.split("#")[1] != null) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   748
	var pageurl= url.split("#")[0];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   749
 }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   750
 return pageurl;
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   751
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   752
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   753
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   754
/* CODE SPECIAL JW PLAYER  creation + listener */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   755
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   756
__IriSP.currentPosition 	= 0; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   757
__IriSP.currentVolume   	= 50; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   758
__IriSP.player 				= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   759
__IriSP.startPosition 		= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   760
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   761
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   762
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   763
__IriSP.createPlayer = function (url,streamerPath) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   764
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   765
	// vimeo
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   766
	__IriSP.config.player.flashvars.clip_id =  __IriSP.config.player.src;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   767
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   768
	if(__IriSP.config.player.type	=='dailymotion'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   769
		__IriSP.config.player.src 	= __IriSP.config.player.src+"&chromeless=1&enableApi=1";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   770
	} else if (__IriSP.config.player.type =='youtube'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   771
		__IriSP.config.player.src 	= __IriSP.config.player.src+"&enablejsapi=1&version=3";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   772
	} else if (__IriSP.config.player.type =='vimeo'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   773
		__IriSP.config.player.src 	= "http://vimeo.com/moogaloop.swf";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   774
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   775
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   776
	__IriSP.trace("__IriSP.createPlayer","start");			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   777
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   778
	__IriSP.myUrlFragment = url.split(streamerPath);	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   779
	__IriSP.config.player.flashvars.streamer =	streamerPath;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   780
	__IriSP.config.player.flashvars.file =	__IriSP.myUrlFragment[1];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   781
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   782
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   783
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   784
	var flashvars 		  = __IriSP.config.player.flashvars;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   785
	var params 			  = __IriSP.config.player.params;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   786
	var attributes 		  = __IriSP.config.player.attributes;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   787
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   788
	__IriSP.trace(
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   789
				  "__IriSP.createPlayer",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   790
				  "SWFOBJECT src:"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   791
				  __IriSP.config.player.src+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   792
				  " " +__IriSP.config.gui.width+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   793
				  " " +__IriSP.config.gui.height+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   794
				  " || src = " +__IriSP.config.player.src
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   795
				  );
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   796
				  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   797
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   798
	swfobject.embedSWF(
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   799
						__IriSP.config.player.src,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   800
						"Ldt-PlaceHolder",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   801
						__IriSP.config.gui.width,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   802
						__IriSP.config.gui.height,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   803
						"9.0.115",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   804
						false,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   805
						flashvars,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   806
						params,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   807
						attributes
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   808
					);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   809
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   810
	// need a methode to 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   811
	// re execute if this swf call does'nt work 
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   812
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   813
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   814
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   815
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   816
/* API DAILYMOTION 	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   817
onDailymotionPlayerReady = function (playerid){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   818
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   819
	//alert(playerid);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   820
	__IriSP.player = document.getElementById(__IriSP.config.player.attributes.id);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   821
	__IriSP.MyApiPlayer.ready(__IriSP.player);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   822
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   823
	var url = document.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   824
	var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   825
	__IriSP.startPosition = time;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   826
	__IriSP.DailymotionAddListeners();	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   827
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   828
	__IriSP.MyApiPlayer.ready(playerid);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   829
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   830
__IriSP.DailymotionAddListeners = function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   831
	if (__IriSP.player) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   832
		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   833
		//__IriSP.player.addEventListener("onStateChange", "__IriSP.DailymotionPositionListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   834
		setTimeout("__IriSP.DailymotionPositionListener()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   835
		__IriSP.DailymotionPositionListener();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   836
		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   837
		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   838
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   839
		__IriSP.setTimeout("__IriSP.DailymotionAddListeners()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   840
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   841
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   842
__IriSP.DailymotionPositionListener = function() { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   843
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   844
	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   845
	//__IriSP.trace("__IriSP.DailymotionPositionListener",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   846
	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   847
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   848
	__IriSP.jQuery("#slider-range-min").slider("value",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   849
	__IriSP.jQuery("#amount").val(__IriSP.currentPosition+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   850
	// afficher annotation 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   851
	/*__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   852
	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   853
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   854
	setTimeout("__IriSP.DailymotionPositionListener()",10);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   855
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   856
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   857
/* API YOUTUBE 	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   858
onYouTubePlayerReady= function (playerid){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   859
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   860
	var url = document.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   861
	var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   862
	__IriSP.player = document.getElementById(__IriSP.config.player.attributes.id);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   863
	__IriSP.startPosition = time;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   864
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   865
	__IriSP.MyApiPlayer.ready(__IriSP.player);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   866
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   867
	__IriSP.MyApiPlayer.seek(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   868
	__IriSP.MyApiPlayer.play();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   869
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   870
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   871
	__IriSP.YouTubeAddListeners();	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   872
	__IriSP.trace("onYouTubePlayerReady=",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   873
	//__IriSP.MyApiPlayer.ready(playerid);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   874
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   875
__IriSP.YouTubeAddListeners = function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   876
	if (__IriSP.player) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   877
		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   878
		__IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   879
		setTimeout("__IriSP.YouTubePositionListener()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   880
		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   881
		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   882
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   883
		__IriSP.setTimeout("__IriSP.YouTubePositionListener()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   884
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   885
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   886
__IriSP.YouTubePositionListener = function() { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   887
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   888
	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   889
	//__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   890
	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   891
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   892
	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   893
	__IriSP.jQuery("#slider-range-min").slider("value",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   894
	__IriSP.jQuery("#amount").val(__IriSP.currentPosition+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   895
	// afficher annotation 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   896
	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   897
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   898
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   899
	setTimeout("__IriSP.YouTubePositionListener()",10);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   900
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   901
__IriSP.YouTubeStateMonitor = function (obj) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   902
	__IriSP.player.addModelListener('__IriSP.YouTubeStateMonitor ', newstate);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   903
	//alert(newstate+" "+obj.newstate);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   904
	 if(newstate == '2')
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   905
    {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   906
		__IriSP.trace("__IriSP.stateMonitor","PAUSE");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   907
		__IriSP.MyApiPlayer.changePageUrlOffset(__IriSP.currentPosition);			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   908
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   909
	}else if (newstate == '1'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   910
		// une fois la video prete a lire  la déplacer au bon timecode 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   911
		if(__IriSP.startPosition!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   912
			__IriSP.MyApiPlayer.update(__IriSP.startPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   913
			__IriSP.startPosition = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   914
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   915
	} 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   916
	else if (newstate == '-1'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   917
		// une fois la video prete a lire  la déplacer au bon timecode 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   918
		if(__IriSP.startPosition!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   919
			__IriSP.MyApiPlayer.update(__IriSP.startPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   920
			__IriSP.startPosition = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   921
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   922
	} else if (newstate == '3'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   923
		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   924
		//changePageUrlOffset(currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   925
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   926
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   927
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   928
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   929
/* API VIMEO 	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   930
onVimeoPlayerReady= function (playerid){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   931
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   932
	var url = document.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   933
	var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   934
	__IriSP.player = document.getElementById(__IriSP.config.player.attributes.id);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   935
	__IriSP.startPosition = time;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   936
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   937
	__IriSP.MyApiPlayer.ready(__IriSP.player);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   938
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   939
	__IriSP.MyApiPlayer.seek(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   940
	__IriSP.MyApiPlayer.play();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   941
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   942
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   943
	__IriSP.YouTubeAddListeners();	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   944
	__IriSP.trace("onYouTubePlayerReady=",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   945
	//__IriSP.MyApiPlayer.ready(playerid);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   946
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   947
__IriSP.VimeoAddListeners = function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   948
	if (__IriSP.player) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   949
		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   950
		__IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   951
		setTimeout("__IriSP.YouTubePositionListener()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   952
		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   953
		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   954
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   955
		__IriSP.setTimeout("__IriSP.YouTubePositionListener()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   956
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   957
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   958
__IriSP.VimeoPositionListener = function() { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   959
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   960
	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   961
	//__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   962
	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   963
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   964
	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   965
	__IriSP.jQuery("#slider-range-min").slider("value",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   966
	__IriSP.jQuery("#amount").val(__IriSP.currentPosition+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   967
	// afficher annotation 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   968
	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   969
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   970
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   971
	setTimeout("__IriSP.YouTubePositionListener()",10);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   972
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   973
__IriSP.VimeoStateMonitor = function (obj) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   974
	__IriSP.player.addModelListener('__IriSP.YouTubeStateMonitor ', newstate);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   975
	//alert(newstate+" "+obj.newstate);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   976
	 if(newstate == '2')
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   977
    {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   978
		__IriSP.trace("__IriSP.stateMonitor","PAUSE");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   979
		__IriSP.MyApiPlayer.changePageUrlOffset(__IriSP.currentPosition);			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   980
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   981
	}else if (newstate == '1'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   982
		// une fois la video prete a lire  la déplacer au bon timecode 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   983
		if(__IriSP.startPosition!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   984
			__IriSP.MyApiPlayer.update(__IriSP.startPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   985
			__IriSP.startPosition = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   986
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   987
	} 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   988
	else if (newstate == '-1'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   989
		// une fois la video prete a lire  la déplacer au bon timecode 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   990
		if(__IriSP.startPosition!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   991
			__IriSP.MyApiPlayer.update(__IriSP.startPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   992
			__IriSP.startPosition = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   993
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   994
	} else if (newstate == '3'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   995
		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   996
		//changePageUrlOffset(currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   997
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
   998
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   999
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1000
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1001
/* API JW PLAYER 	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1002
__IriSP.playerReady  = function (thePlayer) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1003
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1004
	__IriSP.trace("__IriSP.playerReady","PLAYER READY !!!!!!!!!!!!");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1005
	__IriSP.trace("__IriSP.playerReady",thePlayer);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1006
	if (__IriSP.config.player.type == 'vimeo'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1007
		__IriSP.player = window.document[thePlayer];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1008
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1009
		__IriSP.player = window.document[thePlayer.id];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1010
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1011
	// ??? 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1012
	__IriSP.MyApiPlayer.ready(__IriSP.player);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1013
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1014
	var url = document.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1015
	var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1016
	//__IriSP.trace("__IriSP.playerReady"," "+url+" "+time );
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1017
	__IriSP.startPosition = time;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1018
	//__IriSP.trace("__IriSP.playerReady"," LISTENER LAUCHER");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1019
	__IriSP.addListeners();	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1020
	//__IriSP.trace("__IriSP.playerReady"," LISTENER END");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1021
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1022
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1023
__IriSP.addListeners = function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1024
	if (__IriSP.player) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1025
		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1026
		__IriSP.player.addModelListener("TIME", "__IriSP.positionListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1027
		__IriSP.player.addControllerListener("VOLUME", "__IriSP.volumeListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1028
		__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1029
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1030
		__IriSP.setTimeout("__IriSP.addListeners()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1031
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1032
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1033
	// et changer les boutons
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1034
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1035
__IriSP.stateMonitor = function (obj) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1036
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1037
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1038
	 if(obj.newstate == 'PAUSED')
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1039
    {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1040
		__IriSP.trace("__IriSP.stateMonitor","PAUSE");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1041
		__IriSP.MyApiPlayer.changePageUrlOffset(__IriSP.currentPosition);	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1042
		//PaperSlider.attr({x:-100,y:-100});		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1043
		__IriSP.jQuery(".ui-icon-play").css("background-position","0px -160px");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1044
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1045
	} else if (obj.newstate == 'PLAYING'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1046
		// une fois la video prete a lire  la déplacer au bon timecode 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1047
		if(__IriSP.startPosition!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1048
			__IriSP.MyApiPlayer.update(__IriSP.startPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1049
			__IriSP.startPosition = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1050
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1051
		__IriSP.jQuery(".ui-icon-play").css("background-position","-16px -160px");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1052
	} else if (obj.newstate == 'BUFFERING'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1053
		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1054
		//changePageUrlOffset(currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1055
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1056
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1057
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1058
__IriSP.positionListener = function(obj) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1059
	//__IriSP.trace("__IriSP.positionListener",obj.position);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1060
	__IriSP.currentPosition = obj.position; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1061
	//var tmp = document.getElementById("posit");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1062
	//if (tmp) { tmp.innerHTML = "position: " + __IriSP.currentPosition; }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1063
	__IriSP.jQuery("#slider-range-min").slider("value", obj.position);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1064
	PaperSliderPostion = obj.position/(__IriSP.LDTligne.duration/1000)*__IriSP.config.gui.width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1065
	PaperSlider.attr({x:PaperSliderPostion,y:yMax});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1066
	//PaperSlider.toFront();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1067
	//__IriSP.jQuery("#amount").val(obj.position+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1068
	// afficher annotation 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1069
	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1070
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1071
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1072
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1073
__IriSP.volumeListener   = function (obj) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1074
	__IriSP.currentVolume = obj.percentage; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1075
	var tmp = document.getElementById("vol");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1076
	if (tmp) { tmp.innerHTML = "volume: " + __IriSP.currentVolume; }
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1077
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1078
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1079
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1080
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1081
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1082
/* 	UTIL */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1083
// code from http://stackoverflow.com/questions/822452/strip-html-from-text-javascript
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1084
__IriSP.stripHtml = function(s){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1085
	return s.replace(/\\&/g, '&amp;').replace(/\\</g, '&lt;').replace(/\\>/g, '&gt;').replace(/\\t/g, '&nbsp;&nbsp;&nbsp;').replace(/\\n/g, '<br />').replace(/'/g, '&#39;').replace(/"/g, '&quot;');
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1086
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1087
// conversion de couleur Decimal vers HexaDecimal || 000 si fff 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1088
__IriSP.DEC_HEXA_COLOR = function (dec){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1089
	 var hexa='0123456789ABCDEF',hex='';
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1090
	 var tmp;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1091
	 while (dec>15){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1092
		  tmp = dec-(Math.floor(dec/16))*16;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1093
		  hex = hexa.charAt(tmp)+hex;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1094
		  dec = Math.floor(dec/16);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1095
	 }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1096
	 hex = hexa.charAt(dec)+hex;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1097
	 //if (hex == "FFCC00"){ hex="";/* by default color of Ldt annotation */ }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1098
	 return(hex);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1099
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1100
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1101
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1102
/*
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1103
private function colorNbrToHexaStr(c:int):String{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1104
                  var s:String = c.toString(16);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1105
                  var nbZero:uint = 6 - s.length;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1106
                  for(var i:uint=0;i<nbZero;i++){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1107
                        s = "0" + s;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1108
                  }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1109
                  return s;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1110
            }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1111
private function colorHexaStrToNbr(s:String):Number{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1112
                  var n:Number;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1113
                  if(s.substr(0,1)=="#") n = Number("0x" + s.substr(1));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1114
                  else n = Number(s);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1115
                  return n;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1116
            }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1117
*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1118
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1119
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1120
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1121
/* CLASS Ligne (annotationType) 	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1122
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1123
__IriSP.LDTligne 	= null;		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1124
__IriSP.Ligne = function (id,title,description,duration){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1125
	this.id 		 = id;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1126
	this.title 		 = title;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1127
	this.description = description;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1128
	//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1129
	this.annotations = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1130
	this.duration = duration;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1131
	this.annotationOldRead="";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1132
	__IriSP.LDTligne = this;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1133
	__IriSP.trace("__IriSP.Ligne","CREATE "+__IriSP.LDTligne);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1134
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1135
__IriSP.Ligne.prototype.addAnnotation = function (json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1136
	var myAnnotation = new __IriSP.Annotation(json,this.duration);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1137
	this.annotations.push(myAnnotation);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1138
	//__IriSP.trace("__IriSP.Ligne.prototype.addAnnotation  ","add annotation "+title);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1139
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1140
__IriSP.Ligne.prototype.onClickLigneAnnotation = function(id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1141
	//changePageUrlOffset(currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1142
	//player.sendEvent('SEEK', this.start);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1143
	//__IriSP.trace("SEEK",this.start);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1144
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1145
__IriSP.Ligne.prototype.searchLigneAnnotation  = function(id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1146
	/*for (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1147
	}*/
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1148
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1149
__IriSP.Ligne.prototype.listAnnotations 	   = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1150
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1151
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1152
__IriSP.Ligne.prototype.nextAnnotation 		   = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1153
	var annotationCibleNumber = this.numAnnotation(this.annotationOldRead)+1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1154
	var annotationCible = this.annotations[annotationCibleNumber];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1155
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1156
	if(annotationCibleNumber<this.annotations.length-1){
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1157
		annotationCible.begin;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1158
		__IriSP.player .sendEvent('SEEK', annotationCible.begin/1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1159
		__IriSP.trace("LIGNE  ","| next = "+annotationCibleNumber+" - "+this.annotations.length+" | seek :"+annotationCible.begin/1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1160
	}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1161
		__IriSP.player .sendEvent('SEEK', this.annotations[0].begin/1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1162
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1163
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1164
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1165
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1166
__IriSP.Ligne.prototype.numAnnotation 		   = function (annotationCible){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1167
	for (var i=0; i < this.annotations.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1168
		if(annotationCible == this.annotations[i]){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1169
			return i;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1170
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1171
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1172
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1173
__IriSP.Ligne.prototype.checkTime			   = function(time){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1174
	var annotationTempo = -1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1175
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1176
	for (var i=0; i < this.annotations.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1177
		annotationTempo = this.annotations[i];	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1178
		if (time>annotationTempo.begin/1000 && time<annotationTempo.end/1000){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1179
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1180
				// different form the previous
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1181
				if(annotationTempo!=this.annotationOldRead){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1182
					this.annotationOldRead = annotationTempo;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1183
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1184
					__IriSP.jQuery("#Ldt-SaTitle").text(annotationTempo.title);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1185
					__IriSP.jQuery("#Ldt-SaDescription").text(annotationTempo.description);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1186
					__IriSP.jQuery("#Ldt-SaKeywordText").html("Mots clefs : "+annotationTempo.htmlTags);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1187
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1188
					var startPourcent 	= annotationTempo.timeToPourcent((annotationTempo.begin*1+(annotationTempo.end*1-annotationTempo.begin*1)/2),annotationTempo.duration*1); 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1189
					__IriSP.jQuery("#Ldt-Show-Arrow").animate({left:startPourcent+'%'},1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1190
					__IriSP.jQuery("#"+annotationTempo.id).animate({alpha:'100%'},1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1191
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1192
					var tempolinkurl  =  __IriSP.ignoreTimeFragment(window.location.href)+"#t="+(this.annotations[i].begin/1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1193
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1194
			break;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1195
		}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1196
		annotationTempo=-1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1197
		}		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1198
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1199
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1200
	// si il y en a pas : retractation du volet 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1201
	if( annotationTempo == -1){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1202
		if(annotationTempo!=this.annotationOldRead){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1203
			__IriSP.trace("Check : ","pas d'annotation ici ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1204
			__IriSP.jQuery("#Ldt-SaTitle").text("");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1205
			__IriSP.jQuery("#Ldt-SaDescription").text("");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1206
			__IriSP.jQuery("#Ldt-SaKeywordText").html("");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1207
			__IriSP.jQuery('#Ldt-ShowAnnotation').slideUp();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1208
			if(this.annotationOldRead){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1209
				__IriSP.jQuery("#"+this.annotationOldRead.id).animate({alpha:'70%'},1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1210
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1211
			//__IriSP.jQuery("#Ldt-Show-Arrow").animate({left:'0%'},1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1212
			this.annotationOldRead = annotationTempo;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1213
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1214
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1215
	__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",annotationTempo);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1216
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1217
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1218
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1219
/* CLASS Annotation */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1220
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1221
__IriSP.Annotation = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1222
	var id 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1223
	var begin 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1224
	var end 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1225
	var media 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1226
	var description	= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1227
	var title 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1228
	var color 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1229
	var tags			= null;
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1230
	__IriSP.trace("annotation ","réussi");
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1231
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1232
__IriSP.Annotation = function(json,duration){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1233
	this.id 			= json.id;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1234
	this.begin 			= json.begin;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1235
	this.end 			= json.end;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1236
	this.media 			= json.media;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1237
	this.description 	= json.content.description;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1238
	this.title 			= json.content.title;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1239
	this.color 			= json.content.color;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1240
	this.tags			= json.tags;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1241
	this.htmlTags		= "";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1242
	this.duration		= duration;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1243
	// draw it 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1244
	this.draw();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1245
	this.drawTags();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1246
	//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1247
	__IriSP.trace("Annotation created : ",this.id);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1248
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1249
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1250
__IriSP.Annotation.prototype.draw 				  = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1251
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1252
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1253
	//alert (this.duration);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1254
	var startPourcent 	= this.timeToPourcent(this.begin,this.duration); // temps du media 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1255
	var endPourcent 	= this.timeToPourcent(this.end,this.duration)-startPourcent;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1256
	var titleForDiv		= this.title.substr(0,55);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1257
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1258
	__IriSP.jQueryAnnotationTemplate = "<div title='"+__IriSP.stripHtml(titleForDiv)+"' id='"+this.id+"'  class='ui-slider-range ui-slider-range-min ui-widget-header iri-chapter' width='100%' style=\"left:"+startPourcent+"%; width:"+endPourcent+"%; padding-top:15px; border-left:solid 1px #aaaaaa; border-right:solid 1px #aaaaaa; background:#"+__IriSP.DEC_HEXA_COLOR(this.color)+";\" onClick=\"__IriSP.MyApiPlayer.seek('"+Math.round(this.begin/1000)+"');__IriSP.jQuery('#Ldt-ShowAnnotation').slideDown();\"    ></div> ";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1259
	//alert(this.color+" : "+DEC_HEXA_COLOR(this.color));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1260
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1261
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1262
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1263
	__IriSP.jQuery("<div'>"+__IriSP.jQueryAnnotationTemplate+"</div>").appendTo("#Ldt-Annotations");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1264
	// TOOLTIP BUG ! 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1265
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1266
	__IriSP.jQuery("#"+this.id).tooltip({ effect: 'slide'});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1267
	//var thisNode = __IriSP.jQuery();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1268
	//addTip("#"+this.id, __IriSP.stripHtml(titleForDiv),"#000");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1269
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1270
	__IriSP.jQuery("#"+this.id).fadeTo(0,0.3);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1271
	__IriSP.jQuery("#"+this.id).mouseover(function() {
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1272
		__IriSP.jQuery("#"+this.id).animate({opacity: 0.6}, 5);
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1273
	}).mouseout(function(){		
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1274
		__IriSP.jQuery("#"+this.id).animate({opacity: 0.3}, 5);
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1275
	});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1276
	__IriSP.trace("__IriSP.Annotation.prototype.draw","ADD ANOTATION : "+this.begin+" "+this.end+" "+__IriSP.stripHtml(this.title)+" | "+startPourcent+" | "+endPourcent+" | duration = "+this.duration);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1277
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1278
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1279
__IriSP.Annotation.prototype.drawTags 			  = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1280
	var KeywordPattern = '<a href=\"\"> '+' </a>';
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1281
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1282
	//__IriSP.trace(" !? Tags : ",this.tags);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1283
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1284
	if (this.tags!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1285
		for (var i = 0; i < this.tags.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1286
			this.htmlTags += '<span> '+__IriSP.MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , ";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1287
		}		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1288
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1289
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1290
__IriSP.Annotation.prototype.tootTipAnnotation    = function() {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1291
	// 1 chercher le div correspondant
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1292
	// 2 y mettre les information
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1293
	return this.color + ' ' + this.type + ' apple';
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1294
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1295
__IriSP.Annotation.prototype.onRollOverAnnotation = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1296
	//this.tootTip();
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1297
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1298
__IriSP.Annotation.prototype.timeToPourcent 	  = function(time,timetotal){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1299
	return (parseInt(Math.round(time/timetotal*100)));
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1300
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1301
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1302
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1303
/* CLASS Tags */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1304
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1305
__IriSP.Tags = function(object){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1306
	this.myTags 	=	object;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1307
	this.htmlTags 	= 	null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1308
	this.weigthMax 	= 	0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1309
	//this.mySegments  = 	new array();
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1310
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1311
__IriSP.Tags.prototype.addAnnotation = function (annotation){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1312
	for (var i = 0; i < this.myTags.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1313
		this.myTags[i].mySegments = new Array(); 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1314
		if (annotation.tags!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1315
			for (var j = 0; j < annotation.tags.length; ++j){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1316
				if (this.myTags[i]['id'] == annotation.tags[j]['id-ref']){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1317
					this.myTags[i].mySegments.push([annotation.begin,annotation.end,annotation.id]);
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1318
					var weigthTempo = this.myTags[i].mySegments.length;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1319
					var tempo = this.myTags[i].mySegments[weigthTempo-1];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1320
					//__IriSP.trace ("__IriSP.Tags.prototype.addAnnotation ","  "+this.myTags[i]['meta']['dc:title']+" "+this.myTags[i]['id']+" : "+tempo[0]+" - "+tempo[1]);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1321
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1322
					if (this.weigthMax < weigthTempo ){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1323
						this.weigthMax = weigthTempo;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1324
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1325
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1326
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1327
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1328
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1329
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1330
__IriSP.Tags.prototype.getTitle = function (id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1331
	for (var i = 0; i < this.myTags.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1332
		if(this.myTags[i]['id']==id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1333
			return(this.myTags[i]['meta']['dc:title']);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1334
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1335
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1336
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1337
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1338
__IriSP.Tags.prototype.draw = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1339
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1340
	__IriSP.trace("__IriSP.Tags.prototype.draw"," !!! WELL START " );
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1341
	for (var i = 0; i < this.myTags.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1342
		__IriSP.trace("__IriSP.Tags.prototype.draw"," ADD Tags : "+this.myTags[i]['id']);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1343
		if(this.myTags[i]['id']!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1344
		this.htmlTags += '<span onclick=\"MyTags.show( \''+this.myTags[i]['id']
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1345
						+'\');\" style=\"font-size:'  +((this.myTags[i].mySegments.length/this.weigthMax*10)+8)
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1346
						+'px;\" alt=\"'+this.myTags[i].mySegments.length
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1347
						+'\"> '+this.myTags[i]['meta']['dc:title']+' </span>'+' , ';
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1348
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1349
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1350
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1351
	__IriSP.jQuery('#Ldt-Tags').html(this.htmlTags);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1352
	__IriSP.trace("__IriSP.Tags.prototype.draw"," !!!!  END WMAX= "+this.weigthMax );
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1353
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1354
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1355
__IriSP.Tags.prototype.show = function (id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1356
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1357
	var timeStartOffsetA	=	100000000000000000000;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1358
	var timeStartOffsetB	=	100000000000000000000;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1359
	var timeEndOffsetA		=	0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1360
	var timeEndOffsetB		=	0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1361
	var timeStartID;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1362
	var timeEndID;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1363
	var WidthPourCent;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1364
	var leftPourCent;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1365
	var timeStartOffset;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1366
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1367
	// case 1 : seul segment 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1368
	// case 2 : 2 ou X segments 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1369
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1370
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1371
	for (var i = 0; i < this.myTags.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1372
		if (this.myTags[i]['id']==id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1373
			__IriSP.trace("######### TAG DRAWing : "," END" );		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1374
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1375
			for (var j = 0; j < this.myTags[i].mySegments.length; ++j){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1376
				if(timeStartOffset> this.myTags[i].mySegments[j][0]){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1377
					timeStartOffsetA = this.myTags[i].mySegments[j][0];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1378
					timeStartOffsetB = this.myTags[i].mySegments[j][1];
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1379
					timeStartID		 = this.myTags[i].mySegments[j][2];
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1380
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1381
				if(timeStartOffset> this.myTags[i].mySegments[j][0]){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1382
					timeEndOffsetA  = this.myTags[i].mySegments[j][0];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1383
					timeEndOffsetB  = this.myTags[i].mySegments[j][1];
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1384
					timeEndID		= this.myTags[i].mySegments[j][2];
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1385
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1386
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1387
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1388
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1389
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1390
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1391
	// -------------------------------------------------
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1392
	// 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1393
	// -------------------------------------------------
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1394
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1395
	leftPourCent 	= __IriSP.timeToPourcent((timeStartOffsetA*1+(timeStartOffsetB-timeStartOffsetA)/2),__IriSP.MyLdt.duration); 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1396
	WidthPourCent	= __IriSP.timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),__IriSP.MyLdt.duration)-leftPourCent; 			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1397
	//WidthPourCent	= timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),MyLdt.duration)-startPourcent; 			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1398
	__IriSP.jQuery("#Ldt-Show-Tags").css('left',leftPourCent+'%');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1399
	__IriSP.jQuery("#Ldt-Show-Tags").css('width',WidthPourCent+'%');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1400
	// like arrow script
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1401
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1402
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1403
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1404
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1405
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1406
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1407
/* CLASS TRACE */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1408
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1409
__IriSP.traceNum=0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1410
__IriSP.trace = function(msg,value){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1411
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1412
	if(__IriSP.config.gui.debug===true){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1413
		__IriSP.traceNum += 1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1414
		__IriSP.jQuery("<div>"+__IriSP.traceNum+" - "+msg+" : "+value+"</div>").appendTo("#Ldt-output");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1415
	}
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
  1416
};
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 119
diff changeset
  1417