front_idill/src/mosaic/js/notifications.js
author bastiena
Thu, 16 Aug 2012 14:32:19 +0200
changeset 79 9eff85166868
parent 77 205409da0f32
child 85 b244a7bc0844
permissions -rw-r--r--
Front IDILL : spaces in img names removed touch interactions finished can't select timeline before player is reading
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
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    34
    //On enlève les autres notifications.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    35
    this.removeNotifications();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    36
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    37
    //On indique qu'elle est affiché.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    38
    this.helpDisplayed = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    39
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    40
    //Section des courbes de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    41
    var search_2hands_tab;
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    42
    var search_2hands_tab_text;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    43
    //Section des recherches corporelles.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    44
    var search_body_tab;
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    45
    var search_body_tab_text;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    46
    //Section des actions de contrôle sur l'interface.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    47
    var controls_1hand_tab;
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    48
    var controls_1hand_tab_text;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    49
    //Opacités (indique si elles sont actuellement implémentées).
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    50
    var search_2hands_tab_opacities;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    51
    var search_body_tab_opacities;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    52
    var controls_1hand_tab_opacities;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    53
    var controls_1hand_tab_opacities;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    54
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    55
    //Dossier contenant les images.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    56
    var img_directory = './pictos/help/';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    57
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    58
    //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
    59
    if(this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    60
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    61
        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
    62
        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
    63
        search_2hands_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    64
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    65
    else
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'];
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'];
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    69
        search_body_tab = ['chute', 'knee_up', 'jump', 'bend'];
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    70
        search_body_tab_text = ['fall', 'knee-up', 'jump', 'bend'];
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
    71
        search_2hands_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1];
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    72
        search_body_tab_opacities = [1, 1, 1, 1];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    73
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    74
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    75
    //Dans la mosaique, on ne peut que sélectionner un snapshot.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    76
    if(inMosaic)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    77
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    78
        controls_1hand_tab = ['selection'];
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    79
        controls_1hand_tab_text = ['controls_selection'];
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    80
        controls_1hand_tab_opacities = [1];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    81
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    82
    //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
    83
    else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    84
    {
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    85
		if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    86
		{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    87
			controls_1hand_tab = ['deplacer', 'move_down', 'move_up', 'move_right', 'move_left'];
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    88
			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
    89
			controls_1hand_tab_opacities = [1, 1, 1, 1, 1];
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    90
		}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    91
		else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    92
		{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    93
			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
    94
			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
    95
			controls_1hand_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1, 1];
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
    96
		}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    97
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    98
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    99
    //Colonne de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   100
    //Titre de la colonne de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   101
    var search_title = "<div id='search_title'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   102
    //Image de la colonne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   103
    var search_img = "<div id='search_img' class='notify_imgs'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   104
    //Sous-titre.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   105
    var search_2hands_text = "<div id='search_2hands_text'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   106
    //Images de recherche par courbes.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   107
    var search_2hands_imgs = "<div id='search_2hands_imgs' class='notify_imgs_big'>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   108
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   109
    //On crée les images.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   110
    for(var i = 0 ; i < search_2hands_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   111
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   112
        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
   113
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   114
    search_2hands_imgs += "</div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   115
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   116
    //Sous-titre de la zone de recherche corporelle.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   117
    var search_body_text;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   118
    //Images de recherche corporelle.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   119
    var search_body_imgs;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   120
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   121
    //Si on est en mode Kinect.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   122
    if(!this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   123
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   124
        //On crée le texte et les images de la recherche corporelle.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   125
        search_body_text = "<div id='search_body_text'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   126
        search_body_imgs = "<div id='search_body_imgs' class='notify_imgs'>"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   127
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   128
        for(var i = 0 ; i < search_body_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   129
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   130
            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
   131
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   132
        search_body_imgs += "</div>";
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   133
		
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   134
		//On ajoute ce qu'il faut pour quitter l'aide.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   135
		
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   136
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   137
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   138
    //Titre de la colonne des actions de contrôle.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   139
    var controls_title = "<div id='controls_title'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   140
    //Image de la colonne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   141
    var controls_img = "<div id='controls_img' class='notify_imgs'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   142
    //Sous-titre de la zone de contrôle de l'interface.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   143
    var controls_1hand_text = "<div id='controls_1hand_text'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   144
    //Images des actions de contrôle de l'interface.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   145
    var controls_1hand_imgs;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   146
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   147
    controls_1hand_imgs = "<div id='controls_1hand_imgs' class='notify_imgs'>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   148
    for(var i = 0 ; i < controls_1hand_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   149
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   150
        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
   151
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   152
    controls_1hand_imgs += "</div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   153
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   154
    //Colonne de recherche du panneau d'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   155
    var help_search;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   156
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   157
    //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
   158
    if(this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   159
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   160
        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
   161
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   162
    else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   163
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   164
        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
   165
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   166
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   167
    //Colonne de contrôle du panneau d'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   168
    var help_controls;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   169
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   170
    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
   171
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   172
    //Panneau d'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   173
    var notification_help = "<div id='notify_help'>" + help_search + "<div id='help_sep'></div>" + help_controls + "</div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   174
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   175
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   176
    $('body').append(notification_help);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   177
    
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   178
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   179
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   180
		//On rétrécit certaines images si on est sur une tablette.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   181
		$('#search_img, #controls_img').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   182
		{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   183
			height: 150,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   184
			'background-size': '150px 150px'
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   185
		});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   186
		
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   187
		$('.notify_imgs_small').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   188
		{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   189
			height: 80,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   190
			width: 80,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   191
			'background-size': '80px 80px'
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   192
		});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   193
		
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   194
		//On ajoute l'icone de sortie.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   195
		this.exitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   196
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   197
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   198
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   199
    var notify_width = $(window).width(), notify_height = $(window).height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   200
    var notify_margin = parseInt($('#notify_help').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   201
    var notify_ = 10;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   202
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   203
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   204
    $('#notify_help').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   205
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   206
        left: "0px",
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   207
        top: "0px",
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   208
        width: notify_width - notify_margin * 2,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   209
        height: notify_height - notify_margin * 2,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   210
        'z-index': 1000
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   211
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   212
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   213
    //Taille des marges des images.
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   214
    var margins = parseInt($('.notify_imgs_small').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   215
    //Largeur des images.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   216
    var widths = $('.notify_imgs_small').width();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   217
    //Hauteur des images.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   218
    var heights = $('.notify_imgs_small').height();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   219
    //Position horizontale du séparateur de colonnes.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   220
    var sep_left = $('#help_sep').position().left;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   221
    //Marge du panneau d'aide.
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   222
    var help_margin = parseInt($('#notify_help').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   223
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   224
    //On calcule la taille d'une zone de recherche (une des deux parties).
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   225
    var help_column_width = sep_left - help_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   226
    //Longueur d'une image.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   227
    var img_width = (margins * 2 + widths);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   228
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   229
    //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
   230
    var search_2hands_n_imgs = Math.floor(help_column_width / img_width);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   231
    //Calcul du padding-left de cette section.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   232
    var search_2hands_padding_left = (help_column_width - search_2hands_n_imgs * img_width) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   233
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   234
    //On positionne la section de recherche par courbes.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   235
    $('#search_2hands_imgs').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   236
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   237
        'padding-left': search_2hands_padding_left,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   238
        'height': ($('.notify_imgs_small').height() * 2 + parseInt($('.notify_imgs_small').css('margin-left')))
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   239
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   240
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   241
    //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
   242
    var search_body_n_imgs = Math.floor(help_column_width / img_width);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   243
    //Calcul du padding-left de cette section.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   244
    var search_body_padding_left = (help_column_width - search_body_n_imgs * img_width) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   245
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   246
    //On positionne la section de recherche par gestures corporelles.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   247
    $('#search_body_imgs').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   248
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   249
        'padding-left': search_body_padding_left,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   250
        'height': ($('.notify_imgs_small').height() * 2 + parseInt($('.notify_imgs_small').css('margin-left')))
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   251
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   252
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   253
    //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
   254
    var controls_1hand_n_imgs = Math.floor(help_column_width / img_width);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   255
    //Calcul du padding-left de cette section.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   256
    var controls_1hand_padding_left = (help_column_width - controls_1hand_n_imgs * img_width) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   257
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   258
    //On potisionne la section des actions de contrôle de l'interface.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   259
    $('#controls_1hand_imgs').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   260
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   261
        'padding-left': controls_1hand_padding_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   262
        'height': ($('.notify_imgs_small').height())
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   263
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   264
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   265
    //Longueur de la colonne de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   266
    var search_width = $('#help_search').width();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   267
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   268
    $('#search_title').html(this.helpText.search_title);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   269
    var MI = '';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   270
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   271
    //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
   272
    if(this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   273
    {
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   274
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   275
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   276
			$('#search_2hands_text').html(this.helpText.search_touch_text);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   277
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   278
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   279
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   280
			$('#search_2hands_text').html(this.helpText.search_mouse_text);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   281
		}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   282
        MI = 'MI/';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   283
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   284
    else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   285
    {
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   286
        $('#search_2hands_text').html(this.helpText.search_2hands_text);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   287
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   288
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   289
    //On affecte les images pour la recherche par courbes.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   290
    for(var i = 0 ; i < search_2hands_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   291
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   292
        $("#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
   293
		$("#2hands_" + search_2hands_tab[i]).html(this.notificationStrings[search_2hands_tab_text[i]]);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   294
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   295
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   296
    //Si on est en mode Kinect, on affecte les images de recherche corporelle.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   297
    if(!this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   298
    {
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   299
        $('#search_body_text').html(this.helpText.search_body_text);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   300
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   301
        for(var i = 0 ; i < search_body_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   302
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   303
            $("#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
   304
			$("#body_" + search_body_tab[i]).html(this.notificationStrings[search_body_tab_text[i]]);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   305
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   306
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   307
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   308
    //Actions de contrôle de l'interface.
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   309
    $('#controls_title').html(this.helpText.controls_title);
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   310
	
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   311
	if(this.config.mouseInteractions)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   312
	{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   313
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   314
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   315
			$('#controls_1hand_text').html(this.helpText.controls_touch_text);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   316
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   317
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   318
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   319
			$('#controls_1hand_text').html(this.helpText.controls_mouse_text);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   320
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   321
	}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   322
	else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   323
	{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   324
		$('#controls_1hand_text').html(this.helpText.controls_1hand_text);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   325
	}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   326
    
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   327
	//On affecte les images des actions de contrôle de l'interface.
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   328
	for(var i = 0 ; i < controls_1hand_tab.length ; i++)
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   329
	{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   330
		$("#1hand_" + controls_1hand_tab[i]).css("background-image", "url('" + img_directory + controls_1hand_tab[i] + ".png')");
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   331
		$("#1hand_" + controls_1hand_tab[i]).html(this.helpText[controls_1hand_tab_text[i]]);
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   332
	}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   333
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   334
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   335
    $('#notify_help').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   336
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   337
        opacity: "1"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   338
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   339
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   340
    $('.notify_imgs_big').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   341
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   342
        opacity: "1"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   343
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   344
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   345
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   346
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   347
 * Supprime l'aide.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   348
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   349
 * pointers > fonction detectIdlePointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   350
 * mosaic > fonction manageControlEvents et onClick.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   351
 * curvesDetector > fonction updateDists.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   352
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   353
Mosaic.prototype.removeHelp = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   354
{
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   355
	// console.trace();
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   356
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   357
    //Si l'aide n'est pas affichée, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   358
    if(!this.helpDisplayed)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   359
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   360
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   361
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   362
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   363
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   364
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   365
    //On fait disparaître l'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   366
    $('#notify_help').fadeOut(this.timeNotifyFade, function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   367
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   368
        //On indique que l'aide n'est plus affichée, et on détruit le panneau.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   369
        _this.helpDisplayed = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   370
        _this.canNotifyHelp = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   371
        $('#notify_help').remove();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   372
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   373
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   374
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   375
/*
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   376
 * Affichage de la notification de sélection & recherche dans la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   377
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   378
 * zoomInteractions > fonctions preUnzoom et unzoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   379
 * mosaic > fonction showNImages.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   380
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   381
Mosaic.prototype.mosaicSelectionAndSearch = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   382
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   383
    //Si on n'est pas en mode mosaic, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   384
    if(this.currentMode != 'MOSAIC')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   385
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   386
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   387
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   388
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   389
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   390
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   391
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   392
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   393
	//On calcule leurs dimensions.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   394
	var notify_width, notify_height, notify_margin;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   395
	var selection_left, search_left;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   396
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   397
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   398
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   399
		//On ajoute à la mosaïque seulement la recherche.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   400
		$('body').append(notification_search);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   401
		notify_margin = parseInt($('.notifications').css('margin-left'));
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   402
		notify_width = $('.notifications').width();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   403
		notify_height = $('.notifications').height();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   404
		//On calcule leurs coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   405
		search_left = ($(window).width() / 2 - notify_width / 2 - notify_margin);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   406
		var img = $('#notify_search').css('background-image');
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   407
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   408
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   409
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/TI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   410
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   411
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   412
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   413
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/MI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   414
		}
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   415
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   416
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   417
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   418
		//On les ajoute à la mosaïque.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   419
		$('body').append(notification_selection + notification_search);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   420
		notify_margin = parseInt($('.notifications').css('margin-left'));
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   421
		notify_width = $('.notifications').width();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   422
		notify_height = $('.notifications').height();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   423
		//On calcule leurs coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   424
		selection_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   425
		search_left = selection_left + notify_width + notify_margin;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   426
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   427
		this.putText($('#notify_selection'), this.notificationStrings.select);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   428
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   429
		$('#notify_selection').css(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   430
		{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   431
			left: selection_left
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   432
		});
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   433
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   434
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   435
	this.putText($('#notify_search'), this.notificationStrings.search);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   436
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   437
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   438
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   439
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   440
        left: search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   441
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   442
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   443
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   444
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   445
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   446
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   447
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   448
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   449
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   450
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   451
 * Affichage de la notification de sélection dans la mosaïque.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   452
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   453
 * zoomInteractions > fonction preZoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   454
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   455
Mosaic.prototype.mosaicSelection = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   456
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   457
    //Si on n'est pas en mode mosaic, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   458
    if(this.currentMode != 'MOSAIC')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   459
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   460
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   461
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   462
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   463
    //On spécifie la notification en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   464
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   465
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   466
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   467
    $('body').append(notification_selection);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   468
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   469
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   470
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   471
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   472
    var selection_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   473
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   474
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   475
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   476
		var img = $('#notify_selection').css('background-image');
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   477
		$('#notify_selection').css('background-image', img.replace('notifications/', 'notifications/MI/'));
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   478
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   479
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   480
	this.putText($('#notify_selection'), this.notificationStrings.confirm);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   481
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   482
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   483
    $('#notify_selection').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   484
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   485
        left: selection_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   486
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   487
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   488
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   489
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   490
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   491
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   492
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   493
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   494
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   495
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   496
 * Affichage de la notification de recherche dans une demande de filtrage de la mosaïque.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   497
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   498
 * pointers > fonction launchIdlePointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   499
 * zoomInteractions > fonction preUnzoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   500
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   501
Mosaic.prototype.filterSearch = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   502
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   503
    //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
   504
    if(this.currentMode != 'FILTER' || this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   505
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   506
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   507
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   508
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   509
    //On spécifie la notification en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   510
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   511
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   512
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   513
    $('body').append(notification_search);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   514
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   515
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   516
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   517
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   518
    var search_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   519
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   520
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   521
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   522
		var img = $('#notify_search').css('background-image');
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   523
		
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   524
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   525
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   526
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/TI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   527
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   528
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   529
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   530
			$('#notify_search').css('background-image', img.replace('notifications/', 'notifications/MI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   531
		}
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   532
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   533
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   534
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   535
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   536
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   537
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   538
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   539
        left: search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   540
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   541
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   542
    //On la fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   543
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   544
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   545
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   546
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   547
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   548
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   549
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   550
 * 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
   551
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   552
 * zoomInteractions > fonction preZoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   553
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   554
Mosaic.prototype.filterSearchAndSelection = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   555
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   556
    //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
   557
    if(this.currentMode != 'FILTER' || this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   558
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   559
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   560
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   561
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   562
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   563
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   564
    var notification_search = "<div id='notify_search' class='notifications'></div>";
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   565
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   566
	//On les ajoute à la mosaïque.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   567
	$('body').append(notification_selection + notification_search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   568
	
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   569
	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
   570
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   571
	//On calcule leurs coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   572
	var selection_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   573
	var search_left = selection_left + notify_width + notify_margin;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   574
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   575
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   576
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   577
		var imgSel = $('#notify_selection').css('background-image');
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   578
		$('#notify_selection').css('background-image', imgSel.replace('notifications/', 'notifications/MI/'));
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   579
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   580
		var imgSearch = $('#notify_search').css('background-image');
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   581
		
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   582
		if(this.isTablet)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   583
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   584
			$('#notify_search').css('background-image', imgSearch.replace('notifications/', 'notifications/TI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   585
		}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   586
		else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   587
		{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   588
			$('#notify_search').css('background-image', imgSearch.replace('notifications/', 'notifications/MI/'));
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   589
		}
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   590
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   591
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   592
	this.putText($('#notify_selection'), this.notificationStrings.confirm);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   593
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   594
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   595
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   596
    $('#notify_selection').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   597
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   598
        left: selection_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   599
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   600
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   601
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   602
        left: search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   603
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   604
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   605
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   606
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   607
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   608
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   609
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   610
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   611
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   612
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   613
 * Affichage de la notification de résultat de gesture dans la mosaïque filtrée.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   614
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   615
 * zoomInteractions > fonction preUnzoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   616
 * mosaic > onMouseUp et manageControlEvents.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   617
 * curvesDetector > updateDists.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   618
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   619
Mosaic.prototype.filterGesture = function(gestureName, mode)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   620
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   621
    //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
   622
    if(this.currentMode != 'FILTER' || !this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   623
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   624
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   625
    }
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   626
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   627
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   628
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   629
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   630
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   631
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   632
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   633
    $('body').append(notification_search_1gesture);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   634
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   635
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   636
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   637
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   638
    var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   639
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   640
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   641
    {
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   642
        $('#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
   643
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   644
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   645
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   646
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   647
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   648
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   649
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   650
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   651
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   652
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   653
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   654
        top: 0,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   655
        left: ($(window).width() - notify_width) / 2
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   656
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   657
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   658
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   659
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   660
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   661
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   662
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   663
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   664
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   665
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   666
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   667
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   668
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   669
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   670
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   671
 * 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
   672
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   673
 * zoomInteractions > fonction preZoom.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   674
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   675
Mosaic.prototype.filterGestureAndSelection = function(gestureName, mode)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   676
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   677
    //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
   678
    if(this.currentMode != 'FILTER' || !this.filterSearchedType)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   679
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   680
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   681
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   682
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   683
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   684
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   685
    var notification_selection = "<div id='notify_selection' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   686
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   687
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   688
    $('body').append(notification_search_1gesture + notification_selection);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   689
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   690
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   691
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   692
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   693
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   694
    var selection_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   695
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   696
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   697
    {
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   698
        $('#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
   699
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   700
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   701
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   702
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   703
    }
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   704
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   705
	if(this.config.mouseInteractions)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   706
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   707
		var img = $('#notify_selection').css('background-image');
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   708
		$('#notify_selection').css('background-image', img.replace('notifications/', 'notifications/MI/'));
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   709
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   710
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   711
	this.putText($('#notify_selection'), this.notificationStrings.confirm);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   712
    this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   713
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   714
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   715
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   716
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   717
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   718
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   719
    $('#notify_selection').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   720
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   721
        left: selection_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   722
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   723
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   724
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   725
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   726
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   727
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   728
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   729
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   730
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   731
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   732
 * Affiche la notification de dezoom.
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   733
 * Direction vaut left ou right.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   734
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   735
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   736
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   737
Mosaic.prototype.videoSwipe = function(direction)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   738
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   739
    //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
   740
    if(this.currentMode != 'VIDEO' || !this.isSwipe)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   741
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   742
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   743
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   744
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   745
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   746
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   747
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   748
    var notification_swipe = "<div id='notify_swipe' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   749
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   750
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   751
    $('body').append(notification_swipe);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   752
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   753
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   754
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   755
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   756
    var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   757
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   758
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   759
    
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   760
	if(direction == "left")
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   761
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   762
		this.putText($('#notify_swipe'), this.notificationStrings.next);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   763
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   764
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   765
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   766
		this.putText($('#notify_swipe'), this.notificationStrings.previous);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   767
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   768
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   769
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   770
    $('#notify_swipe').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   771
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   772
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   773
        left: -notifyLeft + ($(window).width() - notify_width - notify_margin) / 2,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   774
        'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   775
    });
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   776
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   777
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   778
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   779
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   780
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   781
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   782
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   783
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   784
/*
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   785
 * Affichage de la notification de résultat de move vers un voisin.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   786
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   787
 * neighbours > fonction selectNeighbour.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   788
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   789
Mosaic.prototype.videoMove = function(targetId)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   790
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   791
    //Si on n'est pas en mode video, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   792
    if(this.currentMode != 'VIDEO')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   793
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   794
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   795
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   796
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   797
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   798
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   799
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   800
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   801
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   802
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   803
    $('body').append(notification_move);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   804
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   805
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   806
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   807
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   808
    var move_left = $(window).width() / 2 - (notify_width) / 2 + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   809
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   810
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   811
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   812
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   813
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   814
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   815
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   816
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   817
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   818
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   819
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   820
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   821
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   822
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   823
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   824
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   825
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   826
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   827
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   828
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   829
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   830
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   831
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   832
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   833
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   834
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   835
    });
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   836
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   837
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   838
/*
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   839
 * 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
   840
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   841
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   842
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   843
Mosaic.prototype.videoMoveAndUnzoom = function(targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   844
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   845
    //Si on n'est pas en mode video, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   846
    if(this.currentMode != 'VIDEO')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   847
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   848
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   849
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   850
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   851
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   852
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   853
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   854
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   855
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   856
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   857
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   858
    $('body').append(notification_move + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   859
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   860
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   861
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   862
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   863
    var move_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   864
    var unzoom_left = move_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   865
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   866
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   867
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   868
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   869
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   870
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   871
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   872
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   873
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   874
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   875
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   876
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   877
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   878
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   879
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   880
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   881
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   882
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   883
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   884
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   885
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   886
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   887
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   888
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   889
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   890
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   891
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   892
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   893
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   894
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   895
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   896
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   897
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   898
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   899
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   900
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   901
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   902
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   903
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   904
 * Affichage de la notification de résultat de dézoom dans une vidéo.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   905
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   906
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   907
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   908
Mosaic.prototype.videoUnzoom = function(targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   909
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   910
    //Si on n'est pas en mode video, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   911
    if(this.currentMode != 'VIDEO')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   912
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   913
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   914
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   915
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   916
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   917
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   918
    //On spécifie la notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   919
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   920
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   921
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   922
    $('body').append(notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   923
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   924
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   925
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   926
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   927
    var unzoom_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   928
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   929
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   930
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   931
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   932
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   933
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   934
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   935
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   936
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   937
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   938
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   939
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   940
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   941
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   942
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   943
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   944
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   945
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   946
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   947
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   948
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   949
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   950
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   951
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   952
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   953
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   954
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   955
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   956
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   957
 * Affichage de la notification de timeline dans une vidéo/recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   958
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   959
 * pointers > fonction pointersTimelineSelection.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   960
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   961
Mosaic.prototype.timelineTimeline = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   962
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   963
    //Si on n'est pas en mode timeline, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   964
    if(this.currentMode != 'TIMELINE')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   965
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   966
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   967
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   968
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   969
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   970
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   971
    //On spécifie la notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   972
    var notification_timeline = "<div id='notify_timeline' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   973
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   974
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   975
    $('body').append(notification_timeline);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   976
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   977
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   978
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   979
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   980
    var timeline_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   981
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   982
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   983
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   984
	this.putText($('#notify_timeline'), this.notificationStrings.timeline);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   985
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   986
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   987
    $('#notify_timeline').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   988
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   989
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   990
        left: -notifyLeft + timeline_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   991
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   992
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   993
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   994
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   995
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   996
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   997
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   998
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   999
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1000
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1001
 * Affichage de la notification de recherche dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1002
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1003
 * neighbours > fonction deselectNeighbour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1004
 * pointers > fonction launchIdlePointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1005
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1006
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1007
Mosaic.prototype.searchSearch = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1008
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1009
    //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
  1010
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1011
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1012
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1013
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1014
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1015
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1016
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1017
    //On spécifie la notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1018
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1019
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1020
    //On l'ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1021
    $('body').append(notification_search);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1022
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1023
    //On calcule ses coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1024
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1025
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1026
    var search_left = $(window).width() / 2 - notify_width / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1027
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1028
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1029
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1030
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1031
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1032
    //On la positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1033
    $('#notify_search').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 + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1037
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1038
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1039
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1040
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1041
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1042
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1043
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1044
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1045
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1046
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1047
 * Affichage de la notification de recherche & de swipe dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1048
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1049
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1050
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1051
Mosaic.prototype.searchSearchAndSwipe = function(direction)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1052
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1053
    //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
  1054
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture || !this.isSwipe)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1055
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1056
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1057
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1058
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1059
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1060
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1061
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1062
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1063
    var notification_swipe = "<div id='notify_swipe' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1064
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1065
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1066
    $('body').append(notification_search + notification_swipe);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1067
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1068
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1069
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1070
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1071
    var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1072
    var swipe_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1073
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1074
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1075
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1076
	this.putText($('#notify_search'), this.notificationStrings.search);
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1077
	if(direction == "left")
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1078
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1079
		this.putText($('#notify_swipe'), this.notificationStrings.next);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1080
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1081
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1082
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1083
		this.putText($('#notify_swipe'), this.notificationStrings.previous);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1084
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1085
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1086
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1087
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1088
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1089
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1090
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1091
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1092
    $('#notify_swipe').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1093
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1094
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1095
        left: -notifyLeft + swipe_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1096
        'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1097
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1098
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1099
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1100
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1101
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1102
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1103
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1104
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1105
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1106
/*
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1107
 * Affichage de la notification de recherche, de move vers un voisin.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1108
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1109
 * neighbours > fonction selectNeighbour.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1110
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1111
Mosaic.prototype.searchSearchAndMove = function(targetId)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1112
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1113
    //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
  1114
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1115
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1116
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1117
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1118
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1119
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1120
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1121
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1122
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1123
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1124
    $('body').append(notification_search + notification_move);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1125
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1126
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1127
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1128
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1129
    var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1130
    var move_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1131
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1132
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1133
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1134
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1135
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1136
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1137
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1138
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1139
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1140
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1141
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1142
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1143
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1144
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1145
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1146
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1147
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1148
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1149
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1150
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1151
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1152
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1153
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1154
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1155
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1156
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1157
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1158
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1159
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1160
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1161
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1162
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1163
    });
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1164
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1165
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1166
/*
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1167
 * 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
  1168
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1169
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1170
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1171
Mosaic.prototype.searchSearchAndMoveAndUnzoom = function(targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1172
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1173
    //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
  1174
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1175
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1176
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1177
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1178
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1179
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1180
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1181
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1182
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1183
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1184
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1185
    $('body').append(notification_search + notification_move + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1186
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1187
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1188
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1189
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1190
    var search_left = $(window).width() / 2 - (notify_width * 3 + notify_margin * 4) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1191
    var move_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1192
    var unzoom_left = move_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1193
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1194
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1195
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1196
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1197
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1198
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1199
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1200
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1201
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1202
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1203
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1204
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1205
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1206
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1207
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1208
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1209
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1210
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1211
    $('#notify_search').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1212
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1213
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1214
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1215
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1216
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1217
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1218
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1219
        left: -notifyLeft + move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1220
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1221
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1222
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1223
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1224
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1225
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1226
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1227
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1228
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1229
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1230
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1231
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1232
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1233
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1234
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1235
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1236
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1237
 * Affichage de la notification de recherche & de dézoom dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1238
 * Est appelé dans le fichier :
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1239
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1240
Mosaic.prototype.searchSearchAndUnzoom = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1241
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1242
    //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
  1243
    if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1244
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1245
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1246
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1247
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1248
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1249
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1250
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1251
    var notification_search = "<div id='notify_search' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1252
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1253
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1254
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1255
    $('body').append(notification_search + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1256
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1257
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1258
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1259
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1260
    var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1261
    var unzoom_left = search_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1262
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1263
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1264
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1265
    if(side == -1)
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
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1271
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1272
    var notifyTop = 0, notifyLeft = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1273
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1274
	this.putText($('#notify_search'), this.notificationStrings.search);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1275
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1276
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1277
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1278
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1279
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1280
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1281
        left: -notifyLeft + search_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1282
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1283
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1284
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1285
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1286
        top: -notifyTop,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1287
        left: -notifyLeft + unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1288
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1289
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1290
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1291
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1292
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1293
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1294
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1295
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1296
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1297
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1298
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1299
 * Affichage de la notification de résultat dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1300
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1301
 * neighbours > fonctions deselectNeighbour et moveToNeighbour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1302
 * playerControl > fonction exitTimeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1303
 * zoomInteractions > fonction zoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1304
 * mosaic > fonctions onMouseUp et manageControlEvents.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1305
 * curvesDetector > fonction updateDists.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1306
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1307
Mosaic.prototype.searchGesture = function(gestureName, mode)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1308
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1309
    //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
  1310
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1311
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1312
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1313
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1314
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1315
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1316
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1317
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1318
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1319
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1320
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1321
    $('body').append(notification_search_1gesture);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1322
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1323
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1324
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1325
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1326
    var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1327
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1328
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1329
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1330
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1331
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1332
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1333
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1334
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1335
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1336
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1337
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1338
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1339
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1340
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1341
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1342
        top: 0,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1343
        left: ($(window).width() - notify_width) / 2
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1344
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1345
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1346
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1347
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1348
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1349
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1350
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1351
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1352
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1353
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1354
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1355
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1356
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1357
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1358
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1359
 * Affichage de la notification de résultat & de swipe dans une vidéo de recherche.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1360
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1361
 * mosaic > fonction manageControlEvents.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1362
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1363
Mosaic.prototype.searchGestureAndSwipe = function(gestureName, mode, direction)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1364
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1365
    //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
  1366
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '' || !this.isSwipe)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1367
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1368
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1369
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1370
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1371
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1372
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1373
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1374
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1375
    var notification_swipe = "<div id='notify_swipe' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1376
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1377
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1378
    $('body').append(notification_search_1gesture + notification_swipe);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1379
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1380
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1381
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1382
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1383
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1384
    var swipe_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1385
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1386
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1387
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1388
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1389
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1390
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1391
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1392
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1393
    }
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1394
	
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1395
	if(direction == "left")
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1396
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1397
		this.putText($('#notify_swipe'), this.notificationStrings.next);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1398
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1399
	else
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1400
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1401
		this.putText($('#notify_swipe'), this.notificationStrings.previous);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1402
	}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1403
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1404
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1405
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1406
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1407
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1408
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1409
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1410
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1411
    $('#notify_swipe').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1412
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1413
        left: swipe_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1414
        'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1415
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1416
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1417
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1418
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1419
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1420
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1421
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1422
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1423
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1424
/*
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1425
 * Affichage de la notification de résultat, de move vers un voisin.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1426
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1427
 * neighbours > fonction selectNeighbour.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1428
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1429
Mosaic.prototype.searchGestureAndMove = function(gestureName, mode, targetId)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1430
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1431
    //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
  1432
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1433
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1434
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1435
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1436
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1437
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1438
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1439
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1440
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1441
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1442
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1443
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1444
    $('body').append(notification_search_1gesture + notification_move);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1445
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1446
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1447
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1448
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1449
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1450
    var move_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1451
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1452
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1453
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1454
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1455
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1456
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1457
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1458
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1459
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1460
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1461
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1462
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1463
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1464
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1465
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1466
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1467
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1468
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1469
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1470
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1471
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1472
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1473
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1474
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1475
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1476
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1477
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1478
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1479
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1480
        left: move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1481
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1482
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1483
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1484
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1485
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1486
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1487
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1488
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1489
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1490
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1491
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1492
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1493
	}
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1494
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1495
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1496
/*
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1497
 * 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
  1498
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1499
 * neighbours > fonction selectNeighbour.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1500
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1501
Mosaic.prototype.searchGestureAndMoveAndUnzoom = function(gestureName, mode, targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1502
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1503
    //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
  1504
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1505
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1506
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1507
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1508
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1509
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1510
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1511
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1512
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1513
    var notification_move = "<div id='notify_move' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1514
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1515
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1516
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1517
    $('body').append(notification_search_1gesture + notification_move + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1518
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1519
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1520
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1521
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1522
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 3 + notify_margin * 4) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1523
    var move_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1524
    var unzoom_left = move_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1525
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1526
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1527
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1528
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1529
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1530
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1531
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1532
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1533
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1534
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1535
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1536
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1537
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1538
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1539
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1540
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1541
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1542
    var sides = ['left', 'right', 'up', 'down'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1543
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1544
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1545
	this.putText($('#notify_move'), this.notificationStrings.move);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1546
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1547
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1548
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1549
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1550
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1551
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1552
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1553
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1554
    $('#notify_move').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1555
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1556
        left: move_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1557
        'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1558
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1559
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1560
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1561
        left: unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1562
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1563
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1564
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1565
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1566
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1567
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1568
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1569
    });
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1570
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1571
	if(this.isTablet)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1572
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1573
		this.searchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1574
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1575
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1576
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1577
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1578
 * 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
  1579
 * Est appelé dans le fichier :
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1580
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1581
Mosaic.prototype.searchGestureAndUnzoom = function(gestureName, mode, targetId)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1582
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1583
    //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
  1584
    if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1585
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1586
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1587
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1588
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1589
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1590
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1591
    //On spécifie les notifications en div.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1592
    var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1593
    var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1594
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1595
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1596
    $('body').append(notification_search_1gesture + notification_unzoom);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1597
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1598
    //On calcule leurs coordonnées et dimensions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1599
    var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1600
    var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1601
    var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1602
    var unzoom_left = search_1gesture_left + notify_width + notify_margin;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1603
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1604
    if(_.include(this.gestures, gestureName))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1605
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1606
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1607
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1608
    else if(mode == 'none')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1609
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1610
        $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1611
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1612
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1613
    var side = $.inArray(parseInt(targetId), this.neighboursIds);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1614
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1615
    if(side == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1616
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1617
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1618
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1619
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1620
    var unzooms = ['horizontal', 'vertical'];
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1621
    
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1622
	this.putText($('#notify_unzoom'), this.notificationStrings.unzoom);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1623
	this.putText($('#notify_search_1gesture'), this.notificationStrings[gestureName]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1624
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1625
    //On les positionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1626
    $('#notify_search_1gesture').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1627
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1628
        left: search_1gesture_left
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1629
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1630
    $('#notify_unzoom').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1631
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1632
        left: unzoom_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1633
        'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1634
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1635
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1636
    //On les fait apparaître.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1637
    $('.notifications').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1638
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1639
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1640
    });
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1641
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1642
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1643
/*
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1644
 * Affichage des notifications de gestures trouvées dans une recherche par courbes.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1645
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1646
 * curvesDetector > fonction updateDists.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1647
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1648
Mosaic.prototype.curvesGestures = function(gestures)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
  1649
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1650
    //S'il n'y a pas de gestures à afficher.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1651
    if(gestures.length == 0)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1652
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1653
        //On ajoute une seule notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1654
        var notification_curves = "<div class='notifications' id='notify_curves'></div>";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1655
        $('body').append(notification_curves);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1656
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1657
        //On calcule leurs dimensions et coordonnées.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1658
        var notify_width = $('.notifications').width(), notify_height = $('.notifications').height();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1659
        var notify_margin = parseInt($('.notifications').css('margin-left'));
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1660
        var curves_left = $(window).width() / 2 - (notify_width + notify_margin * 2) / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1661
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1662
        $('#notify_curves').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1663
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1664
            left: curves_left,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1665
            'background-image': 'url("./pictos/big/normal/inconnu.png")',
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1666
            opacity: '0.9'
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1667
        });
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1668
		
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1669
		this.putText($('#notify_curves'), this.notificationStrings["unknown"]);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1670
		
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1671
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1672
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1673
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1674
    //Sinon, on les met dans un tableau.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1675
    var gestures_tab = gestures.split(';');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1676
    
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1677
    var notifications_curves_gestures = "<div id='notify_curves_container'>";
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1678
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1679
    //On crée autant de notifications qu'il y a de gestures.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1680
    for(var i = 0 ; i < gestures_tab.length ; i++)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1681
    {
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1682
        notifications_curves_gestures += "<div class='notification_curves' id='notify_curves_" + gestures_tab[i] + "'></div>";
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1683
    }
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1684
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1685
	notifications_curves_gestures += "</div>";
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1686
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1687
    //On les ajoute à la mosaïque.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1688
    $('body').append(notifications_curves_gestures);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1689
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1690
    //On calcule leurs dimensions.
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1691
    var notify_width = $('.notification_curves').width(), notify_height = $('.notification_curves').height();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1692
    var notify_margin = parseInt($('.notification_curves').css('margin-left'));
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1693
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1694
	//Nombre de notifications dans une ligne.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1695
	var notify_in_a_row = Math.floor($(window).width() / (+notify_width + 2 * notify_margin));
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1696
	//Notifications sur la première ligne.
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1697
	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
  1698
	//Espace libre restant sur la ligne.
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1699
	var free_space = $(window).width() - notify_in_first_row * (+notify_width + 2 * notify_margin);
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1700
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1701
	//On met à jour le container.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1702
	$('#notify_curves_container').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1703
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1704
		height: Math.ceil(gestures_tab.length * (+notify_width + 2 * notify_margin) / $(window).width()),
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1705
		'margin-left': free_space / 2,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1706
		'margin-right': free_space / 2
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1707
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1708
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1709
    //On calcule leurs dimensions et leur backgrounds.
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1710
	for(var i = 0 ; i < gestures_tab.length ; i++)
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1711
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1712
        //On va chercher leurs backgrounds.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1713
        $('#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
  1714
        
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1715
		this.putText($('#notify_curves_' + gestures_tab[i]), this.notificationStrings[gestures_tab[i]]);
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1716
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1717
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1718
    //On les fait apparaître.
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1719
    $('.notification_curves').css(
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1720
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1721
        opacity: "0.9"
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1722
    });
47
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1723
}
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1724
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1725
/*
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1726
 * Efface les notifications. Précède chaque notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1727
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1728
 * neighbours > fonctions listenToNeighbours, selectNeighbour, deselectNeighbour et moveToNeighbour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1729
 * notifications > fonction notifyHelp.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1730
 * playerControl > fonction exitTimeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1731
 * pointers > fonctions pointersTimelineSelection, launchIdlePointers et removeSearchNotificationIfOnIt.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1732
 * search > fonction removeFilter.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1733
 * zoomInteractions > fonctions preZoom, preUnzoom, zoom et unzoom.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1734
 * mosaic > fonctions onMouseUp, showNImages et manageControlEvents.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1735
 * curvesDetector > fonction updateDists.
47
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1736
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1737
Mosaic.prototype.removeNotifications = function()
47
4e1ee94d70b1 Front IDILL:
bastiena
parents: 46
diff changeset
  1738
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
  1739
    $('.notifications').remove();
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1740
    $('#notify_curves_container').remove();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1741
    $('.notification_curves').remove();
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1742
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1743
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1744
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1745
 * Place un texte sur la notification.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1746
 * Est appelé dans chaque fonction servant à notifier dans le fichier de notification.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1747
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1748
Mosaic.prototype.putText = function(notification, text)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1749
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1750
	notification.html(text);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1751
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1752
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1753
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1754
 * Affiche l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1755
 * Est appelé dans les fichiers :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1756
 * mosaic > fonction loadMosaic.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1757
 * zoomInteractions > fonctions zoom et unzoom.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1758
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1759
Mosaic.prototype.helpIcon = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1760
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1761
	this.removeHelpIcon();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1762
	//On construit le div.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1763
	var helpIcon = "<img id='helpIcon' src='./img/helpIcon.png' />";
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1764
	//On l'ajoute.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1765
	$('body').append(helpIcon);
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1766
	//On spécifie ses coordonnées.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1767
	$('#helpIcon').css(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1768
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1769
		top: 0,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1770
		left: $(window).width() - $('#helpIcon').width() - 2 * parseInt($('#helpIcon').css('margin-left'))
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1771
	});
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1772
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1773
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1774
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1775
 * Supprime l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1776
 * Est appelé dans les fichiers :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1777
 * zoomInteractions > fonctions zoom et unzoom.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1778
 * notifications > fonction helpIcon.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1779
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1780
Mosaic.prototype.removeHelpIcon = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1781
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1782
	this.isHelpIconZooming = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1783
	this.isHelpIconZoomed = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1784
	$('#helpIcon').remove();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1785
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1786
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1787
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1788
 * Agrandit l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1789
 * Est appelé dans le fichier :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1790
 * mosaic > fonction onMouseMove.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1791
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1792
Mosaic.prototype.showBigHelp = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1793
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1794
	//Si on a déjà zoomé on quitte.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1795
	if(this.isHelpIconZoomed || this.isHelpIconZooming)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1796
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1797
		return;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1798
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1799
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1800
	this.isHelpIconZooming = true;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1801
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1802
	var _this = this;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1803
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1804
	$('#helpIcon').animate(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1805
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1806
		width: 100,
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1807
		height: 100,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1808
		left: $(window).width() - 100 - 2 * parseInt($('#helpIcon').css('margin-left'))
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1809
	}, this.config.timeShowBigHelp, function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1810
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1811
		_this.isHelpIconZoomed = true;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1812
		_this.isHelpIconZooming = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1813
	});
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1814
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1815
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1816
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1817
 * Rétrecit l'icone d'aide.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1818
 * Est appelé dans le fichier :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1819
 * mosaic > fonction onMouseMove.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1820
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1821
Mosaic.prototype.showSmallHelp = function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1822
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1823
	//Si on n'a pas zoomé on quitte.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1824
	if(!this.isHelpIconZoomed || this.isHelpIconZooming)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1825
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1826
		return;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1827
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1828
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1829
	this.isHelpIconZooming = true;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1830
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1831
	var _this = this;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1832
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1833
	var helpIconWidth = $('#helpIcon').width();
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1834
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1835
	$('#helpIcon').animate(
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1836
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1837
		width: 50,
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1838
		height: 50,
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1839
		left: $(window).width() - 50 - 2 * parseInt($('#helpIcon').css('margin-left'))
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1840
	}, this.config.timeShowBigHelp, function()
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1841
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1842
		_this.isHelpIconZoomed = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1843
		_this.isHelpIconZooming = false;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1844
	});
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1845
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1846
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1847
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1848
 * Affiche l'icone de sortie pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1849
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1850
Mosaic.prototype.exitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1851
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1852
	this.removeExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1853
	//On construit le div.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1854
	var exitIcon = "<img id='exitIcon' src='./img/exitIcon.png' />";
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1855
	//On l'ajoute.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1856
	$('body').append(exitIcon);
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1857
	//On spécifie ses coordonnées.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1858
	$('#exitIcon').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1859
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1860
		top: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1861
		left: $(window).width() - $('#exitIcon').width() - 2 * parseInt($('#exitIcon').css('margin-left')),
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1862
		'z-index': 1000
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1863
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1864
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1865
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1866
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1867
 * Supprime l'icone de sortie pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1868
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1869
Mosaic.prototype.removeExitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1870
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1871
	$('#exitIcon').remove();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1872
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1873
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1874
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1875
 * Affiche l'icone de retour à la mosaïque pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1876
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1877
Mosaic.prototype.homeIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1878
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1879
	this.removeHomeIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1880
	//On construit le div.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1881
	var homeIcon = "<img id='homeIcon' src='./img/homeIcon.png' />";
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1882
	//On l'ajoute.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1883
	$('body').append(homeIcon);
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1884
	//On spécifie ses coordonnées.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1885
	$('#homeIcon').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1886
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1887
		top: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1888
		left: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1889
		'z-index': 900
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1890
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1891
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1892
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1893
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1894
 * Supprime l'icone de sortie pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1895
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1896
Mosaic.prototype.removeHomeIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1897
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1898
	$('#homeIcon').remove();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1899
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1900
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1901
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1902
 * Affiche l'icone de sortie de recherche pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1903
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1904
Mosaic.prototype.searchExitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1905
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1906
	//S'il n'y a pas de notification de recherche, on s'en va.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1907
	if($('#notify_search_1gesture').length == 0)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1908
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1909
		return;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1910
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1911
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1912
	this.removeSearchExitIcon();
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1913
	//On construit le div.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1914
	var searchExitIcon = "<img id='searchExitIcon' src='./img/exitIcon.png' />";
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1915
	//On l'ajoute.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1916
	$('body').append(searchExitIcon);
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1917
	//On spécifie ses coordonnées.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1918
	$('#searchExitIcon').css(
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1919
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1920
		top: 0,
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1921
		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
  1922
		'z-index': 900
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1923
	});
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1924
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1925
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1926
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1927
 * Supprime l'icone de sortie de recherche pour tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1928
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1929
Mosaic.prototype.removeSearchExitIcon = function()
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1930
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1931
	$('#searchExitIcon').remove();
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1932
}