front_idill/src/mosaic/js/notifications.js
author bastiena
Thu, 20 Sep 2012 04:12:52 +0200
changeset 100 db42ef1faa7a
parent 98 f3249915a9bd
child 101 af33e06d06b9
permissions -rw-r--r--
Front IDILL: help details updated for mouse interactions
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.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
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_upArrow' 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
		
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   378
		//On ajoute les flèches pour accéder aux détails du panneau d'aide.
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   379
		var help_details_arrows = "<div id='help_details_upArrow' class='help_details_arrows'></div><div id='help_details_downArrow' class='help_details_arrows'></div>";
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   380
		
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   381
		//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
   382
		var helpDetailsLeftContainerLength = Math.ceil(this.helpDetailsGestures.length / 2), helpDetailsRightContainerLength = Math.floor(this.helpDetailsGestures.length / 2);
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   383
		
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   384
		//On ajoute les gestes des détails de l'aide.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   385
		//On remplit les divs gauche et droite des détails par les éléments.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   386
		var help_details_gestures = "<div id='help_details_left_container' class='help_details_containers'>";
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   387
		
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   388
		var i = 0;
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   389
		for(i ; i < helpDetailsLeftContainerLength ; i++)
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   390
		{
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   391
			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
   392
			this.helpDetailsGesturesMetadata.name + '</b> : ' + this.helpDetailsGestures[i].name + "</td></tr><tr><td><b>" +
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   393
			this.helpDetailsGesturesMetadata.usage + '</b> : ' + this.helpDetailsGestures[i].usage + "</td></tr><tr><td><b>" +
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   394
			this.helpDetailsGesturesMetadata.desc + '</b> : ' + this.helpDetailsGestures[i].desc + "</td></tr></table></div>";
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   395
		}
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   396
		help_details_gestures += "</div><div id='help_details_right_container' class='help_details_containers'>";
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   397
		for(i ; i < this.helpDetailsGestures.length ; i++)
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   398
		{
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>" +
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   400
			this.helpDetailsGesturesMetadata.name + '</b> : ' + this.helpDetailsGestures[i].name + "</td></tr><tr><td><b>" +
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   401
			this.helpDetailsGesturesMetadata.usage + '</b> : ' + this.helpDetailsGestures[i].usage + "</td></tr><tr><td><b>" +
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   402
			this.helpDetailsGesturesMetadata.desc + '</b> : ' + this.helpDetailsGestures[i].desc + "</td></tr></table></div>";
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   403
		}
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   404
		
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   405
		help_details_gestures += "</div>";
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   406
		
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   407
		notify_help.append(help_details_arrows + help_details_gestures);
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   408
		
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   409
		//Hauteur totale de la plus longue colonne.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   410
		var helpDetailsMaxContainerHeight = $('#help_details_left_container').height();
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   411
		
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   412
		//On positionne les flèches même si elles sont invisibles pour l'instant.
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   413
		$('#help_details_upArrow').css(
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   414
		{
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   415
			top: 0,
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   416
			left: notify_help.width() / 2 - arrowWidth / 2
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   417
		});
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   418
		$('#help_details_downArrow').css(
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   419
		{
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   420
			top: notify_help.height() - arrowHeight,
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   421
			left: notify_help.width() / 2 - arrowWidth / 2
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
   422
		});
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   423
		
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   424
		$('.helpDetailsImg').css(
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   425
		{
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   426
			
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   427
		});
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   428
		
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   429
		var helpDetailsColumnWidth = (notify_help.width() - 2 * notify_margin) / 2 - 100;
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   430
		
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   431
		//On spécifie les colonnes.
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   432
		$('.help_details_containers').css(
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   433
		{
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   434
			position: 'absolute',
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   435
			width: notify_help.width() / 2 - notify_margin * 2 - notify_border * 2
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   436
	    });
100
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   437
		$('#help_details_left_container').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   438
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   439
			top: 0,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   440
			left: 0
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   441
		});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   442
		$('#help_details_right_container').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   443
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   444
			top: 0,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   445
			left: notify_help.width() / 2
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   446
		});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   447
		
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   448
		//Hauteur du panneau d'aide moins la hauteur des flèches.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   449
		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
   450
		//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
   451
		this.helpDetailsPageLength = Math.ceil(helpDetailsMaxContainerHeight / notify_help_height_without_arrows) + 1;
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   452
		
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   453
		//On ajoute les flèches à l'interface.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   454
		$('#help_details_upArrow').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   455
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   456
			top: 0,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   457
			left: notify_help.width() / 2 - arrowWidth / 2
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   458
		});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   459
		$('#help_details_downArrow').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   460
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   461
			top: notify_help.height() - arrowHeight,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   462
			left: notify_help.width() / 2 - arrowWidth / 2
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   463
		});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   464
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   465
		//Si on est sur la première page de l'aide.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   466
		if(this.helpDetailsPageNumber == 0)
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   467
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   468
			//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
   469
			$('.help_details_containers').css(
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   470
			{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   471
				//top: 0,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   472
				top: $('#notify_help').height(),
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   473
				// height: notify_help.height() - arrowHeight
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   474
			});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   475
			//$('#notify_help').css('padding-bottom', arrowHeight);
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   476
			$('#help_details_downArrow').css('opacity', '1');
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   477
			
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   478
			//$('.help_details_containers').css('opacity', '0');
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   479
		}
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   480
		//Sinon si on est sur la dernière page de l'aide.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   481
		else if(this.helpDetailsPageNumber + 1 == this.helpDetailsPageLength)
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   482
		{
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   483
			$('#help_details_downArrow').css('opacity', '0');
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   484
		}
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   485
		//Sinon on laisse la place pour revenir en arrière ou en avant.
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   486
		else
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   487
		{
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: arrowHeight,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   491
				// height: notify_help.height() - arrowHeight * 2,
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   492
			});
db42ef1faa7a Front IDILL:
bastiena
parents: 98
diff changeset
   493
		}
97
be87091be54e Front IDILL:
bastiena
parents: 89
diff changeset
   494
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   495
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   496
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   497
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   498
 * Supprime l'aide.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   499
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   500
 * pointers > fonction detectIdlePointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   501
 * mosaic > fonction manageControlEvents et onClick.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   502
 * curvesDetector > fonction updateDists.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   503
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   504
Mosaic.prototype.removeHelp = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   505
{
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   506
	// console.trace();
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   507
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   508
    //Si l'aide n'est pas affichée, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   509
    if(!this.helpDisplayed)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   510
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   511
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   512
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   513
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   514
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   515
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   516
    //On fait disparaître l'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   517
    $('#notify_help').fadeOut(this.timeNotifyFade, function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   518
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   519
        //On indique que l'aide n'est plus affichée, et on détruit le panneau.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   520
        _this.helpDisplayed = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   521
        _this.canNotifyHelp = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   522
        $('#notify_help').remove();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   523
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   524
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   525
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   526
/*
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   527
 * Affichage de la notification de sélection & recherche dans la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   528
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   529
 * zoomInteractions > fonctions preUnzoom et unzoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   530
 * mosaic > fonction showNImages.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   531
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   532
Mosaic.prototype.mosaicSelectionAndSearch = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   533
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   534
    //Si on n'est pas en mode mosaic, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   535
    if(this.currentMode != 'MOSAIC')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   536
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   537
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   538
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   539
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   540
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   541
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   542
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   543
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   544
	//On calcule leurs dimensions.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   545
	var notify_width, notify_height, notify_margin;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   546
	var selection_left, search_left;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   547
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   548
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   549
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   550
		//On ajoute à la mosaïque seulement la recherche.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   551
		$('body').append(notification_search);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   552
		notify_margin = parseInt($('.notifications').css('margin-left'));
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   553
		notify_width = $('.notifications').width();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   554
		notify_height = $('.notifications').height();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   555
		//On calcule leurs coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   556
		search_left = ($(window).width() / 2 - notify_width / 2 - notify_margin);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   557
		var img = $('#notify_search').css('background-image');
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   558
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   559
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   560
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/TI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   561
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   562
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   563
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   564
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/MI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   565
		}
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   566
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   567
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   568
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   569
		//On les ajoute à la mosaïque.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   570
		$('body').append(notification_selection + notification_search);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   571
		notify_margin = parseInt($('.notifications').css('margin-left'));
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   572
		notify_width = $('.notifications').width();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   573
		notify_height = $('.notifications').height();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   574
		//On calcule leurs coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   575
		selection_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   576
		search_left = selection_left + notify_width + notify_margin;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   577
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   578
		this.putText($('#notify_selection'), this.notificationStrings.select);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   579
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   580
		$('#notify_selection').css(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   581
		{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   582
			left: selection_left
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   583
		});
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   584
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   585
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   586
	this.putText($('#notify_search'), this.notificationStrings.search);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   587
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   588
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   589
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   590
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   591
        left: search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   592
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   593
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   594
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   595
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   596
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   597
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   598
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   599
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   600
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   601
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   602
 * Affichage de la notification de sélection dans la mosaïque.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   603
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   604
 * zoomInteractions > fonction preZoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   605
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   606
Mosaic.prototype.mosaicSelection = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   607
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   608
    //Si on n'est pas en mode mosaic, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   609
    if(this.currentMode != 'MOSAIC')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   610
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   611
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   612
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   613
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   614
    //On spécifie la notification en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   615
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   616
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   617
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   618
    $('body').append(notification_selection);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   619
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   620
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   621
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   622
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   623
    var selection_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   624
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   625
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   626
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   627
		var img = $('#notify_selection').css('background-image');
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   628
		$('#notify_selection').css('background-image', img.replace('notifications/', 'notifications/MI/'));
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   629
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   630
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   631
	this.putText($('#notify_selection'), this.notificationStrings.confirm);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   632
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   633
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   634
    $('#notify_selection').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   635
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   636
        left: selection_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   637
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   638
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   639
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   640
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   641
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   642
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   643
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   644
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   645
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   646
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   647
 * Affichage de la notification de recherche dans une demande de filtrage de la mosaïque.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   648
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   649
 * pointers > fonction launchIdlePointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   650
 * zoomInteractions > fonction preUnzoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   651
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   652
Mosaic.prototype.filterSearch = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   653
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   654
    //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
   655
    if(this.currentMode != 'FILTER' || this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   656
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   657
        return;
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 spécifie la notification en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   661
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   662
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   663
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   664
    $('body').append(notification_search);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   665
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   666
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   667
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   668
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   669
    var search_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   670
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   671
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   672
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   673
		var img = $('#notify_search').css('background-image');
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   674
		
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   675
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   676
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   677
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/TI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   678
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   679
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   680
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   681
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/MI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   682
		}
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   683
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   684
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   685
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   686
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   687
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   688
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   689
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   690
        left: search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   691
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   692
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   693
    //On la fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   694
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   695
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   696
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   697
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   698
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   699
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   700
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   701
 * 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
   702
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   703
 * zoomInteractions > fonction preZoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   704
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   705
Mosaic.prototype.filterSearchAndSelection = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   706
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   707
    //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
   708
    if(this.currentMode != 'FILTER' || this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   709
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   710
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   711
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   712
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   713
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   714
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   715
    var notification_search = "<div id='notify_search' class='notifications'></div>";
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   716
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   717
	//On les ajoute à la mosaïque.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   718
	$('body').append(notification_selection + notification_search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   719
	
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   720
	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
   721
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   722
	//On calcule leurs coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   723
	var selection_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   724
	var search_left = selection_left + notify_width + notify_margin;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   725
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   726
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   727
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   728
		var imgSel = $('#notify_selection').css('background-image');
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   729
		$('#notify_selection').css('background-image', imgSel.replace('notifications/', 'notifications/MI/'));
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   730
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   731
		var imgSearch = $('#notify_search').css('background-image');
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   732
		
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   733
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   734
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   735
			$('#notify_search').css('background-image', imgSearch.replace('notifications/', 'notifications/TI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   736
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   737
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   738
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   739
			$('#notify_search').css('background-image', imgSearch.replace('notifications/', 'notifications/MI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   740
		}
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   741
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   742
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   743
	this.putText($('#notify_selection'), this.notificationStrings.confirm);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   744
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   745
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   746
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   747
    $('#notify_selection').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   748
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   749
        left: selection_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   750
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   751
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   752
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   753
        left: search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   754
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   755
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   756
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   757
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   758
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   759
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   760
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   761
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   762
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   763
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   764
 * Affichage de la notification de résultat de gesture dans la mosaïque filtrée.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   765
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   766
 * zoomInteractions > fonction preUnzoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   767
 * mosaic > onMouseUp et manageControlEvents.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   768
 * curvesDetector > updateDists.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   769
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   770
Mosaic.prototype.filterGesture = function(gestureName, mode)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   771
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   772
    //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
   773
    if(this.currentMode != 'FILTER' || !this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   774
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   775
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   776
    }
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   777
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   778
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   779
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   780
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   781
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   782
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   783
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   784
    $('body').append(notification_search_1gesture);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   785
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   786
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   787
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   788
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   789
    var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   790
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   791
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   792
    {
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   793
        $('#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
   794
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   795
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   796
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   797
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   798
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   799
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   800
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   801
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   802
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   803
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   804
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   805
        top: 0,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   806
        left: ($(window).width() - notify_width) / 2
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   807
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   808
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   809
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   810
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   811
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   812
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   813
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   814
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   815
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   816
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   817
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   818
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   819
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   820
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   821
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   822
 * 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
   823
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   824
 * zoomInteractions > fonction preZoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   825
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   826
Mosaic.prototype.filterGestureAndSelection = function(gestureName, mode)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   827
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   828
    //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
   829
    if(this.currentMode != 'FILTER' || !this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   830
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   831
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   832
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   833
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   834
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   835
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   836
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   837
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   838
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   839
    $('body').append(notification_search_1gesture + notification_selection);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   840
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   841
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   842
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   843
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   844
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   845
    var selection_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   846
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   847
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   848
    {
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   849
        $('#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
   850
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   851
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   852
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   853
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   854
    }
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   855
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   856
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   857
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   858
		var img = $('#notify_selection').css('background-image');
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   859
		$('#notify_selection').css('background-image', img.replace('notifications/', 'notifications/MI/'));
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   860
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   861
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   862
	this.putText($('#notify_selection'), this.notificationStrings.confirm);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   863
    this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   864
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   865
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   866
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   867
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   868
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   869
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   870
    $('#notify_selection').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   871
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   872
        left: selection_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   873
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   874
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   875
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   876
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   877
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   878
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   879
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   880
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   881
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   882
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   883
 * Affiche la notification de dezoom.
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   884
 * Direction vaut left ou right.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   885
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   886
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   887
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   888
Mosaic.prototype.videoSwipe = function(direction)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   889
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   890
    //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
   891
    if(this.currentMode != 'VIDEO' || !this.isSwipe)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   892
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   893
        return;
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
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   897
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   898
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   899
    var notification_swipe = "<div id='notify_swipe' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   900
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   901
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   902
    $('body').append(notification_swipe);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   903
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   904
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   905
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   906
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   907
    var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   908
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   909
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   910
    
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   911
	if(direction == "left")
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   912
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   913
		this.putText($('#notify_swipe'), this.notificationStrings.next);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   914
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   915
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   916
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   917
		this.putText($('#notify_swipe'), this.notificationStrings.previous);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   918
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   919
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   920
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   921
    $('#notify_swipe').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   922
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   923
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   924
        left: -notifyLeft + ($(window).width() - notify_width - notify_margin) / 2,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   925
        'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   926
    });
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   927
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   928
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   929
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   930
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   931
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   932
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   933
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   934
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   935
/*
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   936
 * Affichage de la notification de résultat de move vers un voisin.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   937
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   938
 * neighbours > fonction selectNeighbour.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   939
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   940
Mosaic.prototype.videoMove = function(targetId)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   941
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   942
    //Si on n'est pas en mode video, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   943
    if(this.currentMode != 'VIDEO')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   944
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   945
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   946
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   947
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   948
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   949
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   950
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   951
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   952
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   953
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   954
    $('body').append(notification_move);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   955
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   956
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   957
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   958
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   959
    var move_left = $(window).width() / 2 - (notify_width) / 2 + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   960
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   961
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   962
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   963
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   964
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   965
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   966
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   967
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   968
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   969
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   970
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   971
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   972
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   973
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   974
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   975
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   976
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   977
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   978
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   979
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   980
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   981
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   982
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   983
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   984
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   985
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   986
    });
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   987
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   988
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   989
/*
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   990
 * 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
   991
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   992
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   993
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   994
Mosaic.prototype.videoMoveAndUnzoom = function(targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   995
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   996
    //Si on n'est pas en mode video, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   997
    if(this.currentMode != 'VIDEO')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   998
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   999
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1000
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1001
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1002
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1003
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1004
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1005
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1006
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1007
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1008
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1009
    $('body').append(notification_move + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1010
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1011
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1012
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1013
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1014
    var move_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1015
    var unzoom_left = move_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1016
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1017
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1018
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1019
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1020
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1021
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1022
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1023
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1024
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1025
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1026
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1027
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1028
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1029
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1030
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1031
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1032
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1033
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1034
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1035
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1036
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1037
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1038
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1039
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1040
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1041
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1042
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1043
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1044
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1045
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1046
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1047
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1048
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1049
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1050
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1051
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1052
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1053
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1054
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1055
 * Affichage de la notification de résultat de dézoom dans une vidéo.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1056
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1057
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1058
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1059
Mosaic.prototype.videoUnzoom = function(targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1060
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1061
    //Si on n'est pas en mode video, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1062
    if(this.currentMode != 'VIDEO')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1063
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1064
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1065
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1066
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1067
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1068
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1069
    //On spécifie la notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1070
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1071
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1072
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1073
    $('body').append(notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1074
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1075
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1076
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1077
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1078
    var unzoom_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1079
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1080
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1081
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1082
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1083
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1084
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1085
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1086
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1087
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1088
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1089
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1090
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1091
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1092
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1093
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1094
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1095
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1096
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1097
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1098
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1099
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1100
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1101
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1102
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1103
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1104
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1105
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1106
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1107
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1108
 * Affichage de la notification de timeline dans une vidéo/recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1109
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1110
 * pointers > fonction pointersTimelineSelection.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1111
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1112
Mosaic.prototype.timelineTimeline = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1113
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1114
    //Si on n'est pas en mode timeline, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1115
    if(this.currentMode != 'TIMELINE')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1116
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1117
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1118
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1119
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1120
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1121
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1122
    //On spécifie la notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1123
    var notification_timeline = "<div id='notify_timeline' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1124
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1125
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1126
    $('body').append(notification_timeline);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1127
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1128
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1129
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1130
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1131
    var timeline_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1132
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1133
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1134
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1135
	this.putText($('#notify_timeline'), this.notificationStrings.timeline);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1136
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1137
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1138
    $('#notify_timeline').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1139
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1140
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1141
        left: -notifyLeft + timeline_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1142
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1143
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1144
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1145
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1146
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1147
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1148
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1149
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1150
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1151
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1152
 * Affichage de la notification de recherche dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1153
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1154
 * neighbours > fonction deselectNeighbour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1155
 * pointers > fonction launchIdlePointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1156
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1157
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1158
Mosaic.prototype.searchSearch = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1159
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1160
    //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
  1161
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1162
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1163
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1164
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1165
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1166
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1167
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1168
    //On spécifie la notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1169
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1170
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1171
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1172
    $('body').append(notification_search);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1173
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1174
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1175
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1176
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1177
    var search_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1178
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1179
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1180
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1181
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1182
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1183
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1184
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1185
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1186
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1187
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1188
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1189
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1190
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1191
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1192
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1193
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1194
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1195
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1196
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1197
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1198
 * Affichage de la notification de recherche & de swipe dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1199
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1200
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1201
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1202
Mosaic.prototype.searchSearchAndSwipe = function(direction)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1203
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1204
    //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
  1205
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture || !this.isSwipe)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1206
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1207
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1208
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1209
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1210
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1211
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1212
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1213
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1214
    var notification_swipe = "<div id='notify_swipe' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1215
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1216
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1217
    $('body').append(notification_search + notification_swipe);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1218
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1219
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1220
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1221
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1222
    var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1223
    var swipe_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1224
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1225
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1226
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1227
	this.putText($('#notify_search'), this.notificationStrings.search);
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1228
	if(direction == "left")
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1229
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1230
		this.putText($('#notify_swipe'), this.notificationStrings.next);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1231
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1232
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1233
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1234
		this.putText($('#notify_swipe'), this.notificationStrings.previous);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1235
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1236
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1237
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1238
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1239
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1240
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1241
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1242
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1243
    $('#notify_swipe').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1244
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1245
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1246
        left: -notifyLeft + swipe_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1247
        'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1248
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1249
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1250
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1251
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1252
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1253
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1254
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1255
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1256
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1257
/*
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1258
 * Affichage de la notification de recherche, de move vers un voisin.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1259
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1260
 * neighbours > fonction selectNeighbour.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1261
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1262
Mosaic.prototype.searchSearchAndMove = function(targetId)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1263
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1264
    //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
  1265
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1266
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1267
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1268
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1269
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1270
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1271
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1272
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1273
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1274
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1275
    $('body').append(notification_search + notification_move);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1276
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1277
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1278
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1279
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1280
    var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1281
    var move_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1282
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1283
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1284
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1285
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1286
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1287
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1288
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1289
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1290
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1291
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1292
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1293
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1294
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1295
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1296
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1297
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1298
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1299
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1300
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1301
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1302
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1303
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1304
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1305
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1306
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1307
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1308
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1309
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1310
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1311
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1312
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1313
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1314
    });
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1315
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1316
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1317
/*
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1318
 * 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
  1319
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1320
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1321
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1322
Mosaic.prototype.searchSearchAndMoveAndUnzoom = function(targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1323
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1324
    //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
  1325
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1326
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1327
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1328
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1329
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1330
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1331
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1332
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1333
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1334
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1335
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1336
    $('body').append(notification_search + notification_move + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1337
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1338
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1339
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1340
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1341
    var search_left = $(window).width() / 2 - (notify_width * 3 + notify_margin * 4) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1342
    var move_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1343
    var unzoom_left = move_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1344
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1345
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1346
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1347
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1348
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1349
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1350
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1351
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1352
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1353
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1354
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1355
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1356
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1357
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1358
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1359
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1360
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1361
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1362
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1363
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1364
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1365
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1366
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1367
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1368
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1369
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1370
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1371
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1372
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1373
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1374
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1375
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1376
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1377
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1378
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1379
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1380
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1381
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1382
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1383
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1384
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1385
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1386
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1387
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1388
 * Affichage de la notification de recherche & de dézoom dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1389
 * Est appelé dans le fichier :
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1390
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1391
Mosaic.prototype.searchSearchAndUnzoom = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1392
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1393
    //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
  1394
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1395
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1396
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1397
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1398
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1399
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1400
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1401
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1402
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1403
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1404
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1405
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1406
    $('body').append(notification_search + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1407
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1408
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1409
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1410
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1411
    var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1412
    var unzoom_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1413
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1414
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1415
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1416
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1417
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1418
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1419
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1420
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1421
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1422
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1423
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1424
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1425
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1426
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1427
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1428
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1429
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1430
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1431
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1432
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1433
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1434
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1435
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1436
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1437
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1438
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1439
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
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
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1443
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1444
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1445
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1446
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1447
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1448
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1449
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1450
 * Affichage de la notification de résultat dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1451
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1452
 * neighbours > fonctions deselectNeighbour et moveToNeighbour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1453
 * playerControl > fonction exitTimeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1454
 * zoomInteractions > fonction zoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1455
 * mosaic > fonctions onMouseUp et manageControlEvents.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1456
 * curvesDetector > fonction updateDists.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1457
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1458
Mosaic.prototype.searchGesture = function(gestureName, mode)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1459
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1460
    //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
  1461
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1462
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1463
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1464
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1465
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1466
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1467
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1468
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1469
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1470
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1471
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1472
    $('body').append(notification_search_1gesture);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1473
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1474
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1475
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1476
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1477
    var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1478
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1479
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1480
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1481
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1482
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1483
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1484
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1485
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1486
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1487
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1488
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1489
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1490
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1491
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1492
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1493
        top: 0,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1494
        left: ($(window).width() - notify_width) / 2
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1495
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1496
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1497
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1498
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1499
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1500
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1501
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1502
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1503
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1504
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1505
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1506
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1507
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1508
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1509
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1510
 * Affichage de la notification de résultat & de swipe dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1511
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1512
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1513
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1514
Mosaic.prototype.searchGestureAndSwipe = function(gestureName, mode, direction)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1515
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1516
    //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
  1517
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '' || !this.isSwipe)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1518
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1519
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1520
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1521
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1522
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1523
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1524
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1525
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1526
    var notification_swipe = "<div id='notify_swipe' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1527
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1528
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1529
    $('body').append(notification_search_1gesture + notification_swipe);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1530
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1531
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1532
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1533
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1534
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1535
    var swipe_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1536
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1537
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1538
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1539
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1540
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1541
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1542
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1543
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1544
    }
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1545
	
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1546
	if(direction == "left")
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1547
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1548
		this.putText($('#notify_swipe'), this.notificationStrings.next);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1549
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1550
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1551
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1552
		this.putText($('#notify_swipe'), this.notificationStrings.previous);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1553
	}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1554
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1555
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1556
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1557
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1558
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1559
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1560
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1561
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1562
    $('#notify_swipe').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1563
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1564
        left: swipe_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1565
        'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1566
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1567
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1568
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1569
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1570
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1571
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1572
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1573
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1574
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1575
/*
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1576
 * Affichage de la notification de résultat, de move vers un voisin.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1577
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1578
 * neighbours > fonction selectNeighbour.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1579
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1580
Mosaic.prototype.searchGestureAndMove = function(gestureName, mode, targetId)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1581
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1582
    //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
  1583
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1584
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1585
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1586
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1587
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1588
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1589
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1590
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1591
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1592
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1593
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1594
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1595
    $('body').append(notification_search_1gesture + notification_move);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1596
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1597
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1598
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1599
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1600
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1601
    var move_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1602
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1603
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1604
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1605
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1606
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1607
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1608
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1609
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1610
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1611
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1612
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1613
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1614
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1615
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1616
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1617
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1618
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1619
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1620
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1621
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1622
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1623
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1624
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1625
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1626
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1627
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1628
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1629
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1630
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1631
        left: move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1632
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1633
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1634
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1635
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1636
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1637
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1638
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1639
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1640
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1641
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1642
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1643
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1644
	}
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1645
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1646
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1647
/*
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1648
 * 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
  1649
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1650
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1651
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1652
Mosaic.prototype.searchGestureAndMoveAndUnzoom = function(gestureName, mode, targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1653
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1654
    //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
  1655
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1656
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1657
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1658
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1659
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1660
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1661
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1662
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1663
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1664
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1665
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1666
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1667
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1668
    $('body').append(notification_search_1gesture + notification_move + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1669
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1670
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1671
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1672
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1673
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 3 + notify_margin * 4) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1674
    var move_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1675
    var unzoom_left = move_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1676
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1677
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1678
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1679
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1680
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1681
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1682
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1683
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1684
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1685
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1686
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1687
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1688
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1689
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1690
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1691
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1692
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1693
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1694
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1695
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1696
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1697
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1698
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1699
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1700
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1701
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1702
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1703
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1704
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1705
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1706
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1707
        left: move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1708
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1709
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1710
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1711
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1712
        left: unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1713
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1714
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1715
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1716
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1717
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1718
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1719
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1720
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1721
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1722
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1723
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1724
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1725
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1726
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1727
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1728
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1729
 * 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
  1730
 * Est appelé dans le fichier :
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1731
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1732
Mosaic.prototype.searchGestureAndUnzoom = function(gestureName, mode, targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1733
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1734
    //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
  1735
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1736
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1737
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1738
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1739
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1740
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1741
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1742
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1743
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1744
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1745
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1746
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1747
    $('body').append(notification_search_1gesture + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1748
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1749
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1750
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1751
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1752
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1753
    var unzoom_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1754
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1755
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1756
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1757
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1758
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1759
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1760
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1761
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1762
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1763
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1764
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1765
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1766
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1767
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1768
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1769
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1770
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1771
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1772
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1773
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1774
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1775
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1776
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1777
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1778
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1779
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1780
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1781
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1782
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1783
        left: unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1784
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1785
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1786
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1787
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1788
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1789
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1790
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1791
    });
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1792
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1793
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1794
/*
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1795
 * Affichage des notifications de gestures trouvées dans une recherche par courbes.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1796
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1797
 * curvesDetector > fonction updateDists.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1798
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1799
Mosaic.prototype.curvesGestures = function(gestures)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1800
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1801
    //S'il n'y a pas de gestures à afficher.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1802
    if(gestures.length == 0)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1803
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1804
        //On ajoute une seule notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1805
        var notification_curves = "<div class='notifications' id='notify_curves'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1806
        $('body').append(notification_curves);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1807
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1808
        //On calcule leurs dimensions et coordonnées.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1809
        var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1810
        var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1811
        var curves_left = $(window).width() / 2 - (notify_width + notify_margin * 2) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1812
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1813
        $('#notify_curves').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1814
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1815
            left: curves_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1816
            'background-image': 'url("./pictos/big/normal/inconnu.png")',
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1817
            opacity: '0.9'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1818
        });
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1819
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1820
		this.putText($('#notify_curves'), this.notificationStrings["unknown"]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1821
		
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1822
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1823
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1824
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1825
    //Sinon, on les met dans un tableau.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1826
    var gestures_tab = gestures.split(';');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1827
    
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1828
    var notifications_curves_gestures = "<div id='notify_curves_container'>";
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1829
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1830
    //On crée autant de notifications qu'il y a de gestures.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1831
    for(var i = 0 ; i < gestures_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1832
    {
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1833
        notifications_curves_gestures += "<div class='notification_curves' id='notify_curves_" + gestures_tab[i] + "'></div>";
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1834
    }
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1835
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1836
	notifications_curves_gestures += "</div>";
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1837
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1838
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1839
    $('body').append(notifications_curves_gestures);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1840
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1841
    //On calcule leurs dimensions.
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1842
    var notify_width = $('.notification_curves').width(), notify_height = $('.notification_curves').height();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1843
    var notify_margin = parseInt($('.notification_curves').css('margin-left'));
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1844
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1845
	//Nombre de notifications dans une ligne.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1846
	var notify_in_a_row = Math.floor($(window).width() / (+notify_width + 2 * notify_margin));
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1847
	//Notifications sur la première ligne.
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1848
	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
  1849
	//Espace libre restant sur la ligne.
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1850
	var free_space = $(window).width() - notify_in_first_row * (+notify_width + 2 * notify_margin);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1851
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1852
	//On met à jour le container.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1853
	$('#notify_curves_container').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1854
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1855
		height: Math.ceil(gestures_tab.length * (+notify_width + 2 * notify_margin) / $(window).width()),
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1856
		'margin-left': free_space / 2,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1857
		'margin-right': free_space / 2
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1858
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1859
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1860
    //On calcule leurs dimensions et leur backgrounds.
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1861
	for(var i = 0 ; i < gestures_tab.length ; i++)
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1862
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1863
        //On va chercher leurs backgrounds.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1864
        $('#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
  1865
        
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1866
		this.putText($('#notify_curves_' + gestures_tab[i]), this.notificationStrings[gestures_tab[i]]);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1867
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1868
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1869
    //On les fait apparaître.
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1870
    $('.notification_curves').css(
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1871
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1872
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1873
    });
47
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1874
}
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1875
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1876
/*
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1877
 * Efface les notifications. Précède chaque notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1878
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1879
 * neighbours > fonctions listenToNeighbours, selectNeighbour, deselectNeighbour et moveToNeighbour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1880
 * notifications > fonction notifyHelp.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1881
 * playerControl > fonction exitTimeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1882
 * pointers > fonctions pointersTimelineSelection, launchIdlePointers et removeSearchNotificationIfOnIt.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1883
 * search > fonction removeFilter.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1884
 * zoomInteractions > fonctions preZoom, preUnzoom, zoom et unzoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1885
 * mosaic > fonctions onMouseUp, showNImages et manageControlEvents.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1886
 * curvesDetector > fonction updateDists.
47
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1887
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1888
Mosaic.prototype.removeNotifications = function()
47
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1889
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1890
    $('.notifications').remove();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1891
    $('#notify_curves_container').remove();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1892
    $('.notification_curves').remove();
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1893
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1894
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1895
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1896
 * Place un texte sur la notification.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1897
 * Est appelé dans chaque fonction servant à notifier dans le fichier de notification.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1898
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1899
Mosaic.prototype.putText = function(notification, text)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1900
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1901
	notification.html(text);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1902
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1903
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1904
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1905
 * Affiche l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1906
 * Est appelé dans les fichiers :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1907
 * mosaic > fonction loadMosaic.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1908
 * zoomInteractions > fonctions zoom et unzoom.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1909
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1910
Mosaic.prototype.helpIcon = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1911
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1912
	this.removeHelpIcon();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1913
	//On construit le div.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1914
	var helpIcon = "<img id='helpIcon' src='./img/helpIcon.png' />";
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1915
	//On l'ajoute.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1916
	$('body').append(helpIcon);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1917
	//On spécifie ses coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1918
	$('#helpIcon').css(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1919
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1920
		top: 0,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1921
		left: $(window).width() - $('#helpIcon').width() - 2 * parseInt($('#helpIcon').css('margin-left'))
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1922
	});
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
 * Supprime 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
 * zoomInteractions > fonctions zoom et unzoom.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1929
 * notifications > fonction helpIcon.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1930
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1931
Mosaic.prototype.removeHelpIcon = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1932
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1933
	this.isHelpIconZooming = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1934
	this.isHelpIconZoomed = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1935
	$('#helpIcon').remove();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1936
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1937
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1938
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1939
 * Agrandit l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1940
 * Est appelé dans le fichier :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1941
 * mosaic > fonction onMouseMove.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1942
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1943
Mosaic.prototype.showBigHelp = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1944
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1945
	//Si on a déjà zoomé on quitte.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1946
	if(this.isHelpIconZoomed || this.isHelpIconZooming)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1947
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1948
		return;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1949
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1950
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1951
	this.isHelpIconZooming = true;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1952
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1953
	var _this = this;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1954
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1955
	$('#helpIcon').animate(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1956
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1957
		width: 100,
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1958
		height: 100,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1959
		left: $(window).width() - 100 - 2 * parseInt($('#helpIcon').css('margin-left'))
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1960
	}, this.config.timeShowBigHelp, function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1961
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1962
		_this.isHelpIconZoomed = true;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1963
		_this.isHelpIconZooming = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1964
	});
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1965
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1966
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1967
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1968
 * Rétrecit l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1969
 * Est appelé dans le fichier :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1970
 * mosaic > fonction onMouseMove.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1971
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1972
Mosaic.prototype.showSmallHelp = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1973
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1974
	//Si on n'a pas zoomé on quitte.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1975
	if(!this.isHelpIconZoomed || this.isHelpIconZooming)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1976
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1977
		return;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1978
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1979
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1980
	this.isHelpIconZooming = true;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1981
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1982
	var _this = this;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1983
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1984
	var helpIconWidth = $('#helpIcon').width();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1985
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1986
	$('#helpIcon').animate(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1987
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1988
		width: 50,
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1989
		height: 50,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1990
		left: $(window).width() - 50 - 2 * parseInt($('#helpIcon').css('margin-left'))
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1991
	}, this.config.timeShowBigHelp, function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1992
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1993
		_this.isHelpIconZoomed = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1994
		_this.isHelpIconZooming = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1995
	});
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1996
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1997
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1998
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1999
 * Affiche l'icone de sortie pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2000
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2001
Mosaic.prototype.exitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2002
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2003
	this.removeExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2004
	//On construit le div.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2005
	var exitIcon = "<img id='exitIcon' src='./img/exitIcon.png' />";
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2006
	//On l'ajoute.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2007
	$('body').append(exitIcon);
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2008
	//On spécifie ses coordonnées.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2009
	$('#exitIcon').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2010
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2011
		top: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2012
		left: $(window).width() - $('#exitIcon').width() - 2 * parseInt($('#exitIcon').css('margin-left')),
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2013
		'z-index': 1000
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2014
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2015
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2016
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2017
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2018
 * Supprime l'icone de sortie pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2019
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2020
Mosaic.prototype.removeExitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2021
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2022
	$('#exitIcon').remove();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2023
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2024
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2025
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2026
 * Affiche l'icone de retour à la mosaïque pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2027
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2028
Mosaic.prototype.homeIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2029
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2030
	this.removeHomeIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2031
	//On construit le div.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2032
	var homeIcon = "<img id='homeIcon' src='./img/homeIcon.png' />";
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2033
	//On l'ajoute.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2034
	$('body').append(homeIcon);
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2035
	//On spécifie ses coordonnées.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2036
	$('#homeIcon').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2037
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2038
		top: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2039
		left: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2040
		'z-index': 900
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2041
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2042
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2043
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2044
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2045
 * Supprime l'icone de sortie pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2046
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2047
Mosaic.prototype.removeHomeIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2048
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2049
	$('#homeIcon').remove();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2050
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2051
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2052
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2053
 * Affiche l'icone de sortie de recherche pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2054
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2055
Mosaic.prototype.searchExitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2056
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2057
	//S'il n'y a pas de notification de recherche, on s'en va.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2058
	if($('#notify_search_1gesture').length == 0)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2059
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2060
		return;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2061
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2062
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2063
	this.removeSearchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2064
	//On construit le div.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2065
	var searchExitIcon = "<img id='searchExitIcon' src='./img/exitIcon.png' />";
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2066
	//On l'ajoute.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2067
	$('body').append(searchExitIcon);
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2068
	//On spécifie ses coordonnées.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2069
	$('#searchExitIcon').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2070
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2071
		top: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2072
		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
  2073
		'z-index': 900
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2074
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2075
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2076
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2077
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2078
 * Supprime l'icone de sortie de recherche pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2079
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2080
Mosaic.prototype.removeSearchExitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2081
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  2082
	$('#searchExitIcon').remove();
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2083
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2084
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2085
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2086
 * Affiche l'icone des credits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2087
 * Est appelé dans les fichiers :
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2088
 * mosaic > fonction loadMosaic.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2089
 * zoomInteractions > fonctions zoom et unzoom.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2090
*/
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2091
Mosaic.prototype.creditsIcon = function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2092
{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2093
	this.removeCreditsIcon();
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2094
	//On construit le div.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2095
	var creditsIcon = "<img id='creditsIcon' src='./img/creditsIcon.png' />";
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2096
	//On l'ajoute.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2097
	$('body').append(creditsIcon);
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2098
	//On spécifie ses coordonnées.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2099
	$('#creditsIcon').css(
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2100
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2101
		top: $(window).height() - $('#creditsIcon').height() - 2 * parseInt($('#creditsIcon').css('margin-left')),
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2102
		left: $(window).width() - $('#creditsIcon').width() - 2 * parseInt($('#creditsIcon').css('margin-left'))
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2103
	});
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
 * Supprime 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
 * zoomInteractions > fonctions zoom et unzoom.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2110
 * notifications > fonction helpIcon.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2111
*/
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2112
Mosaic.prototype.removeCreditsIcon = function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2113
{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2114
	this.isCreditsIconZooming = false;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2115
	this.isCreditsIconZoomed = false;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2116
	$('#creditsIcon').remove();
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2117
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2118
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2119
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2120
 * Agrandit l'icone des credits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2121
 * Est appelé dans le fichier :
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2122
 * mosaic > fonction onMouseMove.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2123
*/
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2124
Mosaic.prototype.showBigCredits = function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2125
{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2126
	//Si on a déjà zoomé on quitte.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2127
	if(this.isCreditsIconZoomed || this.isCreditsIconZooming)
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2128
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2129
		return;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2130
	}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2131
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2132
	this.isCreditsIconZooming = true;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2133
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2134
	var _this = this;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2135
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2136
	$('#creditsIcon').animate(
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2137
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2138
		width: 100,
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2139
		height: 100,
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2140
		top: $(window).height() - 100 - 2 * parseInt($('#creditsIcon').css('margin-left')),
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2141
		left: $(window).width() - 100 - 2 * parseInt($('#creditsIcon').css('margin-left'))
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2142
	}, this.config.timeShowBigCredits, function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2143
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2144
		_this.isCreditsIconZoomed = true;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2145
		_this.isCreditsIconZooming = false;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2146
	});
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2147
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2148
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2149
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2150
 * Rétrecit l'icone des credits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2151
 * Est appelé dans le fichier :
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2152
 * mosaic > fonction onMouseMove.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2153
*/
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2154
Mosaic.prototype.showSmallCredits = function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2155
{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2156
	//Si on n'a pas zoomé on quitte.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2157
	if(!this.isCreditsIconZoomed || this.isCreditsIconZooming)
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2158
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2159
		return;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2160
	}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2161
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2162
	this.isCreditsIconZooming = true;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2163
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2164
	var _this = this;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2165
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2166
	var creditsIconWidth = $('#creditsIcon').width();
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2167
	
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2168
	$('#creditsIcon').animate(
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2169
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2170
		width: 50,
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2171
		height: 50,
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2172
		top: $(window).height() - 50 - 2 * parseInt($('#creditsIcon').css('margin-left')),
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2173
		left: $(window).width() - 50 - 2 * parseInt($('#creditsIcon').css('margin-left'))
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2174
	}, this.config.timeShowBigCredits, function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2175
	{
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2176
		_this.isCreditsIconZoomed = false;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2177
		_this.isCreditsIconZooming = false;
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2178
	});
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2179
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2180
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2181
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2182
 * Affiche les crédits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2183
*/
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2184
Mosaic.prototype.notifyCredits = function(tabCredits)
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2185
{
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2186
	//Si ils sont déjà affichés on quitte.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2187
    if(this.creditsDisplayed)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2188
    {
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2189
        return;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2190
    }
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2191
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2192
    //On enlève les autres notifications.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2193
    this.removeNotifications();
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2194
    
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2195
    //On indique qu'ils sont affichés.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2196
    this.creditsDisplayed = true;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2197
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2198
	//Panneau des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2199
	//On crée les flèches au niveau du container en cas d'overflow du texte.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2200
	var credits = "<div id='notify_credits'><div id='credits_upArrow' class='credits_arrows'></div><div id='credits_container'></div><div id='credits_downArrow' class='credits_arrows'></div></div>";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2201
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2202
	//Pied de page des crédits.
93
417d4b573bc8 Front IDILL:
bastiena
parents: 85
diff changeset
  2203
	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
  2204
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2205
	$('body').append(credits);
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2206
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2207
	//On récupère les éléments css du div des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2208
	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
  2209
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2210
	//On ajoute le pied de page aux crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2211
	notify_credits.append(credits_footer);
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2212
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2213
	//Elements html contenant les crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2214
	var credits_elements = "<div id='credits_content'><div id='credits_title' class='credits_text'>" + this.creditsMetadata.title + "<br /></div><div id='credits_subtitle' class='credits_text'><i>" + this.creditsMetadata.subtitle + "</i><br /><br /></div>";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2215
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2216
	for(var i = 0 ; i < this.tabCredits.length ; i++)
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2217
	{
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2218
		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
  2219
		if(this.tabCredits[i].realisation)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2220
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2221
			credits_elements += this.creditsMetadata.realisation + " : " + this.tabCredits[i].realisation + "<br />";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2222
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2223
		if(this.tabCredits[i].company)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2224
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2225
			credits_elements += this.creditsMetadata.company + " : " + this.tabCredits[i].company + "<br />";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2226
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2227
		if(this.tabCredits[i].production)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2228
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2229
			credits_elements += this.creditsMetadata.production + " : " + this.tabCredits[i].production + "<br />";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2230
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2231
		if(this.tabCredits[i].choregraphy)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2232
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2233
			credits_elements += this.creditsMetadata.choregraphy + " : " + this.tabCredits[i].choregraphy + "<br />";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2234
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2235
		if(this.tabCredits[i].music)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2236
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2237
			credits_elements += this.creditsMetadata.music + " : " + this.tabCredits[i].music + "<br />";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2238
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2239
		
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2240
		credits_elements += "<br /></div>"
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2241
	}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2242
	
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2243
	credits_elements += "</div>";
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2244
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2245
	$('#credits_container').append(credits_elements);
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2246
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2247
	//On le positionne
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2248
	notify_credits.css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2249
    {
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2250
        left: "0px",
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2251
        top: "0px",
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2252
        width: window_width - notify_margin * 2 - notify_padding * 2,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2253
        height: window_height - notify_margin * 2 - notify_padding * 2,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2254
        'z-index': 1000
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2255
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2256
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2257
	//$('#credits_content').css('background-color', '#0000FF');
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2258
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2259
	this.column_gap = 30;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2260
	// 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
  2261
	this.column_width = 150;//Math.ceil((notify_credits.width() - this.column_gap) / 3 - notify_margin * 2);
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2262
	//console.log(Math.ceil((notify_credits.width() - this.column_gap) / 3 - notify_margin * 2));
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2263
	//Dimensions des flèches.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2264
	var arrowWidth = 50, arrowHeight = 50;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2265
	//Dimensions du footer.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2266
	var footer_height = 100;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2267
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2268
	//On spécifie les colonnes.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2269
	$('#credits_container').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2270
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2271
		position: 'absolute',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2272
		'-moz-column-width': this.column_width,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2273
		'-webkit-column-width': this.column_width,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2274
		'-moz-column-gap': this.column_gap,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2275
		'-webkit-column-gap': this.column_gap,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2276
		'-moz-column-rule': '1px solid #ddccb5',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2277
		'-webkit-column-rule': '1px solid #ddccb5'
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2278
    });
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2279
	
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2280
	//CSS du pied de page.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2281
	$('#credits_footer').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2282
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2283
		position: 'absolute',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2284
		'background-color': '#FFF',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2285
		width: +notify_credits.width() + notify_margin + notify_padding,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2286
		height: footer_height,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2287
		top: +notify_credits.height() - 100 + notify_margin + notify_padding,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2288
		left: '0px'
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2289
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2290
	$('#credits_footer_BBM').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2291
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2292
		position: 'absolute',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2293
		'background-image': 'url(./img/creditsBBM.png)',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2294
		'background-repeat': 'no-repeat',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2295
		'background-size': '300px 40px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2296
		width: '300px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2297
		height: '40px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2298
		top: '0px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2299
		left: '0px'
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2300
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2301
	$('#credits_footer_partners').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2302
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2303
		position: 'absolute',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2304
		'background-image': 'url(./img/creditsPartners.png)',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2305
		'background-repeat': 'no-repeat',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2306
		width: '386px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2307
		height: '41px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2308
		top: $('#credits_footer').height() - 41,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2309
		left: +notify_credits.width() - 386 + notify_margin + notify_padding
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2310
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2311
	$('#credits_footer_text').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2312
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2313
		position: 'absolute',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2314
		width: notify_credits.width() - $('#credits_footer_partners').width(),
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2315
		top: '40px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2316
		left: '0px',
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2317
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2318
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2319
	//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
  2320
	$('#credits_upArrow').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2321
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2322
		top: 0,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2323
		left: notify_credits.width() / 2 - arrowWidth / 2
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2324
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2325
	$('#credits_downArrow').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2326
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2327
		top: $('#credits_footer').position().top - arrowHeight,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2328
		left: notify_credits.width() / 2 - arrowWidth / 2
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2329
	});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2330
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2331
	//Hauteur totale du texte des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2332
	var credits_total_height = $('#credits_content').height();
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2333
	//Nombre de pages de crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2334
	this.creditsPageLength = Math.ceil(credits_total_height / (notify_credits.height() * 3));
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2335
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2336
	//On suppose qu'il n'y a pas d'overflow du texte des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2337
	this.isCreditsTextOverflow = false;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2338
	
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2339
	//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.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2340
	if(credits_total_height > notify_credits.height() * 3)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2341
	{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2342
		//Si on est arrivé là, on a constaté un overflow du texte des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2343
		this.isCreditsTextOverflow = true;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2344
		
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2345
		//Si on est sur la première page des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2346
		if(this.creditsPageNumber == 0)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2347
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2348
			//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
  2349
			$('#credits_container').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2350
			{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2351
				//top: 0,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2352
				height: notify_credits.height() - footer_height - arrowHeight
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2353
			});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2354
			$('#credits_downArrow').css('opacity', '1');
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2355
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2356
		//Sinon si on est sur la dernière page des crédits.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2357
		else if(this.creditsPageNumber + 1 == creditsPageLength)
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2358
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2359
			$('#credits_downArrow').css('opacity', '0');
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2360
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2361
		//Sinon on laisse la place pour revenir en arrière ou en avant.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2362
		else
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2363
		{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2364
			$('#credits_container').css(
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2365
			{
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2366
				//top: arrowHeight,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2367
				height: notify_credits.height() - footer_height - arrowHeight * 2,
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2368
			});
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2369
		}
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2370
	}
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2371
}
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2372
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2373
/*
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2374
 * Supprime les crédits.
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2375
*/
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2376
Mosaic.prototype.removeCredits = function()
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2377
{
89
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2378
	//On indique qu'ils ne sont plus affichés.
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2379
    this.creditsDisplayed = false;
b6a115568b52 Front IDILL:
bastiena
parents: 85
diff changeset
  2380
	this.creditsPageNumber = 0;
85
b244a7bc0844 Front IDILL:
bastiena
parents: 79
diff changeset
  2381
	$('#notify_credits').remove();
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  2382
}