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