front_idill/src/mosaic/js/notifications.js
author bastiena
Mon, 24 Sep 2012 15:20:10 +0200
changeset 124 d2b4682dc9cc
parent 117 5b7757a12bd7
permissions -rw-r--r--
Étiquette V00.17 ajoutée à la révision 57a65edde708
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     1
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     2
* This file is part of the TraKERS\Front IDILL package.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     3
*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     4
* (c) IRI <http://www.iri.centrepompidou.fr/>
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     5
*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     6
* For the full copyright and license information, please view the LICENSE
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     7
* file that was distributed with this source code.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     8
*/
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     9
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    10
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    11
 * Projet : TraKERS
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    12
 * Module : Front IDILL
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    13
 * Fichier : notifications.js
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    14
 * 
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    15
 * Auteur : alexandre.bastien@iri.centrepompidou.fr
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    16
 * 
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    17
 * Fonctionnalités : Définit les fonctions de notification (images apparaissant en haut de la fenêtre).
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    18
 */
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    19
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    20
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    21
 * Affiche l'aide.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    22
 * Est appelé dans les fichiers :
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    23
 * mosaic > fonctions manageControlEvents et onMouseDown.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    24
 * curvesDetector > fonction updateDists.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    25
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    26
Mosaic.prototype.notifyHelp = function(inMosaic)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    27
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    28
    //Si elle est déjà affichée on quitte.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    29
    if(this.helpDisplayed)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    30
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    31
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    32
    }
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    33
	
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
    34
	//Tous les noms d'images des gestes de recherche.
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
    35
	var all_gestures_img = ['arret', 'chute', 'contact', 'group_spin', 'bend', 'knee_up', 'port_de_bras', 'grandjete', 'jump', 'spin', 'up_down', 'wave'];
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
    36
	
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
    37
	//Emplacement des images pour l'aide.
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
    38
	var imgPath = './pictos/help/';
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
    39
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    40
    //On enlève les autres notifications.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    41
    this.removeNotifications();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    42
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    43
    //On indique qu'elle est affiché.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    44
    this.helpDisplayed = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    45
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    46
    //Section des courbes de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    47
    var search_2hands_tab;
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    48
    var search_2hands_tab_text;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    49
    //Section des recherches corporelles.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    50
    var search_body_tab;
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    51
    var search_body_tab_text;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    52
    //Section des actions de contrôle sur l'interface.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    53
    var controls_1hand_tab;
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    54
    var controls_1hand_tab_text;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    55
    //Opacités (indique si elles sont actuellement implémentées).
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    56
    var search_2hands_tab_opacities;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    57
    var search_body_tab_opacities;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    58
    var controls_1hand_tab_opacities;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    59
    var controls_1hand_tab_opacities;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    60
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    61
    //Dossier contenant les images.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    62
    var img_directory = './pictos/help/';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    63
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    64
    //Si on est en mode d'intéraction souris, la recherche corporelle se fait par des courbes. On les regroupes donc dans la section des courbes.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    65
    if(this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    66
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    67
        search_2hands_tab = ['arret', 'contact', 'grandjete', 'group_spin', 'port_de_bras', 'spin', 'up_down', 'wave', 'chute', 'knee_up', 'jump', 'bend'];
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    68
        search_2hands_tab_text = ['no-motion', 'contact', 'grand-jete', 'screw', 'arc', 'circle', 'up-down', 'wave', 'fall', 'knee-up', 'jump', 'bend'];
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    69
        search_2hands_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    70
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    71
    else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    72
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    73
        search_2hands_tab = ['arret', 'contact', 'grandjete', 'group_spin', 'port_de_bras', 'spin', 'up_down', 'wave'];
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    74
        search_2hands_tab_text = ['no-motion', 'contact', 'grand-jete', 'screw', 'arc', 'circle', 'up-down', 'wave'];
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    75
        search_body_tab = ['chute', 'knee_up', 'jump', 'bend'];
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    76
        search_body_tab_text = ['fall', 'knee-up', 'jump', 'bend'];
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
    77
        search_2hands_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1];
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    78
        search_body_tab_opacities = [1, 1, 1, 1];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    79
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    80
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    81
    //Dans la mosaique, on ne peut que sélectionner un snapshot.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    82
    if(inMosaic)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    83
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    84
        controls_1hand_tab = ['selection'];
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    85
        controls_1hand_tab_text = ['controls_selection'];
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    86
        controls_1hand_tab_opacities = [1];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    87
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    88
    //Dans une vidéo, on peut aller d'un voisin à l'autre, bouger dans la timeline, dézoomer et swiper d'un marqueur à l'autre.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    89
    else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    90
    {
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    91
		if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    92
		{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    93
			controls_1hand_tab = ['deplacer', 'move_down', 'move_up', 'move_right', 'move_left'];
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    94
			controls_1hand_tab_text = ['controls_timeline', 'controls_move_down', 'controls_move_up', 'controls_move_right', 'controls_move_left'];
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    95
			controls_1hand_tab_opacities = [1, 1, 1, 1, 1];
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    96
		}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    97
		else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    98
		{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    99
			controls_1hand_tab = ['deplacer', 'precedent', 'suivant', 'mosaique_horizontal', 'mosaique_vertical', 'move_down', 'move_up', 'move_right', 'move_left'];
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   100
			controls_1hand_tab_text = ['controls_timeline', 'controls_previous', 'controls_next', 'controls_mos_horizontal', 'controls_mos_vertical', 'controls_move_down', 'controls_move_up', 'controls_move_right', 'controls_move_left'];
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   101
			controls_1hand_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1, 1];
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   102
		}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   103
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   104
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   105
    //Colonne de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   106
    //Titre de la colonne de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   107
    var search_title = "<div id='search_title'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   108
    //Image de la colonne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   109
    var search_img = "<div id='search_img' class='notify_imgs'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   110
    //Sous-titre.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   111
    var search_2hands_text = "<div id='search_2hands_text'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   112
    //Images de recherche par courbes.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   113
    var search_2hands_imgs = "<div id='search_2hands_imgs' class='notify_imgs_big'>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   114
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   115
    //On crée les images.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   116
    for(var i = 0 ; i < search_2hands_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   117
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   118
        search_2hands_imgs += "<div id='2hands_" + search_2hands_tab[i] + "' class='notify_imgs_small' style='opacity: " + search_2hands_tab_opacities[i] + ";'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   119
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   120
    search_2hands_imgs += "</div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   121
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   122
    //Sous-titre de la zone de recherche corporelle.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   123
    var search_body_text;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   124
    //Images de recherche corporelle.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   125
    var search_body_imgs;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   126
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   127
    //Si on est en mode Kinect.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   128
    if(!this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   129
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   130
        //On crée le texte et les images de la recherche corporelle.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   131
        search_body_text = "<div id='search_body_text'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   132
        search_body_imgs = "<div id='search_body_imgs' class='notify_imgs'>"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   133
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   134
        for(var i = 0 ; i < search_body_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   135
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   136
            search_body_imgs += "<div id='body_" + search_body_tab[i] + "' class='notify_imgs_small' style='opacity: " + search_body_tab_opacities[i] + ";'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   137
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   138
        search_body_imgs += "</div>";
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   139
		
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   140
		//On ajoute ce qu'il faut pour quitter l'aide.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   141
		
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   142
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   143
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   144
    //Titre de la colonne des actions de contrôle.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   145
    var controls_title = "<div id='controls_title'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   146
    //Image de la colonne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   147
    var controls_img = "<div id='controls_img' class='notify_imgs'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   148
    //Sous-titre de la zone de contrôle de l'interface.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   149
    var controls_1hand_text = "<div id='controls_1hand_text'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   150
    //Images des actions de contrôle de l'interface.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   151
    var controls_1hand_imgs;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   152
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   153
    controls_1hand_imgs = "<div id='controls_1hand_imgs' class='notify_imgs'>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   154
    for(var i = 0 ; i < controls_1hand_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   155
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   156
        controls_1hand_imgs += "<div id='1hand_" + controls_1hand_tab[i] + "' class='notify_imgs_small' style='opacity: " + controls_1hand_tab_opacities[i] + ";'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   157
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   158
    controls_1hand_imgs += "</div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   159
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   160
    //Colonne de recherche du panneau d'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   161
    var help_search;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   162
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   163
    //Dans le mode d'intéraction souris, les gestures de recherche corporelles ont été intégrées aux courbes.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   164
    if(this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   165
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   166
        help_search = "<div id='help_search'>" + search_title + search_img + search_2hands_text + search_2hands_imgs + "</div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   167
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   168
    else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   169
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   170
        help_search = "<div id='help_search'>" + search_title + search_img + search_2hands_text + search_2hands_imgs + search_body_text + search_body_imgs + "</div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   171
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   172
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   173
    //Colonne de contrôle du panneau d'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   174
    var help_controls;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   175
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   176
    help_controls = "<div id='help_controls'>" + controls_title + controls_img + controls_1hand_text + controls_1hand_imgs + "</div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   177
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   178
    //Panneau d'aide.
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   179
	//On crée les flèches au niveau du panneau d'aide.
106
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   180
    var notification_help = "<div id='notify_help'><div id='help_details_upArrow' class='help_details_arrows'></div>" + help_search + "<div id='help_sep'></div>" + help_controls + "<div id='help_details_downArrow' class='help_details_arrows'></div></div>";
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   181
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   182
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   183
    $('body').append(notification_help);
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   184
	
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   185
	var notify_help = $('#notify_help');
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   186
    
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   187
	var notify_imgs_width = $('#notify_imgs_small').css('margin-leftf')
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   188
	
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   189
	$('.notify_imgs').css(
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   190
	{
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   191
		width: $('#notify_imgs_small')
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   192
	});
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   193
	
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   194
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   195
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   196
		//On rétrécit certaines images si on est sur une tablette.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   197
		$('#search_img, #controls_img').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   198
		{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   199
			height: 150,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   200
			'background-size': '150px 150px'
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   201
		});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   202
		
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   203
		$('.notify_imgs_small').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   204
		{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   205
			height: 80,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   206
			width: 80,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   207
			'background-size': '80px 80px'
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   208
		});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   209
		
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   210
		//On ajoute l'icone de sortie.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   211
		this.exitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   212
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   213
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   214
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   215
    var notify_width = $(window).width(), notify_height = $(window).height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   216
    var notify_margin = parseInt($('#notify_help').css('margin-left'));
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   217
    var notify_border = parseInt($('#notify_help').css('border-width'));
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   218
    //var notify_ = 10;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   219
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   220
    //On les positionne.
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   221
    notify_help.css(
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   222
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   223
        left: "0px",
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   224
        top: "0px",
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   225
        width: notify_width - notify_margin * 2,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   226
        height: notify_height - notify_margin * 2,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   227
        'z-index': 1000
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   228
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   229
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   230
    //Position horizontale du séparateur de colonnes.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   231
    var sep_left = $('#help_sep').position().left;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   232
    //Marge du panneau d'aide.
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   233
    var help_margin = parseInt(notify_help.css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   234
    //On calcule la taille d'une zone de recherche (une des deux parties).
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   235
    var help_column_width = sep_left - help_margin;
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   236
	
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   237
    //Taille des marges des images.
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   238
    var margins = parseInt($('.notify_imgs_small').css('margin-left'));
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   239
    //Largeur des images.
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   240
    var widths = help_column_width / 5 - 4 * margins * 2;// $('.notify_imgs_small').width();
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   241
    //Hauteur des images.
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   242
    var heights = widths;//$('.notify_imgs_small').height();
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   243
    
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   244
	$('.notify_imgs_small').css(
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   245
	{
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   246
		width: widths,
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   247
		height: heights,
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   248
		'background-size': widths + 'px ' + heights + 'px',
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   249
		'font-size': widths / 5 + 'px',
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   250
		'padding-left': '0px'
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   251
	});
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   252
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   253
    //Longueur d'une image.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   254
    var img_width = (margins * 2 + widths);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   255
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   256
    //On récupère le nombre d'images affichables horizontalement pour les gestures de recherche à deux mains dans une des parties de l'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   257
    var search_2hands_n_imgs = Math.floor(help_column_width / img_width);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   258
    //Calcul du padding-left de cette section.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   259
    var search_2hands_padding_left = (help_column_width - search_2hands_n_imgs * img_width) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   260
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   261
    //On positionne la section de recherche par courbes.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   262
    $('#search_2hands_imgs').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   263
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   264
        'padding-left': search_2hands_padding_left,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   265
        'height': ($('.notify_imgs_small').height() * 2 + parseInt($('.notify_imgs_small').css('margin-left')))
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   266
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   267
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   268
    //On récupère le nombre d'images affichables horizontalement pour les gestures de recherche corporelles dans une des parties de l'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   269
    var search_body_n_imgs = Math.floor(help_column_width / img_width);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   270
    //Calcul du padding-left de cette section.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   271
    var search_body_padding_left = (help_column_width - search_body_n_imgs * img_width) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   272
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   273
    //On positionne la section de recherche par gestures corporelles.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   274
    $('#search_body_imgs').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   275
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   276
        'padding-left': search_body_padding_left,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   277
        'height': ($('.notify_imgs_small').height() * 2 + parseInt($('.notify_imgs_small').css('margin-left')))
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   278
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   279
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   280
    //On récupère le nombre d'images affichables horizontalement pour les gestures de controle dans une des parties de l'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   281
    var controls_1hand_n_imgs = Math.floor(help_column_width / img_width);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   282
    //Calcul du padding-left de cette section.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   283
    var controls_1hand_padding_left = (help_column_width - controls_1hand_n_imgs * img_width) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   284
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   285
    //On potisionne la section des actions de contrôle de l'interface.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   286
    $('#controls_1hand_imgs').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   287
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   288
        'padding-left': controls_1hand_padding_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   289
        'height': ($('.notify_imgs_small').height())
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   290
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   291
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   292
    //Longueur de la colonne de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   293
    var search_width = $('#help_search').width();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   294
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   295
    $('#search_title').html(this.helpText.search_title);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   296
    var MI = '';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   297
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   298
    //Le texte de recherche et les images changent en fonction du mode d'intéraction (souris/Kinect).
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   299
    if(this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   300
    {
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   301
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   302
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   303
			$('#search_2hands_text').html(this.helpText.search_touch_text);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   304
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   305
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   306
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   307
			$('#search_2hands_text').html(this.helpText.search_mouse_text);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   308
		}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   309
        MI = 'MI/';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   310
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   311
    else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   312
    {
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   313
        $('#search_2hands_text').html(this.helpText.search_2hands_text);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   314
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   315
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   316
    //On affecte les images pour la recherche par courbes.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   317
    for(var i = 0 ; i < search_2hands_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   318
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   319
        $("#2hands_" + search_2hands_tab[i]).css("background-image", "url('" + img_directory + MI + search_2hands_tab[i] + ".png')");
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   320
		$("#2hands_" + search_2hands_tab[i]).html(this.notificationStrings[search_2hands_tab_text[i]]);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   321
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   322
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   323
    //Si on est en mode Kinect, on affecte les images de recherche corporelle.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   324
    if(!this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   325
    {
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   326
        $('#search_body_text').html(this.helpText.search_body_text);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   327
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   328
        for(var i = 0 ; i < search_body_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   329
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   330
            $("#body_" + search_body_tab[i]).css("background-image", "url('" + img_directory + search_body_tab[i] + ".png')");
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   331
			$("#body_" + search_body_tab[i]).html(this.notificationStrings[search_body_tab_text[i]]);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   332
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   333
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   334
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   335
    //Actions de contrôle de l'interface.
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   336
    $('#controls_title').html(this.helpText.controls_title);
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   337
	
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   338
	if(this.config.mouseInteractions)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   339
	{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   340
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   341
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   342
			$('#controls_1hand_text').html(this.helpText.controls_touch_text);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   343
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   344
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   345
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   346
			$('#controls_1hand_text').html(this.helpText.controls_mouse_text);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   347
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   348
	}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   349
	else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   350
	{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   351
		$('#controls_1hand_text').html(this.helpText.controls_1hand_text);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   352
	}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   353
    
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   354
	//On affecte les images des actions de contrôle de l'interface.
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   355
	for(var i = 0 ; i < controls_1hand_tab.length ; i++)
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   356
	{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   357
		$("#1hand_" + controls_1hand_tab[i]).css("background-image", "url('" + img_directory + controls_1hand_tab[i] + ".png')");
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   358
		$("#1hand_" + controls_1hand_tab[i]).html(this.helpText[controls_1hand_tab_text[i]]);
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   359
	}
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   360
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   361
    //On les fait apparaître.
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   362
    notify_help.css(
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   363
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   364
        opacity: "1"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   365
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   366
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   367
    $('.notify_imgs_big').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   368
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   369
        opacity: "1"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   370
    });
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   371
	
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   372
	//Si on est en mode d'interaction souris, on rajoute les détails.
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   373
	if(this.config.mouseInteractions)
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   374
	{
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   375
		//Dimensions des flèches.
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   376
		var arrowWidth = 50, arrowHeight = 50;
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   377
		
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   378
		//Nombre d'éléments présents dans les 2 divs de stockage des détails de l'aide.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   379
		var helpDetailsLeftContainerLength = Math.ceil(this.helpDetailsGestures.length / 2), helpDetailsRightContainerLength = Math.floor(this.helpDetailsGestures.length / 2);
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   380
		
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   381
		//On ajoute les gestes des détails de l'aide.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   382
		//On remplit les divs gauche et droite des détails par les éléments.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   383
		var help_details_gestures = "<div id='help_details_left_container' class='help_details_containers'>";
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   384
		
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   385
		var i = 0;
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   386
		for(i ; i < helpDetailsLeftContainerLength ; i++)
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   387
		{
106
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   388
			//On récupère l'usage pour kinect/souris.
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   389
			var usage;
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   390
			if(this.config.mouseInteractions)
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   391
			{
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   392
				usage = this.helpDetailsGestures[i].usage_MI;
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   393
			}
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   394
			else
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   395
			{
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   396
				usage = this.helpDetailsGestures[i].usage_KI;
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   397
			}
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   398
			
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   399
			help_details_gestures += "<div><table border='0'><tr><td rowspan='4'><img class='helpDetailsImgs' src='" + imgPath + MI + all_gestures_img[i] + ".png' /></td><td><b>" +
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   400
			this.helpDetailsGesturesMetadata.name + '</b> : ' + this.helpDetailsGestures[i].name + "</td></tr><tr><td><b>" +
106
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   401
			this.helpDetailsGesturesMetadata.usage + '</b> : ' + usage + "</td></tr><tr><td><b>" +
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   402
			this.helpDetailsGesturesMetadata.desc + '</b> : ' + this.helpDetailsGestures[i].desc + "</td></tr></table></div>";
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   403
		}
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   404
		help_details_gestures += "</div><div id='help_details_right_container' class='help_details_containers'>";
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   405
		for(i ; i < this.helpDetailsGestures.length ; i++)
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   406
		{
106
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   407
			//On récupère l'usage pour kinect/souris.
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   408
			var usage;
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   409
			if(this.config.mouseInteractions)
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   410
			{
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   411
				usage = this.helpDetailsGestures[i].usage_MI;
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   412
			}
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   413
			else
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   414
			{
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   415
				usage = this.helpDetailsGestures[i].usage_KI;
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   416
			}
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   417
			
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   418
			help_details_gestures += "<div><table border='0'><tr><td rowspan='4'><img class='helpDetailsImgs' src='" + imgPath + MI + all_gestures_img[i] + ".png' /></td><td><b>" +
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   419
			this.helpDetailsGesturesMetadata.name + '</b> : ' + this.helpDetailsGestures[i].name + "</td></tr><tr><td><b>" +
109
ace8f4b644f1 Front IDILL:
bastiena
parents: 106
diff changeset
   420
			this.helpDetailsGesturesMetadata.usage + '</b> : ' + usage + "</td></tr><tr><td><b>" +
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   421
			this.helpDetailsGesturesMetadata.desc + '</b> : ' + this.helpDetailsGestures[i].desc + "</td></tr></table></div>";
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   422
		}
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   423
		
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   424
		help_details_gestures += "</div>";
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   425
		
106
62bfe94d7738 Front IDILL:
bastiena
parents: 101
diff changeset
   426
		notify_help.append(help_details_gestures);
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   427
		
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   428
		//Hauteur totale de la plus longue colonne.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   429
		var helpDetailsMaxContainerHeight = $('#help_details_left_container').height();
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   430
		
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   431
		//On positionne les flèches même si elles sont invisibles pour l'instant.
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   432
		$('#help_details_upArrow').css(
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   433
		{
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   434
			top: 0,
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   435
			left: notify_help.width() / 2 - arrowWidth / 2
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   436
		});
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   437
		$('#help_details_downArrow').css(
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   438
		{
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   439
			top: notify_help.height() - arrowHeight,
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   440
			left: notify_help.width() / 2 - arrowWidth / 2
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   441
		});
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   442
		
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   443
		$('.helpDetailsImg').css(
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   444
		{
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   445
			
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   446
		});
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   447
		
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   448
		var helpDetailsColumnWidth = (notify_help.width() - 2 * notify_margin) / 2 - 100;
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   449
		
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   450
		//On spécifie les colonnes.
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   451
		$('.help_details_containers').css(
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   452
		{
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   453
			position: 'absolute',
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   454
			width: notify_help.width() / 2 - notify_margin * 2 - notify_border * 2
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   455
	    });
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   456
		$('#help_details_left_container').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   457
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   458
			top: 0,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   459
			left: 0
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   460
		});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   461
		$('#help_details_right_container').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   462
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   463
			top: 0,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   464
			left: notify_help.width() / 2
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   465
		});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   466
		
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   467
		//Hauteur du panneau d'aide moins la hauteur des flèches.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   468
		var notify_help_height_without_arrows = notify_help.height() - notify_margin * 2 - notify_border * 2 - $('.help_details_arrows').height() * 2;
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   469
		//On rajoute la page de départ de l'aide aux pages des détails de l'aide.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   470
		this.helpDetailsPageLength = Math.ceil(helpDetailsMaxContainerHeight / notify_help_height_without_arrows) + 1;
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   471
		
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   472
		//On ajoute les flèches à l'interface.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   473
		$('#help_details_upArrow').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   474
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   475
			top: 0,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   476
			left: notify_help.width() / 2 - arrowWidth / 2
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   477
		});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   478
		$('#help_details_downArrow').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   479
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   480
			top: notify_help.height() - arrowHeight,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   481
			left: notify_help.width() / 2 - arrowWidth / 2
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   482
		});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   483
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   484
		//Si on est sur la première page de l'aide.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   485
		if(this.helpDetailsPageNumber == 0)
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   486
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   487
			//On ne laisse pas la place du haut pour la flèche haut puisqu'on est sur la première page.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   488
			$('.help_details_containers').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   489
			{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   490
				//top: 0,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   491
				top: $('#notify_help').height(),
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   492
				// height: notify_help.height() - arrowHeight
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   493
			});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   494
			//$('#notify_help').css('padding-bottom', arrowHeight);
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   495
			$('#help_details_downArrow').css('opacity', '1');
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   496
			
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   497
			//$('.help_details_containers').css('opacity', '0');
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   498
		}
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   499
		//Sinon si on est sur la dernière page de l'aide.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   500
		else if(this.helpDetailsPageNumber + 1 == this.helpDetailsPageLength)
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   501
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   502
			$('#help_details_downArrow').css('opacity', '0');
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   503
		}
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   504
		//Sinon on laisse la place pour revenir en arrière ou en avant.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   505
		else
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   506
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   507
			$('.help_details_containers').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   508
			{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   509
				top: arrowHeight,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   510
				// height: notify_help.height() - arrowHeight * 2,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   511
			});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   512
		}
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   513
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   514
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   515
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   516
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   517
 * Supprime l'aide.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   518
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   519
 * pointers > fonction detectIdlePointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   520
 * mosaic > fonction manageControlEvents et onClick.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   521
 * curvesDetector > fonction updateDists.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   522
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   523
Mosaic.prototype.removeHelp = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   524
{
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   525
	// console.trace();
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   526
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   527
    //Si l'aide n'est pas affichée, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   528
    if(!this.helpDisplayed)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   529
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   530
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   531
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   532
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   533
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   534
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   535
    //On fait disparaître l'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   536
    $('#notify_help').fadeOut(this.timeNotifyFade, function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   537
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   538
        //On indique que l'aide n'est plus affichée, et on détruit le panneau.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   539
        _this.helpDisplayed = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   540
        _this.canNotifyHelp = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   541
        $('#notify_help').remove();
101
af33e06d06b9 Front IDILL:
bastiena
parents: 100
diff changeset
   542
		//On réinitialise la page.
af33e06d06b9 Front IDILL:
bastiena
parents: 100
diff changeset
   543
		_this.helpDetailsPageNumber = 0;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   544
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   545
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   546
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   547
/*
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   548
 * Affichage de la notification de sélection & recherche dans la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   549
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   550
 * zoomInteractions > fonctions preUnzoom et unzoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   551
 * mosaic > fonction showNImages.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   552
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   553
Mosaic.prototype.mosaicSelectionAndSearch = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   554
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   555
    //Si on n'est pas en mode mosaic, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   556
    if(this.currentMode != 'MOSAIC')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   557
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   558
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   559
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   560
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   561
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   562
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   563
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   564
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   565
	//On calcule leurs dimensions.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   566
	var notify_width, notify_height, notify_margin;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   567
	var selection_left, search_left;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   568
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   569
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   570
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   571
		//On ajoute à la mosaïque seulement la recherche.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   572
		$('body').append(notification_search);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   573
		notify_margin = parseInt($('.notifications').css('margin-left'));
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   574
		notify_width = $('.notifications').width();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   575
		notify_height = $('.notifications').height();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   576
		//On calcule leurs coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   577
		search_left = ($(window).width() / 2 - notify_width / 2 - notify_margin);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   578
		var img = $('#notify_search').css('background-image');
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   579
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   580
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   581
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/TI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   582
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   583
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   584
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   585
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/MI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   586
		}
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   587
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   588
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   589
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   590
		//On les ajoute à la mosaïque.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   591
		$('body').append(notification_selection + notification_search);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   592
		notify_margin = parseInt($('.notifications').css('margin-left'));
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   593
		notify_width = $('.notifications').width();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   594
		notify_height = $('.notifications').height();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   595
		//On calcule leurs coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   596
		selection_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   597
		search_left = selection_left + notify_width + notify_margin;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   598
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   599
		this.putText($('#notify_selection'), this.notificationStrings.select);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   600
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   601
		$('#notify_selection').css(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   602
		{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   603
			left: selection_left
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   604
		});
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   605
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   606
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   607
	this.putText($('#notify_search'), this.notificationStrings.search);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   608
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   609
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   610
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   611
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   612
        left: search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   613
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   614
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   615
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   616
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   617
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   618
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   619
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   620
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   621
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   622
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   623
 * Affichage de la notification de sélection dans la mosaïque.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   624
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   625
 * zoomInteractions > fonction preZoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   626
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   627
Mosaic.prototype.mosaicSelection = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   628
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   629
    //Si on n'est pas en mode mosaic, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   630
    if(this.currentMode != 'MOSAIC')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   631
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   632
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   633
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   634
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   635
    //On spécifie la notification en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   636
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   637
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   638
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   639
    $('body').append(notification_selection);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   640
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   641
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   642
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   643
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   644
    var selection_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   645
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   646
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   647
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   648
		var img = $('#notify_selection').css('background-image');
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   649
		$('#notify_selection').css('background-image', img.replace('notifications/', 'notifications/MI/'));
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   650
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   651
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   652
	this.putText($('#notify_selection'), this.notificationStrings.confirm);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   653
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   654
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   655
    $('#notify_selection').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   656
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   657
        left: selection_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   658
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   659
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   660
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   661
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   662
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   663
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   664
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   665
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   666
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   667
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   668
 * Affichage de la notification de recherche dans une demande de filtrage de la mosaïque.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   669
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   670
 * pointers > fonction launchIdlePointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   671
 * zoomInteractions > fonction preUnzoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   672
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   673
Mosaic.prototype.filterSearch = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   674
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   675
    //Si on n'est pas en mode filtrage ou qu'aucune recherche n'est affectée au filtrage, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   676
    if(this.currentMode != 'FILTER' || this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   677
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   678
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   679
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   680
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   681
    //On spécifie la notification en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   682
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   683
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   684
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   685
    $('body').append(notification_search);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   686
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   687
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   688
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   689
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   690
    var search_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   691
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   692
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   693
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   694
		var img = $('#notify_search').css('background-image');
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   695
		
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   696
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   697
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   698
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/TI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   699
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   700
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   701
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   702
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/MI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   703
		}
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   704
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   705
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   706
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   707
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   708
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   709
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   710
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   711
        left: search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   712
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   713
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   714
    //On la fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   715
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   716
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   717
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   718
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   719
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   720
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   721
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   722
 * Affichage de la notification de recherche & sélection dans une demande de filtrage de la mosaïque.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   723
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   724
 * zoomInteractions > fonction preZoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   725
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   726
Mosaic.prototype.filterSearchAndSelection = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   727
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   728
    //Si on n'est pas en mode filtrage ou qu'aucune recherche n'est affectée au filtrage, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   729
    if(this.currentMode != 'FILTER' || this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   730
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   731
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   732
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   733
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   734
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   735
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   736
    var notification_search = "<div id='notify_search' class='notifications'></div>";
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   737
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   738
	//On les ajoute à la mosaïque.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   739
	$('body').append(notification_selection + notification_search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   740
	
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   741
	var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(), notify_margin = parseInt($('.notifications').css('margin-left'));
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   742
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   743
	//On calcule leurs coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   744
	var selection_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   745
	var search_left = selection_left + notify_width + notify_margin;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   746
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   747
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   748
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   749
		var imgSel = $('#notify_selection').css('background-image');
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   750
		$('#notify_selection').css('background-image', imgSel.replace('notifications/', 'notifications/MI/'));
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   751
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   752
		var imgSearch = $('#notify_search').css('background-image');
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   753
		
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   754
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   755
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   756
			$('#notify_search').css('background-image', imgSearch.replace('notifications/', 'notifications/TI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   757
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   758
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   759
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   760
			$('#notify_search').css('background-image', imgSearch.replace('notifications/', 'notifications/MI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   761
		}
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   762
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   763
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   764
	this.putText($('#notify_selection'), this.notificationStrings.confirm);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   765
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   766
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   767
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   768
    $('#notify_selection').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   769
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   770
        left: selection_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   771
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   772
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   773
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   774
        left: search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   775
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   776
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   777
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   778
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   779
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   780
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   781
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   782
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   783
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   784
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   785
 * Affichage de la notification de résultat de gesture dans la mosaïque filtrée.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   786
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   787
 * zoomInteractions > fonction preUnzoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   788
 * mosaic > onMouseUp et manageControlEvents.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   789
 * curvesDetector > updateDists.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   790
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   791
Mosaic.prototype.filterGesture = function(gestureName, mode)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   792
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   793
    //Si on n'est pas en mode filtrage ou qu'aucune recherche n'est affectée au filtrage, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   794
    if(this.currentMode != 'FILTER' || !this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   795
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   796
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   797
    }
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   798
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   799
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   800
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   801
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   802
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   803
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   804
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   805
    $('body').append(notification_search_1gesture);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   806
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   807
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   808
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   809
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   810
    var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   811
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   812
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   813
    {
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   814
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + (this.gestureDelRequested ? 'hover' : 'valid') + '/' + gestureName + '.png")');
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   815
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   816
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   817
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   818
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   819
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   820
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   821
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   822
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   823
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   824
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   825
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   826
        top: 0,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   827
        left: ($(window).width() - notify_width) / 2
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   828
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   829
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   830
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   831
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   832
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   833
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   834
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   835
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   836
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   837
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   838
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   839
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   840
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   841
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   842
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   843
 * Affichage de la notification de résultat de gesture & de sélection dans la mosaïque filtrée.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   844
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   845
 * zoomInteractions > fonction preZoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   846
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   847
Mosaic.prototype.filterGestureAndSelection = function(gestureName, mode)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   848
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   849
    //Si on n'est pas en mode filtrage ou qu'aucune recherche n'est affectée au filtrage, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   850
    if(this.currentMode != 'FILTER' || !this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   851
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   852
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   853
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   854
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   855
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   856
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   857
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   858
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   859
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   860
    $('body').append(notification_search_1gesture + notification_selection);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   861
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   862
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   863
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   864
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   865
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   866
    var selection_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   867
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   868
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   869
    {
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   870
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   871
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   872
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   873
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   874
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   875
    }
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   876
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   877
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   878
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   879
		var img = $('#notify_selection').css('background-image');
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   880
		$('#notify_selection').css('background-image', img.replace('notifications/', 'notifications/MI/'));
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   881
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   882
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   883
	this.putText($('#notify_selection'), this.notificationStrings.confirm);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   884
    this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   885
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   886
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   887
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   888
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   889
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   890
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   891
    $('#notify_selection').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   892
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   893
        left: selection_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   894
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   895
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   896
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   897
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   898
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   899
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   900
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   901
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   902
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   903
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   904
 * Affiche la notification de dezoom.
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   905
 * Direction vaut left ou right.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   906
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   907
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   908
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   909
Mosaic.prototype.videoSwipe = function(direction)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   910
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   911
    //Si on n'est pas en mode video ou qu'on n'est pas en train d'effectuer un swipe, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   912
    if(this.currentMode != 'VIDEO' || !this.isSwipe)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   913
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   914
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   915
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   916
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   917
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   918
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   919
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   920
    var notification_swipe = "<div id='notify_swipe' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   921
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   922
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   923
    $('body').append(notification_swipe);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   924
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   925
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   926
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   927
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   928
    var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   929
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   930
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   931
    
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   932
	if(direction == "left")
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   933
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   934
		this.putText($('#notify_swipe'), this.notificationStrings.next);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   935
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   936
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   937
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   938
		this.putText($('#notify_swipe'), this.notificationStrings.previous);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   939
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   940
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   941
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   942
    $('#notify_swipe').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   943
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   944
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   945
        left: -notifyLeft + ($(window).width() - notify_width - notify_margin) / 2,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   946
        'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   947
    });
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   948
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   949
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   950
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   951
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   952
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   953
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   954
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   955
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   956
/*
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   957
 * Affichage de la notification de résultat de move vers un voisin.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   958
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   959
 * neighbours > fonction selectNeighbour.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   960
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   961
Mosaic.prototype.videoMove = function(targetId)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   962
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   963
    //Si on n'est pas en mode video, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   964
    if(this.currentMode != 'VIDEO')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   965
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   966
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   967
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   968
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   969
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   970
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   971
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   972
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   973
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   974
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   975
    $('body').append(notification_move);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   976
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   977
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   978
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   979
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   980
    var move_left = $(window).width() / 2 - (notify_width) / 2 + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   981
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   982
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   983
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   984
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   985
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   986
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   987
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   988
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   989
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   990
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   991
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   992
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   993
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   994
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   995
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   996
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   997
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   998
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   999
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1000
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1001
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1002
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1003
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1004
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1005
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1006
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1007
    });
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1008
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1009
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1010
/*
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1011
 * Affichage de la notification de résultat de move vers un voisin & de dézoom dans une vidéo.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1012
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1013
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1014
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1015
Mosaic.prototype.videoMoveAndUnzoom = function(targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1016
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1017
    //Si on n'est pas en mode video, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1018
    if(this.currentMode != 'VIDEO')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1019
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1020
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1021
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1022
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1023
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1024
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1025
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1026
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1027
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1028
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1029
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1030
    $('body').append(notification_move + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1031
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1032
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1033
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1034
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1035
    var move_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1036
    var unzoom_left = move_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1037
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1038
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1039
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1040
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1041
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1042
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1043
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1044
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1045
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1046
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1047
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1048
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1049
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1050
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1051
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1052
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1053
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1054
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1055
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1056
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1057
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1058
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1059
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1060
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1061
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1062
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1063
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1064
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1065
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1066
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1067
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1068
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1069
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1070
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1071
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1072
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1073
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1074
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1075
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1076
 * Affichage de la notification de résultat de dézoom dans une vidéo.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1077
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1078
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1079
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1080
Mosaic.prototype.videoUnzoom = function(targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1081
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1082
    //Si on n'est pas en mode video, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1083
    if(this.currentMode != 'VIDEO')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1084
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1085
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1086
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1087
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1088
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1089
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1090
    //On spécifie la notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1091
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1092
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1093
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1094
    $('body').append(notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1095
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1096
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1097
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1098
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1099
    var unzoom_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1100
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1101
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1102
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1103
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1104
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1105
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1106
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1107
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1108
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1109
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1110
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1111
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1112
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1113
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1114
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1115
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1116
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1117
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1118
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1119
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1120
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1121
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1122
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1123
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1124
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1125
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1126
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1127
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1128
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1129
 * Affichage de la notification de timeline dans une vidéo/recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1130
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1131
 * pointers > fonction pointersTimelineSelection.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1132
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1133
Mosaic.prototype.timelineTimeline = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1134
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1135
    //Si on n'est pas en mode timeline, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1136
    if(this.currentMode != 'TIMELINE')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1137
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1138
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1139
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1140
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1141
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1142
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1143
    //On spécifie la notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1144
    var notification_timeline = "<div id='notify_timeline' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1145
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1146
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1147
    $('body').append(notification_timeline);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1148
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1149
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1150
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1151
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1152
    var timeline_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1153
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1154
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1155
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1156
	this.putText($('#notify_timeline'), this.notificationStrings.timeline);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1157
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1158
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1159
    $('#notify_timeline').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1160
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1161
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1162
        left: -notifyLeft + timeline_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1163
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1164
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1165
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1166
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1167
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1168
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1169
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1170
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1171
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1172
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1173
 * Affichage de la notification de recherche dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1174
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1175
 * neighbours > fonction deselectNeighbour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1176
 * pointers > fonction launchIdlePointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1177
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1178
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1179
Mosaic.prototype.searchSearch = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1180
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1181
    //Si on n'est pas en mode recherche dans une video ou qu'aucune recherche n'est effectuée, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1182
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1183
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1184
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1185
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1186
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1187
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1188
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1189
    //On spécifie la notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1190
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1191
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1192
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1193
    $('body').append(notification_search);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1194
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1195
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1196
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1197
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1198
    var search_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1199
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1200
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1201
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1202
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1203
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1204
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1205
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1206
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1207
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1208
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1209
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1210
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1211
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1212
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1213
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1214
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1215
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1216
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1217
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1218
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1219
 * Affichage de la notification de recherche & de swipe dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1220
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1221
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1222
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1223
Mosaic.prototype.searchSearchAndSwipe = function(direction)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1224
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1225
    //Si on n'est pas en mode recherche dans une video ou qu'aucune recherche n'est effectuée ou qu'on n'est pas en train de faire un swipe, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1226
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture || !this.isSwipe)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1227
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1228
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1229
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1230
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1231
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1232
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1233
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1234
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1235
    var notification_swipe = "<div id='notify_swipe' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1236
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1237
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1238
    $('body').append(notification_search + notification_swipe);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1239
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1240
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1241
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1242
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1243
    var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1244
    var swipe_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1245
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1246
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1247
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1248
	this.putText($('#notify_search'), this.notificationStrings.search);
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1249
	if(direction == "left")
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1250
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1251
		this.putText($('#notify_swipe'), this.notificationStrings.next);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1252
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1253
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1254
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1255
		this.putText($('#notify_swipe'), this.notificationStrings.previous);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1256
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1257
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1258
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1259
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1260
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1261
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1262
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1263
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1264
    $('#notify_swipe').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1265
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1266
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1267
        left: -notifyLeft + swipe_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1268
        'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1269
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1270
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1271
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1272
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1273
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1274
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1275
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1276
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1277
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1278
/*
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1279
 * Affichage de la notification de recherche, de move vers un voisin.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1280
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1281
 * neighbours > fonction selectNeighbour.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1282
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1283
Mosaic.prototype.searchSearchAndMove = function(targetId)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1284
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1285
    //Si on n'est pas en mode recherche dans une video ou qu'aucune recherche n'est effectuée, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1286
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1287
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1288
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1289
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1290
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1291
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1292
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1293
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1294
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1295
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1296
    $('body').append(notification_search + notification_move);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1297
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1298
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1299
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1300
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1301
    var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1302
    var move_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1303
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1304
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1305
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1306
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1307
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1308
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1309
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1310
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1311
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1312
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1313
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1314
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1315
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1316
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1317
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1318
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1319
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1320
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1321
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1322
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1323
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1324
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1325
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1326
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1327
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1328
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1329
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1330
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1331
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1332
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1333
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1334
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1335
    });
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1336
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1337
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1338
/*
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1339
 * Affichage de la notification de recherche, de move vers un voisin & de dézoom dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1340
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1341
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1342
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1343
Mosaic.prototype.searchSearchAndMoveAndUnzoom = function(targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1344
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1345
    //Si on n'est pas en mode recherche dans une video ou qu'aucune recherche n'est effectuée, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1346
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1347
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1348
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1349
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1350
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1351
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1352
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1353
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1354
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1355
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1356
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1357
    $('body').append(notification_search + notification_move + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1358
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1359
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1360
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1361
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1362
    var search_left = $(window).width() / 2 - (notify_width * 3 + notify_margin * 4) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1363
    var move_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1364
    var unzoom_left = move_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1365
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1366
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1367
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1368
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1369
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1370
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1371
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1372
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1373
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1374
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1375
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1376
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1377
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1378
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1379
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1380
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1381
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1382
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1383
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1384
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1385
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1386
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1387
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1388
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1389
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1390
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1391
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1392
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1393
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1394
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1395
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1396
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1397
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1398
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1399
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1400
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1401
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1402
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1403
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1404
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1405
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1406
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1407
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1408
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1409
 * Affichage de la notification de recherche & de dézoom dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1410
 * Est appelé dans le fichier :
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1411
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1412
Mosaic.prototype.searchSearchAndUnzoom = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1413
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1414
    //Si on n'est pas en mode recherche dans une video ou qu'aucune recherche n'est effectuée, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1415
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1416
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1417
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1418
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1419
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1420
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1421
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1422
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1423
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1424
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1425
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1426
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1427
    $('body').append(notification_search + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1428
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1429
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1430
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1431
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1432
    var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1433
    var unzoom_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1434
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1435
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1436
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1437
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1438
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1439
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1440
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1441
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1442
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1443
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1444
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1445
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1446
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1447
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1448
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1449
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1450
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1451
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1452
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1453
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1454
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1455
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1456
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1457
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1458
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1459
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1460
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1461
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1462
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1463
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1464
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1465
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1466
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1467
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1468
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1469
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1470
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1471
 * Affichage de la notification de résultat dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1472
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1473
 * neighbours > fonctions deselectNeighbour et moveToNeighbour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1474
 * playerControl > fonction exitTimeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1475
 * zoomInteractions > fonction zoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1476
 * mosaic > fonctions onMouseUp et manageControlEvents.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1477
 * curvesDetector > fonction updateDists.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1478
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1479
Mosaic.prototype.searchGesture = function(gestureName, mode)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1480
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1481
    //Si on n'est pas en mode recherche dans une video ou qu'aucune recherche n'est reconnue, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1482
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1483
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1484
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1485
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1486
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1487
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1488
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1489
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1490
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1491
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1492
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1493
    $('body').append(notification_search_1gesture);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1494
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1495
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1496
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1497
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1498
    var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1499
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1500
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1501
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1502
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1503
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1504
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1505
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1506
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1507
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1508
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1509
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1510
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1511
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1512
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1513
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1514
        top: 0,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1515
        left: ($(window).width() - notify_width) / 2
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1516
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1517
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1518
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1519
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1520
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1521
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1522
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1523
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1524
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1525
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1526
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1527
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1528
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1529
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1530
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1531
 * Affichage de la notification de résultat & de swipe dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1532
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1533
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1534
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1535
Mosaic.prototype.searchGestureAndSwipe = function(gestureName, mode, direction)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1536
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1537
    //Si on n'est pas en mode recherche dans une video ou qu'aucune recherche n'est reconnue ou on ne fait pas de swipe, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1538
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '' || !this.isSwipe)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1539
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1540
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1541
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1542
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1543
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1544
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1545
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1546
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1547
    var notification_swipe = "<div id='notify_swipe' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1548
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1549
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1550
    $('body').append(notification_search_1gesture + notification_swipe);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1551
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1552
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1553
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1554
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1555
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1556
    var swipe_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1557
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1558
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1559
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1560
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1561
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1562
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1563
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1564
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1565
    }
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1566
	
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1567
	if(direction == "left")
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1568
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1569
		this.putText($('#notify_swipe'), this.notificationStrings.next);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1570
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1571
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1572
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1573
		this.putText($('#notify_swipe'), this.notificationStrings.previous);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1574
	}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1575
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1576
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1577
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1578
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1579
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1580
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1581
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1582
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1583
    $('#notify_swipe').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1584
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1585
        left: swipe_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1586
        'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1587
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1588
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1589
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1590
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1591
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1592
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1593
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1594
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1595
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1596
/*
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1597
 * Affichage de la notification de résultat, de move vers un voisin.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1598
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1599
 * neighbours > fonction selectNeighbour.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1600
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1601
Mosaic.prototype.searchGestureAndMove = function(gestureName, mode, targetId)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1602
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1603
    //Si on n'est pas en mode recherche dans une video ou qu'aucune recherche n'est reconnue, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1604
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1605
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1606
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1607
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1608
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1609
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1610
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1611
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1612
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1613
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1614
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1615
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1616
    $('body').append(notification_search_1gesture + notification_move);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1617
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1618
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1619
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1620
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1621
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1622
    var move_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1623
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1624
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1625
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1626
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1627
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1628
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1629
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1630
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1631
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1632
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1633
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1634
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1635
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1636
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1637
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1638
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1639
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1640
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1641
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1642
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1643
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1644
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1645
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1646
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1647
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1648
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1649
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1650
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1651
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1652
        left: move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1653
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1654
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1655
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1656
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1657
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1658
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1659
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1660
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1661
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1662
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1663
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1664
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1665
	}
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1666
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1667
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1668
/*
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1669
 * Affichage de la notification de résultat, de move vers un voisin & de dézoom dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1670
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1671
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1672
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1673
Mosaic.prototype.searchGestureAndMoveAndUnzoom = function(gestureName, mode, targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1674
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1675
    //Si on n'est pas en mode recherche dans une video ou qu'aucune recherche n'est reconnue, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1676
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1677
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1678
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1679
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1680
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1681
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1682
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1683
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1684
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1685
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1686
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1687
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1688
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1689
    $('body').append(notification_search_1gesture + notification_move + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1690
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1691
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1692
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1693
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1694
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 3 + notify_margin * 4) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1695
    var move_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1696
    var unzoom_left = move_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1697
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1698
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1699
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1700
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1701
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1702
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1703
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1704
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1705
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1706
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1707
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1708
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1709
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1710
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1711
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1712
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1713
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1714
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1715
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1716
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1717
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1718
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1719
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1720
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1721
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1722
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1723
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1724
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1725
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1726
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1727
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1728
        left: move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1729
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1730
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1731
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1732
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1733
        left: unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1734
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1735
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1736
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1737
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1738
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1739
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1740
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1741
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1742
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1743
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1744
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1745
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1746
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1747
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1748
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1749
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1750
 * Affichage de la notification de résultat & de dézoom dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1751
 * Est appelé dans le fichier :
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1752
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1753
Mosaic.prototype.searchGestureAndUnzoom = function(gestureName, mode, targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1754
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1755
    //Si on n'est pas en mode recherche dans une video ou qu'aucune recherche n'est reconnue, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1756
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1757
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1758
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1759
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1760
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1761
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1762
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1763
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1764
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1765
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1766
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1767
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1768
    $('body').append(notification_search_1gesture + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1769
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1770
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1771
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1772
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1773
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1774
    var unzoom_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1775
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1776
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1777
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1778
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1779
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1780
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1781
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1782
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1783
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1784
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1785
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1786
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1787
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1788
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1789
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1790
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1791
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1792
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1793
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1794
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1795
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1796
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1797
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1798
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1799
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1800
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1801
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1802
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1803
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1804
        left: unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1805
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1806
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1807
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1808
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1809
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1810
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1811
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1812
    });
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1813
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1814
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1815
/*
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1816
 * Affichage des notifications de gestures trouvées dans une recherche par courbes.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1817
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1818
 * curvesDetector > fonction updateDists.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1819
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1820
Mosaic.prototype.curvesGestures = function(gestures)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1821
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1822
    //S'il n'y a pas de gestures à afficher.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1823
    if(gestures.length == 0)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1824
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1825
        //On ajoute une seule notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1826
        var notification_curves = "<div class='notifications' id='notify_curves'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1827
        $('body').append(notification_curves);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1828
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1829
        //On calcule leurs dimensions et coordonnées.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1830
        var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1831
        var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1832
        var curves_left = $(window).width() / 2 - (notify_width + notify_margin * 2) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1833
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1834
        $('#notify_curves').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1835
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1836
            left: curves_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1837
            'background-image': 'url("./pictos/big/normal/inconnu.png")',
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1838
            opacity: '0.9'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1839
        });
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1840
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1841
		this.putText($('#notify_curves'), this.notificationStrings["unknown"]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1842
		
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1843
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1844
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1845
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1846
    //Sinon, on les met dans un tableau.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1847
    var gestures_tab = gestures.split(';');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1848
    
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1849
    var notifications_curves_gestures = "<div id='notify_curves_container'>";
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1850
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1851
    //On crée autant de notifications qu'il y a de gestures.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1852
    for(var i = 0 ; i < gestures_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1853
    {
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1854
        notifications_curves_gestures += "<div class='notification_curves' id='notify_curves_" + gestures_tab[i] + "'></div>";
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1855
    }
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1856
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1857
	notifications_curves_gestures += "</div>";
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1858
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1859
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1860
    $('body').append(notifications_curves_gestures);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1861
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1862
    //On calcule leurs dimensions.
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1863
    var notify_width = $('.notification_curves').width(), notify_height = $('.notification_curves').height();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1864
    var notify_margin = parseInt($('.notification_curves').css('margin-left'));
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1865
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1866
	//Nombre de notifications dans une ligne.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1867
	var notify_in_a_row = Math.floor($(window).width() / (+notify_width + 2 * notify_margin));
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1868
	//Notifications sur la première ligne.
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1869
	var notify_in_first_row = (gestures_tab.length > notify_in_a_row) ? notify_in_a_row : gestures_tab.length;
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1870
	//Espace libre restant sur la ligne.
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1871
	var free_space = $(window).width() - notify_in_first_row * (+notify_width + 2 * notify_margin);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1872
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1873
	//On met à jour le container.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1874
	$('#notify_curves_container').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1875
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1876
		height: Math.ceil(gestures_tab.length * (+notify_width + 2 * notify_margin) / $(window).width()),
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1877
		'margin-left': free_space / 2,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1878
		'margin-right': free_space / 2
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1879
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1880
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1881
    //On calcule leurs dimensions et leur backgrounds.
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1882
	for(var i = 0 ; i < gestures_tab.length ; i++)
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1883
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1884
        //On va chercher leurs backgrounds.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1885
        $('#notify_curves_' + gestures_tab[i]).css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + 'normal/' + gestures_tab[i] + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1886
        
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1887
		this.putText($('#notify_curves_' + gestures_tab[i]), this.notificationStrings[gestures_tab[i]]);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1888
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1889
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1890
    //On les fait apparaître.
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1891
    $('.notification_curves').css(
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1892
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1893
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1894
    });
47
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1895
}
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1896
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1897
/*
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1898
 * Efface les notifications. Précède chaque notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1899
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1900
 * neighbours > fonctions listenToNeighbours, selectNeighbour, deselectNeighbour et moveToNeighbour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1901
 * notifications > fonction notifyHelp.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1902
 * playerControl > fonction exitTimeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1903
 * pointers > fonctions pointersTimelineSelection, launchIdlePointers et removeSearchNotificationIfOnIt.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1904
 * search > fonction removeFilter.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1905
 * zoomInteractions > fonctions preZoom, preUnzoom, zoom et unzoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1906
 * mosaic > fonctions onMouseUp, showNImages et manageControlEvents.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1907
 * curvesDetector > fonction updateDists.
47
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1908
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1909
Mosaic.prototype.removeNotifications = function()
47
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1910
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1911
    $('.notifications').remove();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1912
    $('#notify_curves_container').remove();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1913
    $('.notification_curves').remove();
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1914
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1915
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1916
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1917
 * Place un texte sur la notification.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1918
 * Est appelé dans chaque fonction servant à notifier dans le fichier de notification.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1919
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1920
Mosaic.prototype.putText = function(notification, text)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1921
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1922
	notification.html(text);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1923
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1924
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1925
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1926
 * Affiche l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1927
 * Est appelé dans les fichiers :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1928
 * mosaic > fonction loadMosaic.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1929
 * zoomInteractions > fonctions zoom et unzoom.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1930
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1931
Mosaic.prototype.helpIcon = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1932
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1933
	this.removeHelpIcon();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1934
	//On construit le div.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1935
	var helpIcon = "<img id='helpIcon' src='./img/helpIcon.png' />";
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1936
	//On l'ajoute.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1937
	$('body').append(helpIcon);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1938
	//On spécifie ses coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1939
	$('#helpIcon').css(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1940
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1941
		top: 0,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1942
		left: $(window).width() - $('#helpIcon').width() - 2 * parseInt($('#helpIcon').css('margin-left'))
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1943
	});
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1944
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1945
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1946
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1947
 * Supprime l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1948
 * Est appelé dans les fichiers :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1949
 * zoomInteractions > fonctions zoom et unzoom.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1950
 * notifications > fonction helpIcon.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1951
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1952
Mosaic.prototype.removeHelpIcon = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1953
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1954
	this.isHelpIconZooming = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1955
	this.isHelpIconZoomed = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1956
	$('#helpIcon').remove();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1957
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1958
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1959
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1960
 * Agrandit l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1961
 * Est appelé dans le fichier :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1962
 * mosaic > fonction onMouseMove.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1963
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1964
Mosaic.prototype.showBigHelp = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1965
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1966
	//Si on a déjà zoomé on quitte.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1967
	if(this.isHelpIconZoomed || this.isHelpIconZooming)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1968
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1969
		return;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1970
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1971
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1972
	this.isHelpIconZooming = true;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1973
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1974
	var _this = this;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1975
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1976
	$('#helpIcon').animate(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1977
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1978
		width: 100,
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1979
		height: 100,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1980
		left: $(window).width() - 100 - 2 * parseInt($('#helpIcon').css('margin-left'))
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1981
	}, this.config.timeShowBigHelp, function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1982
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1983
		_this.isHelpIconZoomed = true;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1984
		_this.isHelpIconZooming = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1985
	});
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1986
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1987
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1988
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1989
 * Rétrecit l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1990
 * Est appelé dans le fichier :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1991
 * mosaic > fonction onMouseMove.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1992
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1993
Mosaic.prototype.showSmallHelp = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1994
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1995
	//Si on n'a pas zoomé on quitte.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1996
	if(!this.isHelpIconZoomed || this.isHelpIconZooming)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1997
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1998
		return;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1999
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2000
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2001
	this.isHelpIconZooming = true;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2002
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2003
	var _this = this;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2004
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2005
	var helpIconWidth = $('#helpIcon').width();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2006
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2007
	$('#helpIcon').animate(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2008
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2009
		width: 50,
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2010
		height: 50,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2011
		left: $(window).width() - 50 - 2 * parseInt($('#helpIcon').css('margin-left'))
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2012
	}, this.config.timeShowBigHelp, function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2013
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2014
		_this.isHelpIconZoomed = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2015
		_this.isHelpIconZooming = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  2016
	});
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2017
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2018
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2019
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2020
 * Affiche l'icone de sortie pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2021
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2022
Mosaic.prototype.exitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2023
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2024
	this.removeExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2025
	//On construit le div.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2026
	var exitIcon = "<img id='exitIcon' src='./img/exitIcon.png' />";
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2027
	//On l'ajoute.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2028
	$('body').append(exitIcon);
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2029
	//On spécifie ses coordonnées.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2030
	$('#exitIcon').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2031
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2032
		top: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2033
		left: $(window).width() - $('#exitIcon').width() - 2 * parseInt($('#exitIcon').css('margin-left')),
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2034
		'z-index': 1000
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2035
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2036
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2037
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2038
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2039
 * Supprime l'icone de sortie pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2040
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2041
Mosaic.prototype.removeExitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2042
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2043
	$('#exitIcon').remove();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2044
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2045
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2046
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2047
 * Affiche l'icone de retour à la mosaïque pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2048
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2049
Mosaic.prototype.homeIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2050
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2051
	this.removeHomeIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2052
	//On construit le div.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2053
	var homeIcon = "<img id='homeIcon' src='./img/homeIcon.png' />";
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2054
	//On l'ajoute.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2055
	$('body').append(homeIcon);
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2056
	//On spécifie ses coordonnées.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2057
	$('#homeIcon').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2058
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2059
		top: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2060
		left: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2061
		'z-index': 900
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2062
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2063
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2064
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2065
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2066
 * Supprime l'icone de sortie pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2067
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2068
Mosaic.prototype.removeHomeIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2069
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2070
	$('#homeIcon').remove();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2071
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2072
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2073
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2074
 * Affiche l'icone de sortie de recherche pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2075
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2076
Mosaic.prototype.searchExitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2077
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2078
	//S'il n'y a pas de notification de recherche, on s'en va.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2079
	if($('#notify_search_1gesture').length == 0)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2080
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2081
		return;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2082
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2083
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2084
	this.removeSearchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2085
	//On construit le div.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2086
	var searchExitIcon = "<img id='searchExitIcon' src='./img/exitIcon.png' />";
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2087
	//On l'ajoute.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2088
	$('body').append(searchExitIcon);
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2089
	//On spécifie ses coordonnées.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2090
	$('#searchExitIcon').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2091
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2092
		top: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2093
		left: +$('#notify_search_1gesture').position().left + $('#notify_search_1gesture').width() - $('#searchExitIcon').width() - parseInt($('#searchExitIcon').css('margin-left')) / 2,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2094
		'z-index': 900
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2095
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2096
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2097
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2098
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2099
 * Supprime l'icone de sortie de recherche pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2100
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2101
Mosaic.prototype.removeSearchExitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2102
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2103
	$('#searchExitIcon').remove();
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2104
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2105
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2106
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2107
 * Affiche l'icone des credits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2108
 * Est appelé dans les fichiers :
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2109
 * mosaic > fonction loadMosaic.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2110
 * zoomInteractions > fonctions zoom et unzoom.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2111
*/
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2112
Mosaic.prototype.creditsIcon = function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2113
{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2114
	this.removeCreditsIcon();
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2115
	//On construit le div.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2116
	var creditsIcon = "<img id='creditsIcon' src='./img/creditsIcon.png' />";
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2117
	//On l'ajoute.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2118
	$('body').append(creditsIcon);
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2119
	//On spécifie ses coordonnées.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2120
	$('#creditsIcon').css(
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2121
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2122
		top: $(window).height() - $('#creditsIcon').height() - 2 * parseInt($('#creditsIcon').css('margin-left')),
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2123
		left: $(window).width() - $('#creditsIcon').width() - 2 * parseInt($('#creditsIcon').css('margin-left'))
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2124
	});
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2125
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2126
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2127
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2128
 * Supprime l'icone des credits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2129
 * Est appelé dans les fichiers :
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2130
 * zoomInteractions > fonctions zoom et unzoom.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2131
 * notifications > fonction helpIcon.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2132
*/
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2133
Mosaic.prototype.removeCreditsIcon = function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2134
{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2135
	this.isCreditsIconZooming = false;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2136
	this.isCreditsIconZoomed = false;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2137
	$('#creditsIcon').remove();
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2138
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2139
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2140
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2141
 * Agrandit l'icone des credits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2142
 * Est appelé dans le fichier :
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2143
 * mosaic > fonction onMouseMove.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2144
*/
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2145
Mosaic.prototype.showBigCredits = function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2146
{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2147
	//Si on a déjà zoomé on quitte.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2148
	if(this.isCreditsIconZoomed || this.isCreditsIconZooming)
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2149
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2150
		return;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2151
	}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2152
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2153
	this.isCreditsIconZooming = true;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2154
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2155
	var _this = this;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2156
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2157
	$('#creditsIcon').animate(
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2158
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2159
		width: 100,
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2160
		height: 100,
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2161
		top: $(window).height() - 100 - 2 * parseInt($('#creditsIcon').css('margin-left')),
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2162
		left: $(window).width() - 100 - 2 * parseInt($('#creditsIcon').css('margin-left'))
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2163
	}, this.config.timeShowBigCredits, function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2164
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2165
		_this.isCreditsIconZoomed = true;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2166
		_this.isCreditsIconZooming = false;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2167
	});
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2168
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2169
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2170
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2171
 * Rétrecit l'icone des credits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2172
 * Est appelé dans le fichier :
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2173
 * mosaic > fonction onMouseMove.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2174
*/
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2175
Mosaic.prototype.showSmallCredits = function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2176
{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2177
	//Si on n'a pas zoomé on quitte.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2178
	if(!this.isCreditsIconZoomed || this.isCreditsIconZooming)
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2179
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2180
		return;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2181
	}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2182
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2183
	this.isCreditsIconZooming = true;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2184
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2185
	var _this = this;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2186
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2187
	var creditsIconWidth = $('#creditsIcon').width();
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2188
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2189
	$('#creditsIcon').animate(
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2190
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2191
		width: 50,
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2192
		height: 50,
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2193
		top: $(window).height() - 50 - 2 * parseInt($('#creditsIcon').css('margin-left')),
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2194
		left: $(window).width() - 50 - 2 * parseInt($('#creditsIcon').css('margin-left'))
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2195
	}, this.config.timeShowBigCredits, function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2196
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2197
		_this.isCreditsIconZoomed = false;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2198
		_this.isCreditsIconZooming = false;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2199
	});
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2200
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2201
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2202
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2203
 * Affiche les crédits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2204
*/
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2205
Mosaic.prototype.notifyCredits = function(tabCredits)
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2206
{
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2207
	//Si ils sont déjà affichés on quitte.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2208
    if(this.creditsDisplayed)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2209
    {
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2210
        return;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2211
    }
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2212
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2213
    //On enlève les autres notifications.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2214
    this.removeNotifications();
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2215
    
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2216
    //On indique qu'ils sont affichés.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2217
    this.creditsDisplayed = true;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2218
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2219
	//Panneau des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2220
	//On crée les flèches au niveau du container en cas d'overflow du texte.
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2221
	var credits = "<div id='notify_credits'><div id='credits_upArrow_mask' class='credits_masks'></div><div id='credits_upArrow' class='credits_arrows'></div><div id='credits_container'></div><div id='credits_downArrow_mask' class='credits_masks'></div><div id='credits_downArrow' class='credits_arrows'></div></div>";
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2222
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2223
	//Pied de page des crédits.
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
  2224
	var credits_footer = "<div id='credits_footer'><div id='credits_footer_BBM'></div><div id='credits_footer_text'>" + this.creditsMetadata.footer_line1 + "<br />" + this.creditsMetadata.footer_line2 + "</div><div id='credits_footer_partners'></div></div>";
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2225
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2226
	$('body').append(credits);
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2227
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2228
	//On récupère les éléments css du div des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2229
	var notify_credits = $('#notify_credits'), window_width = $(window).width(), window_height = $(window).height(), notify_margin = parseInt(notify_credits.css('margin-left')), notify_padding = parseInt(notify_credits.css('padding-left'));
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2230
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2231
	//On ajoute le pied de page aux crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2232
	notify_credits.append(credits_footer);
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2233
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2234
	//Elements html contenant les crédits.
117
5b7757a12bd7 Front IDILL:
bastiena
parents: 112
diff changeset
  2235
	var credits_elements = "<div id='credits_content_left' class='credits_content'><div id='credits_title' class='credits_text'>" + this.creditsMetadata.title + "<br /></div><div id='credits_subtitle' class='credits_text'>" + this.creditsMetadata.subtitle + "<br /><br /></div>";
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2236
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2237
	for(var i = 0 ; i < this.tabCredits.length ; i++)
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2238
	{
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2239
		credits_elements += "<div class='credits_film credits_text'>" + this.tabCredits[i].film + "</div><div class='credits_body credits_text'>";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2240
		if(this.tabCredits[i].realisation)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2241
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2242
			credits_elements += this.creditsMetadata.realisation + " : " + this.tabCredits[i].realisation + "<br />";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2243
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2244
		if(this.tabCredits[i].company)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2245
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2246
			credits_elements += this.creditsMetadata.company + " : " + this.tabCredits[i].company + "<br />";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2247
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2248
		if(this.tabCredits[i].production)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2249
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2250
			credits_elements += this.creditsMetadata.production + " : " + this.tabCredits[i].production + "<br />";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2251
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2252
		if(this.tabCredits[i].choregraphy)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2253
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2254
			credits_elements += this.creditsMetadata.choregraphy + " : " + this.tabCredits[i].choregraphy + "<br />";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2255
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2256
		if(this.tabCredits[i].music)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2257
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2258
			credits_elements += this.creditsMetadata.music + " : " + this.tabCredits[i].music + "<br />";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2259
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2260
		
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2261
		credits_elements += "<br /></div>"
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2262
		
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2263
		if(i == Math.floor(this.tabCredits.length / 3))
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2264
		{
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2265
			credits_elements += "</div><div id='credits_content_center' class='credits_content'>"
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2266
		}
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2267
		else if(i == Math.floor(this.tabCredits.length * 2 / 3))
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2268
		{
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2269
			credits_elements += "</div><div id='credits_content_right' class='credits_content'>"
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2270
		}
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2271
	}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2272
	
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2273
	credits_elements += "</div>";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2274
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2275
	$('#credits_container').append(credits_elements);
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2276
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2277
	//On le positionne
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2278
	notify_credits.css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2279
    {
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2280
        left: "0px",
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2281
        top: "0px",
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2282
        width: window_width - notify_margin * 2 - notify_padding * 2,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2283
        height: window_height - notify_margin * 2 - notify_padding * 2,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2284
        'z-index': 1000
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2285
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2286
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2287
	//$('#credits_content').css('background-color', '#0000FF');
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2288
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2289
	this.column_gap = 30;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2290
	// this.column_width = (notify_credits.width() - notify_margin * 2 - notify_padding * 2) / 3 - this.column_gap * 3;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2291
	this.column_width = 150;//Math.ceil((notify_credits.width() - this.column_gap) / 3 - notify_margin * 2);
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2292
	//console.log(Math.ceil((notify_credits.width() - this.column_gap) / 3 - notify_margin * 2));
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2293
	//Dimensions des flèches.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2294
	var arrowWidth = 50, arrowHeight = 50;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2295
	//Dimensions du footer.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2296
	var footer_height = 100;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2297
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2298
	//On spécifie les colonnes.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2299
	$('#credits_container').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2300
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2301
		position: 'absolute',
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2302
		/*,'-moz-column-width': this.column_width,
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2303
		'-webkit-column-width': this.column_width,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2304
		'-moz-column-gap': this.column_gap,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2305
		'-webkit-column-gap': this.column_gap,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2306
		'-moz-column-rule': '1px solid #ddccb5',
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2307
		'-webkit-column-rule': '1px solid #ddccb5'*/
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2308
    });
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2309
	
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2310
	$('.credits_content').css(
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2311
	{
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2312
		position: 'absolute',
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2313
		width: Math.floor(notify_credits.width() / 3)
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2314
	});
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2315
	$('#credits_content_left').css(
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2316
	{
117
5b7757a12bd7 Front IDILL:
bastiena
parents: 112
diff changeset
  2317
		top: 0,//+$('#credits_title').height() + $('#credits_subtitle').height(),
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2318
		left: 0
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2319
	});
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2320
	$('#credits_content_center').css(
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2321
	{
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2322
		top: 0,
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2323
		left: Math.floor(notify_credits.width() / 3)
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2324
	});
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2325
	$('#credits_content_right').css(
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2326
	{
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2327
		top: 0,
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2328
		left: Math.floor(notify_credits.width() * 2 / 3)
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2329
	});
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2330
	
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2331
	//On récupère la hauteur de la colonne la plus longue.
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2332
	var credits_content_max_height = Math.max(Math.max($('#credits_content_left').height(), $('#credits_content_center').height()), $('#credits_content_right').height());
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2333
	
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2334
	//CSS du pied de page.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2335
	$('#credits_footer').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2336
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2337
		position: 'absolute',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2338
		'background-color': '#FFF',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2339
		width: +notify_credits.width() + notify_margin + notify_padding,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2340
		height: footer_height,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2341
		top: +notify_credits.height() - 100 + notify_margin + notify_padding,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2342
		left: '0px'
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2343
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2344
	$('#credits_footer_BBM').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2345
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2346
		position: 'absolute',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2347
		'background-image': 'url(./img/creditsBBM.png)',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2348
		'background-repeat': 'no-repeat',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2349
		'background-size': '300px 40px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2350
		width: '300px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2351
		height: '40px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2352
		top: '0px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2353
		left: '0px'
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2354
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2355
	$('#credits_footer_partners').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2356
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2357
		position: 'absolute',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2358
		'background-image': 'url(./img/creditsPartners.png)',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2359
		'background-repeat': 'no-repeat',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2360
		width: '386px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2361
		height: '41px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2362
		top: $('#credits_footer').height() - 41,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2363
		left: +notify_credits.width() - 386 + notify_margin + notify_padding
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2364
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2365
	$('#credits_footer_text').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2366
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2367
		position: 'absolute',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2368
		width: notify_credits.width() - $('#credits_footer_partners').width(),
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2369
		top: '40px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2370
		left: '0px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2371
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2372
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2373
	//On ajoute les flèches à l'interface, bien qu'elles soient invisibles s'il n'y a pas d'overflow du texte.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2374
	$('#credits_upArrow').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2375
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2376
		top: 0,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2377
		left: notify_credits.width() / 2 - arrowWidth / 2
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2378
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2379
	$('#credits_downArrow').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2380
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2381
		top: $('#credits_footer').position().top - arrowHeight,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2382
		left: notify_credits.width() / 2 - arrowWidth / 2
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2383
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2384
	
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2385
	//On masque ce qu'il y a derrière les flèches.
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2386
	$('.credits_masks').css(
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2387
	{
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2388
		position: 'absolute',
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2389
		left: 0,
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2390
		'background-color': '#D1D2D4',
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2391
		width: notify_credits.width(),
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2392
		height: arrowHeight,
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2393
		opacity: 0,
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2394
		'z-index': 100
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2395
	});
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2396
	$('#credits_upArrow_mask').css(
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2397
	{
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2398
		top: 0
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2399
	});
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2400
	$('#credits_downArrow_mask').css(
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2401
	{
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2402
		top: $('#credits_footer').position().top - arrowHeight
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2403
	});
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2404
	
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2405
	//Nombre de pages de crédits.
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2406
	this.creditsPageLength = Math.ceil(credits_content_max_height / (notify_credits.height() - footer_height - 2 * arrowHeight));
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2407
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2408
	//On suppose qu'il n'y a pas d'overflow du texte des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2409
	this.isCreditsTextOverflow = false;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2410
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2411
	//Si la taille totale des crédits excède celle de la hauteur du panneau des crédits x 3, alors le panneau sera en plusieurs parties.
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2412
	if(credits_content_max_height > (notify_credits.height() - footer_height - 2 * arrowHeight))
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2413
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2414
		//Si on est arrivé là, on a constaté un overflow du texte des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2415
		this.isCreditsTextOverflow = true;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2416
		
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2417
		//Si on est sur la première page des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2418
		if(this.creditsPageNumber == 0)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2419
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2420
			//On ne laisse pas la place du haut pour la flèche haut puisqu'on est sur la première page.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2421
			$('#credits_container').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2422
			{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2423
				//top: 0,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2424
				height: notify_credits.height() - footer_height - arrowHeight
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2425
			});
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2426
			$('#credits_downArrow, #credits_downArrow_mask').css('opacity', '1');
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2427
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2428
		//Sinon si on est sur la dernière page des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2429
		else if(this.creditsPageNumber + 1 == creditsPageLength)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2430
		{
112
58ba3ae2d3d9 Front IDILL:
bastiena
parents: 109
diff changeset
  2431
			$('#credits_downArrow, #credits_downArrow_mask').css('opacity', '0');
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2432
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2433
		//Sinon on laisse la place pour revenir en arrière ou en avant.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2434
		else
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2435
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2436
			$('#credits_container').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2437
			{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2438
				//top: arrowHeight,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2439
				height: notify_credits.height() - footer_height - arrowHeight * 2,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2440
			});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2441
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2442
	}
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2443
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2444
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2445
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2446
 * Supprime les crédits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2447
*/
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2448
Mosaic.prototype.removeCredits = function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2449
{
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2450
	//On indique qu'ils ne sont plus affichés.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2451
    this.creditsDisplayed = false;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2452
	this.creditsPageNumber = 0;
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2453
	$('#notify_credits').remove();
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  2454
}