4 mosaic.prototype.listenToNeighbours = function() |
4 mosaic.prototype.listenToNeighbours = function() |
5 { |
5 { |
6 ////TEST |
6 ////TEST |
7 //$('.test').empty(); |
7 //$('.test').empty(); |
8 console.log('LISTEN TO NEIGHBOURS'); |
8 console.log('LISTEN TO NEIGHBOURS'); |
9 $('.notifications').remove(); |
9 |
|
10 if(this.currentMode != 'SEARCH') |
|
11 { |
|
12 this.removeNotifications(); |
|
13 } |
10 |
14 |
11 if(this.currentMode == "NO-USER" || this.currentMode.indexOf("INCOMING") != -1) |
15 if(this.currentMode == "NO-USER" || this.currentMode.indexOf("INCOMING") != -1) |
12 { |
16 { |
13 return; |
17 return; |
14 } |
18 } |
240 { |
252 { |
241 if(_this.mouseInteractions) |
253 if(_this.mouseInteractions) |
242 { |
254 { |
243 if(_this.currentMode == 'VIDEO') |
255 if(_this.currentMode == 'VIDEO') |
244 { |
256 { |
245 $('.notifications').remove(); |
257 _this.removeNotifications(); |
246 _this.videoMove(snapshotId); |
258 _this.videoMove(snapshotId); |
247 } |
259 } |
248 else if(_this.currentMode == 'SEARCH' && !_this.currentSearchGesture) |
260 else if(_this.currentMode == 'SEARCH' && !_this.currentSearchGesture[_this.centerId]) |
249 { |
261 { |
250 $('.notifications').remove(); |
262 _this.removeNotifications(); |
251 _this.searchSearchAndMove(snapshotId); |
263 _this.searchSearchAndMove(snapshotId); |
252 } |
264 } |
253 else if(_this.currentMode == 'SEARCH' && _this.currentSearchGesture) |
265 else if(_this.currentMode == 'SEARCH' && _this.currentSearchGesture[_this.centerId]) |
254 { |
266 { |
255 $('.notifications').remove(); |
267 _this.removeNotifications(); |
256 _this.searchGestureAndMove(_this.currentSearchGesture, 'valid', snapshotId); |
268 _this.searchGestureAndMove(_this.currentSearchGesture[_this.centerId], 'valid', snapshotId); |
257 } |
269 } |
258 |
270 |
259 _this.canMoveToNeighbour = true; |
271 _this.canMoveToNeighbour = true; |
260 } |
272 } |
261 else |
273 else |
262 { |
274 { |
263 if(_this.currentMode == 'VIDEO') |
275 if(_this.currentMode == 'VIDEO') |
264 { |
276 { |
265 $('.notifications').remove(); |
277 _this.removeNotifications(); |
266 _this.videoMoveAndUnzoom(snapshotId); |
278 _this.videoMoveAndUnzoom(snapshotId); |
267 } |
279 } |
268 else if(_this.currentMode == 'SEARCH' && !_this.currentSearchGesture) |
280 else if(_this.currentMode == 'SEARCH' && !_this.currentSearchGesture[_this.centerId]) |
269 { |
281 { |
270 $('.notifications').remove(); |
282 _this.removeNotifications(); |
271 _this.searchSearchAndMoveAndUnzoom(snapshotId); |
283 _this.searchSearchAndMoveAndUnzoom(snapshotId); |
272 } |
284 } |
273 else if(_this.currentMode == 'SEARCH' && _this.currentSearchGesture) |
285 else if(_this.currentMode == 'SEARCH' && _this.currentSearchGesture[_this.centerId]) |
274 { |
286 { |
275 $('.notifications').remove(); |
287 _this.removeNotifications(); |
276 _this.searchGestureAndMoveAndUnzoom(_this.currentSearchGesture, 'valid', snapshotId); |
288 _this.searchGestureAndMoveAndUnzoom(_this.currentSearchGesture[_this.centerId], 'valid', snapshotId); |
277 } |
289 } |
278 } |
290 } |
279 }); |
291 }); |
280 |
292 |
281 var side = $.inArray(parseInt(snapshotId), this.neighboursIds); |
293 var side = $.inArray(parseInt(snapshotId), this.neighboursIds); |
326 opacity: '0' |
338 opacity: '0' |
327 }, this.config['timeNeighbourUnglowing'], function() |
339 }, this.config['timeNeighbourUnglowing'], function() |
328 { |
340 { |
329 //Une fois invisible, on le supprime. |
341 //Une fois invisible, on le supprime. |
330 neighbourFrame.remove(); |
342 neighbourFrame.remove(); |
331 $('.notifications').remove(); |
343 _this.removeNotifications(); |
332 |
344 |
333 if(_this.currentMode == 'SEARCH' && !_this.currentSearchGesture) |
345 if(_this.currentMode == 'SEARCH' && _this.currentSearchGesture[_this.centerId] == '') |
334 { |
346 { |
335 _this.searchSearch(); |
347 _this.searchSearch(); |
336 } |
348 } |
337 else if(_this.currentMode == 'SEARCH' && _this.currentSearchGesture) |
349 else if(_this.currentMode == 'SEARCH' && _this.currentSearchGesture[_this.centerId] != '') |
338 { |
350 { |
339 _this.searchGesture(_this.currentSearchGesture, 'valid'); |
351 _this.searchGesture(_this.currentSearchGesture[_this.centerId], 'valid'); |
340 } |
352 } |
341 |
353 |
342 _this.canSwipe = true; |
354 _this.canSwipe = true; |
343 }); |
355 }); |
344 } |
356 } |
460 if(_this.currentMode == 'TIMELINE') |
472 if(_this.currentMode == 'TIMELINE') |
461 { |
473 { |
462 _this.exitTimeline('move'); |
474 _this.exitTimeline('move'); |
463 } |
475 } |
464 |
476 |
465 console.log(Math.floor(_this.player.popcorn.currentTime())); |
477 // console.log(Math.floor(_this.player.popcorn.currentTime())); |
466 if(_this.autoMove) |
478 if(_this.autoMove) |
467 { |
479 { |
468 _this.timeToGoAt[_this.centerId] = 0; |
480 _this.timeToGoAt[_this.centerId] = 0; |
469 this.autoMove = false; |
481 this.autoMove = false; |
470 } |
482 } |
491 { |
503 { |
492 top: MPCurrentTop, |
504 top: MPCurrentTop, |
493 left: MPCurrentLeft |
505 left: MPCurrentLeft |
494 }, _this.config['timeMovingToNeighbour'], function() |
506 }, _this.config['timeMovingToNeighbour'], function() |
495 { |
507 { |
|
508 if(_this.currentSearchGesture[_this.centerId] != '') |
|
509 { |
|
510 console.log('notify move'); |
|
511 _this.currentMode = 'SEARCH'; |
|
512 _this.isCurrentlyInASearchByGesture = true; |
|
513 _this.removeNotifications(); |
|
514 _this.searchGesture(_this.currentSearchGesture[_this.centerId], 'valid'); |
|
515 } |
|
516 |
496 //On fait apparaître le snapshot vers lequel on s'est déplacé. |
517 //On fait apparaître le snapshot vers lequel on s'est déplacé. |
497 $('#snapshotDiv-' + destinationId).fadeTo(_this.config['zoomTime'], '1', function() |
518 $('#snapshotDiv-' + destinationId).fadeTo(_this.config['zoomTime'], '1', function() |
498 { |
519 { |
499 //On recharge les voisins. |
520 //On recharge les voisins. |
500 _this.previousZoomedSN = $('#snapshotDiv-' + _this.centerId); |
521 _this.previousZoomedSN = $('#snapshotDiv-' + _this.centerId); |