|
44
|
1 |
/* |
|
|
2 |
* Affiche les pointeurs. |
|
|
3 |
*/ |
|
|
4 |
mosaic.prototype.addPointers = function() |
|
|
5 |
{ |
|
45
|
6 |
if(this.mouseInteractions) |
|
|
7 |
{ |
|
|
8 |
return; |
|
|
9 |
} |
|
|
10 |
|
|
44
|
11 |
var mainPointer = '<div id="mainPointer" class="pointers"></div>'; |
|
|
12 |
var secondPointer = '<div id="secondPointer" class="pointers"></div>'; |
|
|
13 |
$('body').append(mainPointer + secondPointer); |
|
|
14 |
|
|
|
15 |
$('#secondPointer').css( |
|
|
16 |
{ |
|
|
17 |
top: $(window).height() / 2 - $('#secondPointer').height() / 2, |
|
|
18 |
left: $(window).width() / 4 - $('#secondPointer').width() / 2 |
|
|
19 |
}); |
|
|
20 |
|
|
|
21 |
this.secondPointerLastX = $(window).width() / 4 - $('#secondPointer').width() / 2; |
|
|
22 |
this.secondPointerLastY = $(window).height() / 2 - $('#secondPointer').height() / 2; |
|
|
23 |
|
|
|
24 |
$('#mainPointer').css( |
|
|
25 |
{ |
|
|
26 |
top: $(window).height() / 2 - $('#mainPointer').height() / 2, |
|
|
27 |
left: $(window).width() * 3 / 4 - $('#mainPointer').width() / 2 |
|
|
28 |
}); |
|
|
29 |
|
|
|
30 |
this.mainPointerLastX = $(window).width() * 3 / 4 - $('#mainPointer').width() / 2; |
|
|
31 |
this.mainPointerLastY = $(window).height() / 2 - $('#mainPointer').height() / 2; |
|
|
32 |
|
|
|
33 |
this.mainPointerIdleStartX = this.mainPointerLastX; |
|
|
34 |
this.mainPointerIdleStartY = this.mainPointerLastY; |
|
|
35 |
this.secondPointerIdleStartX = this.secondPointerLastX; |
|
|
36 |
this.secondPointerIdleStartY = this.secondPointerLastY; |
|
|
37 |
} |
|
|
38 |
|
|
|
39 |
/* |
|
|
40 |
* Affiche/Masque le pointeur principal. |
|
|
41 |
* Main est un booléen valant vrai s'il faut afficher le pointeur. |
|
|
42 |
*/ |
|
|
43 |
mosaic.prototype.mainPointerDisplay = function(main) |
|
|
44 |
{ |
|
|
45 |
var _this = this; |
|
|
46 |
|
|
|
47 |
//On n'affiche pas les pointeurs dans le mode sans utilisateur ni utilisateur en phase d'approche. |
|
|
48 |
if(this.currentMode != 'NO-USER' && this.currentMode.indexOf('INCOMING-') == -1) |
|
|
49 |
{ |
|
|
50 |
if(main) |
|
|
51 |
{ |
|
|
52 |
clearTimeout(this.arrowSpinnerTimeout); |
|
|
53 |
|
|
|
54 |
$('#mainPointer').fadeTo(this.config['timeFilling'], '1'); |
|
|
55 |
|
|
|
56 |
//Si on a un seul pointeur, on affiche la mire. |
|
|
57 |
if(!this.areBothPointersHere) |
|
|
58 |
{ |
|
|
59 |
// console.log('ONE'); |
|
|
60 |
/*$('#mainPointer').css( |
|
|
61 |
{ |
|
|
62 |
'background-image': 'url(./img/cursors/selector_gray.png)', |
|
|
63 |
width: 85, |
|
|
64 |
height: 85 |
|
|
65 |
});*/ |
|
|
66 |
} |
|
|
67 |
} |
|
|
68 |
} |
|
|
69 |
|
|
|
70 |
//Si le booléen est à faux, on masque le pointeur. |
|
|
71 |
if(!main) |
|
|
72 |
{ |
|
|
73 |
$('#spinner').remove(); |
|
|
74 |
|
|
|
75 |
$('#mainPointer').fadeTo(this.config['timeFilling'], '0'); |
|
|
76 |
if(this.mainPointerNeighbourSelectedId != null) |
|
|
77 |
{ |
|
|
78 |
// this.deselectNeighbour(this.mainPointerNeighbourSelectedId); |
|
|
79 |
} |
|
|
80 |
|
|
|
81 |
//Si on a zoomé sur une vidéo. |
|
|
82 |
if(this.currentMode == 'VIDEO' || this.currentMode == 'SEARCH') |
|
|
83 |
{ |
|
|
84 |
//On annule aussi la TL s'il y a lieu. |
|
|
85 |
if(this.isTLSelected()) |
|
|
86 |
{ |
|
|
87 |
this.isTLRequested = false; |
|
|
88 |
clearTimeout(this.selectTLTimeout); |
|
|
89 |
} |
|
|
90 |
} |
|
|
91 |
|
|
|
92 |
if(this.isTLSelectedByMainPointer) |
|
|
93 |
{ |
|
|
94 |
//On déselectionne la TL. |
|
|
95 |
this.exitTimeline(''); |
|
|
96 |
} |
|
|
97 |
} |
|
|
98 |
} |
|
|
99 |
/* |
|
|
100 |
* Affiche/Masque le pointeur secondaire. |
|
|
101 |
* Main est un booléen valant vrai s'il faut afficher le pointeur. |
|
|
102 |
*/ |
|
|
103 |
mosaic.prototype.secondPointerDisplay = function(second) |
|
|
104 |
{ |
|
|
105 |
//On n'affiche pas les pointeurs dans le mode sans utilisateur ni utilisateur en phase d'approche. |
|
|
106 |
if(this.currentMode != 'NO-USER' && this.currentMode.indexOf('INCOMING-') == -1) |
|
|
107 |
{ |
|
|
108 |
if(second) |
|
|
109 |
{ |
|
|
110 |
clearTimeout(this.arrowSpinnerTimeout); |
|
|
111 |
|
|
|
112 |
$('#secondPointer').fadeTo(this.config['timeFilling'], '1'); |
|
|
113 |
|
|
|
114 |
//Si on a un seul pointeur, on affiche la mire. |
|
|
115 |
if(!this.areBothPointersHere) |
|
|
116 |
{ |
|
|
117 |
// console.log('ONE'); |
|
|
118 |
/*$('#secondPointer').css( |
|
|
119 |
{ |
|
|
120 |
'background-image': 'url(./img/cursors/selector_gray.png)', |
|
|
121 |
width: 85, |
|
|
122 |
height: 85 |
|
|
123 |
});*/ |
|
|
124 |
} |
|
|
125 |
} |
|
|
126 |
} |
|
|
127 |
|
|
|
128 |
//Si le booléen est à faux, on masque le pointeur. |
|
|
129 |
if(!second) |
|
|
130 |
{ |
|
|
131 |
$('#spinner').remove(); |
|
|
132 |
|
|
|
133 |
$('#secondPointer').fadeTo(this.config['timeFilling'], '0'); |
|
|
134 |
if(this.secondPointerNeighbourSelectedId != null) |
|
|
135 |
{ |
|
|
136 |
// this.deselectNeighbour(this.secondPointerNeighbourSelectedId); |
|
|
137 |
} |
|
|
138 |
|
|
|
139 |
if(this.isTLSelectedBySecondPointer) |
|
|
140 |
{ |
|
|
141 |
//On déselectionne la TL. |
|
|
142 |
this.exitTimeline(''); |
|
|
143 |
} |
|
|
144 |
} |
|
|
145 |
} |
|
|
146 |
|
|
|
147 |
/* |
|
|
148 |
* Raffraîchit la position des pointeurs. |
|
|
149 |
*/ |
|
|
150 |
mosaic.prototype.refreshMainPointer = function(x, y) |
|
|
151 |
{ |
|
|
152 |
// console.log(' DEBUG MP'); |
|
|
153 |
if(this.currentMode == "NO-USER" || this.currentMode.indexOf('INCOMING-') != -1) |
|
|
154 |
{ |
|
|
155 |
return; |
|
|
156 |
} |
|
|
157 |
|
|
|
158 |
if(!this.mouseInteractions) |
|
|
159 |
{ |
|
|
160 |
x *= 7; |
|
|
161 |
y *= 7; |
|
|
162 |
x -= $(window).width() * 3 / 4; |
|
|
163 |
y -= $(window).height() * 2 / 4; |
|
|
164 |
} |
|
|
165 |
|
|
|
166 |
//Si le pointeur quitte la fenêtre en X, on ne le change pas. |
|
|
167 |
// console.log('x : ' + x + ' mplx : ' + this.mainPointerLastX); |
|
|
168 |
if(x < 0 || x > $(window).width()) |
|
|
169 |
{ |
|
|
170 |
x = this.mainPointerLastX; |
|
|
171 |
} |
|
|
172 |
//Sinon, on le met à jour. |
|
|
173 |
else |
|
|
174 |
{ |
|
|
175 |
this.mainPointerLastX = x; |
|
|
176 |
} |
|
|
177 |
|
|
|
178 |
//Si le pointeur quitte la fenêtre en Y, on ne le change pas. |
|
|
179 |
if(y < 0 || y > $(window).height()) |
|
|
180 |
{ |
|
|
181 |
y = this.mainPointerLastY; |
|
|
182 |
} |
|
|
183 |
//Sinon, on le met à jour. |
|
|
184 |
else |
|
|
185 |
{ |
|
|
186 |
this.mainPointerLastY = y; |
|
|
187 |
} |
|
|
188 |
|
|
45
|
189 |
var pointerX, pointerY; |
|
|
190 |
|
|
|
191 |
if(this.mouseInteractions) |
|
|
192 |
{ |
|
|
193 |
pointerX = x; |
|
|
194 |
pointerY = y; |
|
|
195 |
} |
|
|
196 |
else |
|
|
197 |
{ |
|
|
198 |
pointerX = x - $('#mainPointer').width()/2; |
|
|
199 |
pointerY = y - $('#mainPointer').height()/2; |
|
|
200 |
} |
|
44
|
201 |
var _this = this; |
|
|
202 |
|
|
|
203 |
$('#mainPointer').css( |
|
|
204 |
{ |
|
|
205 |
top: pointerY, |
|
|
206 |
left: pointerX |
|
|
207 |
}); |
|
|
208 |
|
|
|
209 |
if($('#spinner').length > 0) |
|
|
210 |
{ |
|
|
211 |
$('#spinner').css( |
|
|
212 |
{ |
|
|
213 |
top: pointerY, |
|
|
214 |
left: pointerX |
|
|
215 |
}); |
|
|
216 |
} |
|
|
217 |
|
|
|
218 |
var snapshot = null; |
|
|
219 |
|
|
|
220 |
if(this.currentMode == 'MOSAIC' || this.currentMode == 'FILTER' && this.isMosaicFiltered) |
|
|
221 |
{ |
|
|
222 |
snapshot = this.pointerPositionToSN(pointerX, pointerY, true); |
|
|
223 |
|
|
|
224 |
if(this.previousZoomedSN != null) |
|
|
225 |
{ |
|
|
226 |
var id = this.previousZoomedSN.attr('id').replace('snapshotDiv-', ''); |
|
|
227 |
} |
|
|
228 |
|
|
|
229 |
if(snapshot == null) |
|
|
230 |
{ |
|
|
231 |
this.isOnASnapshot = false; |
|
|
232 |
this.lastNonNullSN = this.previousZoomedSN; |
|
|
233 |
this.preUnzoom(); |
|
|
234 |
|
|
|
235 |
$('#mainPointer').css('background-image', 'url(./img/cursors/pointer.png)'); |
|
|
236 |
} |
|
|
237 |
|
|
|
238 |
if(!this.isSecondPointerDisplayed && snapshot != null && (this.previousZoomedSN != null && snapshot.attr('id') !== this.previousZoomedSN.attr('id') || this.lastNonNullSN != null && snapshot.attr('id') === this.lastNonNullSN.attr('id')) && !this.areBothPointersHere) |
|
|
239 |
{ |
|
|
240 |
this.isOnASnapshot = true; |
|
|
241 |
this.previousZoomedSN = snapshot; |
|
|
242 |
this.lastNonNullSN = null; |
|
|
243 |
this.preZoom(snapshot); |
|
|
244 |
|
|
|
245 |
$('#mainPointer').css('background-image', 'url(./img/cursors/selector_gray.png)'); |
|
|
246 |
// console.log(this.isMainPointerDisplayed + ' ' + this.isSecondPointerDisplayed); |
|
|
247 |
} |
|
|
248 |
|
|
|
249 |
//Si on se trouve actuellement dans une recherche par gestures. |
|
|
250 |
// /!\ // RAJOUTE EN ATTENDANT UN GESTE DE CANCEL. |
|
|
251 |
if(this.isMosaicFiltered && !this.isMosaicFiltering) |
|
|
252 |
{ |
|
45
|
253 |
//console.log('CHECK IF ON NOTIFY GESTURE'); |
|
44
|
254 |
this.checkIfPointerIsOnSearchNotification(pointerX, pointerY, $('#mainPointer')); |
|
|
255 |
} |
|
|
256 |
} |
|
|
257 |
else if(this.currentMode == 'VIDEO' || this.currentMode == 'SEARCH' || this.currentMode == 'TIMELINE') |
|
|
258 |
{ |
|
|
259 |
//On vérifie si on veut sélectionner la TL. |
|
|
260 |
if((this.currentMode != 'TIMELINE' || this.isTLRequested) && this.playerIsReady && !this.isTLSelectedBySecondPointer && !this.helpDisplayed) |
|
|
261 |
{ |
|
|
262 |
// console.log('(1) SP : ' + this.isTLSelectedBySecondPointer + ' MP : ' + this.isTLSelectedByMainPointer); |
|
|
263 |
if(this.isTLSelected(true, true) && !this.isTLRequested) |
|
|
264 |
{ |
|
|
265 |
// console.log('(2) TIMELINE REQUESTED ' + this.date()); |
|
|
266 |
// $('.a').css('background-color', '#f00'); |
|
|
267 |
//On a demandé à aller dans la TL. |
|
|
268 |
this.isTLRequested = true; |
|
|
269 |
this.isTLSelectedByMainPointer = true; |
|
|
270 |
this.isTLSelectedBySecondPointer = false; |
|
|
271 |
// console.log('(1) SP : ' + this.isTLSelectedBySecondPointer + ' MP : ' + this.isTLSelectedByMainPointer); |
|
|
272 |
this.currentMode = 'TIMELINE'; |
|
|
273 |
this.player.widgets[0].selectTimeline(); |
|
|
274 |
$('#mainPointer').css('background-image', 'url(./img/cursors/selector_gray.png)'); |
|
|
275 |
|
|
45
|
276 |
if(!this.mouseInteractions) |
|
44
|
277 |
{ |
|
45
|
278 |
//On met le spinner gif sur le pointeur. |
|
|
279 |
var spinner = "<img id='spinner'></div>"; |
|
|
280 |
$('body').append(spinner); |
|
|
281 |
$('#spinner').css( |
|
|
282 |
{ |
|
|
283 |
position: 'absolute', |
|
|
284 |
top: $('#mainPointer').position().top, |
|
|
285 |
left: $('#mainPointer').position().left, |
|
|
286 |
width: 85, |
|
|
287 |
height: 85, |
|
|
288 |
'z-index': 600 |
|
|
289 |
}); |
|
|
290 |
$('#spinner').attr('src', './img/cursors/selector_anim.gif'); |
|
|
291 |
} |
|
44
|
292 |
|
|
|
293 |
this.selectTLTimeout = setTimeout(function() |
|
|
294 |
{ |
|
|
295 |
//On permet l'interaction après un laps de temps. |
|
|
296 |
_this.canSlideInTL = true; |
|
|
297 |
|
|
|
298 |
$('.notifications').remove(); |
|
|
299 |
_this.timelineTimeline(); |
|
|
300 |
|
|
|
301 |
// console.log('(4) TIMELINE SLIDE ' + _this.date()); |
|
|
302 |
}, this.config['timeoutSlideTL']); |
|
|
303 |
} |
|
|
304 |
else if(!this.isTLSelected(true, true) && this.isTLRequested) |
|
|
305 |
{ |
|
|
306 |
// console.log('(3) TIMELINE ABORTED'); |
|
|
307 |
this.isTLRequested = false; |
|
|
308 |
clearTimeout(this.selectTLTimeout); |
|
|
309 |
//On déselectionne la TL. |
|
|
310 |
this.exitTimeline(''); |
|
|
311 |
} |
|
|
312 |
} |
|
|
313 |
|
|
|
314 |
if(this.isTLSelectedByMainPointer && !this.isTLSelected(false, true)) |
|
|
315 |
{ |
|
|
316 |
// console.log('(4) TIMELINE EXITED'); |
|
|
317 |
// $('.a').css('background-color', '#0f0'); |
|
|
318 |
|
|
|
319 |
//On déselectionne la TL. |
|
|
320 |
this.exitTimeline(''); |
|
|
321 |
} |
|
|
322 |
|
|
|
323 |
// var zoomX = pointerX, zoomY = pointerY; |
|
|
324 |
var zoomX = pointerX - this.notifyLeftVideo, zoomY = pointerY - this.notifyTopVideo; |
|
|
325 |
|
|
|
326 |
//Si on a sélectionné la TL et qu'on a le pointeur droit dessus, on peut modifier la position de lecture. |
|
|
327 |
if(this.currentMode == 'TIMELINE' && this.playerIsReady && !this.isSecondPointerDisplayed && this.canSlideInTL) |
|
|
328 |
{ |
|
|
329 |
var time, TL = $('.Ldt-Timeline'), P = $('.LdtPlayer'); |
|
|
330 |
|
|
|
331 |
if(pointerX < P.position().left) |
|
|
332 |
{ |
|
|
333 |
time = 0; |
|
|
334 |
// console.log('trop à droite'); |
|
|
335 |
} |
|
|
336 |
else if(pointerX > (+P.position().left + TL.width())) |
|
|
337 |
{ |
|
|
338 |
time = this.player.widgets[0].source.getDuration().getSeconds(); |
|
|
339 |
// console.log('trop à gauche'); |
|
|
340 |
// time = 0; |
|
|
341 |
} |
|
|
342 |
else |
|
|
343 |
{ |
|
|
344 |
time = this.player.widgets[0].scaleIntervals(P.position().left, (+P.position().left + TL.width()), 0, this.player.widgets[0].source.getDuration().getSeconds(), pointerX); |
|
|
345 |
// console.log(time); |
|
|
346 |
} |
|
|
347 |
|
|
|
348 |
this.player.popcorn.currentTime(time); |
|
|
349 |
} |
|
|
350 |
|
|
|
351 |
|
|
|
352 |
//Si on se trouve actuellement dans une recherche par gestures. |
|
|
353 |
if(this.isCurrentlyInASearchByGesture) |
|
|
354 |
{ |
|
|
355 |
this.checkIfPointerIsOnSearchNotification(pointerX, pointerY, $('#mainPointer')); |
|
|
356 |
} |
|
|
357 |
|
|
|
358 |
//on vérifie si le pointeur est sur un snapshot zoomé. |
|
|
359 |
snapshot = this.pointerPositionToSN(zoomX, zoomY, true); |
|
|
360 |
if(snapshot == null) |
|
|
361 |
{ |
|
|
362 |
$('#mainPointer').css('background-image', 'url(./img/cursors/pointer.png)'); |
|
|
363 |
snapshot = this.pointerPositionToAN(pointerX, pointerY); |
|
|
364 |
} |
|
|
365 |
|
|
|
366 |
// console.log(snapshot); |
|
|
367 |
|
|
|
368 |
var intValueOfId; |
|
|
369 |
//Si c'est le cas. |
|
|
370 |
if(snapshot != null && snapshot.length > 0) |
|
|
371 |
{ |
|
|
372 |
//S'il s'agit d'un voisin additionnel. |
|
|
373 |
if(snapshot.attr('id').indexOf('borderNeighbour') != -1) |
|
|
374 |
{ |
|
|
375 |
intValueOfId = parseInt(snapshot.attr('id').replace('borderNeighbour-', '')); |
|
|
376 |
} |
|
|
377 |
//Sinon si c'est un voisin normal. |
|
|
378 |
else |
|
|
379 |
{ |
|
|
380 |
intValueOfId = parseInt(snapshot.attr('id').replace('snapshotDiv-', '')); |
|
|
381 |
} |
|
|
382 |
} |
|
|
383 |
else |
|
|
384 |
{ |
|
|
385 |
intValueOfId = -2; |
|
|
386 |
} |
|
|
387 |
|
|
|
388 |
//Si c'est un voisin additionnel. |
|
|
389 |
if(snapshot != null && snapshot.attr('id').indexOf('borderNeighbour') != -1) |
|
|
390 |
{ |
|
|
391 |
//S'il a été trouvé. |
|
|
392 |
if(intValueOfId > -1 && intValueOfId < 5) |
|
|
393 |
{ |
|
|
394 |
//On le sélectionne. |
|
|
395 |
this.selectNeighbour(snapshot, $('#mainPointer')); |
|
|
396 |
this.mainPointerExitBorder = true; |
|
|
397 |
this.mainPointerNeighbourSelectedId = intValueOfId + this.config['imagesToShow']; |
|
|
398 |
} |
|
|
399 |
else |
|
|
400 |
{ |
|
|
401 |
if(this.mainPointerNeighbourSelectedId != null && this.mainPointerNeighbourSelectedId > -1) |
|
|
402 |
{ |
|
|
403 |
this.deselectNeighbour(this.mainPointerNeighbourSelectedId); |
|
|
404 |
} |
|
|
405 |
} |
|
|
406 |
} |
|
|
407 |
else |
|
|
408 |
{ |
|
|
409 |
//Si c'est un voisin. |
|
|
410 |
if(_.include(this.neighboursIds, intValueOfId)) |
|
|
411 |
{ |
|
|
412 |
//On le sélectionne. |
|
|
413 |
this.selectNeighbour(snapshot, $('#mainPointer')); |
|
|
414 |
clearTimeout(this.moveToNeighbourTimeout); |
|
|
415 |
clearTimeout(this.mainPointerExitBorderTimeout); |
|
|
416 |
this.mainPointerExitBorder = true; |
|
|
417 |
this.mainPointerNeighbourSelectedId = intValueOfId; |
|
|
418 |
} |
|
|
419 |
else |
|
|
420 |
{ |
|
|
421 |
if(this.mainPointerNeighbourSelectedId != null && this.mainPointerNeighbourSelectedId > -1) |
|
|
422 |
{ |
|
|
423 |
this.deselectNeighbour(this.mainPointerNeighbourSelectedId); |
|
|
424 |
|
|
|
425 |
if(this.mainPointerExitBorder && !this.secondPointerExitBorder) |
|
|
426 |
{ |
|
|
427 |
this.correctMoveToNeighbour(this.mainPointerNeighbourSelectedId, zoomX, zoomY); |
|
|
428 |
} |
|
|
429 |
|
|
|
430 |
this.moveToNeighbourTimeout = setTimeout(function() |
|
|
431 |
{ |
|
|
432 |
_this.canMoveToNeighbour = false; |
|
|
433 |
}, this.config['timeoutMoveToNeighbour']); |
|
|
434 |
|
|
|
435 |
this.mainPointerExitBorderTimeout = setTimeout(function() |
|
|
436 |
{ |
|
|
437 |
if(_this.mainPointerExitBorder) |
|
|
438 |
{ |
|
|
439 |
// console.log('Main pointer left'); |
|
|
440 |
} |
|
|
441 |
_this.mainPointerExitBorder = false; |
|
|
442 |
}, this.config['timeoutUnzoom']); |
|
|
443 |
|
|
|
444 |
this.checkForDezoom(); |
|
|
445 |
} |
|
|
446 |
} |
|
|
447 |
} |
|
|
448 |
} |
|
|
449 |
} |
|
|
450 |
|
|
|
451 |
mosaic.prototype.refreshSecondPointer = function(x, y) |
|
|
452 |
{ |
|
|
453 |
if(this.currentMode == "NO-USER" || this.currentMode.indexOf('INCOMING-') != -1) |
|
|
454 |
{ |
|
|
455 |
return; |
|
|
456 |
} |
|
|
457 |
|
|
|
458 |
if(!this.mouseInteractions) |
|
|
459 |
{ |
|
|
460 |
x *= 7; |
|
|
461 |
y *= 7; |
|
|
462 |
x -= $(window).width() * 3 / 4; |
|
|
463 |
y -= $(window).height() * 2 / 4; |
|
|
464 |
} |
|
|
465 |
|
|
|
466 |
//Si le pointeur quitte la fenêtre en X, on ne le change pas. |
|
|
467 |
if(x < 0 || x > $(window).width()) |
|
|
468 |
{ |
|
|
469 |
x = this.secondPointerLastX; |
|
|
470 |
} |
|
|
471 |
//Sinon, on le met à jour. |
|
|
472 |
else |
|
|
473 |
{ |
|
|
474 |
this.secondPointerLastX = x; |
|
|
475 |
} |
|
|
476 |
|
|
|
477 |
//Si le pointeur quitte la fenêtre en Y, on ne le change pas. |
|
|
478 |
if(y < 0 || y > $(window).height()) |
|
|
479 |
{ |
|
|
480 |
y = this.secondPointerLastY; |
|
|
481 |
} |
|
|
482 |
//Sinon, on le met à jour. |
|
|
483 |
else |
|
|
484 |
{ |
|
|
485 |
this.secondPointerLastY = y; |
|
|
486 |
} |
|
|
487 |
|
|
|
488 |
var pointerX = x - $('#secondPointer').width()/2, pointerY = y - $('#secondPointer').height()/2; |
|
|
489 |
var _this = this; |
|
|
490 |
|
|
|
491 |
$('#secondPointer').css( |
|
|
492 |
{ |
|
|
493 |
top: pointerY, |
|
|
494 |
left: pointerX |
|
|
495 |
}); |
|
|
496 |
|
|
|
497 |
var snapshot = null; |
|
|
498 |
|
|
|
499 |
if(this.currentMode == 'MOSAIC' || this.currentMode == 'FILTER' && this.isMosaicFiltered) |
|
|
500 |
{ |
|
|
501 |
snapshot = this.pointerPositionToSN(pointerX, pointerY, false); |
|
|
502 |
|
|
|
503 |
if(this.previousZoomedSN != null) |
|
|
504 |
{ |
|
|
505 |
var id = this.previousZoomedSN.attr('id').replace('snapshotDiv-', ''); |
|
|
506 |
} |
|
|
507 |
|
|
|
508 |
if(snapshot == null) |
|
|
509 |
{ |
|
|
510 |
this.isOnASnapshot = false; |
|
|
511 |
this.lastNonNullSN = this.previousZoomedSN; |
|
|
512 |
this.preUnzoom(); |
|
|
513 |
|
|
|
514 |
$('#secondPointer').css('background-image', 'url(./img/cursors/pointer2.png)'); |
|
|
515 |
} |
|
|
516 |
|
|
|
517 |
if(!this.isMainPointerDisplayed && snapshot != null && (this.previousZoomedSN != null && snapshot.attr('id') !== this.previousZoomedSN.attr('id') || this.lastNonNullSN != null && snapshot.attr('id') === this.lastNonNullSN.attr('id')) && !this.areBothPointersHere) |
|
|
518 |
{ |
|
|
519 |
this.isOnASnapshot = true; |
|
|
520 |
this.previousZoomedSN = snapshot; |
|
|
521 |
this.lastNonNullSN = null; |
|
|
522 |
this.preZoom(snapshot); |
|
|
523 |
|
|
|
524 |
$('#secondPointer').css('background-image', 'url(./img/cursors/selector_gray.png)'); |
|
|
525 |
// console.log(this.isMainPointerDisplayed + ' ' + this.isSecondPointerDisplayed); |
|
|
526 |
} |
|
|
527 |
|
|
|
528 |
//Si on se trouve actuellement dans une recherche par gestures. |
|
|
529 |
// /!\ // RAJOUTE EN ATTENDANT UN GESTE DE CANCEL. |
|
|
530 |
if(this.isMosaicFiltered && !this.isMosaicFiltering) |
|
|
531 |
{ |
|
|
532 |
this.checkIfPointerIsOnSearchNotification(pointerX, pointerY, $('#secondPointer')); |
|
|
533 |
} |
|
|
534 |
} |
|
|
535 |
else if(this.currentMode == 'VIDEO' || this.currentMode == 'SEARCH' || this.currentMode == 'TIMELINE') |
|
|
536 |
{ |
|
|
537 |
//On vérifie si on veut sélectionner la TL. |
|
|
538 |
if((this.currentMode != 'TIMELINE' || this.isTLRequested) && this.playerIsReady && !this.isTLSelectedByMainPointer && !this.helpDisplayed) |
|
|
539 |
{ |
|
|
540 |
// console.log('(1) SP : ' + this.isTLSelectedBySecondPointer + ' MP : ' + this.isTLSelectedByMainPointer); |
|
|
541 |
if(this.isTLSelected(true, false) && !this.isTLRequested) |
|
|
542 |
{ |
|
|
543 |
// console.log('(2) TIMELINE REQUESTED ' + this.date()); |
|
|
544 |
// $('.a').css('background-color', '#f00'); |
|
|
545 |
//On a demandé à aller dans la TL. |
|
|
546 |
this.isTLRequested = true; |
|
|
547 |
this.isTLSelectedBySecondPointer = true; |
|
|
548 |
this.isTLSelectedByMainPointer = false; |
|
|
549 |
// console.log('(1) SP : ' + this.isTLSelectedBySecondPointer + ' MP : ' + this.isTLSelectedByMainPointer); |
|
|
550 |
this.currentMode = 'TIMELINE'; |
|
|
551 |
this.player.widgets[0].selectTimeline(); |
|
|
552 |
$('#secondPointer').css('background-image', 'url(./img/cursors/selector_gray.png)'); |
|
|
553 |
|
|
45
|
554 |
if(!this.mouseInteractions) |
|
44
|
555 |
{ |
|
45
|
556 |
//On met le spinner gif sur le pointeur. |
|
|
557 |
var spinner = "<div id='spinner'></div>"; |
|
|
558 |
$('body').append(spinner); |
|
|
559 |
$('#spinner').css( |
|
|
560 |
{ |
|
|
561 |
position: 'absolute', |
|
|
562 |
'background-repeat': 'no-repeat', |
|
|
563 |
top: $('#mainPointer').position().top, |
|
|
564 |
left: $('#mainPointer').position().left, |
|
|
565 |
width: 85, |
|
|
566 |
height: 85, |
|
|
567 |
'z-index': 600 |
|
|
568 |
}); |
|
|
569 |
$('#spinner').attr('src', './img/cursors/selector_anim.gif'); |
|
|
570 |
} |
|
44
|
571 |
|
|
|
572 |
this.selectTLTimeout = setTimeout(function() |
|
|
573 |
{ |
|
|
574 |
//On permet l'interaction après un laps de temps. |
|
|
575 |
_this.canSlideInTL = true; |
|
|
576 |
|
|
|
577 |
$('.notifications').remove(); |
|
|
578 |
_this.timelineTimeline(); |
|
|
579 |
|
|
|
580 |
// console.log('(4) TIMELINE SLIDE ' + _this.date()); |
|
|
581 |
}, this.config['timeoutSlideTL']); |
|
|
582 |
} |
|
|
583 |
else if(!this.isTLSelected(true, false) && this.isTLRequested) |
|
|
584 |
{ |
|
|
585 |
// console.log('(3) TIMELINE ABORTED'); |
|
|
586 |
this.isTLRequested = false; |
|
|
587 |
clearTimeout(this.selectTLTimeout); |
|
|
588 |
//On déselectionne la TL. |
|
|
589 |
this.exitTimeline(''); |
|
|
590 |
} |
|
|
591 |
} |
|
|
592 |
|
|
|
593 |
if(this.isTLSelectedByMainPointer && !this.isTLSelected(false, false)) |
|
|
594 |
{ |
|
|
595 |
// console.log('(4) TIMELINE EXITED'); |
|
|
596 |
// $('.a').css('background-color', '#0f0'); |
|
|
597 |
|
|
|
598 |
//On déselectionne la TL. |
|
|
599 |
this.exitTimeline(''); |
|
|
600 |
} |
|
|
601 |
|
|
|
602 |
// var zoomX = pointerX, zoomY = pointerY; |
|
|
603 |
var zoomX = pointerX - this.notifyLeftVideo, zoomY = pointerY - this.notifyTopVideo; |
|
|
604 |
|
|
|
605 |
//Si on a sélectionné la TL et qu'on a le pointeur droit dessus, on peut modifier la position de lecture. |
|
|
606 |
if(this.currentMode == 'TIMELINE' && this.playerIsReady && !this.isMainPointerDisplayed && this.canSlideInTL) |
|
|
607 |
{ |
|
|
608 |
var time, TL = $('.Ldt-Timeline'), P = $('.LdtPlayer'); |
|
|
609 |
|
|
|
610 |
if(pointerX < P.position().left) |
|
|
611 |
{ |
|
|
612 |
time = 0; |
|
|
613 |
// console.log('trop à droite'); |
|
|
614 |
} |
|
|
615 |
else if(pointerX > (+P.position().left + TL.width())) |
|
|
616 |
{ |
|
|
617 |
time = this.player.widgets[0].source.getDuration().getSeconds(); |
|
|
618 |
// console.log('trop à gauche'); |
|
|
619 |
// time = 0; |
|
|
620 |
} |
|
|
621 |
else |
|
|
622 |
{ |
|
|
623 |
time = this.player.widgets[0].scaleIntervals(P.position().left, (+P.position().left + TL.width()), 0, this.player.widgets[0].source.getDuration().getSeconds(), pointerX); |
|
|
624 |
// console.log(time); |
|
|
625 |
} |
|
|
626 |
|
|
|
627 |
this.player.popcorn.currentTime(time); |
|
|
628 |
} |
|
|
629 |
|
|
|
630 |
//Si on se trouve actuellement dans une recherche par gestures. |
|
|
631 |
if(this.isCurrentlyInASearchByGesture) |
|
|
632 |
{ |
|
|
633 |
this.checkIfPointerIsOnSearchNotification(pointerX, pointerY, $('#secondPointer')); |
|
|
634 |
} |
|
|
635 |
|
|
|
636 |
//on vérifie si le pointeur est sur un snapshot zoomé. |
|
|
637 |
snapshot = this.pointerPositionToSN(zoomX, zoomY, false); |
|
|
638 |
if(snapshot == null) |
|
|
639 |
{ |
|
|
640 |
$('#secondPointer').css('background-image', 'url(./img/cursors/pointer2.png)'); |
|
|
641 |
snapshot = this.pointerPositionToAN(pointerX, pointerY); |
|
|
642 |
} |
|
|
643 |
|
|
|
644 |
var intValueOfId; |
|
|
645 |
//Si c'est le cas. |
|
|
646 |
if(snapshot != null && snapshot.length > 0) |
|
|
647 |
{ |
|
|
648 |
//S'il s'agit d'un voisin additionnel. |
|
|
649 |
if(snapshot.attr('id').indexOf('borderNeighbour') != -1) |
|
|
650 |
{ |
|
|
651 |
intValueOfId = parseInt(snapshot.attr('id').replace('borderNeighbour-', '')); |
|
|
652 |
} |
|
|
653 |
//Sinon si c'est un voisin normal. |
|
|
654 |
else |
|
|
655 |
{ |
|
|
656 |
intValueOfId = parseInt(snapshot.attr('id').replace('snapshotDiv-', '')); |
|
|
657 |
} |
|
|
658 |
} |
|
|
659 |
else |
|
|
660 |
{ |
|
|
661 |
intValueOfId = -2; |
|
|
662 |
} |
|
|
663 |
|
|
|
664 |
//Si c'est un voisin additionnel. |
|
|
665 |
if(snapshot != null && snapshot.attr('id').indexOf('borderNeighbour') != -1) |
|
|
666 |
{ |
|
|
667 |
//S'il a été trouvé. |
|
|
668 |
if(intValueOfId > -1 && intValueOfId < 5) |
|
|
669 |
{ |
|
|
670 |
//On le sélectionne. |
|
|
671 |
this.selectNeighbour(snapshot, $('#secondPointer')); |
|
|
672 |
this.secondPointerExitBorder = true; |
|
|
673 |
this.secondPointerNeighbourSelectedId = intValueOfId + this.config['imagesToShow']; |
|
|
674 |
} |
|
|
675 |
else |
|
|
676 |
{ |
|
|
677 |
if(this.secondPointerNeighbourSelectedId != null && this.secondPointerNeighbourSelectedId > -1) |
|
|
678 |
{ |
|
|
679 |
this.deselectNeighbour(this.secondPointerNeighbourSelectedId); |
|
|
680 |
|
|
|
681 |
/*this.secondPointerExitBorderTimeout = setTimeout(function() |
|
|
682 |
{ |
|
|
683 |
if(_this.secondPointerExitBorder) |
|
|
684 |
{ |
|
|
685 |
console.log('Second pointer left'); |
|
|
686 |
} |
|
|
687 |
_this.secondPointerExitBorder = false; |
|
|
688 |
}, this.config['timeoutUnzoom']);*/ |
|
|
689 |
|
|
|
690 |
this.checkForDezoom(); |
|
|
691 |
} |
|
|
692 |
} |
|
|
693 |
} |
|
|
694 |
else |
|
|
695 |
{ |
|
|
696 |
//Si c'est un voisin. |
|
|
697 |
if(_.include(this.neighboursIds, intValueOfId)) |
|
|
698 |
{ |
|
|
699 |
//On le sélectionne. |
|
|
700 |
this.selectNeighbour(snapshot, $('#secondPointer')); |
|
|
701 |
clearTimeout(this.moveToNeighbourTimeout); |
|
|
702 |
clearTimeout(this.secondPointerExitBorderTimeout); |
|
|
703 |
this.secondPointerExitBorder = true; |
|
|
704 |
this.secondPointerNeighbourSelectedId = intValueOfId; |
|
|
705 |
} |
|
|
706 |
else |
|
|
707 |
{ |
|
|
708 |
if(this.secondPointerNeighbourSelectedId != null && this.secondPointerNeighbourSelectedId > -1) |
|
|
709 |
{ |
|
|
710 |
this.deselectNeighbour(this.secondPointerNeighbourSelectedId); |
|
|
711 |
|
|
|
712 |
if(!this.mainPointerExitBorder && this.secondPointerExitBorder) |
|
|
713 |
{ |
|
|
714 |
this.correctMoveToNeighbour(this.secondPointerNeighbourSelectedId, zoomX, zoomY); |
|
|
715 |
} |
|
|
716 |
|
|
|
717 |
this.moveToNeighbourTimeout = setTimeout(function() |
|
|
718 |
{ |
|
|
719 |
_this.canMoveToNeighbour = false; |
|
|
720 |
}, this.config['timeoutMoveToNeighbour']); |
|
|
721 |
|
|
|
722 |
this.secondPointerExitBorderTimeout = setTimeout(function() |
|
|
723 |
{ |
|
|
724 |
if(_this.secondPointerExitBorder) |
|
|
725 |
{ |
|
|
726 |
// console.log('Second pointer left'); |
|
|
727 |
} |
|
|
728 |
_this.secondPointerExitBorder = false; |
|
|
729 |
}, this.config['timeoutUnzoom']); |
|
|
730 |
|
|
|
731 |
this.checkForDezoom(); |
|
|
732 |
} |
|
|
733 |
} |
|
|
734 |
} |
|
|
735 |
} |
|
|
736 |
} |
|
|
737 |
|
|
|
738 |
mosaic.prototype.detectIdlePointers = function() |
|
|
739 |
{ |
|
|
740 |
var mainPointer = $('#mainPointer'); |
|
|
741 |
var secondPointer = $('#secondPointer'); |
|
|
742 |
|
|
|
743 |
//Si la position des pointeurs au début de l'analyse d'idle change de plus ou moins leur taille par rapport à leur position actuelle. |
|
|
744 |
if(Math.abs(this.mainPointerIdleStartX - this.mainPointerLastX) > mainPointer.width() || Math.abs(this.mainPointerIdleStartY - this.mainPointerLastY) > mainPointer.height() || |
|
|
745 |
Math.abs(this.secondPointerIdleStartX - this.secondPointerLastX) > secondPointer.width() || Math.abs(this.secondPointerIdleStartY - this.secondPointerLastY) > secondPointer.height()) |
|
|
746 |
{ |
|
|
747 |
//On réinitialise les dernières positions connues. |
|
|
748 |
this.mainPointerIdleStartX = this.mainPointerLastX; |
|
|
749 |
this.mainPointerIdleStartY = this.mainPointerLastY; |
|
|
750 |
this.secondPointerIdleStartX = this.secondPointerLastX; |
|
|
751 |
this.secondPointerIdleStartY = this.secondPointerLastY; |
|
|
752 |
|
|
|
753 |
this.removeIdlePointers(); |
|
|
754 |
this.pointersIdleNeedLaunch = true; |
|
|
755 |
} |
|
|
756 |
|
|
|
757 |
if(this.helpDisplayed) |
|
|
758 |
{ |
|
|
759 |
this.removeHelp(); |
|
|
760 |
} |
|
|
761 |
|
|
|
762 |
if((this.currentMode == 'SEARCH' || this.currentMode == 'FILTER') && !this.isSearchByCurvesOn) |
|
|
763 |
{ |
|
|
764 |
// this.isSearchByCurvesOn = true; |
|
|
765 |
// this.startSearch(); |
|
|
766 |
} |
|
|
767 |
// console.log('DETECT IDLE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'); |
|
|
768 |
} |
|
|
769 |
|
|
|
770 |
mosaic.prototype.removeIdlePointers = function() |
|
|
771 |
{ |
|
|
772 |
clearTimeout(this.pointersSearchIdleTimeout); |
|
|
773 |
// console.log(this.date() + ' - ra'); |
|
|
774 |
} |
|
|
775 |
|
|
|
776 |
mosaic.prototype.launchIdlePointers = function() |
|
|
777 |
{ |
|
|
778 |
var _this = this; |
|
|
779 |
|
|
|
780 |
//Si on est en mode TL, on ne peut pas effectuer de recherche. |
|
|
781 |
if(this.currentMode == 'TIMELINE' || (!this.playerIsReady && (this.currentMode == 'VIDEO' || this.currentMode == 'SEARCH'))) |
|
|
782 |
{ |
|
|
783 |
return; |
|
|
784 |
} |
|
|
785 |
|
|
|
786 |
if(this.currentMode == 'VIDEO')// || this.currentMode == 'SEARCH') |
|
|
787 |
{ |
|
|
788 |
//On peut le faire que sur la video au dessus de la TL. |
|
|
789 |
var mainPointer = $('#mainPointer'), secondPointer = $('#secondPointer'), TL = $('.Ldt-Timeline'); |
|
|
790 |
var TLwidth = TL.width(), TLheight = TL.height(); |
|
|
791 |
var Ptop = $('.LdtPlayer').position().top, Pleft = $('.LdtPlayer').position().left; |
|
|
792 |
var Pheight = $('.LdtPlayer').height(); |
|
|
793 |
var MPx = mainPointer.position().left + mainPointer.width() / 2, MPy = mainPointer.position().top + mainPointer.height() / 2; |
|
|
794 |
var SPx = secondPointer.position().left + secondPointer.width() / 2, SPy = secondPointer.position().top + secondPointer.height() / 2; |
|
|
795 |
|
|
|
796 |
if(MPx < Pleft || MPx > (+Pleft + TLwidth) || MPy < Ptop || MPy > (+Ptop + Pheight - TLheight) || |
|
|
797 |
SPx < Pleft || SPx > (+Pleft + TLwidth) || SPy < Ptop || SPy > (+Ptop + Pheight - TLheight)) |
|
|
798 |
{ |
|
|
799 |
return; |
|
|
800 |
} |
|
|
801 |
} |
|
|
802 |
|
|
|
803 |
//A la fin du timeout, si rien n'est venu l'interrompre, on entre en recherche/filtrage en fonction du mode dans lequel on se trouve. |
|
|
804 |
this.pointersSearchIdleTimeout = setTimeout(function() |
|
|
805 |
{ |
|
|
806 |
if(!_this.areBothPointersHere) |
|
|
807 |
{ |
|
|
808 |
return; |
|
|
809 |
} |
|
|
810 |
|
|
|
811 |
// console.log('rdy for idle'); |
|
|
812 |
|
|
|
813 |
if(_this.currentMode == "MOSAIC") |
|
|
814 |
{ |
|
|
815 |
_this.currentMode = "FILTER"; |
|
|
816 |
// _this.currentMode = "FILTR"; |
|
|
817 |
_this.isMosaicFiltered = true; |
|
|
818 |
|
|
|
819 |
console.log(_this.date() + ' - ENTRE EN MODE FILTRAGE'); |
|
|
820 |
|
|
|
821 |
$('.notifications').remove(); |
|
|
822 |
_this.filterSearch(); |
|
|
823 |
} |
|
|
824 |
else if(_this.currentMode == "VIDEO" || _this.currentMode == "TIMELINE") |
|
|
825 |
{ |
|
|
826 |
_this.currentMode = "SEARCH"; |
|
|
827 |
|
|
|
828 |
console.log(_this.date() + ' - ENTRE EN MODE RECHERCHE'); |
|
|
829 |
// console.log(''); |
|
|
830 |
|
|
|
831 |
$('.notifications').remove(); |
|
|
832 |
_this.searchSearch(); |
|
|
833 |
} |
|
|
834 |
|
|
|
835 |
if(!_this.canNotifyHelp) |
|
|
836 |
{ |
|
|
837 |
_this.canNotifyHelpTimeout = setTimeout(function() |
|
|
838 |
{ |
|
|
839 |
// console.log(_this.date() + ' CAN NOTIFY HELP'); |
|
|
840 |
_this.canNotifyHelp = true; |
|
|
841 |
}, _this.config['timeoutCanNotifyHelp']); |
|
|
842 |
} |
|
|
843 |
|
|
|
844 |
//Si on est déjà en recherche, et que l'aide n'est pas encore affichée, on l'affiche. |
|
|
845 |
/*if(_this.currentMode == 'SEARCH' && _this.canNotifyHelp) |
|
|
846 |
{ |
|
|
847 |
_this.notifyHelp(false); |
|
|
848 |
} |
|
|
849 |
if(_this.currentMode == 'FILTER' && _this.canNotifyHelp) |
|
|
850 |
{ |
|
|
851 |
_this.notifyHelp(true); |
|
|
852 |
}*/ |
|
|
853 |
|
|
|
854 |
}, this.config['timeoutPointersIdle']); |
|
|
855 |
} |
|
|
856 |
|
|
|
857 |
mosaic.prototype.checkForBothPointersHere = function() |
|
|
858 |
{ |
|
|
859 |
var _this = this; |
|
|
860 |
|
|
|
861 |
if(!this.areBothPointersTimeoutLaunched) |
|
|
862 |
{ |
|
|
863 |
this.areBothPointersHereTimeout = setTimeout(function() |
|
|
864 |
{ |
|
|
865 |
_this.areBothPointersHere = false; |
|
|
866 |
/*if(_this.isSearchByCurvesOn) |
|
|
867 |
{ |
|
|
868 |
_this.leaveSearch(); |
|
|
869 |
}*/ |
|
|
870 |
}, this.config['timeoutAreBothPointersHere']); |
|
|
871 |
|
|
|
872 |
this.areBothPointersHereTimeoutLaunched = true; |
|
|
873 |
} |
|
|
874 |
} |
|
|
875 |
|
|
|
876 |
mosaic.prototype.removeCheckForBothPointersHere = function() |
|
|
877 |
{ |
|
|
878 |
// console.log('TRY QUIT'); |
|
|
879 |
|
|
|
880 |
// if(this.areBothPointersTimeoutLaunched) |
|
|
881 |
// { |
|
|
882 |
clearTimeout(this.areBothPointersHereTimeout); |
|
|
883 |
// console.log('QUIT'); |
|
|
884 |
// } |
|
|
885 |
this.areBothPointersHereTimeoutLaunched = false; |
|
|
886 |
} |
|
|
887 |
|
|
|
888 |
/* |
|
|
889 |
* Vérifie si on se trouve sur la notification de recherche par gesture. |
|
|
890 |
*/ |
|
|
891 |
mosaic.prototype.checkIfPointerIsOnSearchNotification = function(x, y, pointer) |
|
|
892 |
{ |
|
|
893 |
var _this = this; |
|
|
894 |
var notification_search = $('#notify_search_1gesture'); |
|
|
895 |
|
|
|
896 |
//Si la notification de recherche existe (dans le player). |
|
|
897 |
if(notification_search.length > 0) |
|
|
898 |
{ |
|
|
899 |
//Pictogramme actuel de la notification. |
|
|
900 |
var currentPicto = notification_search.css('background-image'); |
|
|
901 |
|
|
|
902 |
//y -= this.MPTop_margin; |
|
|
903 |
|
|
|
904 |
/*console.log('==================================='); |
|
|
905 |
console.log('x : ' + x + ' > ' + notification_search.position().left); |
|
|
906 |
console.log('x : ' + x + ' < ' + (+notification_search.position().left + notification_search.width())); |
|
|
907 |
console.log('y : ' + y + ' > ' + notification_search.position().top); |
|
|
908 |
console.log('y : ' + y + ' < ' + (+notification_search.position().top + notification_search.height())); |
|
|
909 |
console.log('===================================');*/ |
|
|
910 |
|
|
|
911 |
//Si le pointeur est sur la notification. |
|
|
912 |
if(x > notification_search.position().left && x < (+notification_search.position().left + notification_search.width()) && y > notification_search.position().top && y < (+notification_search.position().top + notification_search.height())) |
|
|
913 |
{ |
|
45
|
914 |
/*if($('#a').length == 0) |
|
44
|
915 |
{ |
|
45
|
916 |
var a = "<div id='a'></div>"; |
|
|
917 |
$('body').append(a); |
|
|
918 |
$('#a').css( |
|
44
|
919 |
{ |
|
45
|
920 |
left: notification_search.position().left, |
|
|
921 |
top: notification_search.position().top, |
|
|
922 |
width: notification_search.width(), |
|
|
923 |
height: notification_search.height(), |
|
|
924 |
"background-color": "#fff", |
|
44
|
925 |
position: 'absolute', |
|
|
926 |
}); |
|
45
|
927 |
}*/ |
|
|
928 |
|
|
|
929 |
if(!this.alreadyOnNotification && ($('#spinner').length == 0 && !this.mouseInteractions || this.mouseInteractions)) |
|
|
930 |
{ |
|
|
931 |
notification_search.css('background-image', currentPicto.replace('/big/' + (this.mouseInteractions ? 'MI/' : '') + 'valid/', '/big/' + (this.mouseInteractions ? 'MI/' : '') + 'hover/')); |
|
|
932 |
|
|
|
933 |
this.gestureDelRequested = true; |
|
|
934 |
|
|
|
935 |
// console.log(this.date() + ' try remove not ' + currentPicto.replace('/big/' + (this.mouseInteractions ? 'MI/' : '') + 'valid/', '/big/' + (this.mouseInteractions ? 'MI/' : '') + 'hover/')); |
|
|
936 |
|
|
|
937 |
if(!this.mouseInteractions) |
|
44
|
938 |
{ |
|
45
|
939 |
//On met le spinner gif sur le pointeur. |
|
|
940 |
var spinner = "<img id='spinner'></div>"; |
|
|
941 |
$('body').append(spinner); |
|
|
942 |
$('#spinner').css( |
|
|
943 |
{ |
|
|
944 |
position: 'absolute', |
|
|
945 |
top: pointer.position().top, |
|
|
946 |
left: pointer.position().left, |
|
|
947 |
width: 85, |
|
|
948 |
height: 85, |
|
|
949 |
'z-index': 600 |
|
|
950 |
}); |
|
|
951 |
$('#spinner').attr('src', './img/cursors/selector_anim.gif'); |
|
44
|
952 |
|
|
45
|
953 |
this.removeNotificationByGestureTimeout = setTimeout(function() |
|
44
|
954 |
{ |
|
45
|
955 |
if(_this.currentMode == 'SEARCH') |
|
|
956 |
{ |
|
|
957 |
_this.player.widgets[0].removeSearchByGesture(); |
|
|
958 |
_this.currentMode = 'VIDEO'; |
|
|
959 |
} |
|
|
960 |
else if(_this.currentMode == 'TIMELINE') |
|
|
961 |
{ |
|
|
962 |
_this.player.widgets[0].removeSearchByGesture(); |
|
|
963 |
_this.currentMode = 'TIMELINE'; |
|
|
964 |
} |
|
|
965 |
else if(_this.currentMode == 'FILTER') |
|
|
966 |
{ |
|
|
967 |
_this.removeFilter(); |
|
|
968 |
} |
|
|
969 |
|
|
|
970 |
_this.alreadyOnNotification = false; |
|
|
971 |
_this.isCurrentlyInASearchByGesture = false; |
|
|
972 |
_this.currentSearchGesture = ''; |
|
|
973 |
_this.canNotifyHelp = false; |
|
|
974 |
}, this.config['timeoutRemoveNotificationByGesture']); |
|
|
975 |
} |
|
|
976 |
else |
|
|
977 |
{ |
|
|
978 |
|
|
|
979 |
} |
|
|
980 |
|
|
44
|
981 |
this.alreadyOnNotification = true; |
|
|
982 |
} |
|
45
|
983 |
|
|
|
984 |
return true; |
|
44
|
985 |
} |
|
|
986 |
else |
|
|
987 |
{ |
|
|
988 |
if(this.alreadyOnNotification) |
|
|
989 |
{ |
|
45
|
990 |
notification_search.css('background-image', currentPicto.replace('/big/' + (this.mouseInteractions ? 'MI/' : '') + 'hover/', '/big/' + (this.mouseInteractions ? 'MI/' : '') + 'valid/')); |
|
|
991 |
|
|
|
992 |
this.gestureDelRequested = false; |
|
|
993 |
|
|
|
994 |
// console.log(currentPicto.replace('/big/' + (this.mouseInteractions ? 'MI/' : '') + 'hover/', '/big/' + (this.mouseInteractions ? 'MI/' : '') + 'valid/')); |
|
|
995 |
|
|
44
|
996 |
clearTimeout(this.removeNotificationByGestureTimeout); |
|
|
997 |
this.alreadyOnNotification = false; |
|
|
998 |
$('#spinner').remove(); |
|
|
999 |
} |
|
45
|
1000 |
|
|
|
1001 |
return false; |
|
|
1002 |
} |
|
|
1003 |
} |
|
|
1004 |
|
|
|
1005 |
return false; |
|
|
1006 |
} |
|
|
1007 |
|
|
|
1008 |
/* |
|
|
1009 |
* Si on se trouve sur la notification de recherche par gesture, on la supprime. |
|
|
1010 |
*/ |
|
|
1011 |
mosaic.prototype.removeSearchNotificationIfOnIt = function(x, y) |
|
|
1012 |
{ |
|
|
1013 |
var _this = this; |
|
|
1014 |
|
|
|
1015 |
var notification_search = $('#notify_search_1gesture'); |
|
|
1016 |
|
|
|
1017 |
//Si la notification de recherche existe (dans le player). |
|
|
1018 |
if(notification_search.length > 0) |
|
|
1019 |
{ |
|
|
1020 |
if(x > notification_search.position().left && x < (+notification_search.position().left + notification_search.width()) && y > notification_search.position().top && y < (+notification_search.position().top + notification_search.height())) |
|
|
1021 |
{ |
|
|
1022 |
$('.notifications').remove(); |
|
|
1023 |
if(_this.currentMode == 'SEARCH') |
|
|
1024 |
{ |
|
|
1025 |
_this.player.widgets[0].removeSearchByGesture(); |
|
|
1026 |
_this.currentMode = 'VIDEO'; |
|
|
1027 |
} |
|
|
1028 |
else if(_this.currentMode == 'TIMELINE') |
|
|
1029 |
{ |
|
|
1030 |
_this.player.widgets[0].removeSearchByGesture(); |
|
|
1031 |
_this.currentMode = 'TIMELINE'; |
|
|
1032 |
} |
|
|
1033 |
else if(_this.currentMode == 'FILTER') |
|
|
1034 |
{ |
|
|
1035 |
_this.removeFilter(); |
|
|
1036 |
} |
|
|
1037 |
|
|
|
1038 |
_this.alreadyOnNotification = false; |
|
|
1039 |
_this.isCurrentlyInASearchByGesture = false; |
|
|
1040 |
_this.curvesGesturesFound = false; |
|
|
1041 |
_this.canDrawNextCurve = false; |
|
|
1042 |
_this.isSearchByCurvesOn = false; |
|
|
1043 |
_this.canNotifyHelp = false; |
|
|
1044 |
|
|
|
1045 |
//Si on est dans une vidéo, on laisse cette variable afin de ne pas dézoomer / bouger. |
|
|
1046 |
if(_this.currentMode != 'VIDEO' && _this.currentMode != 'TIMELINE') |
|
|
1047 |
{ |
|
|
1048 |
_this.gestureDelRequested = false; |
|
|
1049 |
} |
|
44
|
1050 |
} |
|
|
1051 |
} |
|
|
1052 |
} |