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