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