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