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