|
52
|
1 |
/* |
|
|
2 |
* This file is part of the TraKERS\Front IDILL package. |
|
|
3 |
* |
|
|
4 |
* (c) IRI <http://www.iri.centrepompidou.fr/> |
|
|
5 |
* |
|
|
6 |
* For the full copyright and license information, please view the LICENSE |
|
|
7 |
* file that was distributed with this source code. |
|
|
8 |
*/ |
|
|
9 |
|
|
|
10 |
/* |
|
|
11 |
* Projet : TraKERS |
|
|
12 |
* Module : Front IDILL |
|
|
13 |
* Fichier : pointers.js |
|
|
14 |
* |
|
|
15 |
* Auteur : alexandre.bastien@iri.centrepompidou.fr |
|
|
16 |
* |
|
|
17 |
* Fonctionnalités : Définit les fonctions d'interaction avec les pointeurs. |
|
|
18 |
*/ |
|
|
19 |
|
|
44
|
20 |
/* |
|
|
21 |
* Affiche les pointeurs. |
|
52
|
22 |
* Est appelé dans le fichier : |
|
|
23 |
* mosaic > fonction loadMosaic. |
|
44
|
24 |
*/ |
|
52
|
25 |
Mosaic.prototype.addPointers = function() |
|
44
|
26 |
{ |
|
52
|
27 |
//On n'affiche pas les pointeurs en mode d'interaction souris. |
|
|
28 |
if(this.config.mouseInteractions) |
|
|
29 |
{ |
|
|
30 |
return; |
|
|
31 |
} |
|
58
|
32 |
|
|
|
33 |
this.minX = $(window).width(); |
|
|
34 |
this.minY = $(window).height(); |
|
|
35 |
this.maxX = 0; |
|
|
36 |
this.maxY = 0; |
|
52
|
37 |
|
|
|
38 |
//On crée et ajoute les pointeurs. |
|
|
39 |
var mainPointer = '<div id="mainPointer" class="pointers"></div>'; |
|
|
40 |
var secondPointer = '<div id="secondPointer" class="pointers"></div>'; |
|
|
41 |
$('body').append(mainPointer + secondPointer); |
|
|
42 |
|
|
|
43 |
//On les place au centre de l'écran. |
|
|
44 |
$('#secondPointer').css( |
|
|
45 |
{ |
|
|
46 |
top: $(window).height() / 2 - $('#secondPointer').height() / 2, |
|
|
47 |
left: $(window).width() / 4 - $('#secondPointer').width() / 2 |
|
|
48 |
}); |
|
|
49 |
|
|
|
50 |
this.secondPointerLastX = $(window).width() / 4 - $('#secondPointer').width() / 2; |
|
|
51 |
this.secondPointerLastY = $(window).height() / 2 - $('#secondPointer').height() / 2; |
|
|
52 |
|
|
|
53 |
$('#mainPointer').css( |
|
|
54 |
{ |
|
|
55 |
top: $(window).height() / 2 - $('#mainPointer').height() / 2, |
|
|
56 |
left: $(window).width() * 3 / 4 - $('#mainPointer').width() / 2 |
|
|
57 |
}); |
|
44
|
58 |
|
|
52
|
59 |
this.mainPointerLastX = $(window).width() * 3 / 4 - $('#mainPointer').width() / 2; |
|
|
60 |
this.mainPointerLastY = $(window).height() / 2 - $('#mainPointer').height() / 2; |
|
|
61 |
|
|
|
62 |
//On met à jour les anciennes coordonnées des pointeurs. |
|
|
63 |
this.mainPointerIdleStartX = this.mainPointerLastX; |
|
|
64 |
this.mainPointerIdleStartY = this.mainPointerLastY; |
|
|
65 |
this.secondPointerIdleStartX = this.secondPointerLastX; |
|
|
66 |
this.secondPointerIdleStartY = this.secondPointerLastY; |
|
44
|
67 |
} |
|
|
68 |
|
|
|
69 |
/* |
|
|
70 |
* Affiche/Masque le pointeur principal. |
|
|
71 |
* Main est un booléen valant vrai s'il faut afficher le pointeur. |
|
52
|
72 |
* Est appelé dans le fichier : |
|
|
73 |
* client > fonction processMsg. |
|
44
|
74 |
*/ |
|
52
|
75 |
Mosaic.prototype.mainPointerDisplay = function(main) |
|
44
|
76 |
{ |
|
52
|
77 |
var _this = this; |
|
|
78 |
|
|
|
79 |
//On n'affiche pas les pointeurs dans le mode sans utilisateur ni utilisateur en phase d'approche. |
|
|
80 |
if(this.currentMode != 'NO-USER' && this.currentMode.indexOf('INCOMING-') == -1) |
|
|
81 |
{ |
|
|
82 |
if(main) |
|
|
83 |
{ |
|
|
84 |
clearTimeout(this.arrowSpinnerTimeout); |
|
|
85 |
|
|
|
86 |
$('#mainPointer').fadeTo(this.config.timeFilling, '1'); |
|
|
87 |
} |
|
|
88 |
} |
|
|
89 |
|
|
|
90 |
//Si le booléen est à faux, on masque le pointeur. |
|
|
91 |
if(!main) |
|
|
92 |
{ |
|
|
93 |
$('#spinner').remove(); |
|
|
94 |
|
|
|
95 |
$('#mainPointer').fadeTo(this.config.timeFilling, '0'); |
|
|
96 |
|
|
|
97 |
//Si on a zoomé sur une vidéo. |
|
|
98 |
if(this.currentMode == 'VIDEO' || this.currentMode == 'SEARCH') |
|
|
99 |
{ |
|
|
100 |
//On annule aussi la TL s'il y a lieu. |
|
|
101 |
if(this.isTLSelected()) |
|
|
102 |
{ |
|
|
103 |
this.isTLRequested = false; |
|
|
104 |
clearTimeout(this.selectTLTimeout); |
|
|
105 |
} |
|
|
106 |
} |
|
|
107 |
|
|
|
108 |
if(this.isTLSelectedByMainPointer) |
|
|
109 |
{ |
|
|
110 |
//On déselectionne la TL. |
|
|
111 |
this.exitTimeline(''); |
|
|
112 |
} |
|
|
113 |
} |
|
44
|
114 |
} |
|
|
115 |
/* |
|
|
116 |
* Affiche/Masque le pointeur secondaire. |
|
|
117 |
* Main est un booléen valant vrai s'il faut afficher le pointeur. |
|
52
|
118 |
* Est appelé dans le fichier : |
|
|
119 |
* client > fonction processMsg. |
|
44
|
120 |
*/ |
|
52
|
121 |
Mosaic.prototype.secondPointerDisplay = function(second) |
|
44
|
122 |
{ |
|
52
|
123 |
//On n'affiche pas les pointeurs dans le mode sans utilisateur ni utilisateur en phase d'approche. |
|
|
124 |
if(this.currentMode != 'NO-USER' && this.currentMode.indexOf('INCOMING-') == -1) |
|
|
125 |
{ |
|
|
126 |
if(second) |
|
|
127 |
{ |
|
|
128 |
clearTimeout(this.arrowSpinnerTimeout); |
|
|
129 |
|
|
|
130 |
$('#secondPointer').fadeTo(this.config.timeFilling, '1'); |
|
|
131 |
} |
|
|
132 |
} |
|
|
133 |
|
|
|
134 |
//Si le booléen est à faux, on masque le pointeur. |
|
|
135 |
if(!second) |
|
|
136 |
{ |
|
|
137 |
$('#spinner').remove(); |
|
|
138 |
|
|
|
139 |
$('#secondPointer').fadeTo(this.config.timeFilling, '0'); |
|
|
140 |
|
|
|
141 |
if(this.isTLSelectedBySecondPointer) |
|
|
142 |
{ |
|
|
143 |
//On déselectionne la TL. |
|
|
144 |
this.exitTimeline(''); |
|
|
145 |
} |
|
|
146 |
} |
|
|
147 |
} |
|
|
148 |
|
|
|
149 |
/* |
|
|
150 |
* Assure les interactions des pointeurs avec la mosaique. |
|
|
151 |
* Est appelé dans le fichier : |
|
|
152 |
* pointers > fonction refreshPointers. |
|
|
153 |
*/ |
|
|
154 |
Mosaic.prototype.pointersMosaicInteractions = function(pointerX, pointerY, isMainPointer) |
|
|
155 |
{ |
|
|
156 |
var snapshot = null, isOtherPointerDisplayed, pointer, pointerImg; |
|
|
157 |
|
|
|
158 |
if(isMainPointer) |
|
44
|
159 |
{ |
|
52
|
160 |
isOtherPointerDisplayed = this.isSecondPointerDisplayed; |
|
|
161 |
pointer = $('#mainPointer'); |
|
58
|
162 |
|
|
|
163 |
if(!this.isSearchByCurvesOn) |
|
|
164 |
{ |
|
|
165 |
pointerImg = 'url(./img/cursors/pointer.png)'; |
|
|
166 |
} |
|
52
|
167 |
} |
|
|
168 |
else |
|
|
169 |
{ |
|
|
170 |
isOtherPointerDisplayed = this.isMainPointerDisplayed; |
|
|
171 |
pointer = $('#secondPointer'); |
|
58
|
172 |
|
|
|
173 |
if(!this.isSearchByCurvesOn) |
|
|
174 |
{ |
|
|
175 |
pointerImg = 'url(./img/cursors/pointer2.png)'; |
|
|
176 |
} |
|
44
|
177 |
} |
|
|
178 |
|
|
52
|
179 |
//On regarde si on est sur un snapshot. |
|
|
180 |
snapshot = this.pointerPositionToSN(pointerX, pointerY, true); |
|
|
181 |
|
|
|
182 |
//Si c'est le cas, on récupère son id. |
|
|
183 |
if(this.previousZoomedSN != null) |
|
44
|
184 |
{ |
|
52
|
185 |
var id = this.previousZoomedSN.attr('id').replace('snapshotDiv-', ''); |
|
|
186 |
} |
|
|
187 |
|
|
|
188 |
//Sinon, on effectue un preunzoom et on redonne son apparence au pointeur principal. |
|
|
189 |
if(snapshot == null) |
|
|
190 |
{ |
|
|
191 |
this.isOnASnapshot = false; |
|
|
192 |
this.lastNonNullSN = this.previousZoomedSN; |
|
|
193 |
this.preUnzoom(); |
|
|
194 |
|
|
|
195 |
var image |
|
44
|
196 |
|
|
52
|
197 |
pointer.css('background-image', pointerImg); |
|
|
198 |
} |
|
|
199 |
|
|
|
200 |
//Si le pointeur secondaire n'est pas affiché et qu'on est sur un snapshot ou que le dernier snapshot sur lequel on est allé n'est pas nul et que les deux pointeurs ne sont pas là en même temps. |
|
|
201 |
if(!isOtherPointerDisplayed && snapshot != null && (this.previousZoomedSN != null && snapshot.attr('id') !== this.previousZoomedSN.attr('id') || this.lastNonNullSN != null && snapshot.attr('id') === this.lastNonNullSN.attr('id')) && !this.areBothPointersHere) |
|
|
202 |
{ |
|
|
203 |
//On prézoom sur le snapshot sélectionné et on change l'apparence du pointeur. |
|
|
204 |
this.isOnASnapshot = true; |
|
|
205 |
this.previousZoomedSN = snapshot; |
|
|
206 |
this.lastNonNullSN = null; |
|
|
207 |
this.preZoom(snapshot); |
|
44
|
208 |
|
|
52
|
209 |
pointer.css('background-image', 'url(./img/cursors/selector_gray.png)'); |
|
|
210 |
} |
|
|
211 |
|
|
|
212 |
//Si on se trouve actuellement dans une recherche par gestures. |
|
|
213 |
if(this.isMosaicFiltered && !this.isMosaicFiltering) |
|
|
214 |
{ |
|
|
215 |
//On vérifie si on se trouve sur une notification. |
|
|
216 |
this.checkIfPointerIsOnSearchNotification(pointerX, pointerY, pointer); |
|
44
|
217 |
} |
|
|
218 |
} |
|
|
219 |
|
|
|
220 |
/* |
|
52
|
221 |
* Assure les interactions des pointeurs avec la mosaique. |
|
|
222 |
* Est appelé dans le fichier : |
|
|
223 |
* pointers > fonction refreshPointers. |
|
44
|
224 |
*/ |
|
52
|
225 |
Mosaic.prototype.pointersVideoInteractions = function(pointerX, pointerY, isMainPointer) |
|
44
|
226 |
{ |
|
52
|
227 |
var _this = this, pointer, thisPointerNeighbourSelectedId, pointerImg, thisPointerExitBorder, otherPointerExitBorder; |
|
44
|
228 |
|
|
52
|
229 |
if(isMainPointer) |
|
44
|
230 |
{ |
|
52
|
231 |
pointer = $('#mainPointer'); |
|
|
232 |
thisPointerNeighbourSelectedId = this.mainPointerNeighbourSelectedId; |
|
|
233 |
thisPointerExitBorder = this.mainPointerExitBorder; |
|
|
234 |
otherPointerExitBorder = this.secondPointerExitBorder; |
|
58
|
235 |
|
|
|
236 |
if(!this.isSearchByCurvesOn) |
|
|
237 |
{ |
|
|
238 |
pointerImg = 'url(./img/cursors/pointer.png)'; |
|
|
239 |
} |
|
45
|
240 |
} |
|
|
241 |
else |
|
|
242 |
{ |
|
52
|
243 |
pointer = $('#secondPointer'); |
|
|
244 |
thisPointerNeighbourSelectedId = this.secondPointerNeighbourSelectedId; |
|
|
245 |
thisPointerExitBorder = this.secondPointerExitBorder; |
|
|
246 |
otherPointerExitBorder = this.mainPointerExitBorder; |
|
58
|
247 |
|
|
|
248 |
if(!this.isSearchByCurvesOn) |
|
|
249 |
{ |
|
|
250 |
pointerImg = 'url(./img/cursors/pointer2.png)'; |
|
|
251 |
} |
|
45
|
252 |
} |
|
44
|
253 |
|
|
52
|
254 |
var zoomX = pointerX - this.notifyLeftVideo, zoomY = pointerY - this.notifyTopVideo; |
|
|
255 |
|
|
|
256 |
//On calcule les interactions du pointeur avec la timeline. |
|
|
257 |
this.pointersTimelineSelection(pointerX, pointerY, isMainPointer); |
|
|
258 |
|
|
|
259 |
//Si on se trouve actuellement dans une recherche par gestures. |
|
58
|
260 |
if(this.currentSearchGesture[this.centerId]) |
|
44
|
261 |
{ |
|
52
|
262 |
this.checkIfPointerIsOnSearchNotification(pointerX, pointerY, pointer); |
|
44
|
263 |
} |
|
|
264 |
|
|
52
|
265 |
//on vérifie si le pointeur est sur un snapshot zoomé. |
|
|
266 |
snapshot = this.pointerPositionToSN(zoomX, zoomY, true); |
|
|
267 |
if(snapshot == null) |
|
44
|
268 |
{ |
|
52
|
269 |
pointer.css('background-image', pointerImg); |
|
|
270 |
snapshot = this.pointerPositionToAN(pointerX, pointerY); |
|
|
271 |
} |
|
|
272 |
|
|
|
273 |
var intValueOfId; |
|
|
274 |
//Si c'est le cas. |
|
|
275 |
if(snapshot != null && snapshot.length > 0) |
|
|
276 |
{ |
|
|
277 |
//S'il s'agit d'un voisin additionnel. |
|
|
278 |
if(snapshot.attr('id').indexOf('borderNeighbour') != -1) |
|
44
|
279 |
{ |
|
52
|
280 |
intValueOfId = parseInt(snapshot.attr('id').replace('borderNeighbour-', '')); |
|
44
|
281 |
} |
|
52
|
282 |
//Sinon si c'est un voisin normal. |
|
|
283 |
else |
|
44
|
284 |
{ |
|
52
|
285 |
intValueOfId = parseInt(snapshot.attr('id').replace('snapshotDiv-', '')); |
|
44
|
286 |
} |
|
|
287 |
} |
|
52
|
288 |
else |
|
44
|
289 |
{ |
|
52
|
290 |
intValueOfId = -2; |
|
|
291 |
} |
|
|
292 |
|
|
|
293 |
//Si c'est un voisin additionnel. |
|
|
294 |
if(snapshot != null && snapshot.attr('id').indexOf('borderNeighbour') != -1) |
|
|
295 |
{ |
|
|
296 |
//S'il a été trouvé parmi les voisins du centre. |
|
|
297 |
if(intValueOfId > -1 && intValueOfId < 5) |
|
44
|
298 |
{ |
|
52
|
299 |
//On le sélectionne. |
|
|
300 |
this.selectNeighbour(snapshot, pointer); |
|
|
301 |
if(isMainPointer) |
|
44
|
302 |
{ |
|
52
|
303 |
this.mainPointerExitBorder = true; |
|
|
304 |
this.mainPointerNeighbourSelectedId = intValueOfId + this.config.imagesToShow; |
|
44
|
305 |
} |
|
|
306 |
else |
|
|
307 |
{ |
|
52
|
308 |
this.secondPointerExitBorder = true; |
|
|
309 |
this.secondPointerNeighbourSelectedId = intValueOfId + this.config.imagesToShow; |
|
44
|
310 |
} |
|
|
311 |
} |
|
|
312 |
else |
|
|
313 |
{ |
|
52
|
314 |
//Sinon on le déselectionne. |
|
|
315 |
if(thisPointerNeighbourSelectedId != null && thisPointerNeighbourSelectedId > -1) |
|
44
|
316 |
{ |
|
52
|
317 |
this.deselectNeighbour(thisPointerNeighbourSelectedId); |
|
44
|
318 |
} |
|
|
319 |
} |
|
52
|
320 |
} |
|
|
321 |
else |
|
|
322 |
{ |
|
|
323 |
//Si c'est un voisin. |
|
|
324 |
if(_.include(this.neighboursIds, intValueOfId)) |
|
44
|
325 |
{ |
|
52
|
326 |
//On le sélectionne. |
|
|
327 |
this.selectNeighbour(snapshot, pointer); |
|
79
|
328 |
if(!this.config.mouseInteractions) |
|
44
|
329 |
{ |
|
79
|
330 |
clearTimeout(this.moveToNeighbourTimeout); |
|
|
331 |
if(isMainPointer) |
|
|
332 |
{ |
|
|
333 |
clearTimeout(this.mainPointerExitBorderTimeout); |
|
|
334 |
this.mainPointerExitBorder = true; |
|
|
335 |
this.mainPointerNeighbourSelectedId = intValueOfId; |
|
|
336 |
} |
|
|
337 |
else |
|
|
338 |
{ |
|
|
339 |
clearTimeout(this.secondPointerExitBorderTimeout); |
|
|
340 |
this.secondPointerExitBorder = true; |
|
|
341 |
this.secondPointerNeighbourSelectedId = intValueOfId; |
|
|
342 |
} |
|
44
|
343 |
} |
|
|
344 |
else |
|
|
345 |
{ |
|
79
|
346 |
this.mainPointerNeighbourSelectedId = intValueOfId; |
|
44
|
347 |
} |
|
79
|
348 |
|
|
44
|
349 |
} |
|
|
350 |
else |
|
|
351 |
{ |
|
52
|
352 |
//Sinon on déselectionne le snapshot. |
|
|
353 |
if(thisPointerNeighbourSelectedId != null && thisPointerNeighbourSelectedId > -1) |
|
44
|
354 |
{ |
|
52
|
355 |
this.deselectNeighbour(thisPointerNeighbourSelectedId); |
|
|
356 |
|
|
79
|
357 |
if(!this.config.mouseInteractions) |
|
52
|
358 |
{ |
|
79
|
359 |
//Si le pointeur quitte le voisin sans que l'autre pointeur ne fasse de même ailleurs. |
|
|
360 |
if(thisPointerExitBorder && !otherPointerExitBorder) |
|
|
361 |
{ |
|
|
362 |
//On va vers le voisin. |
|
|
363 |
this.correctMoveToNeighbour(thisPointerNeighbourSelectedId, zoomX, zoomY); |
|
|
364 |
} |
|
|
365 |
|
|
|
366 |
//Il n'est possible de se déplacer vers un voisin que dans un certain laps de temps lorsqu'on quitte la sélection d'un voisin. |
|
|
367 |
this.moveToNeighbourTimeout = setTimeout(function() |
|
|
368 |
{ |
|
|
369 |
_this.canMoveToNeighbour = false; |
|
|
370 |
}, this.config.timeoutMoveToNeighbour); |
|
|
371 |
|
|
|
372 |
if(isMainPointer) |
|
44
|
373 |
{ |
|
79
|
374 |
this.mainPointerExitBorderTimeout = setTimeout(function() |
|
|
375 |
{ |
|
|
376 |
_this.mainPointerExitBorder = false; |
|
|
377 |
}, this.config.timeoutUnzoom); |
|
|
378 |
} |
|
|
379 |
else |
|
|
380 |
{ |
|
|
381 |
this.secondPointerExitBorderTimeout = setTimeout(function() |
|
|
382 |
{ |
|
|
383 |
_this.secondPointerExitBorder = false; |
|
|
384 |
}, this.config.timeoutUnzoom); |
|
|
385 |
} |
|
|
386 |
|
|
|
387 |
//On regarde si on a voulu faire de dézoom. |
|
|
388 |
this.checkForDezoom(); |
|
52
|
389 |
} |
|
44
|
390 |
} |
|
|
391 |
} |
|
|
392 |
} |
|
|
393 |
} |
|
|
394 |
|
|
52
|
395 |
/* |
|
|
396 |
* Assure les interactions des pointeurs avec la timeline. |
|
|
397 |
* Est appelé dans le fichier : |
|
|
398 |
* pointers > fonction pointersVideoInteractions. |
|
|
399 |
*/ |
|
|
400 |
Mosaic.prototype.pointersTimelineSelection = function(pointerX, pointerY, isMainPointer) |
|
44
|
401 |
{ |
|
52
|
402 |
var _this = this, pointer, isTLSelectedByThisPointer, isTLSelectedByOtherPointer, isOtherPointerDisplayed; |
|
44
|
403 |
|
|
52
|
404 |
if(isMainPointer) |
|
44
|
405 |
{ |
|
52
|
406 |
pointer = $('#mainPointer'); |
|
|
407 |
isTLSelectedByThisPointer = this.isTLSelectedByMainPointer; |
|
|
408 |
isTLSelectedByOtherPointer = this.isTLSelectedBySecondPointer; |
|
|
409 |
isOtherPointerDisplayed = this.isSecondPointerDisplayed; |
|
|
410 |
} |
|
|
411 |
else |
|
|
412 |
{ |
|
|
413 |
pointer = $('#secondPointer'); |
|
|
414 |
isTLSelectedByThisPointer = this.isTLSelectedBySecondPointer; |
|
|
415 |
isTLSelectedByOtherPointer = this.isTLSelectedByMainPointer; |
|
|
416 |
isOtherPointerDisplayed = this.isMainPointerDisplayed; |
|
44
|
417 |
} |
|
|
418 |
|
|
52
|
419 |
//On vérifie si on veut sélectionner la TL. |
|
|
420 |
if((this.currentMode != 'TIMELINE' || this.isTLRequested) && this.playerIsReady && !isTLSelectedByOtherPointer && !this.helpDisplayed) |
|
44
|
421 |
{ |
|
52
|
422 |
//Si la timeline est sélectionnée. |
|
79
|
423 |
if(this.isTLSelected(true, true) && !this.isTLRequested && this.isVideoReading) |
|
52
|
424 |
{ |
|
|
425 |
//On a demandé à aller dans la TL. |
|
|
426 |
this.isTLRequested = true; |
|
|
427 |
if(isMainPointer) |
|
|
428 |
{ |
|
|
429 |
this.isTLSelectedByMainPointer = true; |
|
|
430 |
this.isTLSelectedBySecondPointer = false; |
|
|
431 |
} |
|
|
432 |
else |
|
|
433 |
{ |
|
|
434 |
this.isTLSelectedBySecondPointer = true; |
|
|
435 |
this.isTLSelectedByMainPointer = false; |
|
|
436 |
} |
|
|
437 |
this.currentMode = 'TIMELINE'; |
|
|
438 |
this.player.widgets[0].selectTimeline(); |
|
|
439 |
pointer.css('background-image', 'url(./img/cursors/selector_gray.png)'); |
|
|
440 |
|
|
|
441 |
//Si on est en mode d'interaction Kinect. |
|
|
442 |
if(!this.config.mouseInteractions) |
|
|
443 |
{ |
|
58
|
444 |
//On met le spinner gif sur le pointeur s'il existe. |
|
|
445 |
if(pointer.length > 0) |
|
52
|
446 |
{ |
|
58
|
447 |
var spinner = "<img id='spinner'></div>"; |
|
|
448 |
$('body').append(spinner); |
|
|
449 |
$('#spinner').css( |
|
|
450 |
{ |
|
|
451 |
position: 'absolute', |
|
|
452 |
top: pointer.position().top, |
|
|
453 |
left: pointer.position().left, |
|
|
454 |
width: 85, |
|
|
455 |
height: 85, |
|
|
456 |
'z-index': 600 |
|
|
457 |
}); |
|
|
458 |
$('#spinner').attr('src', './img/cursors/selector_anim.gif'); |
|
|
459 |
} |
|
52
|
460 |
} |
|
|
461 |
|
|
|
462 |
this.selectTLTimeout = setTimeout(function() |
|
|
463 |
{ |
|
|
464 |
//On permet l'interaction après un laps de temps. |
|
|
465 |
_this.canSlideInTL = true; |
|
|
466 |
_this.removeNotifications(); |
|
|
467 |
_this.timelineTimeline(); |
|
|
468 |
}, this.config.timeoutSlideTL); |
|
|
469 |
} |
|
|
470 |
//Sinon si on était sur la timeline sans qu'elle soit sélectionnée encore et qu'on l'a quitté avant la sélection. |
|
79
|
471 |
else if(!this.isTLSelected(true, true) && this.isTLRequested || !this.isVideoReading) |
|
52
|
472 |
{ |
|
|
473 |
this.isTLRequested = false; |
|
|
474 |
clearTimeout(this.selectTLTimeout); |
|
|
475 |
//On déselectionne la TL. |
|
|
476 |
this.exitTimeline(''); |
|
|
477 |
} |
|
|
478 |
} |
|
|
479 |
|
|
|
480 |
//Si on a quitté la timeline après une sélection. |
|
|
481 |
if(isTLSelectedByThisPointer && !this.isTLSelected(false, true)) |
|
|
482 |
{ |
|
|
483 |
//On déselectionne la TL. |
|
|
484 |
this.exitTimeline(''); |
|
44
|
485 |
} |
|
|
486 |
|
|
52
|
487 |
//Si on a sélectionné la TL et qu'on a le pointeur droit dessus, on peut modifier la position de lecture. |
|
|
488 |
if(this.currentMode == 'TIMELINE' && this.playerIsReady && !isOtherPointerDisplayed && this.canSlideInTL) |
|
44
|
489 |
{ |
|
52
|
490 |
var time, TL = $('.Ldt-Timeline'), P = $('.LdtPlayer'); |
|
|
491 |
|
|
|
492 |
//Si le pointeur est trop à gauche, on met le curseur de lecture à 0. |
|
|
493 |
if(pointerX < P.position().left) |
|
|
494 |
{ |
|
|
495 |
time = 0; |
|
|
496 |
} |
|
|
497 |
//S'il est trop à droite, on le place à la fin. |
|
|
498 |
else if(pointerX > (+P.position().left + TL.width())) |
|
|
499 |
{ |
|
|
500 |
time = this.player.widgets[0].source.getDuration().getSeconds(); |
|
|
501 |
} |
|
|
502 |
//Sinon, on le met à la position du pointeur. |
|
|
503 |
else |
|
|
504 |
{ |
|
|
505 |
time = this.player.widgets[0].scaleIntervals(P.position().left, (+P.position().left + TL.width()), 0, this.player.widgets[0].source.getDuration().getSeconds(), pointerX); |
|
|
506 |
} |
|
|
507 |
|
|
|
508 |
this.player.popcorn.currentTime(time); |
|
79
|
509 |
this.player.popcorn.play(); |
|
44
|
510 |
} |
|
|
511 |
} |
|
|
512 |
|
|
52
|
513 |
/* |
|
|
514 |
* Raffraîchit la position des pointeurs. |
|
|
515 |
* Est appelé dans les fichiers : |
|
|
516 |
* mosaic > fonction loadMosaic. |
|
|
517 |
* client > fonction processMsg. |
|
|
518 |
*/ |
|
|
519 |
Mosaic.prototype.refreshPointers = function(x, y, isMainPointer) |
|
44
|
520 |
{ |
|
52
|
521 |
if(this.currentMode == "NO-USER" || this.currentMode.indexOf('INCOMING-') != -1) |
|
|
522 |
{ |
|
|
523 |
return; |
|
|
524 |
} |
|
|
525 |
|
|
|
526 |
//Si on est en mode d'interaction Kinect, on effectue un réhaussement de la position. |
|
|
527 |
if(!this.config.mouseInteractions) |
|
|
528 |
{ |
|
58
|
529 |
this.minMax(x, y); |
|
|
530 |
x = this.scaleIntervals(this.config.kinectMinCoordX, this.config.kinectMaxCoordX, 0, $(window).width(), x); |
|
|
531 |
y = this.scaleIntervals(this.config.kinectMinCoordY, this.config.kinectMaxCoordY, 0, $(window).height(), y); |
|
|
532 |
/*x *= 7; |
|
52
|
533 |
y *= 7; |
|
|
534 |
x -= $(window).width() * 3 / 4; |
|
58
|
535 |
y -= $(window).height() * 2 / 4;*/ |
|
52
|
536 |
} |
|
|
537 |
|
|
|
538 |
var pointer; |
|
44
|
539 |
|
|
52
|
540 |
//S'il s'agit du pointeur principal. |
|
|
541 |
if(isMainPointer) |
|
44
|
542 |
{ |
|
52
|
543 |
//On affecte les éléments relatifs au pointeur principal. |
|
|
544 |
pointer = $('#mainPointer'); |
|
|
545 |
|
|
|
546 |
//Si le pointeur quitte la fenêtre en X, on ne le change pas. |
|
|
547 |
if(x < 0 || x > $(window).width()) |
|
|
548 |
{ |
|
|
549 |
x = this.mainPointerLastX; |
|
|
550 |
} |
|
|
551 |
//Sinon, on le met à jour. |
|
|
552 |
else |
|
|
553 |
{ |
|
|
554 |
this.mainPointerLastX = x; |
|
|
555 |
} |
|
44
|
556 |
|
|
52
|
557 |
//Si le pointeur quitte la fenêtre en Y, on ne le change pas. |
|
|
558 |
if(y < 0 || y > $(window).height()) |
|
|
559 |
{ |
|
|
560 |
y = this.mainPointerLastY; |
|
|
561 |
} |
|
|
562 |
//Sinon, on le met à jour. |
|
|
563 |
else |
|
44
|
564 |
{ |
|
52
|
565 |
this.mainPointerLastY = y; |
|
|
566 |
} |
|
|
567 |
} |
|
|
568 |
//Sinon. |
|
|
569 |
else |
|
|
570 |
{ |
|
|
571 |
//On affecte les éléments relatifs au pointeur principal. |
|
|
572 |
pointer = $('#secondPointer'); |
|
|
573 |
|
|
|
574 |
//Si le pointeur quitte la fenêtre en X, on ne le change pas. |
|
|
575 |
if(x < 0 || x > $(window).width()) |
|
|
576 |
{ |
|
|
577 |
x = this.secondPointerLastX; |
|
|
578 |
} |
|
|
579 |
//Sinon, on le met à jour. |
|
|
580 |
else |
|
|
581 |
{ |
|
|
582 |
this.secondPointerLastX = x; |
|
|
583 |
} |
|
|
584 |
|
|
|
585 |
//Si le pointeur quitte la fenêtre en Y, on ne le change pas. |
|
|
586 |
if(y < 0 || y > $(window).height()) |
|
|
587 |
{ |
|
|
588 |
y = this.secondPointerLastY; |
|
|
589 |
} |
|
|
590 |
//Sinon, on le met à jour. |
|
|
591 |
else |
|
|
592 |
{ |
|
|
593 |
this.secondPointerLastY = y; |
|
44
|
594 |
} |
|
|
595 |
} |
|
|
596 |
|
|
52
|
597 |
var pointerX, pointerY; |
|
|
598 |
|
|
|
599 |
//Si on est en mode d'interaction souris, on met à jour les coordonnées utilisées dans les fonctions par celles de la souris. |
|
|
600 |
//Sinon on se base sur les coordonnées des pointeurs. |
|
|
601 |
if(this.config.mouseInteractions) |
|
|
602 |
{ |
|
|
603 |
pointerX = x; |
|
|
604 |
pointerY = y; |
|
|
605 |
} |
|
|
606 |
else |
|
|
607 |
{ |
|
|
608 |
pointerX = x - pointer.width()/2; |
|
|
609 |
pointerY = y - pointer.height()/2; |
|
|
610 |
} |
|
|
611 |
var _this = this; |
|
|
612 |
|
|
|
613 |
pointer.css( |
|
|
614 |
{ |
|
|
615 |
top: pointerY, |
|
|
616 |
left: pointerX |
|
|
617 |
}); |
|
|
618 |
|
|
|
619 |
if($('#spinner').length > 0) |
|
|
620 |
{ |
|
|
621 |
$('#spinner').css( |
|
|
622 |
{ |
|
|
623 |
top: pointerY, |
|
|
624 |
left: pointerX |
|
|
625 |
}); |
|
|
626 |
} |
|
|
627 |
|
|
|
628 |
var snapshot = null; |
|
|
629 |
|
|
|
630 |
//Si on est dans la mosaique ou en filtrage. |
|
|
631 |
if(this.currentMode == 'MOSAIC' || this.currentMode == 'FILTER' && this.isMosaicFiltered) |
|
|
632 |
{ |
|
|
633 |
this.pointersMosaicInteractions(pointerX, pointerY, isMainPointer); |
|
|
634 |
} |
|
|
635 |
//Si on est dans une vidéo ou dans une recherche ou dans la timeline. |
|
|
636 |
else if(this.currentMode == 'VIDEO' || this.currentMode == 'SEARCH' || this.currentMode == 'TIMELINE') |
|
|
637 |
{ |
|
|
638 |
this.pointersVideoInteractions(pointerX, pointerY, isMainPointer); |
|
|
639 |
} |
|
|
640 |
} |
|
|
641 |
|
|
|
642 |
/* |
|
|
643 |
* Détecte si les deux pointeurs sont dans la zone de recherche et qu'ils ne bougent pas. |
|
|
644 |
* Est appelé dans le fichier : |
|
|
645 |
* client > fonction processMsg. |
|
|
646 |
*/ |
|
|
647 |
Mosaic.prototype.detectIdlePointers = function() |
|
|
648 |
{ |
|
|
649 |
var mainPointer = $('#mainPointer'); |
|
|
650 |
var secondPointer = $('#secondPointer'); |
|
|
651 |
|
|
|
652 |
//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. |
|
|
653 |
if(Math.abs(this.mainPointerIdleStartX - this.mainPointerLastX) > mainPointer.width() || Math.abs(this.mainPointerIdleStartY - this.mainPointerLastY) > mainPointer.height() || |
|
|
654 |
Math.abs(this.secondPointerIdleStartX - this.secondPointerLastX) > secondPointer.width() || Math.abs(this.secondPointerIdleStartY - this.secondPointerLastY) > secondPointer.height()) |
|
|
655 |
{ |
|
|
656 |
//On réinitialise les dernières positions connues. |
|
|
657 |
this.mainPointerIdleStartX = this.mainPointerLastX; |
|
|
658 |
this.mainPointerIdleStartY = this.mainPointerLastY; |
|
|
659 |
this.secondPointerIdleStartX = this.secondPointerLastX; |
|
|
660 |
this.secondPointerIdleStartY = this.secondPointerLastY; |
|
|
661 |
|
|
|
662 |
this.removeIdlePointers(); |
|
|
663 |
this.pointersIdleNeedLaunch = true; |
|
|
664 |
} |
|
|
665 |
|
|
|
666 |
//Si l'aide est affichée, on la masque. |
|
58
|
667 |
if(this.helpDisplayed && !this.mustTakeOutHands) |
|
52
|
668 |
{ |
|
|
669 |
this.removeHelp(); |
|
|
670 |
} |
|
|
671 |
|
|
|
672 |
if((this.currentMode == 'SEARCH' || this.currentMode == 'FILTER') && !this.isSearchByCurvesOn) |
|
|
673 |
{ |
|
|
674 |
// this.isSearchByCurvesOn = true; |
|
|
675 |
// this.startSearch(); |
|
|
676 |
} |
|
|
677 |
} |
|
|
678 |
|
|
|
679 |
/* |
|
|
680 |
* Enlève la vérification sur les pointeurs qui ne bougent pas. |
|
|
681 |
* Est appelé dans les fichiers : |
|
|
682 |
* pointers > detectIdlePointers. |
|
|
683 |
* client > fonction processMsg. |
|
|
684 |
*/ |
|
|
685 |
Mosaic.prototype.removeIdlePointers = function() |
|
|
686 |
{ |
|
|
687 |
clearTimeout(this.pointersSearchIdleTimeout); |
|
44
|
688 |
} |
|
|
689 |
|
|
52
|
690 |
/* |
|
|
691 |
* Lance une vérification sur les pointeurs qui ne bougent pas. |
|
|
692 |
* Est appelé dans le fichier : |
|
|
693 |
* client > fonction processMsg. |
|
|
694 |
*/ |
|
|
695 |
Mosaic.prototype.launchIdlePointers = function() |
|
44
|
696 |
{ |
|
52
|
697 |
var _this = this; |
|
|
698 |
|
|
|
699 |
//Si on est en mode TL, on ne peut pas effectuer de recherche. |
|
|
700 |
if(this.currentMode == 'TIMELINE' || (!this.playerIsReady && (this.currentMode == 'VIDEO' || this.currentMode == 'SEARCH'))) |
|
|
701 |
{ |
|
|
702 |
return; |
|
|
703 |
} |
|
|
704 |
|
|
|
705 |
if(this.currentMode == 'VIDEO') |
|
|
706 |
{ |
|
|
707 |
//On peut le faire que sur la video au dessus de la TL. |
|
|
708 |
var mainPointer = $('#mainPointer'), secondPointer = $('#secondPointer'), TL = $('.Ldt-Timeline'); |
|
|
709 |
var TLwidth = TL.width(), TLheight = TL.height(); |
|
|
710 |
var Ptop = $('.LdtPlayer').position().top, Pleft = $('.LdtPlayer').position().left; |
|
|
711 |
var Pheight = $('.LdtPlayer').height(); |
|
|
712 |
var MPx = mainPointer.position().left + mainPointer.width() / 2, MPy = mainPointer.position().top + mainPointer.height() / 2; |
|
|
713 |
var SPx = secondPointer.position().left + secondPointer.width() / 2, SPy = secondPointer.position().top + secondPointer.height() / 2; |
|
|
714 |
|
|
|
715 |
//Si les pointeurs ne sont pas sur le player, on part. |
|
|
716 |
if(MPx < Pleft || MPx > (+Pleft + TLwidth) || MPy < Ptop || MPy > (+Ptop + Pheight - TLheight) || |
|
|
717 |
SPx < Pleft || SPx > (+Pleft + TLwidth) || SPy < Ptop || SPy > (+Ptop + Pheight - TLheight)) |
|
|
718 |
{ |
|
|
719 |
return; |
|
|
720 |
} |
|
|
721 |
} |
|
|
722 |
|
|
|
723 |
//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. |
|
|
724 |
this.pointersSearchIdleTimeout = setTimeout(function() |
|
|
725 |
{ |
|
|
726 |
//Si les deux pointeurs ne sont pas dans la zone de recherche, on part. |
|
|
727 |
if(!_this.areBothPointersHere) |
|
|
728 |
{ |
|
|
729 |
return; |
|
|
730 |
} |
|
|
731 |
|
|
|
732 |
//Si on est dans la mosaique. |
|
|
733 |
if(_this.currentMode == "MOSAIC") |
|
|
734 |
{ |
|
|
735 |
//On passe en filtrage. |
|
|
736 |
_this.currentMode = "FILTER"; |
|
|
737 |
_this.isMosaicFiltered = true; |
|
|
738 |
//On notifie. |
|
|
739 |
_this.removeNotifications(); |
|
|
740 |
_this.filterSearch(); |
|
|
741 |
} |
|
|
742 |
//Si on est dans la video ou dans la timeline. |
|
|
743 |
else if(_this.currentMode == "VIDEO" || _this.currentMode == "TIMELINE") |
|
|
744 |
{ |
|
|
745 |
//On entre en recherche. |
|
|
746 |
_this.currentMode = "SEARCH"; |
|
|
747 |
//On notifie. |
|
|
748 |
_this.removeNotifications(); |
|
|
749 |
_this.searchSearch(); |
|
|
750 |
} |
|
|
751 |
|
|
|
752 |
//Si on ne peut pas afficher l'aide. |
|
|
753 |
if(!_this.canNotifyHelp) |
|
|
754 |
{ |
|
|
755 |
//On peut l'afficher après un laps de temps. |
|
|
756 |
_this.canNotifyHelpTimeout = setTimeout(function() |
|
|
757 |
{ |
|
|
758 |
_this.canNotifyHelp = true; |
|
|
759 |
}, _this.config.timeoutCanNotifyHelp); |
|
|
760 |
} |
|
|
761 |
}, this.config.timeoutPointersIdle); |
|
44
|
762 |
} |
|
|
763 |
|
|
52
|
764 |
/* |
|
|
765 |
* Vérifie si les deux pointeurs sont dans la zone de recherche. |
|
|
766 |
* Est appelé dans le fichier : |
|
|
767 |
* client > fonction processMsg. |
|
|
768 |
*/ |
|
|
769 |
Mosaic.prototype.checkForBothPointersHere = function() |
|
44
|
770 |
{ |
|
52
|
771 |
var _this = this; |
|
|
772 |
|
|
|
773 |
//Si le timeout de vérification n'a pas été lancé. |
|
|
774 |
if(!this.areBothPointersTimeoutLaunched) |
|
|
775 |
{ |
|
|
776 |
//On le lance. |
|
|
777 |
this.areBothPointersHereTimeout = setTimeout(function() |
|
|
778 |
{ |
|
|
779 |
//On considère après un laps de temps qu'au moins une des mains a quitté la zone sauf si on est notifié du contraire. |
|
|
780 |
_this.areBothPointersHere = false; |
|
|
781 |
}, this.config.timeoutAreBothPointersHere); |
|
|
782 |
|
|
|
783 |
//On spécifie qu'on l'a lancé. |
|
|
784 |
this.areBothPointersHereTimeoutLaunched = true; |
|
|
785 |
} |
|
|
786 |
} |
|
|
787 |
|
|
|
788 |
/* |
|
|
789 |
* Enlève la vérification de présence des deux pointeurs dans la zone de recherche. |
|
|
790 |
* Est appelé dans le fichier : |
|
|
791 |
* client > fonction processMsg. |
|
|
792 |
*/ |
|
|
793 |
Mosaic.prototype.removeCheckForBothPointersHere = function() |
|
|
794 |
{ |
|
|
795 |
//On désactive le timeout. |
|
|
796 |
clearTimeout(this.areBothPointersHereTimeout); |
|
|
797 |
//On indique que la vérification n'est pas lancée. |
|
|
798 |
this.areBothPointersHereTimeoutLaunched = false; |
|
44
|
799 |
} |
|
|
800 |
|
|
|
801 |
/* |
|
|
802 |
* Vérifie si on se trouve sur la notification de recherche par gesture. |
|
52
|
803 |
* Est appelé dans le fichier : |
|
|
804 |
* pointers > fonctions pointersMosaicInteractions et pointersVideoInteractions. |
|
44
|
805 |
*/ |
|
52
|
806 |
Mosaic.prototype.checkIfPointerIsOnSearchNotification = function(x, y, pointer) |
|
44
|
807 |
{ |
|
52
|
808 |
var _this = this; |
|
|
809 |
var notification_search = $('#notify_search_1gesture'); |
|
58
|
810 |
|
|
52
|
811 |
//Si la notification de recherche existe (dans le player). |
|
|
812 |
if(notification_search.length > 0) |
|
|
813 |
{ |
|
|
814 |
//Pictogramme actuel de la notification. |
|
|
815 |
var currentPicto = notification_search.css('background-image'); |
|
58
|
816 |
|
|
52
|
817 |
//Si le pointeur est sur la notification. |
|
|
818 |
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())) |
|
|
819 |
{ |
|
77
|
820 |
if(!this.alreadyOnNotification && ($('#spinner').length == 0 && !this.config.mouseInteractions || this.config.mouseInteractions) && !this.isTablet) |
|
52
|
821 |
{ |
|
|
822 |
notification_search.css('background-image', currentPicto.replace('/big/' + (this.config.mouseInteractions ? 'MI/' : '') + 'valid/', '/big/' + (this.config.mouseInteractions ? 'MI/' : '') + 'hover/')); |
|
|
823 |
|
|
|
824 |
//On émet la requete de suppression de la notification. |
|
|
825 |
this.gestureDelRequested = true; |
|
|
826 |
|
|
|
827 |
//Si on est en interaction Kinect. |
|
|
828 |
if(!this.config.mouseInteractions) |
|
|
829 |
{ |
|
|
830 |
//On met le spinner gif sur le pointeur. |
|
58
|
831 |
if(pointer != null && pointer.length > 0) |
|
|
832 |
{ |
|
|
833 |
//On modifie l'apparence du pointeur. |
|
|
834 |
pointer.css('background-image', 'url(./img/cursors/selector_gray.png)'); |
|
|
835 |
var spinner = "<img id='spinner'></div>"; |
|
|
836 |
$('body').append(spinner); |
|
|
837 |
$('#spinner').css( |
|
|
838 |
{ |
|
|
839 |
position: 'absolute', |
|
|
840 |
top: pointer.position().top, |
|
|
841 |
left: pointer.position().left, |
|
|
842 |
width: 85, |
|
|
843 |
height: 85, |
|
|
844 |
'z-index': 600 |
|
|
845 |
}); |
|
|
846 |
$('#spinner').attr('src', './img/cursors/selector_anim.gif'); |
|
|
847 |
} |
|
52
|
848 |
|
|
|
849 |
//Après un laps de temps sur la notification, on supprime la recherche et on revient au mode précédent. |
|
|
850 |
this.removeNotificationByGestureTimeout = setTimeout(function() |
|
|
851 |
{ |
|
58
|
852 |
if(pointer.attr('id') == 'mainPanel') |
|
|
853 |
{ |
|
|
854 |
pointer.css('background-image', 'url(./img/cursors/pointer.png)'); |
|
|
855 |
} |
|
|
856 |
else |
|
|
857 |
{ |
|
|
858 |
pointer.css('background-image', 'url(./img/cursors/pointer2.png)'); |
|
|
859 |
} |
|
|
860 |
|
|
52
|
861 |
//Si on est en recherche, on revient en video. |
|
|
862 |
if(_this.currentMode == 'SEARCH') |
|
|
863 |
{ |
|
|
864 |
_this.player.widgets[0].removeSearchByGesture(); |
|
|
865 |
_this.currentMode = 'VIDEO'; |
|
|
866 |
} |
|
|
867 |
//Si on est en timeline, on revient en timeline. |
|
|
868 |
else if(_this.currentMode == 'TIMELINE') |
|
|
869 |
{ |
|
|
870 |
_this.player.widgets[0].removeSearchByGesture(); |
|
|
871 |
_this.currentMode = 'TIMELINE'; |
|
|
872 |
} |
|
|
873 |
//Si on est en filtrage, on l'enlève. |
|
|
874 |
else if(_this.currentMode == 'FILTER') |
|
|
875 |
{ |
|
|
876 |
_this.removeFilter(); |
|
|
877 |
} |
|
|
878 |
|
|
|
879 |
_this.alreadyOnNotification = false; |
|
|
880 |
_this.isCurrentlyInASearchByGesture = false; |
|
58
|
881 |
_this.gestureDelRequested = false; |
|
52
|
882 |
|
|
|
883 |
//Si on n'est ni en recherche, ni en filtrage, on enlève la gesture de recherche. |
|
|
884 |
if(_this.currentMode != 'MOSAIC' && _this.currentMode != 'FILTER') |
|
|
885 |
{ |
|
|
886 |
_this.currentSearchGesture[_this.centerId] = ''; |
|
|
887 |
} |
|
|
888 |
|
|
|
889 |
_this.canNotifyHelp = false; |
|
|
890 |
}, this.config.timeoutRemoveNotificationByGesture); |
|
|
891 |
} |
|
|
892 |
|
|
|
893 |
this.alreadyOnNotification = true; |
|
|
894 |
} |
|
|
895 |
//On retourne vrai si on est sur la notification, et faux sinon. |
|
|
896 |
return true; |
|
|
897 |
} |
|
|
898 |
//S'il n'est pas sur la notification. |
|
|
899 |
else |
|
|
900 |
{ |
|
|
901 |
//Si on était sur la notification, on remet la notification dans l'état où elle était avant qu'on soit dessus. |
|
|
902 |
if(this.alreadyOnNotification) |
|
|
903 |
{ |
|
|
904 |
notification_search.css('background-image', currentPicto.replace('/big/' + (this.config.mouseInteractions ? 'MI/' : '') + 'hover/', '/big/' + (this.config.mouseInteractions ? 'MI/' : '') + 'valid/')); |
|
|
905 |
|
|
|
906 |
this.gestureDelRequested = false; |
|
|
907 |
|
|
|
908 |
clearTimeout(this.removeNotificationByGestureTimeout); |
|
|
909 |
this.alreadyOnNotification = false; |
|
|
910 |
$('#spinner').remove(); |
|
|
911 |
} |
|
|
912 |
|
|
|
913 |
return false; |
|
|
914 |
} |
|
|
915 |
} |
|
|
916 |
|
|
|
917 |
return false; |
|
45
|
918 |
} |
|
|
919 |
|
|
|
920 |
/* |
|
|
921 |
* Si on se trouve sur la notification de recherche par gesture, on la supprime. |
|
52
|
922 |
* Est appelé dans les fichiers : |
|
|
923 |
* mosaic > onMouseDown. |
|
|
924 |
* zoomInteractions > unzoom. |
|
45
|
925 |
*/ |
|
52
|
926 |
Mosaic.prototype.removeSearchNotificationIfOnIt = function(x, y) |
|
45
|
927 |
{ |
|
52
|
928 |
var _this = this; |
|
|
929 |
|
|
|
930 |
var notification_search = $('#notify_search_1gesture'); |
|
|
931 |
|
|
|
932 |
//Si la notification de recherche existe (dans le player). |
|
|
933 |
if(notification_search.length > 0) |
|
|
934 |
{ |
|
|
935 |
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())) |
|
|
936 |
{ |
|
|
937 |
_this.removeNotifications(); |
|
|
938 |
if(_this.currentMode == 'SEARCH') |
|
|
939 |
{ |
|
|
940 |
_this.player.widgets[0].removeSearchByGesture(); |
|
|
941 |
_this.currentMode = 'VIDEO'; |
|
|
942 |
_this.currentSearchGesture[_this.centerId] = ''; |
|
|
943 |
} |
|
|
944 |
else if(_this.currentMode == 'TIMELINE') |
|
|
945 |
{ |
|
|
946 |
_this.player.widgets[0].removeSearchByGesture(); |
|
|
947 |
_this.currentMode = 'TIMELINE'; |
|
|
948 |
_this.currentSearchGesture[_this.centerId] = ''; |
|
|
949 |
} |
|
|
950 |
else if(_this.currentMode == 'FILTER') |
|
|
951 |
{ |
|
|
952 |
_this.removeFilter(); |
|
|
953 |
} |
|
|
954 |
|
|
|
955 |
_this.alreadyOnNotification = false; |
|
|
956 |
_this.isCurrentlyInASearchByGesture = false; |
|
|
957 |
_this.curvesGesturesFound = false; |
|
|
958 |
_this.canDrawNextCurve = false; |
|
|
959 |
_this.isSearchByCurvesOn = false; |
|
|
960 |
_this.canNotifyHelp = false; |
|
|
961 |
|
|
|
962 |
//Si on est dans une vidéo, on laisse cette variable afin de ne pas dézoomer / bouger. |
|
|
963 |
if(_this.currentMode != 'VIDEO' && _this.currentMode != 'TIMELINE') |
|
|
964 |
{ |
|
|
965 |
_this.gestureDelRequested = false; |
|
|
966 |
} |
|
|
967 |
} |
|
|
968 |
} |
|
55
|
969 |
} |
|
|
970 |
|
|
|
971 |
/* |
|
|
972 |
* Retourne vrai si la souris est sur la notification d'aide dans le mode d'interaction souris. |
|
|
973 |
* Est appelé dans les fichiers : |
|
|
974 |
* mosaic > onMouseMove. |
|
|
975 |
*/ |
|
|
976 |
Mosaic.prototype.isOnHelpIcon = function(x, y) |
|
|
977 |
{ |
|
|
978 |
var helpIcon = $('#helpIcon'); |
|
|
979 |
//S'il n'y a pas d'icone d'aide, on quitte. |
|
|
980 |
if(helpIcon.length <= 0) |
|
|
981 |
{ |
|
|
982 |
return; |
|
|
983 |
} |
|
|
984 |
|
|
|
985 |
//Si la souris est sur l'icone, on retourne true. |
|
77
|
986 |
if(x > helpIcon.position().left && x < +helpIcon.position().left + helpIcon.width() + 2 * parseInt(helpIcon.css('margin-left')) && y > helpIcon.position().top && y < +helpIcon.position().top + helpIcon.height() + 2 * parseInt(helpIcon.css('margin-left'))) |
|
|
987 |
{ |
|
|
988 |
return true; |
|
|
989 |
} |
|
|
990 |
|
|
|
991 |
return false; |
|
|
992 |
} |
|
|
993 |
|
|
|
994 |
/* |
|
85
|
995 |
* Retourne vrai si la souris est sur la notification des crédits dans le mode d'interaction souris. |
|
|
996 |
* Est appelé dans les fichiers : |
|
|
997 |
* mosaic > onMouseMove. |
|
|
998 |
*/ |
|
|
999 |
Mosaic.prototype.isOnCreditsIcon = function(x, y) |
|
|
1000 |
{ |
|
|
1001 |
var creditsIcon = $('#creditsIcon'); |
|
|
1002 |
//S'il n'y a pas d'icone des crédits, on quitte. |
|
|
1003 |
if(creditsIcon.length <= 0) |
|
|
1004 |
{ |
|
|
1005 |
return; |
|
|
1006 |
} |
|
|
1007 |
|
|
|
1008 |
//Si la souris est sur l'icone, on retourne true. |
|
|
1009 |
if(x > creditsIcon.position().left && x < +creditsIcon.position().left + creditsIcon.width() + 2 * parseInt(creditsIcon.css('margin-left')) && y > creditsIcon.position().top && y < +creditsIcon.position().top + creditsIcon.height() + 2 * parseInt(creditsIcon.css('margin-left'))) |
|
|
1010 |
{ |
|
|
1011 |
return true; |
|
|
1012 |
} |
|
|
1013 |
|
|
|
1014 |
return false; |
|
|
1015 |
} |
|
|
1016 |
|
|
|
1017 |
/* |
|
77
|
1018 |
* Retourne vrai si le doigt est sur la notification de sortie dans le mode d'interaction tablettes. |
|
|
1019 |
*/ |
|
|
1020 |
Mosaic.prototype.isOnExitIcon = function(x, y) |
|
|
1021 |
{ |
|
|
1022 |
var exitIcon = $('#exitIcon'); |
|
|
1023 |
//S'il n'y a pas d'icone d'aide, on quitte. |
|
|
1024 |
if(exitIcon.length <= 0) |
|
|
1025 |
{ |
|
|
1026 |
return; |
|
|
1027 |
} |
|
|
1028 |
|
|
|
1029 |
//Si la souris est sur l'icone, on retourne true. |
|
|
1030 |
if(x > exitIcon.position().left && x < +exitIcon.position().left + exitIcon.width() + 2 * parseInt(exitIcon.css('margin-left')) && y > exitIcon.position().top && y < +exitIcon.position().top + exitIcon.height() + 2 * parseInt(exitIcon.css('margin-left'))) |
|
|
1031 |
{ |
|
|
1032 |
return true; |
|
|
1033 |
} |
|
|
1034 |
|
|
|
1035 |
return false; |
|
|
1036 |
} |
|
|
1037 |
|
|
|
1038 |
/* |
|
|
1039 |
* Retourne vrai si le doigt est sur la notification de retour vers la mosaïque dans le mode d'interaction tablettes. |
|
|
1040 |
*/ |
|
|
1041 |
Mosaic.prototype.isOnHomeIcon = function(x, y) |
|
|
1042 |
{ |
|
|
1043 |
var homeIcon = $('#homeIcon'); |
|
|
1044 |
//S'il n'y a pas d'icone d'aide, on quitte. |
|
|
1045 |
if(homeIcon.length <= 0) |
|
|
1046 |
{ |
|
|
1047 |
return; |
|
|
1048 |
} |
|
|
1049 |
|
|
|
1050 |
//Si la souris est sur l'icone, on retourne true. |
|
|
1051 |
if(x > homeIcon.position().left && x < +homeIcon.position().left + homeIcon.width() + 2 * parseInt(homeIcon.css('margin-left')) && y > homeIcon.position().top && y < +homeIcon.position().top + homeIcon.height() + 2 * parseInt(homeIcon.css('margin-left'))) |
|
|
1052 |
{ |
|
|
1053 |
return true; |
|
|
1054 |
} |
|
|
1055 |
|
|
|
1056 |
return false; |
|
|
1057 |
} |
|
|
1058 |
|
|
|
1059 |
/* |
|
|
1060 |
* Retourne vrai si le doigt est sur la notification de sortie de recherche dans le mode d'interaction tablettes. |
|
|
1061 |
*/ |
|
|
1062 |
Mosaic.prototype.isOnSearchExitIcon = function(x, y) |
|
|
1063 |
{ |
|
|
1064 |
var searchExitIcon = $('#searchExitIcon'); |
|
|
1065 |
//S'il n'y a pas d'icone d'aide, on quitte. |
|
|
1066 |
if(searchExitIcon.length <= 0) |
|
|
1067 |
{ |
|
|
1068 |
return; |
|
|
1069 |
} |
|
|
1070 |
|
|
|
1071 |
//Si la souris est sur l'icone, on retourne true. |
|
|
1072 |
if(x > searchExitIcon.position().left && x < +searchExitIcon.position().left + searchExitIcon.width() + 2 * parseInt(searchExitIcon.css('margin-left')) && y > searchExitIcon.position().top && y < +searchExitIcon.position().top + searchExitIcon.height() + 2 * parseInt(searchExitIcon.css('margin-left'))) |
|
|
1073 |
{ |
|
|
1074 |
return true; |
|
|
1075 |
} |
|
|
1076 |
|
|
|
1077 |
return false; |
|
|
1078 |
} |
|
|
1079 |
|
|
|
1080 |
/* |
|
|
1081 |
* Retourne vrai si le doigt est sur la notification de recherche dans le mode d'interaction tablettes. |
|
|
1082 |
*/ |
|
|
1083 |
Mosaic.prototype.isOnSearchNotification = function(x, y) |
|
|
1084 |
{ |
|
|
1085 |
var searchNotification = $('#notify_search_1gesture'); |
|
|
1086 |
//S'il n'y a pas d'icone d'aide, on quitte. |
|
|
1087 |
if(searchNotification.length <= 0) |
|
|
1088 |
{ |
|
|
1089 |
return; |
|
|
1090 |
} |
|
|
1091 |
|
|
|
1092 |
//Si la souris est sur l'icone, on retourne true. |
|
|
1093 |
if(x > searchNotification.position().left && x < +searchNotification.position().left + searchNotification.width() + 2 * parseInt(searchNotification.css('margin-left')) && y > searchNotification.position().top && y < +searchNotification.position().top + searchNotification.height() + 2 * parseInt(searchNotification.css('margin-left'))) |
|
55
|
1094 |
{ |
|
|
1095 |
return true; |
|
|
1096 |
} |
|
|
1097 |
|
|
|
1098 |
return false; |
|
58
|
1099 |
} |
|
|
1100 |
|
|
|
1101 |
/* |
|
89
|
1102 |
* Retourne vrai si la souris est sur la flèche haute dans le panneau des crédits. |
|
|
1103 |
*/ |
|
|
1104 |
Mosaic.prototype.isOnCreditsUpArrow = function(x, y) |
|
|
1105 |
{ |
|
|
1106 |
var creditsNotification = $('#notify_credits'), upArrow = $('#credits_upArrow'); |
|
|
1107 |
//Si les crédits ne sont pas affichés, on retourne faux. |
|
|
1108 |
if(creditsNotification.length <= 0) |
|
|
1109 |
{ |
|
|
1110 |
return false; |
|
|
1111 |
} |
|
|
1112 |
|
|
|
1113 |
var margin = parseInt(creditsNotification.css('margin-left')); |
|
|
1114 |
|
|
|
1115 |
//Si la flèche est visible et si la souris est dessus, on retourne true. |
|
|
1116 |
if(upArrow.length > 0 && upArrow.css('opacity') == '1' && x > (+upArrow.position().left + margin) && x < (+upArrow.position().left + upArrow.width() + margin) && y > (+upArrow.position().top + margin) && y < (+upArrow.position().top + upArrow.height() + margin)) |
|
|
1117 |
{ |
|
|
1118 |
return true; |
|
|
1119 |
} |
|
|
1120 |
|
|
|
1121 |
return false; |
|
|
1122 |
} |
|
|
1123 |
|
|
|
1124 |
/* |
|
|
1125 |
* Retourne vrai si la souris est sur la flèche basse dans le panneau des crédits. |
|
|
1126 |
*/ |
|
|
1127 |
Mosaic.prototype.isOnCreditsDownArrow = function(x, y) |
|
|
1128 |
{ |
|
|
1129 |
var creditsNotification = $('#notify_credits'), downArrow = $('#credits_downArrow'); |
|
|
1130 |
//Si les crédits ne sont pas affichés, on retourne faux. |
|
|
1131 |
if(creditsNotification.length <= 0) |
|
|
1132 |
{ |
|
|
1133 |
return false; |
|
|
1134 |
} |
|
|
1135 |
|
|
|
1136 |
//$('#aa').remove(); |
|
|
1137 |
|
|
|
1138 |
var margin = parseInt(creditsNotification.css('margin-left')); |
|
|
1139 |
|
|
|
1140 |
//Si la flèche est visible et si la souris est dessus, on retourne true. |
|
|
1141 |
if(downArrow.length > 0 && downArrow.css('opacity') == '1' && x > (+downArrow.position().left + margin) && x < (+downArrow.position().left + downArrow.width() + margin) && y > (+downArrow.position().top + margin) && y < (+downArrow.position().top + downArrow.height() + margin)) |
|
|
1142 |
{ |
|
|
1143 |
return true; |
|
|
1144 |
} |
|
|
1145 |
|
|
|
1146 |
return false; |
|
|
1147 |
} |
|
|
1148 |
|
|
|
1149 |
/* |
|
|
1150 |
* Retourne vrai si la souris est sur une des flèches du panneau des crédits. |
|
|
1151 |
*/ |
|
|
1152 |
Mosaic.prototype.isOnCreditsArrow = function(x, y) |
|
|
1153 |
{ |
|
|
1154 |
//Si la souris est sur une flèche des crédits, on retourne vrai. |
|
|
1155 |
if(this.isOnCreditsUpArrow(x, y) || this.isOnCreditsDownArrow(x, y)) |
|
|
1156 |
{ |
|
|
1157 |
return true; |
|
|
1158 |
} |
|
|
1159 |
|
|
|
1160 |
return false; |
|
|
1161 |
} |
|
|
1162 |
|
|
|
1163 |
/* |
|
|
1164 |
* Va a la page des crédits suivante. |
|
|
1165 |
*/ |
|
|
1166 |
Mosaic.prototype.goToNextCreditsPage = function() |
|
|
1167 |
{ |
|
|
1168 |
console.log(this.creditsPageLength); |
|
|
1169 |
//Si on est sur la dernière page, on quitte. |
|
|
1170 |
if(this.creditsPageNumber + 1 >= this.creditsPageLength) |
|
|
1171 |
{ |
|
|
1172 |
return; |
|
|
1173 |
} |
|
|
1174 |
|
|
|
1175 |
this.creditsPageNumber++; |
|
|
1176 |
this.goToCreditsPageN(this.creditsPageNumber); |
|
|
1177 |
} |
|
|
1178 |
|
|
|
1179 |
/* |
|
|
1180 |
* Va a la page des crédits précédente. |
|
|
1181 |
*/ |
|
|
1182 |
Mosaic.prototype.goToPreviousCreditsPage = function() |
|
|
1183 |
{ |
|
|
1184 |
//Si on est sur la première page, on quitte. |
|
|
1185 |
if(this.creditsPageNumber == 0) |
|
|
1186 |
{ |
|
|
1187 |
return; |
|
|
1188 |
} |
|
|
1189 |
|
|
|
1190 |
this.creditsPageNumber--; |
|
|
1191 |
this.goToCreditsPageN(this.creditsPageNumber); |
|
|
1192 |
} |
|
|
1193 |
|
|
|
1194 |
/* |
|
|
1195 |
* Va à la page N des crédits. |
|
|
1196 |
*/ |
|
|
1197 |
Mosaic.prototype.goToCreditsPageN = function(N) |
|
|
1198 |
{ |
|
|
1199 |
var notify_credits = $('#notify_credits'), arrowHeight = $('#credits_upArrow').height(), footer_height = $('#credits_footer').height(), margin = parseInt($('#notify_credits').css('margin-left')); |
|
|
1200 |
|
|
|
1201 |
//Si on est sur la première page, on cache la flèche haut. |
|
|
1202 |
if(this.creditsPageNumber == 0) |
|
|
1203 |
{ |
|
|
1204 |
$('#credits_upArrow').css( |
|
|
1205 |
{ |
|
|
1206 |
opacity: 0 |
|
|
1207 |
}); |
|
|
1208 |
$('#credits_downArrow').css( |
|
|
1209 |
{ |
|
|
1210 |
opacity: 1 |
|
|
1211 |
}); |
|
|
1212 |
$('#credits_container').css( |
|
|
1213 |
{ |
|
|
1214 |
top: margin, |
|
|
1215 |
height: notify_credits.height() - footer_height - arrowHeight |
|
|
1216 |
}); |
|
|
1217 |
} |
|
|
1218 |
//Si on est sur la dernière page, on cache la flèche bas. |
|
|
1219 |
else if(this.creditsPageNumber + 1 >= this.creditsPageLength) |
|
|
1220 |
{ |
|
|
1221 |
$('#credits_upArrow').css( |
|
|
1222 |
{ |
|
|
1223 |
opacity: 1 |
|
|
1224 |
}); |
|
|
1225 |
$('#credits_downArrow').css( |
|
|
1226 |
{ |
|
|
1227 |
opacity: 0 |
|
|
1228 |
}); |
|
|
1229 |
$('#credits_container').css( |
|
|
1230 |
{ |
|
|
1231 |
top: +arrowHeight + margin, |
|
|
1232 |
height: notify_credits.height() - footer_height - arrowHeight - margin |
|
|
1233 |
}); |
|
|
1234 |
} |
|
|
1235 |
//Si on est dans les autres pages, on affiche les deux flèches. |
|
|
1236 |
else |
|
|
1237 |
{ |
|
|
1238 |
$('#credits_upArrow').css( |
|
|
1239 |
{ |
|
|
1240 |
opacity: 1 |
|
|
1241 |
}); |
|
|
1242 |
$('#credits_downArrow').css( |
|
|
1243 |
{ |
|
|
1244 |
opacity: 1 |
|
|
1245 |
}); |
|
|
1246 |
$('#credits_container').css( |
|
|
1247 |
{ |
|
|
1248 |
top: +arrowHeight + margin, |
|
|
1249 |
height: notify_credits.height() - footer_height - 2 * arrowHeight - margin |
|
|
1250 |
}); |
|
|
1251 |
} |
|
|
1252 |
|
|
|
1253 |
//On déplace le texte des crédits. |
|
|
1254 |
$('#credits_container').css( |
|
|
1255 |
{ |
|
|
1256 |
left: -($('#credits_container').width() * N - parseInt(notify_credits.css('margin-left')))// + this.column_gap) |
|
|
1257 |
}); |
|
|
1258 |
} |
|
|
1259 |
|
|
100
|
1260 |
/* |
|
|
1261 |
* Retourne vrai si la souris est sur la flèche haute dans le panneau d'aide. |
|
|
1262 |
*/ |
|
|
1263 |
Mosaic.prototype.isOnHelpUpArrow = function(x, y) |
|
|
1264 |
{ |
|
|
1265 |
var helpNotification = $('#notify_help'), upArrow = $('#help_details_upArrow'); |
|
|
1266 |
//Si les crédits ne sont pas affichés, on retourne faux. |
|
|
1267 |
if(helpNotification.length <= 0) |
|
|
1268 |
{ |
|
|
1269 |
return false; |
|
|
1270 |
} |
|
|
1271 |
|
|
|
1272 |
var margin = parseInt(helpNotification.css('margin-left')); |
|
|
1273 |
|
|
|
1274 |
//Si la flèche est visible et si la souris est dessus, on retourne true. |
|
|
1275 |
if(upArrow.length > 0 && upArrow.css('opacity') == '1' && x > (+upArrow.position().left + margin) && x < (+upArrow.position().left + upArrow.width() + margin) && y > (+upArrow.position().top + margin) && y < (+upArrow.position().top + upArrow.height() + margin)) |
|
|
1276 |
{ |
|
|
1277 |
return true; |
|
|
1278 |
} |
|
|
1279 |
|
|
|
1280 |
return false; |
|
|
1281 |
} |
|
89
|
1282 |
|
|
100
|
1283 |
/* |
|
|
1284 |
* Retourne vrai si la souris est sur la flèche basse dans le panneau d'aide. |
|
|
1285 |
*/ |
|
|
1286 |
Mosaic.prototype.isOnHelpDownArrow = function(x, y) |
|
|
1287 |
{ |
|
|
1288 |
var helpNotification = $('#notify_help'), downArrow = $('#help_details_downArrow'); |
|
|
1289 |
//Si les crédits ne sont pas affichés, on retourne faux. |
|
|
1290 |
if(helpNotification.length <= 0) |
|
|
1291 |
{ |
|
|
1292 |
return false; |
|
|
1293 |
} |
|
|
1294 |
|
|
|
1295 |
var margin = parseInt(helpNotification.css('margin-left')); |
|
|
1296 |
|
|
|
1297 |
//Si la flèche est visible et si la souris est dessus, on retourne true. |
|
|
1298 |
if(downArrow.length > 0 && downArrow.css('opacity') == '1' && x > (+downArrow.position().left + margin) && x < (+downArrow.position().left + downArrow.width() + margin) && y > (+downArrow.position().top + margin) && y < (+downArrow.position().top + downArrow.height() + margin)) |
|
|
1299 |
{ |
|
|
1300 |
return true; |
|
|
1301 |
} |
|
|
1302 |
|
|
|
1303 |
return false; |
|
|
1304 |
} |
|
|
1305 |
|
|
|
1306 |
/* |
|
|
1307 |
* Retourne vrai si la souris est sur une des flèches du panneau d'aide. |
|
|
1308 |
*/ |
|
|
1309 |
Mosaic.prototype.isOnHelpArrow = function(x, y) |
|
|
1310 |
{ |
|
|
1311 |
//Si la souris est sur une flèche des crédits, on retourne vrai. |
|
|
1312 |
if(this.isOnHelpUpArrow(x, y) || this.isOnHelpDownArrow(x, y)) |
|
|
1313 |
{ |
|
|
1314 |
return true; |
|
|
1315 |
} |
|
|
1316 |
|
|
|
1317 |
return false; |
|
|
1318 |
} |
|
|
1319 |
|
|
|
1320 |
/* |
|
|
1321 |
* Va a la page d'aide suivante. |
|
|
1322 |
*/ |
|
|
1323 |
Mosaic.prototype.goToNextHelpDetailsPage = function() |
|
|
1324 |
{ |
|
|
1325 |
// console.log(+this.helpDetailsPageNumber + 1 + ' >= ' + this.helpDetailsPageLength); |
|
|
1326 |
//Si on est sur la dernière page, on quitte. |
|
|
1327 |
if(this.helpDetailsPageNumber + 1 >= this.helpDetailsPageLength) |
|
|
1328 |
{ |
|
|
1329 |
return; |
|
|
1330 |
} |
|
|
1331 |
|
|
|
1332 |
this.helpDetailsPageNumber++; |
|
|
1333 |
this.goToHelpDetailsPageN(this.helpDetailsPageNumber); |
|
|
1334 |
} |
|
|
1335 |
|
|
|
1336 |
/* |
|
|
1337 |
* Va a la page d'aide précédente. |
|
|
1338 |
*/ |
|
|
1339 |
Mosaic.prototype.goToPreviousHelpDetailsPage = function() |
|
|
1340 |
{ |
|
|
1341 |
//Si on est sur la première page, on quitte. |
|
|
1342 |
if(this.helpDetailsPageNumber == 0) |
|
|
1343 |
{ |
|
|
1344 |
return; |
|
|
1345 |
} |
|
|
1346 |
|
|
|
1347 |
this.helpDetailsPageNumber--; |
|
|
1348 |
this.goToHelpDetailsPageN(this.helpDetailsPageNumber); |
|
|
1349 |
} |
|
|
1350 |
|
|
|
1351 |
/* |
|
|
1352 |
* Va à la page N des crédits. |
|
|
1353 |
*/ |
|
|
1354 |
Mosaic.prototype.goToHelpDetailsPageN = function(N) |
|
|
1355 |
{ |
|
|
1356 |
var notify_help = $('#notify_help'), arrowHeight = $('#help_details_upArrow').height(), margin = parseInt($('#notify_help').css('margin-left')) + parseInt($('#notify_help').css('border-width')); |
|
|
1357 |
|
|
|
1358 |
//Si on est sur la première page, on cache la flèche haut. |
|
|
1359 |
if(this.helpDetailsPageNumber == 0) |
|
|
1360 |
{ |
|
|
1361 |
//On affiche la page principale. |
|
|
1362 |
$('#help_search, #help_controls').css('opacity', '1'); |
|
|
1363 |
|
|
|
1364 |
$('#help_details_upArrow').css( |
|
|
1365 |
{ |
|
|
1366 |
opacity: 0 |
|
|
1367 |
}); |
|
|
1368 |
$('#help_details_downArrow').css( |
|
|
1369 |
{ |
|
|
1370 |
opacity: 1 |
|
|
1371 |
}); |
|
|
1372 |
$('.help_details_containers').css( |
|
|
1373 |
{ |
|
|
1374 |
top: margin, |
|
|
1375 |
// height: notify_help.height() - arrowHeight |
|
|
1376 |
}); |
|
|
1377 |
} |
|
|
1378 |
//Si on est sur la dernière page, on cache la flèche bas. |
|
|
1379 |
else if(this.helpDetailsPageNumber + 1 >= this.helpDetailsPageLength) |
|
|
1380 |
{ |
|
|
1381 |
//On masque la page principale. |
|
|
1382 |
$('#help_search, #help_controls').css('opacity', '0'); |
|
|
1383 |
|
|
|
1384 |
$('#help_details_upArrow').css( |
|
|
1385 |
{ |
|
|
1386 |
opacity: 1 |
|
|
1387 |
}); |
|
|
1388 |
$('#help_details_downArrow').css( |
|
|
1389 |
{ |
|
|
1390 |
opacity: 0 |
|
|
1391 |
}); |
|
|
1392 |
$('.help_details_containers').css( |
|
|
1393 |
{ |
|
|
1394 |
top: +arrowHeight + margin, |
|
|
1395 |
// height: notify_help.height() - arrowHeight - margin |
|
|
1396 |
}); |
|
|
1397 |
} |
|
|
1398 |
//Si on est dans les autres pages, on affiche les deux flèches. |
|
|
1399 |
else |
|
|
1400 |
{ |
|
|
1401 |
//On masque la page principale. |
|
|
1402 |
$('#help_search, #help_controls').css('opacity', '0'); |
|
|
1403 |
|
|
|
1404 |
$('#help_details_upArrow').css( |
|
|
1405 |
{ |
|
|
1406 |
opacity: 1 |
|
|
1407 |
}); |
|
|
1408 |
$('#help_details_downArrow').css( |
|
|
1409 |
{ |
|
|
1410 |
opacity: 1 |
|
|
1411 |
}); |
|
|
1412 |
$('.help_details_containers').css( |
|
|
1413 |
{ |
|
|
1414 |
top: +arrowHeight + margin, |
|
|
1415 |
// height: notify_help.height() - 2 * arrowHeight - margin |
|
|
1416 |
}); |
|
|
1417 |
} |
|
|
1418 |
|
|
|
1419 |
//On déplace le texte des crédits. |
|
|
1420 |
$('.help_details_containers').css( |
|
|
1421 |
{ |
|
|
1422 |
// top: -($('.help_details_containers').height() * N - margin)// + this.column_gap) |
|
|
1423 |
top: $('#notify_help').height() - ($('#notify_help').height() * N - margin)// + this.column_gap) |
|
|
1424 |
}); |
|
|
1425 |
} |
|
89
|
1426 |
|
|
|
1427 |
/* |
|
79
|
1428 |
* Retourne vrai si le doigt est sur le bouton de lecture de video dans le mode d'interaction tablettes. |
|
|
1429 |
*/ |
|
|
1430 |
Mosaic.prototype.isOnPlayButton = function(x, y) |
|
|
1431 |
{ |
|
|
1432 |
var playButton = $('#tabletPlayButton'); |
|
|
1433 |
//S'il n'y a pas d'icone d'aide, on quitte. |
|
|
1434 |
if(playButton.length <= 0) |
|
|
1435 |
{ |
|
|
1436 |
return; |
|
|
1437 |
} |
|
|
1438 |
|
|
|
1439 |
//Si la souris est sur l'icone, on retourne true. |
|
|
1440 |
if(x > playButton.position().left && x < +playButton.position().left + playButton.width() + 2 * parseInt(playButton.css('margin-left')) && y > playButton.position().top && y < +playButton.position().top + playButton.height() + 2 * parseInt(playButton.css('margin-left'))) |
|
|
1441 |
{ |
|
|
1442 |
return true; |
|
|
1443 |
} |
|
|
1444 |
|
|
|
1445 |
return false; |
|
|
1446 |
} |
|
|
1447 |
|
|
|
1448 |
/* |
|
58
|
1449 |
* Change la couleur des pointeurs pendant le tracé d'une courbe. |
|
|
1450 |
*/ |
|
|
1451 |
Mosaic.prototype.pointersGreen = function() |
|
|
1452 |
{ |
|
|
1453 |
$('#mainPointer').css('background-image', 'url(./img/cursors/pointerC.png)'); |
|
|
1454 |
$('#secondPointer').css('background-image', 'url(./img/cursors/pointer2C.png)'); |
|
|
1455 |
} |
|
|
1456 |
|
|
|
1457 |
Mosaic.prototype.minMax = function(x, y) |
|
|
1458 |
{ |
|
|
1459 |
if(x < this.minX) {this.minX = x;} |
|
|
1460 |
if(x > this.maxX) {this.maxX = x;} |
|
|
1461 |
if(y < this.minY) {this.minY = y;} |
|
|
1462 |
if(y > this.maxY) {this.maxY = y;} |
|
44
|
1463 |
} |