|
44
|
1 |
/* =============================================== |
|
|
2 |
* * |
|
|
3 |
* ZONE DES NOTIFICATIONS * |
|
|
4 |
* * |
|
|
5 |
=============================================== */ |
|
|
6 |
|
|
|
7 |
/* |
|
|
8 |
* Affiche l'aide. |
|
|
9 |
*/ |
|
|
10 |
mosaic.prototype.notifyHelp = function(inMosaic) |
|
|
11 |
{ |
|
|
12 |
if(this.helpDisplayed) |
|
|
13 |
{ |
|
|
14 |
return; |
|
|
15 |
} |
|
|
16 |
|
|
47
|
17 |
console.log('HELP DISPLAYED'); |
|
|
18 |
|
|
|
19 |
this.removeNotifications(); |
|
44
|
20 |
|
|
|
21 |
this.helpDisplayed = true; |
|
|
22 |
|
|
47
|
23 |
var search_2hands_tab; |
|
|
24 |
var search_2hands_tab_opacities; |
|
|
25 |
var search_body_tab; |
|
|
26 |
var search_body_tab_opacities; |
|
|
27 |
var controls_1hand_tab; |
|
44
|
28 |
var controls_1hand_tab; |
|
47
|
29 |
var controls_1hand_tab_opacities; |
|
44
|
30 |
var controls_1hand_tab_opacities; |
|
47
|
31 |
|
|
|
32 |
var img_directory = './pictos/help/'; |
|
|
33 |
|
|
|
34 |
if(this.mouseInteractions) |
|
|
35 |
{ |
|
|
36 |
search_2hands_tab = ['arret', 'contact', 'grandjete', 'group_spin', 'port_de_bras', 'spin', 'up_down', 'wave', 'chute', 'knee_up', 'jump', 'bend']; |
|
|
37 |
search_2hands_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
|
|
38 |
} |
|
|
39 |
else |
|
|
40 |
{ |
|
|
41 |
search_2hands_tab = ['arret', 'contact', 'grandjete', 'group_spin', 'port_de_bras', 'spin', 'up_down', 'wave']; |
|
|
42 |
search_body_tab = ['chute', 'knee_up', 'jump', 'bend']; |
|
|
43 |
search_2hands_tab_opacities = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]; |
|
|
44 |
search_body_tab_opacities = [1, 1, 1, 1]; |
|
|
45 |
} |
|
44
|
46 |
|
|
|
47 |
if(inMosaic) |
|
|
48 |
{ |
|
|
49 |
controls_1hand_tab = ['selection']; |
|
|
50 |
controls_1hand_tab_opacities = [1]; |
|
|
51 |
} |
|
|
52 |
else |
|
|
53 |
{ |
|
47
|
54 |
controls_1hand_tab = ['deplacer', 'precedent', 'suivant', 'mosaique_horizontal', 'mosaique_vertical', 'move_down', 'move_up', 'move_right', 'move_left']; |
|
|
55 |
controls_1hand_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1, 1]; |
|
44
|
56 |
} |
|
|
57 |
|
|
|
58 |
//On spécifie les notifications en div. |
|
|
59 |
var search_title = "<div id='search_title'></div>"; |
|
|
60 |
var search_img = "<div id='search_img' class='notify_imgs'></div>"; |
|
|
61 |
var search_2hands_text = "<div id='search_2hands_text'></div>"; |
|
|
62 |
var search_2hands_imgs = "<div id='search_2hands_imgs' class='notify_imgs_big'>"; |
|
|
63 |
|
|
|
64 |
for(var i = 0 ; i < search_2hands_tab.length ; i++) |
|
|
65 |
{ |
|
|
66 |
search_2hands_imgs += "<div id='2hands_" + search_2hands_tab[i] + "' class='notify_imgs_small' style='opacity: " + search_2hands_tab_opacities[i] + ";'></div>"; |
|
|
67 |
} |
|
|
68 |
search_2hands_imgs += "</div>"; |
|
|
69 |
|
|
47
|
70 |
var search_body_text; |
|
|
71 |
var search_body_imgs; |
|
44
|
72 |
|
|
47
|
73 |
if(!this.mouseInteractions) |
|
44
|
74 |
{ |
|
47
|
75 |
search_body_text = "<div id='search_body_text'></div>"; |
|
|
76 |
search_body_imgs = "<div id='search_body_imgs' class='notify_imgs'>" |
|
|
77 |
|
|
|
78 |
for(var i = 0 ; i < search_body_tab.length ; i++) |
|
|
79 |
{ |
|
|
80 |
search_body_imgs += "<div id='body_" + search_body_tab[i] + "' class='notify_imgs_small' style='opacity: " + search_body_tab_opacities[i] + ";'></div>"; |
|
|
81 |
} |
|
|
82 |
search_body_imgs += "</div>"; |
|
44
|
83 |
} |
|
|
84 |
|
|
|
85 |
var controls_title = "<div id='controls_title'></div>"; |
|
|
86 |
var controls_img = "<div id='controls_img' class='notify_imgs'></div>"; |
|
|
87 |
var controls_1hand_text = "<div id='controls_1hand_text'></div>"; |
|
|
88 |
var controls_1hand_imgs; |
|
47
|
89 |
var controls_1hand_imgs; |
|
44
|
90 |
|
|
47
|
91 |
controls_1hand_imgs = "<div id='controls_1hand_imgs' class='notify_imgs'>"; |
|
|
92 |
for(var i = 0 ; i < controls_1hand_tab.length ; i++) |
|
44
|
93 |
{ |
|
47
|
94 |
controls_1hand_imgs += "<div id='1hand_" + controls_1hand_tab[i] + "' class='notify_imgs_small' style='opacity: " + controls_1hand_tab_opacities[i] + ";'></div>"; |
|
|
95 |
} |
|
|
96 |
controls_1hand_imgs += "</div>"; |
|
|
97 |
|
|
|
98 |
var help_search; |
|
|
99 |
|
|
|
100 |
if(this.mouseInteractions) |
|
|
101 |
{ |
|
|
102 |
help_search = "<div id='help_search'>" + search_title + search_img + search_2hands_text + search_2hands_imgs + "</div>"; |
|
44
|
103 |
} |
|
|
104 |
else |
|
|
105 |
{ |
|
47
|
106 |
help_search = "<div id='help_search'>" + search_title + search_img + search_2hands_text + search_2hands_imgs + search_body_text + search_body_imgs + "</div>"; |
|
44
|
107 |
} |
|
|
108 |
var help_controls; |
|
|
109 |
|
|
47
|
110 |
help_controls = "<div id='help_controls'>" + controls_title + controls_img + controls_1hand_text + controls_1hand_imgs + "</div>"; |
|
44
|
111 |
|
|
|
112 |
var notification_help = "<div id='notify_help'>" + help_search + "<div id='help_sep'></div>" + help_controls + "</div>"; |
|
|
113 |
|
|
|
114 |
//On les ajoute à la mosaïque. |
|
|
115 |
$('body').append(notification_help); |
|
|
116 |
|
|
|
117 |
//On calcule leurs coordonnées et dimensions. |
|
|
118 |
var notify_width = $(window).width(), notify_height = $(window).height(); |
|
|
119 |
var notify_margin = parseInt($('#notify_help').css('margin')); |
|
|
120 |
var notify_ = 10; |
|
|
121 |
|
|
|
122 |
//On les positionne. |
|
|
123 |
$('#notify_help').css( |
|
|
124 |
{ |
|
|
125 |
left: "0px", |
|
|
126 |
top: "0px", |
|
|
127 |
width: notify_width - notify_margin * 2, |
|
|
128 |
height: notify_height - notify_margin * 2, |
|
|
129 |
'z-index': 2000 |
|
|
130 |
}); |
|
|
131 |
|
|
|
132 |
// console.log(($('#help_search').width() - ($('.notify_imgs_small').width() * 5 + parseInt($('.notify_imgs_small').css('margin')))) / 2); |
|
|
133 |
|
|
47
|
134 |
var margins = parseInt($('.notify_imgs_small').css('margin')); |
|
|
135 |
var widths = $('.notify_imgs_small').width(); |
|
|
136 |
var heights = $('.notify_imgs_small').height(); |
|
|
137 |
|
|
|
138 |
var sep_left = $('#help_sep').position().left; |
|
|
139 |
var help_margin = parseInt($('#notify_help').css('margin')); |
|
|
140 |
|
|
|
141 |
//On calcule la taille d'une zone de recherche (une des deux parties). |
|
|
142 |
var help_column_width = sep_left - help_margin; |
|
|
143 |
//Longueur d'une image. |
|
|
144 |
var img_width = (margins * 2 + widths); |
|
|
145 |
//Longueur totale des images de recherche à deux mains mises bout à bout. |
|
|
146 |
// var search_2hands_total_width = search_2hands_tab.length * img_width; |
|
|
147 |
|
|
|
148 |
//On récupère le nombre d'images affichables horizontalement pour les gestures de recherche à deux mains dans une des parties de l'aide. |
|
|
149 |
var search_2hands_n_imgs = Math.floor(help_column_width / img_width); |
|
|
150 |
//Calcul du padding-left de cette section. |
|
|
151 |
var search_2hands_padding_left = (help_column_width - search_2hands_n_imgs * img_width) / 2; |
|
|
152 |
|
|
44
|
153 |
$('#search_2hands_imgs').css( |
|
|
154 |
{ |
|
47
|
155 |
// 'padding-left': ($('#help_search').width() - ($('.notify_imgs_small').width() * 5 + parseInt($('.notify_imgs_small').css('margin')))) / 2, |
|
|
156 |
'padding-left': search_2hands_padding_left, |
|
44
|
157 |
'height': ($('.notify_imgs_small').height() * 2 + parseInt($('.notify_imgs_small').css('margin'))) |
|
|
158 |
}); |
|
|
159 |
|
|
47
|
160 |
//On récupère le nombre d'images affichables horizontalement pour les gestures de recherche corporelles dans une des parties de l'aide. |
|
|
161 |
var search_body_n_imgs = Math.floor(help_column_width / img_width); |
|
|
162 |
//Calcul du padding-left de cette section. |
|
|
163 |
var search_body_padding_left = (help_column_width - search_body_n_imgs * img_width) / 2; |
|
|
164 |
|
|
|
165 |
$('#search_body_imgs').css( |
|
44
|
166 |
{ |
|
47
|
167 |
// 'padding-left': ($('#help_search').width() - ($('.notify_imgs_small').width() * 4 + parseInt($('.notify_imgs_small').css('margin')))) / 2, |
|
|
168 |
'padding-left': search_body_padding_left, |
|
|
169 |
'height': ($('.notify_imgs_small').height() * 2 + parseInt($('.notify_imgs_small').css('margin'))) |
|
|
170 |
}); |
|
|
171 |
|
|
|
172 |
//On récupère le nombre d'images affichables horizontalement pour les gestures de controle dans une des parties de l'aide. |
|
|
173 |
var controls_1hand_n_imgs = Math.floor(help_column_width / img_width); |
|
|
174 |
//Calcul du padding-left de cette section. |
|
|
175 |
var controls_1hand_padding_left = (help_column_width - controls_1hand_n_imgs * img_width) / 2; |
|
|
176 |
|
|
|
177 |
$('#controls_1hand_imgs').css( |
|
|
178 |
{ |
|
|
179 |
// 'padding-left': ($('#help_controls').width() - ($('.notify_imgs_small').width())) / 2, |
|
|
180 |
'padding-left': controls_1hand_padding_left, |
|
|
181 |
'height': ($('.notify_imgs_small').height()) |
|
|
182 |
}); |
|
44
|
183 |
|
|
|
184 |
var search_width = $('#help_search').width(); |
|
|
185 |
|
|
|
186 |
$('#search_title').html('Recherche'); |
|
47
|
187 |
|
|
|
188 |
if(this.mouseInteractions) |
|
|
189 |
{ |
|
|
190 |
$('#search_2hands_text').html('Courbes à effectuer avec la souris'); |
|
|
191 |
} |
|
|
192 |
else |
|
|
193 |
{ |
|
|
194 |
$('#search_2hands_text').html('Gestes à effectuer avec les deux mains'); |
|
|
195 |
} |
|
44
|
196 |
|
|
|
197 |
for(var i = 0 ; i < search_2hands_tab.length ; i++) |
|
|
198 |
{ |
|
47
|
199 |
$("#2hands_" + search_2hands_tab[i]).css("background-image", "url('" + img_directory + 'MI/' + search_2hands_tab[i] + ".png')"); |
|
44
|
200 |
//console.log("url('../../pictos/help/" + search_2hands_tab[i] + ".png')"); |
|
|
201 |
} |
|
|
202 |
|
|
47
|
203 |
if(!this.mouseInteractions) |
|
44
|
204 |
{ |
|
47
|
205 |
$('#search_body_text').html('Gestes à effectuer avec le corps entier'); |
|
|
206 |
|
|
|
207 |
for(var i = 0 ; i < search_body_tab.length ; i++) |
|
|
208 |
{ |
|
|
209 |
$("#body_" + search_body_tab[i]).css("background-image", "url('" + img_directory + search_body_tab[i] + ".png')"); |
|
|
210 |
//console.log("url('../../pictos/help/" + search_2hands_tab[i] + ".png')"); |
|
|
211 |
} |
|
44
|
212 |
} |
|
|
213 |
|
|
|
214 |
$('#controls_title').html('Contrôles'); |
|
|
215 |
$('#controls_1hand_text').html('Gestes à effectuer avec une seule main'); |
|
|
216 |
|
|
47
|
217 |
for(var i = 0 ; i < controls_1hand_tab.length ; i++) |
|
44
|
218 |
{ |
|
47
|
219 |
$("#1hand_" + controls_1hand_tab[i]).css("background-image", "url('" + img_directory + controls_1hand_tab[i] + ".png')"); |
|
44
|
220 |
} |
|
|
221 |
|
|
|
222 |
//On les fait apparaître. |
|
|
223 |
$('#notify_help').css( |
|
|
224 |
{ |
|
|
225 |
opacity: "1" |
|
|
226 |
}); |
|
|
227 |
|
|
|
228 |
$('.notify_imgs_big').css( |
|
|
229 |
{ |
|
|
230 |
opacity: "1" |
|
|
231 |
}); |
|
|
232 |
} |
|
|
233 |
|
|
|
234 |
/* |
|
|
235 |
* Supprime l'aide. |
|
|
236 |
*/ |
|
|
237 |
mosaic.prototype.removeHelp = function() |
|
|
238 |
{ |
|
|
239 |
if(!this.helpDisplayed) |
|
|
240 |
{ |
|
|
241 |
return; |
|
|
242 |
} |
|
|
243 |
|
|
|
244 |
var _this = this; |
|
|
245 |
|
|
|
246 |
$('#notify_help').fadeOut(this.timeNotifyFade, function() |
|
|
247 |
{ |
|
|
248 |
_this.helpDisplayed = false; |
|
|
249 |
// _this.canNotifyHelp = false; |
|
|
250 |
_this.canNotifyHelp = true; |
|
|
251 |
console.log('CAN NOT NOTIFY HELP'); |
|
|
252 |
$('#notify_help').remove(); |
|
|
253 |
}); |
|
|
254 |
} |
|
|
255 |
|
|
|
256 |
/* |
|
|
257 |
* Affiche la notification de validation/survol de gesture de filtrage. |
|
|
258 |
* Mode prend pour valeurs : "valid" ou "hover". |
|
|
259 |
*/ |
|
|
260 |
mosaic.prototype.notifySearch1Gesture = function(gestureName, mode) |
|
|
261 |
{ |
|
|
262 |
// console.log('C'); |
|
|
263 |
if($('#notify_search_1gesture').length > 0) |
|
|
264 |
{ |
|
|
265 |
$('#notify_search_1gesture').remove(); |
|
|
266 |
} |
|
|
267 |
|
|
|
268 |
//Si on a effectué une demande de recherche auparavant, on supprime la notification de demande de recherche. |
|
|
269 |
if($('#notify_search').length > 0) |
|
|
270 |
{ |
|
47
|
271 |
this.removeNotifications(); |
|
44
|
272 |
} |
|
|
273 |
|
|
|
274 |
var _this = this; |
|
|
275 |
|
|
|
276 |
//On spécifie les notifications en div. |
|
|
277 |
var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>"; |
|
|
278 |
|
|
|
279 |
//On les ajoute à la mosaïque. |
|
|
280 |
$('body').append(notification_search_1gesture); |
|
|
281 |
|
|
|
282 |
// console.log(this.player.config.gui.zoomTop + " " + this.player.config.gui.zoomLeft); |
|
|
283 |
|
|
|
284 |
//On calcule leurs coordonnées et dimensions. |
|
|
285 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
286 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
287 |
var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; |
|
|
288 |
|
|
|
289 |
if(_.include(this.gestures, gestureName)) |
|
|
290 |
{ |
|
|
291 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + mode + '/' + gestureName + '.png")'); |
|
|
292 |
} |
|
|
293 |
else if(mode == 'none') |
|
|
294 |
{ |
|
|
295 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")'); |
|
|
296 |
} |
|
|
297 |
|
|
|
298 |
//On les positionne. |
|
|
299 |
$('#notify_search_1gesture').css( |
|
|
300 |
{ |
|
|
301 |
top: 0, |
|
|
302 |
left: ($(window).width() - notify_width) / 2 |
|
|
303 |
}); |
|
|
304 |
|
|
|
305 |
//On les fait apparaître. |
|
|
306 |
$('.notifications').css( |
|
|
307 |
{ |
|
|
308 |
opacity: "0.9" |
|
|
309 |
}); |
|
|
310 |
} |
|
|
311 |
|
|
|
312 |
// /!\/!\/!\ // |
|
|
313 |
|
|
|
314 |
/* NOUVELLES NOTIFICATIONS */ |
|
|
315 |
|
|
|
316 |
// /!\/!\/!\ // |
|
|
317 |
|
|
|
318 |
/* |
|
|
319 |
* Affichage de la notification de sélection & recherche dans la mosaïque. |
|
|
320 |
*/ |
|
|
321 |
mosaic.prototype.mosaicSelectionAndSearch = function() |
|
|
322 |
{ |
|
|
323 |
if(this.currentMode != 'MOSAIC') |
|
|
324 |
{ |
|
|
325 |
return; |
|
|
326 |
} |
|
|
327 |
|
|
|
328 |
//On spécifie les notifications en div. |
|
|
329 |
var notification_selection = "<div id='notify_selection' class='notifications'></div>"; |
|
|
330 |
var notification_search = "<div id='notify_search' class='notifications'></div>"; |
|
|
331 |
|
|
|
332 |
//On les ajoute à la mosaïque. |
|
|
333 |
$('body').append(notification_selection + notification_search); |
|
|
334 |
|
|
|
335 |
//On calcule leurs coordonnées et dimensions. |
|
|
336 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
337 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
338 |
var selection_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; |
|
|
339 |
var search_left = selection_left + notify_width + notify_margin; |
|
|
340 |
|
|
|
341 |
//On les positionne. |
|
|
342 |
$('#notify_selection').css( |
|
|
343 |
{ |
|
|
344 |
left: selection_left |
|
|
345 |
}); |
|
|
346 |
$('#notify_search').css( |
|
|
347 |
{ |
|
|
348 |
left: search_left |
|
|
349 |
}); |
|
|
350 |
|
|
|
351 |
//On les fait apparaître. |
|
|
352 |
$('.notifications').css( |
|
|
353 |
{ |
|
|
354 |
opacity: "0.9" |
|
|
355 |
}); |
|
|
356 |
} |
|
|
357 |
|
|
|
358 |
/* |
|
|
359 |
* Affichage de la notification de sélection dans la mosaïque. |
|
|
360 |
*/ |
|
|
361 |
mosaic.prototype.mosaicSelection = function() |
|
|
362 |
{ |
|
|
363 |
if(this.currentMode != 'MOSAIC') |
|
|
364 |
{ |
|
|
365 |
return; |
|
|
366 |
} |
|
|
367 |
|
|
|
368 |
//On spécifie la notification en div. |
|
|
369 |
var notification_selection = "<div id='notify_selection' class='notifications'></div>"; |
|
|
370 |
|
|
|
371 |
//On l'ajoute à la mosaïque. |
|
|
372 |
$('body').append(notification_selection); |
|
|
373 |
|
|
|
374 |
//On calcule ses coordonnées et dimensions. |
|
|
375 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
376 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
377 |
var selection_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; |
|
|
378 |
|
|
|
379 |
//On les positionne. |
|
|
380 |
$('#notify_selection').css( |
|
|
381 |
{ |
|
|
382 |
left: selection_left |
|
|
383 |
}); |
|
|
384 |
|
|
|
385 |
//On les fait apparaître. |
|
|
386 |
$('.notifications').css( |
|
|
387 |
{ |
|
|
388 |
opacity: "0.9" |
|
|
389 |
}); |
|
|
390 |
} |
|
|
391 |
|
|
|
392 |
/* |
|
|
393 |
* Affichage de la notification de recherche dans une demande de filtrage de la mosaïque. |
|
|
394 |
*/ |
|
|
395 |
mosaic.prototype.filterSearch = function() |
|
|
396 |
{ |
|
|
397 |
if(this.currentMode != 'FILTER' || this.filterSearchedType) |
|
|
398 |
{ |
|
|
399 |
return; |
|
|
400 |
} |
|
|
401 |
|
|
|
402 |
// window.location.reload(); |
|
|
403 |
|
|
|
404 |
//On spécifie la notification en div. |
|
|
405 |
var notification_search = "<div id='notify_search' class='notifications'></div>"; |
|
|
406 |
|
|
|
407 |
//On l'ajoute à la mosaïque. |
|
|
408 |
$('body').append(notification_search); |
|
|
409 |
|
|
|
410 |
//On calcule ses coordonnées et dimensions. |
|
|
411 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
412 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
413 |
var search_left = $(window).width() / 2 - notify_width / 2 - notify_margin; |
|
|
414 |
|
|
|
415 |
//On la positionne. |
|
|
416 |
$('#notify_search').css( |
|
|
417 |
{ |
|
|
418 |
left: search_left |
|
|
419 |
}); |
|
|
420 |
|
|
|
421 |
//On la fait apparaître. |
|
|
422 |
$('.notifications').css( |
|
|
423 |
{ |
|
|
424 |
opacity: "0.9" |
|
|
425 |
}); |
|
|
426 |
} |
|
|
427 |
|
|
|
428 |
/* |
|
|
429 |
* Affichage de la notification de recherche & sélection dans une demande de filtrage de la mosaïque. |
|
|
430 |
*/ |
|
|
431 |
mosaic.prototype.filterSearchAndSelection = function() |
|
|
432 |
{ |
|
|
433 |
if(this.currentMode != 'FILTER' || this.filterSearchedType) |
|
|
434 |
{ |
|
|
435 |
return; |
|
|
436 |
} |
|
|
437 |
|
|
|
438 |
//On spécifie les notifications en div. |
|
|
439 |
var notification_selection = "<div id='notify_selection' class='notifications'></div>"; |
|
|
440 |
var notification_search = "<div id='notify_search' class='notifications'></div>"; |
|
|
441 |
|
|
|
442 |
//On les ajoute à la mosaïque. |
|
|
443 |
$('body').append(notification_selection + notification_search); |
|
|
444 |
|
|
|
445 |
//On calcule leurs coordonnées et dimensions. |
|
|
446 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
447 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
448 |
var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; |
|
|
449 |
var selection_left = search_left + notify_width + notify_margin; |
|
|
450 |
|
|
|
451 |
//On les positionne. |
|
|
452 |
$('#notify_selection').css( |
|
|
453 |
{ |
|
|
454 |
left: selection_left |
|
|
455 |
}); |
|
|
456 |
$('#notify_search').css( |
|
|
457 |
{ |
|
|
458 |
left: search_left |
|
|
459 |
}); |
|
|
460 |
|
|
|
461 |
//On les fait apparaître. |
|
|
462 |
$('.notifications').css( |
|
|
463 |
{ |
|
|
464 |
opacity: "0.9" |
|
|
465 |
}); |
|
|
466 |
} |
|
|
467 |
|
|
|
468 |
/* |
|
|
469 |
* Affichage de la notification de résultat de gesture dans la mosaïque filtrée. |
|
|
470 |
*/ |
|
|
471 |
mosaic.prototype.filterGesture = function(gestureName, mode) |
|
|
472 |
{ |
|
|
473 |
if(this.currentMode != 'FILTER' || !this.filterSearchedType) |
|
|
474 |
{ |
|
|
475 |
return; |
|
|
476 |
} |
|
|
477 |
|
|
46
|
478 |
// console.trace(); |
|
|
479 |
|
|
44
|
480 |
var _this = this; |
|
|
481 |
|
|
|
482 |
//On spécifie les notifications en div. |
|
|
483 |
var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>"; |
|
|
484 |
|
|
|
485 |
//On les ajoute à la mosaïque. |
|
|
486 |
$('body').append(notification_search_1gesture); |
|
|
487 |
|
|
|
488 |
// console.log(this.player.config.gui.zoomTop + " " + this.player.config.gui.zoomLeft); |
|
|
489 |
|
|
|
490 |
//On calcule leurs coordonnées et dimensions. |
|
|
491 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
492 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
493 |
var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; |
|
|
494 |
|
|
45
|
495 |
// console.log('url("./pictos/big/' + (this.mouseInteractions ? 'MI' : '') + '/' + mode + '/' + gestureName + '.png")'); |
|
|
496 |
|
|
44
|
497 |
if(_.include(this.gestures, gestureName)) |
|
|
498 |
{ |
|
45
|
499 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI' : '') + '/' + (this.gestureDelRequested ? 'hover' : 'valid') + '/' + gestureName + '.png")'); |
|
44
|
500 |
} |
|
|
501 |
else if(mode == 'none') |
|
|
502 |
{ |
|
|
503 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")'); |
|
|
504 |
} |
|
|
505 |
|
|
|
506 |
//On les positionne. |
|
|
507 |
$('#notify_search_1gesture').css( |
|
|
508 |
{ |
|
|
509 |
top: 0, |
|
|
510 |
left: ($(window).width() - notify_width) / 2 |
|
|
511 |
}); |
|
|
512 |
|
|
|
513 |
//On les fait apparaître. |
|
|
514 |
$('.notifications').css( |
|
|
515 |
{ |
|
|
516 |
opacity: "0.9" |
|
|
517 |
}); |
|
|
518 |
} |
|
|
519 |
|
|
|
520 |
/* |
|
|
521 |
* Affichage de la notification de résultat de gesture & de sélection dans la mosaïque filtrée. |
|
|
522 |
*/ |
|
|
523 |
mosaic.prototype.filterGestureAndSelection = function(gestureName, mode) |
|
|
524 |
{ |
|
|
525 |
if(this.currentMode != 'FILTER' || !this.filterSearchedType) |
|
|
526 |
{ |
|
|
527 |
return; |
|
|
528 |
} |
|
|
529 |
|
|
|
530 |
//On spécifie les notifications en div. |
|
|
531 |
var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>"; |
|
|
532 |
var notification_selection = "<div id='notify_selection' class='notifications'></div>"; |
|
|
533 |
|
|
|
534 |
//On les ajoute à la mosaïque. |
|
|
535 |
$('body').append(notification_search_1gesture + notification_selection); |
|
|
536 |
|
|
|
537 |
//On calcule leurs coordonnées et dimensions. |
|
|
538 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
539 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
540 |
var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; |
|
|
541 |
var selection_left = search_1gesture_left + notify_width + notify_margin; |
|
|
542 |
|
|
|
543 |
if(_.include(this.gestures, gestureName)) |
|
|
544 |
{ |
|
45
|
545 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI' : '') + '/' + mode + '/' + gestureName + '.png")'); |
|
44
|
546 |
} |
|
|
547 |
else if(mode == 'none') |
|
|
548 |
{ |
|
|
549 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")'); |
|
|
550 |
} |
|
|
551 |
|
|
|
552 |
//On les positionne. |
|
|
553 |
$('#notify_search_1gesture').css( |
|
|
554 |
{ |
|
|
555 |
left: search_1gesture_left |
|
|
556 |
}); |
|
|
557 |
$('#notify_selection').css( |
|
|
558 |
{ |
|
|
559 |
left: selection_left |
|
|
560 |
}); |
|
|
561 |
|
|
|
562 |
//On les fait apparaître. |
|
|
563 |
$('.notifications').css( |
|
|
564 |
{ |
|
|
565 |
opacity: "0.9" |
|
|
566 |
}); |
|
|
567 |
} |
|
|
568 |
|
|
|
569 |
/* |
|
|
570 |
* Affiche la notification de dezoom. |
|
|
571 |
* Direction vaut left ou right. |
|
|
572 |
*/ |
|
|
573 |
mosaic.prototype.videoSwipe = function(direction) |
|
|
574 |
{ |
|
|
575 |
if(this.currentMode != 'VIDEO' || !this.isSwipe) |
|
|
576 |
{ |
|
|
577 |
return; |
|
|
578 |
} |
|
|
579 |
|
|
|
580 |
var _this = this; |
|
|
581 |
|
|
|
582 |
//On spécifie les notifications en div. |
|
|
583 |
var notification_swipe = "<div id='notify_swipe' class='notifications'></div>"; |
|
|
584 |
|
|
|
585 |
//On les ajoute à la mosaïque. |
|
|
586 |
$('body').append(notification_swipe); |
|
|
587 |
|
|
|
588 |
//On calcule leurs coordonnées et dimensions. |
|
|
589 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
590 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
591 |
var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; |
|
|
592 |
|
|
|
593 |
// var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; |
|
|
594 |
var notifyTop = 0, notifyLeft = 0; |
|
|
595 |
|
|
|
596 |
//On les positionne. |
|
|
597 |
$('#notify_swipe').css( |
|
|
598 |
{ |
|
|
599 |
top: -notifyTop, |
|
|
600 |
left: -notifyLeft + ($(window).width() - notify_width - notify_margin) / 2, |
|
|
601 |
'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)' |
|
|
602 |
}); |
|
|
603 |
|
|
|
604 |
//On les fait apparaître. |
|
|
605 |
$('.notifications').css( |
|
|
606 |
{ |
|
|
607 |
opacity: "0.9" |
|
|
608 |
}); |
|
|
609 |
} |
|
|
610 |
|
|
|
611 |
/* |
|
45
|
612 |
* Affichage de la notification de résultat de move vers un voisin. |
|
|
613 |
*/ |
|
|
614 |
mosaic.prototype.videoMove = function(targetId) |
|
|
615 |
{ |
|
|
616 |
if(this.currentMode != 'VIDEO') |
|
|
617 |
{ |
|
|
618 |
return; |
|
|
619 |
} |
|
|
620 |
|
|
|
621 |
var _this = this; |
|
|
622 |
|
|
|
623 |
//On spécifie les notifications en div. |
|
|
624 |
var notification_move = "<div id='notify_move' class='notifications'></div>"; |
|
|
625 |
|
|
|
626 |
//On les ajoute à la mosaïque. |
|
|
627 |
$('body').append(notification_move); |
|
|
628 |
|
|
|
629 |
//On calcule leurs coordonnées et dimensions. |
|
|
630 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
631 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
632 |
var move_left = $(window).width() / 2 - (notify_width) / 2 + notify_margin; |
|
|
633 |
|
|
|
634 |
var side = $.inArray(parseInt(targetId), this.neighboursIds); |
|
|
635 |
// console.log(this.neighboursIds, parseInt(targetId), side); |
|
|
636 |
if(side == -1) |
|
|
637 |
{ |
|
|
638 |
return; |
|
|
639 |
} |
|
|
640 |
|
|
|
641 |
var sides = ['left', 'right', 'up', 'down']; |
|
|
642 |
|
|
|
643 |
// var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; |
|
|
644 |
var notifyTop = 0, notifyLeft = 0; |
|
|
645 |
|
|
|
646 |
//On les positionne. |
|
|
647 |
$('#notify_move').css( |
|
|
648 |
{ |
|
|
649 |
top: -notifyTop, |
|
|
650 |
left: -notifyLeft + move_left, |
|
|
651 |
'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' |
|
|
652 |
}); |
|
|
653 |
|
|
|
654 |
//On les fait apparaître. |
|
|
655 |
$('.notifications').css( |
|
|
656 |
{ |
|
|
657 |
opacity: "0.9" |
|
|
658 |
}); |
|
|
659 |
} |
|
|
660 |
|
|
|
661 |
/* |
|
44
|
662 |
* Affichage de la notification de résultat de move vers un voisin & de dézoom dans une vidéo. |
|
|
663 |
*/ |
|
|
664 |
mosaic.prototype.videoMoveAndUnzoom = function(targetId) |
|
|
665 |
{ |
|
|
666 |
if(this.currentMode != 'VIDEO') |
|
|
667 |
{ |
|
|
668 |
return; |
|
|
669 |
} |
|
|
670 |
|
|
|
671 |
var _this = this; |
|
|
672 |
|
|
|
673 |
//On spécifie les notifications en div. |
|
|
674 |
var notification_move = "<div id='notify_move' class='notifications'></div>"; |
|
|
675 |
var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>"; |
|
|
676 |
|
|
|
677 |
//On les ajoute à la mosaïque. |
|
|
678 |
$('body').append(notification_move + notification_unzoom); |
|
|
679 |
|
|
|
680 |
//On calcule leurs coordonnées et dimensions. |
|
|
681 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
682 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
683 |
var move_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; |
|
|
684 |
var unzoom_left = move_left + notify_width + notify_margin; |
|
|
685 |
|
|
|
686 |
var side = $.inArray(parseInt(targetId), this.neighboursIds); |
|
|
687 |
// console.log(this.neighboursIds, parseInt(targetId), side); |
|
|
688 |
if(side == -1) |
|
|
689 |
{ |
|
|
690 |
return; |
|
|
691 |
} |
|
|
692 |
|
|
|
693 |
var sides = ['left', 'right', 'up', 'down']; |
|
|
694 |
var unzooms = ['horizontal', 'vertical']; |
|
|
695 |
|
|
|
696 |
// var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; |
|
|
697 |
var notifyTop = 0, notifyLeft = 0; |
|
|
698 |
|
|
|
699 |
//On les positionne. |
|
|
700 |
$('#notify_move').css( |
|
|
701 |
{ |
|
|
702 |
top: -notifyTop, |
|
|
703 |
left: -notifyLeft + move_left, |
|
|
704 |
'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' |
|
|
705 |
}); |
|
|
706 |
|
|
|
707 |
$('#notify_unzoom').css( |
|
|
708 |
{ |
|
|
709 |
top: -notifyTop, |
|
|
710 |
left: -notifyLeft + unzoom_left, |
|
|
711 |
'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)' |
|
|
712 |
}); |
|
|
713 |
|
|
|
714 |
//On les fait apparaître. |
|
|
715 |
$('.notifications').css( |
|
|
716 |
{ |
|
|
717 |
opacity: "0.9" |
|
|
718 |
}); |
|
|
719 |
} |
|
|
720 |
|
|
|
721 |
/* |
|
|
722 |
* Affichage de la notification de résultat de dézoom dans une vidéo. |
|
|
723 |
*/ |
|
|
724 |
mosaic.prototype.videoUnzoom = function(targetId) |
|
|
725 |
{ |
|
|
726 |
if(this.currentMode != 'VIDEO') |
|
|
727 |
{ |
|
|
728 |
return; |
|
|
729 |
} |
|
|
730 |
|
|
|
731 |
var _this = this; |
|
|
732 |
|
|
|
733 |
//On spécifie la notifications en div. |
|
|
734 |
var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>"; |
|
|
735 |
|
|
|
736 |
//On l'ajoute à la mosaïque. |
|
|
737 |
$('body').append(notification_unzoom); |
|
|
738 |
|
|
|
739 |
//On calcule ses coordonnées et dimensions. |
|
|
740 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
741 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
742 |
var unzoom_left = $(window).width() / 2 - notify_width / 2 - notify_margin; |
|
|
743 |
|
|
|
744 |
var side = $.inArray(parseInt(targetId), this.neighboursIds); |
|
|
745 |
if(side == -1) |
|
|
746 |
{ |
|
|
747 |
return; |
|
|
748 |
} |
|
|
749 |
|
|
|
750 |
var unzooms = ['horizontal', 'vertical']; |
|
|
751 |
|
|
|
752 |
// var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; |
|
|
753 |
var notifyTop = 0, notifyLeft = 0; |
|
|
754 |
|
|
|
755 |
//On la positionne. |
|
|
756 |
$('#notify_unzoom').css( |
|
|
757 |
{ |
|
|
758 |
top: -notifyTop, |
|
|
759 |
left: -notifyLeft + unzoom_left, |
|
|
760 |
'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)' |
|
|
761 |
}); |
|
|
762 |
|
|
|
763 |
//On les fait apparaître. |
|
|
764 |
$('.notifications').css( |
|
|
765 |
{ |
|
|
766 |
opacity: "0.9" |
|
|
767 |
}); |
|
|
768 |
} |
|
|
769 |
|
|
|
770 |
/* |
|
|
771 |
* Affichage de la notification de timeline dans une vidéo/recherche. |
|
|
772 |
*/ |
|
|
773 |
mosaic.prototype.timelineTimeline = function() |
|
|
774 |
{ |
|
|
775 |
if(this.currentMode != 'TIMELINE') |
|
|
776 |
{ |
|
|
777 |
return; |
|
|
778 |
} |
|
|
779 |
|
|
|
780 |
var _this = this; |
|
|
781 |
|
|
|
782 |
//On spécifie la notifications en div. |
|
|
783 |
var notification_timeline = "<div id='notify_timeline' class='notifications'></div>"; |
|
|
784 |
|
|
|
785 |
//On l'ajoute à la mosaïque. |
|
|
786 |
$('body').append(notification_timeline); |
|
|
787 |
|
|
|
788 |
//On calcule ses coordonnées et dimensions. |
|
|
789 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
790 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
791 |
var timeline_left = $(window).width() / 2 - notify_width / 2 - notify_margin; |
|
|
792 |
|
|
|
793 |
// var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; |
|
|
794 |
var notifyTop = 0, notifyLeft = 0; |
|
|
795 |
|
|
|
796 |
//On la positionne. |
|
|
797 |
$('#notify_timeline').css( |
|
|
798 |
{ |
|
|
799 |
top: -notifyTop, |
|
|
800 |
left: -notifyLeft + timeline_left |
|
|
801 |
}); |
|
|
802 |
|
|
|
803 |
//On les fait apparaître. |
|
|
804 |
$('.notifications').css( |
|
|
805 |
{ |
|
|
806 |
opacity: "0.9" |
|
|
807 |
}); |
|
|
808 |
} |
|
|
809 |
|
|
|
810 |
/* |
|
|
811 |
* Affichage de la notification de recherche dans une vidéo de recherche. |
|
|
812 |
*/ |
|
|
813 |
mosaic.prototype.searchSearch = function() |
|
|
814 |
{ |
|
|
815 |
if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture) |
|
|
816 |
{ |
|
|
817 |
return; |
|
|
818 |
} |
|
|
819 |
|
|
|
820 |
var _this = this; |
|
|
821 |
|
|
|
822 |
//On spécifie la notifications en div. |
|
|
823 |
var notification_search = "<div id='notify_search' class='notifications'></div>"; |
|
|
824 |
|
|
|
825 |
//On l'ajoute à la mosaïque. |
|
|
826 |
$('body').append(notification_search); |
|
|
827 |
|
|
|
828 |
//On calcule ses coordonnées et dimensions. |
|
|
829 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
830 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
831 |
var search_left = $(window).width() / 2 - notify_width / 2 - notify_margin; |
|
|
832 |
|
|
|
833 |
// var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; |
|
|
834 |
var notifyTop = 0, notifyLeft = 0; |
|
|
835 |
|
|
|
836 |
//On la positionne. |
|
|
837 |
$('#notify_search').css( |
|
|
838 |
{ |
|
|
839 |
top: -notifyTop, |
|
|
840 |
left: -notifyLeft + search_left |
|
|
841 |
}); |
|
|
842 |
|
|
|
843 |
//On les fait apparaître. |
|
|
844 |
$('.notifications').css( |
|
|
845 |
{ |
|
|
846 |
opacity: "0.9" |
|
|
847 |
}); |
|
|
848 |
} |
|
|
849 |
|
|
|
850 |
/* |
|
|
851 |
* Affichage de la notification de recherche & de swipe dans une vidéo de recherche. |
|
|
852 |
*/ |
|
|
853 |
mosaic.prototype.searchSearchAndSwipe = function(direction) |
|
|
854 |
{ |
|
|
855 |
if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture || !this.isSwipe) |
|
|
856 |
{ |
|
|
857 |
return; |
|
|
858 |
} |
|
|
859 |
|
|
|
860 |
var _this = this; |
|
|
861 |
|
|
|
862 |
//On spécifie les notifications en div. |
|
|
863 |
var notification_search = "<div id='notify_search' class='notifications'></div>"; |
|
|
864 |
var notification_swipe = "<div id='notify_swipe' class='notifications'></div>"; |
|
|
865 |
|
|
|
866 |
//On les ajoute à la mosaïque. |
|
|
867 |
$('body').append(notification_search + notification_swipe); |
|
|
868 |
|
|
|
869 |
//On calcule leurs coordonnées et dimensions. |
|
|
870 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
871 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
872 |
var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; |
|
|
873 |
var swipe_left = search_left + notify_width + notify_margin; |
|
|
874 |
|
|
|
875 |
// var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; |
|
|
876 |
var notifyTop = 0, notifyLeft = 0; |
|
|
877 |
|
|
|
878 |
//On les positionne. |
|
|
879 |
$('#notify_search').css( |
|
|
880 |
{ |
|
|
881 |
top: -notifyTop, |
|
|
882 |
left: -notifyLeft + search_left |
|
|
883 |
}); |
|
|
884 |
$('#notify_swipe').css( |
|
|
885 |
{ |
|
|
886 |
top: -notifyTop, |
|
|
887 |
left: -notifyLeft + swipe_left, |
|
|
888 |
'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)' |
|
|
889 |
}); |
|
|
890 |
|
|
|
891 |
//On les fait apparaître. |
|
|
892 |
$('.notifications').css( |
|
|
893 |
{ |
|
|
894 |
opacity: "0.9" |
|
|
895 |
}); |
|
|
896 |
} |
|
|
897 |
|
|
|
898 |
/* |
|
45
|
899 |
* Affichage de la notification de recherche, de move vers un voisin. |
|
|
900 |
*/ |
|
|
901 |
mosaic.prototype.searchSearchAndMove = function(targetId) |
|
|
902 |
{ |
|
|
903 |
if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture) |
|
|
904 |
{ |
|
|
905 |
return; |
|
|
906 |
} |
|
|
907 |
|
|
|
908 |
//On spécifie les notifications en div. |
|
|
909 |
var notification_search = "<div id='notify_search' class='notifications'></div>"; |
|
|
910 |
var notification_move = "<div id='notify_move' class='notifications'></div>"; |
|
|
911 |
|
|
|
912 |
//On les ajoute à la mosaïque. |
|
|
913 |
$('body').append(notification_search + notification_move); |
|
|
914 |
|
|
|
915 |
//On calcule leurs coordonnées et dimensions. |
|
|
916 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
917 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
918 |
var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; |
|
|
919 |
var move_left = search_left + notify_width + notify_margin; |
|
|
920 |
|
|
|
921 |
var side = $.inArray(parseInt(targetId), this.neighboursIds); |
|
|
922 |
|
|
|
923 |
if(side == -1) |
|
|
924 |
{ |
|
|
925 |
return; |
|
|
926 |
} |
|
|
927 |
|
|
|
928 |
var sides = ['left', 'right', 'up', 'down']; |
|
|
929 |
|
|
|
930 |
var notifyTop = 0, notifyLeft = 0; |
|
|
931 |
|
|
|
932 |
//On les positionne. |
|
|
933 |
$('#notify_search').css( |
|
|
934 |
{ |
|
|
935 |
top: -notifyTop, |
|
|
936 |
left: -notifyLeft + search_left |
|
|
937 |
}); |
|
|
938 |
$('#notify_move').css( |
|
|
939 |
{ |
|
|
940 |
top: -notifyTop, |
|
|
941 |
left: -notifyLeft + move_left, |
|
|
942 |
'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' |
|
|
943 |
}); |
|
|
944 |
|
|
|
945 |
//On les fait apparaître. |
|
|
946 |
$('.notifications').css( |
|
|
947 |
{ |
|
|
948 |
opacity: "0.9" |
|
|
949 |
}); |
|
|
950 |
} |
|
|
951 |
|
|
|
952 |
/* |
|
44
|
953 |
* Affichage de la notification de recherche, de move vers un voisin & de dézoom dans une vidéo de recherche. |
|
|
954 |
*/ |
|
|
955 |
mosaic.prototype.searchSearchAndMoveAndUnzoom = function(targetId) |
|
|
956 |
{ |
|
|
957 |
if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture) |
|
|
958 |
{ |
|
|
959 |
return; |
|
|
960 |
} |
|
|
961 |
|
|
|
962 |
//On spécifie les notifications en div. |
|
|
963 |
var notification_search = "<div id='notify_search' class='notifications'></div>"; |
|
|
964 |
var notification_move = "<div id='notify_move' class='notifications'></div>"; |
|
|
965 |
var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>"; |
|
|
966 |
|
|
|
967 |
//On les ajoute à la mosaïque. |
|
|
968 |
$('body').append(notification_search + notification_move + notification_unzoom); |
|
|
969 |
|
|
|
970 |
//On calcule leurs coordonnées et dimensions. |
|
|
971 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
972 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
973 |
var search_left = $(window).width() / 2 - (notify_width * 3 + notify_margin * 4) / 2; |
|
|
974 |
var move_left = search_left + notify_width + notify_margin; |
|
|
975 |
var unzoom_left = move_left + notify_width + notify_margin; |
|
|
976 |
|
|
|
977 |
var side = $.inArray(parseInt(targetId), this.neighboursIds); |
|
|
978 |
|
|
|
979 |
if(side == -1) |
|
|
980 |
{ |
|
|
981 |
return; |
|
|
982 |
} |
|
|
983 |
|
|
|
984 |
var sides = ['left', 'right', 'up', 'down']; |
|
|
985 |
var unzooms = ['horizontal', 'vertical']; |
|
|
986 |
|
|
|
987 |
// var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; |
|
|
988 |
var notifyTop = 0, notifyLeft = 0; |
|
|
989 |
|
|
|
990 |
//On les positionne. |
|
|
991 |
$('#notify_search').css( |
|
|
992 |
{ |
|
|
993 |
top: -notifyTop, |
|
|
994 |
left: -notifyLeft + search_left |
|
|
995 |
}); |
|
|
996 |
$('#notify_move').css( |
|
|
997 |
{ |
|
|
998 |
top: -notifyTop, |
|
|
999 |
left: -notifyLeft + move_left, |
|
|
1000 |
'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' |
|
|
1001 |
}); |
|
|
1002 |
$('#notify_unzoom').css( |
|
|
1003 |
{ |
|
|
1004 |
top: -notifyTop, |
|
|
1005 |
left: -notifyLeft + unzoom_left, |
|
|
1006 |
'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)' |
|
|
1007 |
}); |
|
|
1008 |
|
|
|
1009 |
//On les fait apparaître. |
|
|
1010 |
$('.notifications').css( |
|
|
1011 |
{ |
|
|
1012 |
opacity: "0.9" |
|
|
1013 |
}); |
|
|
1014 |
} |
|
|
1015 |
|
|
|
1016 |
/* |
|
|
1017 |
* Affichage de la notification de recherche & de dézoom dans une vidéo de recherche. |
|
|
1018 |
*/ |
|
|
1019 |
mosaic.prototype.searchSearchAndUnzoom = function() |
|
|
1020 |
{ |
|
|
1021 |
if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture) |
|
|
1022 |
{ |
|
|
1023 |
return; |
|
|
1024 |
} |
|
|
1025 |
|
|
|
1026 |
var _this = this; |
|
|
1027 |
|
|
|
1028 |
//On spécifie les notifications en div. |
|
|
1029 |
var notification_search = "<div id='notify_search' class='notifications'></div>"; |
|
|
1030 |
var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>"; |
|
|
1031 |
|
|
|
1032 |
//On les ajoute à la mosaïque. |
|
|
1033 |
$('body').append(notification_search + notification_unzoom); |
|
|
1034 |
|
|
|
1035 |
//On calcule leurs coordonnées et dimensions. |
|
|
1036 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
1037 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
1038 |
var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; |
|
|
1039 |
var unzoom_left = search_left + notify_width + notify_margin; |
|
|
1040 |
|
|
|
1041 |
var side = $.inArray(parseInt(targetId), this.neighboursIds); |
|
|
1042 |
// console.log(this.neighboursIds, parseInt(targetId), side); |
|
|
1043 |
if(side == -1) |
|
|
1044 |
{ |
|
|
1045 |
return; |
|
|
1046 |
} |
|
|
1047 |
|
|
|
1048 |
var unzooms = ['horizontal', 'vertical']; |
|
|
1049 |
|
|
|
1050 |
// var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; |
|
|
1051 |
var notifyTop = 0, notifyLeft = 0; |
|
|
1052 |
|
|
|
1053 |
//On les positionne. |
|
|
1054 |
$('#notify_move').css( |
|
|
1055 |
{ |
|
|
1056 |
top: -notifyTop, |
|
|
1057 |
left: -notifyLeft + search_left |
|
|
1058 |
}); |
|
|
1059 |
|
|
|
1060 |
$('#notify_unzoom').css( |
|
|
1061 |
{ |
|
|
1062 |
top: -notifyTop, |
|
|
1063 |
left: -notifyLeft + unzoom_left, |
|
|
1064 |
'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)' |
|
|
1065 |
}); |
|
|
1066 |
|
|
|
1067 |
//On les fait apparaître. |
|
|
1068 |
$('.notifications').css( |
|
|
1069 |
{ |
|
|
1070 |
opacity: "0.9" |
|
|
1071 |
}); |
|
|
1072 |
} |
|
|
1073 |
|
|
|
1074 |
/* |
|
|
1075 |
* Affichage de la notification de résultat dans une vidéo de recherche. |
|
|
1076 |
*/ |
|
|
1077 |
mosaic.prototype.searchGesture = function(gestureName, mode) |
|
|
1078 |
{ |
|
47
|
1079 |
console.log('NOTIFY GESTURE ' + this.currentMode + ' ' + this.centerId + ' ' + this.currentSearchGesture[this.centerId]); |
|
|
1080 |
if(this.currentMode != 'SEARCH' || this.currentSearchGesture[this.centerId] == '') |
|
44
|
1081 |
{ |
|
|
1082 |
return; |
|
|
1083 |
} |
|
47
|
1084 |
console.log('NOTIFY GESTURE'); |
|
44
|
1085 |
var _this = this; |
|
|
1086 |
|
|
|
1087 |
//On spécifie les notifications en div. |
|
|
1088 |
var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>"; |
|
|
1089 |
|
|
|
1090 |
//On les ajoute à la mosaïque. |
|
|
1091 |
$('body').append(notification_search_1gesture); |
|
|
1092 |
|
|
|
1093 |
// console.log(this.player.config.gui.zoomTop + " " + this.player.config.gui.zoomLeft); |
|
|
1094 |
|
|
|
1095 |
//On calcule leurs coordonnées et dimensions. |
|
|
1096 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
1097 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
1098 |
var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; |
|
|
1099 |
|
|
47
|
1100 |
// console.log('SHOW GESTURE NOTIFICATION 1'); |
|
44
|
1101 |
if(_.include(this.gestures, gestureName)) |
|
|
1102 |
{ |
|
47
|
1103 |
// console.log('SHOW GESTURE NOTIFICATION 2'); |
|
45
|
1104 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")'); |
|
44
|
1105 |
} |
|
|
1106 |
else if(mode == 'none') |
|
|
1107 |
{ |
|
|
1108 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")'); |
|
|
1109 |
} |
|
|
1110 |
|
|
|
1111 |
//On les positionne. |
|
|
1112 |
$('#notify_search_1gesture').css( |
|
|
1113 |
{ |
|
|
1114 |
top: 0, |
|
|
1115 |
left: ($(window).width() - notify_width) / 2 |
|
|
1116 |
}); |
|
|
1117 |
|
|
|
1118 |
//On les fait apparaître. |
|
|
1119 |
$('.notifications').css( |
|
|
1120 |
{ |
|
|
1121 |
opacity: "0.9" |
|
|
1122 |
}); |
|
|
1123 |
} |
|
|
1124 |
|
|
|
1125 |
/* |
|
|
1126 |
* Affichage de la notification de résultat & de swipe dans une vidéo de recherche. |
|
|
1127 |
*/ |
|
|
1128 |
mosaic.prototype.searchGestureAndSwipe = function(gestureName, mode, direction) |
|
|
1129 |
{ |
|
|
1130 |
if(this.currentMode != 'SEARCH' || !this.isCurrentlyInASearchByGesture || !this.isSwipe) |
|
|
1131 |
{ |
|
|
1132 |
return; |
|
|
1133 |
} |
|
|
1134 |
|
|
|
1135 |
var _this = this; |
|
|
1136 |
|
|
|
1137 |
//On spécifie les notifications en div. |
|
|
1138 |
var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>"; |
|
|
1139 |
var notification_swipe = "<div id='notify_swipe' class='notifications'></div>"; |
|
|
1140 |
|
|
|
1141 |
//On les ajoute à la mosaïque. |
|
|
1142 |
$('body').append(notification_search_1gesture + notification_swipe); |
|
|
1143 |
|
|
|
1144 |
// console.log(this.player.config.gui.zoomTop + " " + this.player.config.gui.zoomLeft); |
|
|
1145 |
|
|
|
1146 |
//On calcule leurs coordonnées et dimensions. |
|
|
1147 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
1148 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
1149 |
var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; |
|
|
1150 |
var swipe_left = search_1gesture_left + notify_width + notify_margin; |
|
|
1151 |
|
|
|
1152 |
if(_.include(this.gestures, gestureName)) |
|
|
1153 |
{ |
|
45
|
1154 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")'); |
|
44
|
1155 |
} |
|
|
1156 |
else if(mode == 'none') |
|
|
1157 |
{ |
|
|
1158 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")'); |
|
|
1159 |
} |
|
|
1160 |
|
|
|
1161 |
//On les positionne. |
|
|
1162 |
$('#notify_search_1gesture').css( |
|
|
1163 |
{ |
|
|
1164 |
left: search_1gesture_left |
|
|
1165 |
}); |
|
|
1166 |
$('#notify_swipe').css( |
|
|
1167 |
{ |
|
|
1168 |
left: swipe_left, |
|
|
1169 |
'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)' |
|
|
1170 |
}); |
|
|
1171 |
|
|
|
1172 |
//On les fait apparaître. |
|
|
1173 |
$('.notifications').css( |
|
|
1174 |
{ |
|
|
1175 |
opacity: "0.9" |
|
|
1176 |
}); |
|
|
1177 |
} |
|
|
1178 |
|
|
|
1179 |
/* |
|
45
|
1180 |
* Affichage de la notification de résultat, de move vers un voisin. |
|
|
1181 |
*/ |
|
|
1182 |
mosaic.prototype.searchGestureAndMove = function(gestureName, mode, targetId) |
|
|
1183 |
{ |
|
|
1184 |
if(this.currentMode != 'SEARCH' || !this.isCurrentlyInASearchByGesture) |
|
|
1185 |
{ |
|
|
1186 |
return; |
|
|
1187 |
} |
|
|
1188 |
|
|
|
1189 |
var _this = this; |
|
|
1190 |
|
|
|
1191 |
//On spécifie les notifications en div. |
|
|
1192 |
var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>"; |
|
|
1193 |
var notification_move = "<div id='notify_move' class='notifications'></div>"; |
|
|
1194 |
|
|
|
1195 |
//On les ajoute à la mosaïque. |
|
|
1196 |
$('body').append(notification_search_1gesture + notification_move); |
|
|
1197 |
|
|
|
1198 |
// console.log(this.player.config.gui.zoomTop + " " + this.player.config.gui.zoomLeft); |
|
|
1199 |
|
|
|
1200 |
//On calcule leurs coordonnées et dimensions. |
|
|
1201 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
1202 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
1203 |
var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; |
|
|
1204 |
var move_left = search_1gesture_left + notify_width + notify_margin; |
|
|
1205 |
|
|
|
1206 |
if(_.include(this.gestures, gestureName)) |
|
|
1207 |
{ |
|
|
1208 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")'); |
|
|
1209 |
} |
|
|
1210 |
else if(mode == 'none') |
|
|
1211 |
{ |
|
|
1212 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")'); |
|
|
1213 |
} |
|
|
1214 |
|
|
|
1215 |
var side = $.inArray(parseInt(targetId), this.neighboursIds); |
|
|
1216 |
|
|
|
1217 |
if(side == -1) |
|
|
1218 |
{ |
|
|
1219 |
return; |
|
|
1220 |
} |
|
|
1221 |
|
|
|
1222 |
var sides = ['left', 'right', 'up', 'down']; |
|
|
1223 |
|
|
|
1224 |
//On les positionne. |
|
|
1225 |
$('#notify_search_1gesture').css( |
|
|
1226 |
{ |
|
|
1227 |
left: search_1gesture_left |
|
|
1228 |
}); |
|
|
1229 |
$('#notify_move').css( |
|
|
1230 |
{ |
|
|
1231 |
left: move_left, |
|
|
1232 |
'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' |
|
|
1233 |
}); |
|
|
1234 |
|
|
|
1235 |
//On les fait apparaître. |
|
|
1236 |
$('.notifications').css( |
|
|
1237 |
{ |
|
|
1238 |
opacity: "0.9" |
|
|
1239 |
}); |
|
|
1240 |
} |
|
|
1241 |
|
|
|
1242 |
/* |
|
44
|
1243 |
* Affichage de la notification de résultat, de move vers un voisin & de dézoom dans une vidéo de recherche. |
|
|
1244 |
*/ |
|
|
1245 |
mosaic.prototype.searchGestureAndMoveAndUnzoom = function(gestureName, mode, targetId) |
|
|
1246 |
{ |
|
|
1247 |
if(this.currentMode != 'SEARCH' || !this.isCurrentlyInASearchByGesture) |
|
|
1248 |
{ |
|
|
1249 |
return; |
|
|
1250 |
} |
|
|
1251 |
|
|
|
1252 |
var _this = this; |
|
|
1253 |
|
|
|
1254 |
//On spécifie les notifications en div. |
|
|
1255 |
var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>"; |
|
|
1256 |
var notification_move = "<div id='notify_move' class='notifications'></div>"; |
|
|
1257 |
var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>"; |
|
|
1258 |
|
|
|
1259 |
//On les ajoute à la mosaïque. |
|
|
1260 |
$('body').append(notification_search_1gesture + notification_move + notification_unzoom); |
|
|
1261 |
|
|
|
1262 |
// console.log(this.player.config.gui.zoomTop + " " + this.player.config.gui.zoomLeft); |
|
|
1263 |
|
|
|
1264 |
//On calcule leurs coordonnées et dimensions. |
|
|
1265 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
1266 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
1267 |
var search_1gesture_left = $(window).width() / 2 - (notify_width * 3 + notify_margin * 4) / 2; |
|
|
1268 |
var move_left = search_1gesture_left + notify_width + notify_margin; |
|
|
1269 |
var unzoom_left = move_left + notify_width + notify_margin; |
|
|
1270 |
|
|
|
1271 |
if(_.include(this.gestures, gestureName)) |
|
|
1272 |
{ |
|
45
|
1273 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")'); |
|
44
|
1274 |
} |
|
|
1275 |
else if(mode == 'none') |
|
|
1276 |
{ |
|
|
1277 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")'); |
|
|
1278 |
} |
|
|
1279 |
|
|
|
1280 |
var side = $.inArray(parseInt(targetId), this.neighboursIds); |
|
|
1281 |
|
|
|
1282 |
if(side == -1) |
|
|
1283 |
{ |
|
|
1284 |
return; |
|
|
1285 |
} |
|
|
1286 |
|
|
|
1287 |
var sides = ['left', 'right', 'up', 'down']; |
|
|
1288 |
var unzooms = ['horizontal', 'vertical']; |
|
|
1289 |
|
|
|
1290 |
//On les positionne. |
|
|
1291 |
$('#notify_search_1gesture').css( |
|
|
1292 |
{ |
|
|
1293 |
left: search_1gesture_left |
|
|
1294 |
}); |
|
|
1295 |
$('#notify_move').css( |
|
|
1296 |
{ |
|
|
1297 |
left: move_left, |
|
|
1298 |
'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' |
|
|
1299 |
}); |
|
|
1300 |
$('#notify_unzoom').css( |
|
|
1301 |
{ |
|
|
1302 |
left: unzoom_left, |
|
|
1303 |
'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)' |
|
|
1304 |
}); |
|
|
1305 |
|
|
|
1306 |
//On les fait apparaître. |
|
|
1307 |
$('.notifications').css( |
|
|
1308 |
{ |
|
|
1309 |
opacity: "0.9" |
|
|
1310 |
}); |
|
|
1311 |
} |
|
|
1312 |
|
|
|
1313 |
/* |
|
|
1314 |
* Affichage de la notification de résultat & de dézoom dans une vidéo de recherche. |
|
|
1315 |
*/ |
|
45
|
1316 |
mosaic.prototype.searchGestureAndUnzoom = function(gestureName, mode, targetId) |
|
44
|
1317 |
{ |
|
|
1318 |
if(this.currentMode != 'SEARCH' || !this.isCurrentlyInASearchByGesture) |
|
|
1319 |
{ |
|
|
1320 |
return; |
|
|
1321 |
} |
|
|
1322 |
|
|
|
1323 |
var _this = this; |
|
|
1324 |
|
|
|
1325 |
//On spécifie les notifications en div. |
|
|
1326 |
var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>"; |
|
|
1327 |
var notification_unzoom = "<div id='notify_unzoom' class='notifications'></div>"; |
|
|
1328 |
|
|
|
1329 |
//On les ajoute à la mosaïque. |
|
|
1330 |
$('body').append(notification_search_1gesture + notification_unzoom); |
|
|
1331 |
|
|
|
1332 |
// console.log(this.player.config.gui.zoomTop + " " + this.player.config.gui.zoomLeft); |
|
|
1333 |
|
|
|
1334 |
//On calcule leurs coordonnées et dimensions. |
|
|
1335 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
1336 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
1337 |
var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; |
|
|
1338 |
var unzoom_left = search_1gesture_left + notify_width + notify_margin; |
|
|
1339 |
|
|
|
1340 |
if(_.include(this.gestures, gestureName)) |
|
|
1341 |
{ |
|
45
|
1342 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")'); |
|
44
|
1343 |
} |
|
|
1344 |
else if(mode == 'none') |
|
|
1345 |
{ |
|
|
1346 |
$('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")'); |
|
|
1347 |
} |
|
|
1348 |
|
|
45
|
1349 |
var side = $.inArray(parseInt(targetId), this.neighboursIds); |
|
|
1350 |
|
|
|
1351 |
if(side == -1) |
|
|
1352 |
{ |
|
|
1353 |
return; |
|
|
1354 |
} |
|
|
1355 |
|
|
|
1356 |
var unzooms = ['horizontal', 'vertical']; |
|
|
1357 |
|
|
44
|
1358 |
//On les positionne. |
|
|
1359 |
$('#notify_search_1gesture').css( |
|
|
1360 |
{ |
|
|
1361 |
left: search_1gesture_left |
|
|
1362 |
}); |
|
|
1363 |
$('#notify_unzoom').css( |
|
|
1364 |
{ |
|
45
|
1365 |
left: unzoom_left, |
|
|
1366 |
'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)' |
|
44
|
1367 |
}); |
|
|
1368 |
|
|
|
1369 |
//On les fait apparaître. |
|
|
1370 |
$('.notifications').css( |
|
|
1371 |
{ |
|
|
1372 |
opacity: "0.9" |
|
|
1373 |
}); |
|
45
|
1374 |
} |
|
|
1375 |
|
|
|
1376 |
/* |
|
|
1377 |
* Affichage des notifications de gestures trouvées dans une recherche par courbes. |
|
|
1378 |
*/ |
|
|
1379 |
mosaic.prototype.curvesGestures = function(gestures) |
|
|
1380 |
{ |
|
|
1381 |
//S'il n'y a pas de gestures à afficher. |
|
|
1382 |
if(gestures.length == 0) |
|
|
1383 |
{ |
|
|
1384 |
console.log('NONE'); |
|
|
1385 |
//On ajoute une seule notification. |
|
|
1386 |
var notification_curves = "<div class='notifications' id='notify_curves'></div>"; |
|
|
1387 |
$('body').append(notification_curves); |
|
|
1388 |
|
|
|
1389 |
//On calcule leurs dimensions et coordonnées. |
|
|
1390 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
1391 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
1392 |
var curves_left = $(window).width() / 2 - (notify_width + notify_margin * 2) / 2; |
|
|
1393 |
|
|
|
1394 |
$('#notify_curves').css( |
|
|
1395 |
{ |
|
|
1396 |
left: curves_left, |
|
|
1397 |
'background-image': 'url("./pictos/big/normal/inconnu.png")', |
|
|
1398 |
opacity: '0.9' |
|
|
1399 |
}); |
|
|
1400 |
return; |
|
|
1401 |
} |
|
|
1402 |
|
|
|
1403 |
//Sinon, on les met dans un tableau. |
|
|
1404 |
var gestures_tab = gestures.split(';'); |
|
|
1405 |
|
|
|
1406 |
var notifications_curves_gestures = ''; |
|
|
1407 |
|
|
|
1408 |
//On crée autant de notifications qu'il y a de gestures. |
|
|
1409 |
for(var i = 0 ; i < gestures_tab.length ; i++) |
|
|
1410 |
{ |
|
|
1411 |
notifications_curves_gestures += "<div class='notifications' id='notify_curves_" + gestures_tab[i] + "'></div>"; |
|
|
1412 |
} |
|
|
1413 |
|
|
|
1414 |
//On les ajoute à la mosaïque. |
|
|
1415 |
$('body').append(notifications_curves_gestures); |
|
|
1416 |
|
|
|
1417 |
//On calcule leurs dimensions. |
|
|
1418 |
var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); |
|
|
1419 |
var notify_margin = parseInt($('.notifications').css('margin')); |
|
|
1420 |
var curves_gestures_left = []; |
|
|
1421 |
|
|
|
1422 |
//On calcule leurs dimensions et leur backgrounds. |
|
|
1423 |
curves_gestures_left[0] = $(window).width() / 2 - (notify_width * (gestures_tab.length) + notify_margin * (gestures_tab.length + 2)) / 2; |
|
|
1424 |
|
|
|
1425 |
for(var i = 0 ; i < gestures_tab.length ; i++) |
|
|
1426 |
{ |
|
|
1427 |
//On va chercher leurs backgrounds. |
|
|
1428 |
$('#notify_curves_' + gestures_tab[i]).css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + 'normal/' + gestures_tab[i] + '.png")'); |
|
|
1429 |
// console.log('url("./pictos/big/MI/normal/' + gestures_tab[i] + '.png")'); |
|
|
1430 |
|
|
|
1431 |
//On calcule leurs coordonnées. |
|
|
1432 |
if(i+1 < gestures_tab.length) |
|
|
1433 |
{ |
|
|
1434 |
curves_gestures_left[i+1] = curves_gestures_left[i] + notify_width + notify_margin * 2; |
|
|
1435 |
} |
|
|
1436 |
|
|
|
1437 |
//On les place. |
|
|
1438 |
$('#notify_curves_' + gestures_tab[i]).css('left', curves_gestures_left[i]); |
|
|
1439 |
} |
|
|
1440 |
|
|
|
1441 |
//On les fait apparaître. |
|
|
1442 |
$('.notifications').css( |
|
|
1443 |
{ |
|
|
1444 |
opacity: "0.9" |
|
|
1445 |
}); |
|
47
|
1446 |
} |
|
|
1447 |
|
|
|
1448 |
/* |
|
|
1449 |
* Efface les notifications. |
|
|
1450 |
*/ |
|
|
1451 |
mosaic.prototype.removeNotifications = function() |
|
|
1452 |
{ |
|
|
1453 |
// console.trace(); |
|
|
1454 |
$('.notifications').remove(); |
|
44
|
1455 |
} |