front_idill/src/index.html
author bastiena
Thu, 02 Aug 2012 10:24:09 +0200
changeset 67 d130980a7ef1
parent 62 e960d66dff2b
child 77 205409da0f32
permissions -rw-r--r--
Front IDILL: doc & header comments updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
62
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
     1
<!--
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
     2
/*
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
     3
* This file is part of the TraKERS\Front IDILL package.
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
     4
*
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
     5
* (c) IRI <http://www.iri.centrepompidou.fr/>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
     6
*
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
     7
* For the full copyright and license information, please view the LICENSE
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
     8
* file that was distributed with this source code.
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
     9
*/
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    10
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    11
/*
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    12
 * Projet : TraKERS
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    13
 * Module : Front IDILL
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    14
 * Fichier : index.html
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    15
 * 
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    16
 * Auteur : alexandre.bastien@iri.centrepompidou.fr
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    17
 * 
67
d130980a7ef1 Front IDILL:
bastiena
parents: 62
diff changeset
    18
 * Fonctionnalités : Permet d'accéder au Front IDILL en mode d'interaction souris/Kinect.
62
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    19
 */
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    20
-->
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    21
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    22
<!doctype html>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    23
<html>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    24
    <head>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    25
        <!-- On inclut les styles et les scripts utilisés. -->
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    26
        <title>IDILL</title>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    27
        <meta charset="UTF-8" />
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    28
        <link rel="stylesheet" type="text/css" href="./mosaic/css/reset.css" />
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    29
        <script type="text/javascript" src="../lib/less-1.3.0.min.js"></script>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    30
        <script type="text/javascript" src="../lib/underscore-min.js"></script>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    31
        <script type="text/javascript" src="../lib/jquery.min.js"></script>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    32
    </head>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    33
    
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    34
    <body>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    35
        <!-- Scripts principaux. -->
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    36
        <script type="text/javascript">
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    37
            function loadMenu(textElements)
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    38
			{
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    39
				var form = "<div id='choice'><p id='caution'>" + textElements.caution + "</p><input id='MI' type='button' /><br ><input id='KI' type='button' /></div>";
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    40
				
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    41
				$('body').css({
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    42
				'background-image': 'url("./img/background.png")',
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    43
				'background-repeat': 'repeat'
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    44
				});
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    45
				$('body').append(form);
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    46
				
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    47
				$('#caution').css(
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    48
				{
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    49
					color: '#FFF',
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    50
					'font-size': '20px'
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    51
				});
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    52
				$('#MI').attr('value', textElements.mouse);
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    53
				$('#MI').css('padding', '10px').click(function()
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    54
				{
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    55
					window.location.replace('./index_souris.html');
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    56
				});
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    57
				$('#KI').attr('value', textElements.kinect);
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    58
				$('#KI').css('padding', '10px').click(function()
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    59
				{
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    60
					window.location.replace('./index_kinect.html');
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    61
				});
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    62
				
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    63
				$('#choice').css(
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    64
				{
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    65
					position: 'absolute',
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    66
					width: '60%'
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    67
				});
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    68
				$('#choice').css(
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    69
				{
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    70
					left: ($(window).width() - $('#choice').width()) / 2,
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    71
					'text-align': 'center',
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    72
					top: ($(window).height() - $('#choice').height()) / 2
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    73
				});
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    74
			}
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    75
			
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    76
            //Si la page a chargé, on charge le menu de sélection de mode.
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    77
            $(document).ready(function ()
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    78
            {
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    79
				//Langues gérées.
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    80
				var langs = ["fr", "en"];
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    81
				var lang = navigator.language;
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    82
				
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    83
				//Si la langue n'est pas gérée, on met l'anglais pas défaut.
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    84
				if(langs.indexOf(lang) == -1)
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    85
				{
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    86
					lang = "en";
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    87
				}
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    88
				
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    89
				var path = 'lang/' + lang + '.json';
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    90
				var textElements;
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    91
				$.getJSON(path, function(data)
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    92
				{
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    93
					textElements = data.choice;
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    94
					console.log(textElements);
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    95
					loadMenu(textElements);
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    96
				});
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    97
            });
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    98
        </script>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
    99
    </body>
e960d66dff2b Front IDILL:
bastiena
parents:
diff changeset
   100
</html>