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