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