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