# HG changeset patch # User bastiena # Date 1341497073 -7200 # Node ID 0e29ae4568a0cd4057e113d531ef29323a3c8ae1 # Parent 8393d3473b983a76fb63693fd02fe2501b93e010 Front IDILL: Segment detector created for mouse interactions curves detection diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/config.json --- a/front_idill/src/config.json Fri Jun 29 16:16:24 2012 +0200 +++ b/front_idill/src/config.json Thu Jul 05 16:04:33 2012 +0200 @@ -33,5 +33,7 @@ "prezoomPercentage":"0.25", "zoomedMargin":"42", "host":"127.0.0.1", - "port":"8090" + "port":"8090", + "mouseUpDownDeltaTreshold":"15", + "dico":"./dico.json" } \ No newline at end of file diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/dico.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_idill/src/dico.json Thu Jul 05 16:04:33 2012 +0200 @@ -0,0 +1,30 @@ +{ + "divisions":"6", + "gestures": + [ + { + "name":"contact", + "codes":["D1D0D1", "D1D0D2"] + }, + { + "name":"right-angle", + "codes":["D1D0D1D3D1", "D1D0D1D2D1"] + }, + { + "name":"up-down", + "codes":["D0D1", "D0D2"] + }, + { + "name":"fall", + "codes":["D3"] + }, + { + "name":"jump", + "codes":["D0"] + }, + { + "name":"grand-jete", + "codes":["D1D0", "D2D0"] + } + ] +} \ No newline at end of file diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/img/cursors/down_blue.png Binary file front_idill/src/img/cursors/down_blue.png has changed diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/img/cursors/down_gray.png Binary file front_idill/src/img/cursors/down_gray.png has changed diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/img/pointer.png Binary file front_idill/src/img/pointer.png has changed diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/img/pointer2.png Binary file front_idill/src/img/pointer2.png has changed diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/index.html --- a/front_idill/src/index.html Fri Jun 29 16:16:24 2012 +0200 +++ b/front_idill/src/index.html Thu Jul 05 16:04:33 2012 +0200 @@ -31,6 +31,7 @@ + @@ -43,6 +44,7 @@ + @@ -95,6 +97,8 @@ default_parameters['zoomedMargin'] = 42; default_parameters['host'] = '127.0.0.1'; default_parameters['port'] = '80'; + default_parameters['mouseUpDownDeltaTreshold'] = 15; + default_parameters['dico'] = './dico.json'; /*var length = 5, imagesToShow = 20, totalImages = 23; //Temps de chargement du prezoom en ms (seront importés des paramètres du Middleware). diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/mosaic/css/mosaic.less --- a/front_idill/src/mosaic/css/mosaic.less Fri Jun 29 16:16:24 2012 +0200 +++ b/front_idill/src/mosaic/css/mosaic.less Thu Jul 05 16:04:33 2012 +0200 @@ -71,6 +71,18 @@ } /* + * C'est un div invisible qui s'étale sur l'écran afin d'empêcher l'utilisateur de faire des drag & drop sur les images ou de la sélection de texte. +*/ +#ghostPanel +{ + position: absolute; + opacity: 0; + width: 100%; + height: 100%; + z-index: 1000; +} + +/* * Les divs contenant les snapshots (ou les "voisins" aussi en cas de zoom total). Ils se positionnent par défaut de gauche à droite, à l'horizontale et wrap dès * qu'ils ont atteint la bordure de fenêtre de droite. */ diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/mosaic/js/mosaic.js --- a/front_idill/src/mosaic/js/mosaic.js Fri Jun 29 16:16:24 2012 +0200 +++ b/front_idill/src/mosaic/js/mosaic.js Thu Jul 05 16:04:33 2012 +0200 @@ -25,11 +25,11 @@ function mosaic(config, default_conf) { //Interactions souris/kinect. - this.mouseInteractions = false; + this.mouseInteractions = true; //Interactions avec/sans préphase. this.prephaseEnabled = true; - this.gestures = ["fall", "jump", "circle", "screw", "bend", "arc", "pendulum", "knee-up", "right-angle", "wave", "slow", "hello", "no-motion", "wheel", "contact", "run"]; + this.gestures = ["fall", "jump", "circle", "screw", "bend", "arc", "pendulum", "knee-up", "right-angle", "wave", "slow", "hello", "no-motion", "wheel", "contact", "run", "up-down", "grand-jete"]; //Chemin du fichier de configuration. this.config_path = config; @@ -47,6 +47,9 @@ this.fillingIds = []; this.currentRandomVideoIdx = 0; + //Dictionnaire pour les courbes de recherche. + this.dictionary = []; + //Dernières positions des pointeurs. this.mainPointerLastX; this.mainPointerLastY; @@ -58,6 +61,15 @@ this.secondPointerIdleStartX; this.secondPointerIdleStartY; + //Coordonnées de la souris dans le mode d'interaction souris. + this.mousePosX; + this.mousePosY; + //Coordonnées précédentes de la souris dans le mode d'interaction souris. + this.mousePosLastX; + this.mousePosLastY; + //Valeur du déplacement entre un mouse up et un mouse down. + this.mouseUpDownDelta = 0; + //Dimensions de la mosaïque en pixels. this.width; this.height; @@ -68,95 +80,103 @@ this.marginWidth; //Booléens permettant ou non certaines intéractions selon le contexte. - this.zoomed; - this.fullscreen; - this.canMoveToNeighbour; - this.mainPointerExitBorder; - this.secondPointerExitBorder; - this.isMainPointerDisplayed; - this.isSecondPointerDisplayed; - this.helpDisplayed; + this.zoomed = false; + this.fullscreen = false; + this.canMoveToNeighbour = false; + this.mainPointerExitBorder = false; + this.secondPointerExitBorder = false; + this.isMainPointerDisplayed = false; + this.isSecondPointerDisplayed = false; + this.helpDisplayed = false; //Indique si l'utilisateur a manuellement pausé la vidéo. - this.userPaused; + this.userPaused = false; //Indique si on est en train de se déplacer vers un voisin. - this.currentlyMoving; + this.currentlyMoving = false; //Indique si on est en train de dézoomer vers la mosaïque. - this.currentlyUnzooming; + this.currentlyUnzooming = false; //Indique si on peut s'approcher de kinect. - this.canStart; + this.canStart = false; //Indique si on est actuellement sur un snapshot. - this.isOnASnapshot; + this.isOnASnapshot = false; //Indique si l'idle des pointeurs est disponible (deux mains détectées). - this.pointersIdleAvailable; + this.pointersIdleAvailable = false; //Indique si le timeout pour l'idle des pointeurs à besoin d'être lancé. - this.pointersIdleNeedLaunch; + this.pointersIdleNeedLaunch = false; //Indique si les deux mains sont là. - this.areBothPointersHere; + this.areBothPointersHere = false; //Indique si le timeout pour la détection de deux pointeurs a été lancé. - this.areBothPointersTimeoutLaunched; + this.areBothPointersTimeoutLaunched = false; //Indique si la mosaïque a été filtrée. - this.isMosaicFiltered; + this.isMosaicFiltered = false; //Indique si on est actuellement dans une recherche par gesture. - this.isCurrentlyInASearchByGesture; + this.isCurrentlyInASearchByGesture = false; //Indique si un pointeur est déjà sur une notification de recherche par gesture. - this.alreadyOnNotification; + this.alreadyOnNotification = false; //Si on a fait un swipe. - this.isSwipe; + this.isSwipe = false; //On peut swiper. - this.canSwipe; + this.canSwipe = false; //On passe vers une autre video automatiquement à la fin d'une lecture. - this.autoMove; + this.autoMove = false; //Si l'utilisateur a demandé à sélectionner la TL. - this.isTLRequested; + this.isTLRequested = false; //Le pointeur gauche a sélectionné la TL. - this.isTLSelectedBySecondPointer; + this.isTLSelectedBySecondPointer = false; //Le pointeur droit a sélectionné la TL. - this.isTLSelectedByMainPointer; + this.isTLSelectedByMainPointer = false; //On peut afficher l'aide. - this.canNotifyHelp; + this.canNotifyHelp = false; //Indique si la mosaique est en train d'être filtrée. - this.isMosaicFiltering; + this.isMosaicFiltering = false; this.arrowLeftLoading = false; this.arrowRightLoading = false; this.arrowUpLoading = false; this.arrowDownLoading = false; //On est dans une recherche par courbes. - this.isSearchByCurvesOn; + this.isSearchByCurvesOn = false; this.canDrawNextCurve = false; + //Dans le mode d'interaction souris, indique si on se situe actuellement sur un snapshot entièrement prézoomé. + this.isOnAPrezoomSN = false; + //Indique si une courbe de recherche donne au moins un résultat. + this.curvesGesturesFound = false; + //Indique si on souhaite supprimer la recherche en cours. + this.gestureDelRequested = false; + //Code de gesture actuellement calculé par les détecteurs de courbes. + this.actualCode = ''; //Timeout (attente) pour le zoom après un préZoom. - this.zoomTimeout; + this.zoomTimeout = null; //Timeout (attente) pour le passage vers un voisin. - this.moveToNeighbourTimeout; - this.mainPointerExitBorderTimeout; - this.secondPointerExitBorderTimeout; + this.moveToNeighbourTimeout = null; + this.mainPointerExitBorderTimeout = null; + this.secondPointerExitBorderTimeout = null; //Idle time pour les pointeurs afin d'informer le front qu'on souhaite faire une recherche. - this.pointersSearchIdleTimeout; + this.pointersSearchIdleTimeout = null; //Vérifie toutes les N ms que les deux pointeurs sont détectés. - this.areBothPointersHereTimeout; + this.areBothPointersHereTimeout = null; //Délai de suppression d'une notification de recherche par gesture. - this.removeNotificationByGestureTimeout; + this.removeNotificationByGestureTimeout = null; //Délai de suppression d'une notification de recherche par gesture infructueuse. - this.removeFailedNotificationByGestureTimeout; + this.removeFailedNotificationByGestureTimeout = null; //Délai avant la suppression de notification swipe. - this.notifySwipeTimeout; + this.notifySwipeTimeout = null; //Délai pour la sélection de la TL. - this.selectTLTimeout; + this.selectTLTimeout = null; //Délai pour slider sur la TL. - this.canSlideInTLTimeout; + this.canSlideInTLTimeout = null; //Délai pour afficher l'aide. - this.canNotifyHelpTimeout; - this.arrowLeftTimeout; - this.arrowRightTimeout; - this.arrowUpTimeout; - this.arrowDownTimeout; + this.canNotifyHelpTimeout = null; + this.arrowLeftTimeout = null; + this.arrowRightTimeout = null; + this.arrowUpTimeout = null; + this.arrowDownTimeout = null; - this.arrowSpinnerTimeout; - this.nouserTimeout; - this.nextDrawCurveTimeout; + this.arrowSpinnerTimeout = null; + this.nouserTimeout = null; + this.nextDrawCurveTimeout = null; //Dernier message INCOMING (pour éviter d'effectuer n fois la même action. - this.lastIncomingMessage; + this.lastIncomingMessage = ''; //Type de marqueur recherché dans la mosaïque (en mode filter). this.filterSearchedType = ""; @@ -165,8 +185,10 @@ this.currentMode = "NO-USER"; //Snapshot sur lequel on a zoomé. this.previousZoomedSN = null; + //Snapshot sur lequel on a prezoomé. + this.previousPrezoomDiv = null; //Son ID. - this.previousId; + this.previousId = null; //Dernier snapshot prézoomé non null. this.lastNonNullSN = null; //Largeur de la marge pour le centrage vertical de la mosaïque. @@ -174,8 +196,8 @@ this.top_margin; //Gesture actuellement cherchée. - this.currentSearchGesture; - + this.currentSearchGesture = ''; + //Mosaïque locale. this.localMos; //Position des voisins lors d'un zoom. @@ -191,9 +213,9 @@ this.snapshotsToShow = 1; //Lecteur. - this.player; + this.player = null; //Si le lecteur est prêt. - this.playerIsReady; + this.playerIsReady = false; //Annotations (pour les marqueurs los d'un filtrage). this.annotations = []; @@ -240,34 +262,6 @@ //S'il s'agit d'un rectangle. if(imgs % len == 0) { - this.previousZoomedSN = null; - this.previousPrezoomDiv = null; - this.fullscreen = false; - this.canMoveToNeighbour = false; - this.currentlyZooming = false; - this.currentlyUnzooming = false; - this.helpDisplayed = false; - this.canStart = false; - this.isOnASnapshot = false; - this.isMosaicFiltered = false; - this.areBothPointersHere = false; - this.areBothPointersTimeoutLaunched = false; - this.isCurrentlyInASearchByGesture = false; - this.alreadyOnNotification = false; - this.playerIsReady = false; - this.currentSearchGesture = ''; - this.isMainPointerDisplayed = false; - this.isSecondPointerDisplayed = false; - this.isSwipe = false; - this.canSwipe = false; - this.autoMove = false; - this.isTLRequested = false; - this.isTLSelectedByMainPointer = false; - this.isTLSelectedBySecondPointer = false; - this.canNotifyHelp = false; - this.isMosaicFiltering = false; - this.isSearchByCurvesOn = false; - this.lastIncomingMessage = 'INCOMING-0'; var str = ''; @@ -281,7 +275,7 @@ } } - return str; + return str + '
'; } else { @@ -307,6 +301,7 @@ //On affecte les chemins vers les images à la mosaïque. this.previousZoomedSN; //this.width = + // console.log(createMosaic); //On met à jour la mosaïque. $('#mainPanel').html(createMosaic); //On récupère la taille des bordures. @@ -326,7 +321,6 @@ //On fait coincider le background du body avec celui de la mosaïque. $('body').css('background-position', '0px ' + this.MPTop_margin + 'px'); - console.log(this.MPTop_margin); /*$('.snapshotDivs').mouseover(function () { @@ -374,12 +368,15 @@ //Si on gère les interactions à la souris. if(_this.mouseInteractions) { - $('body').mousemove(function(e){_this.refreshMainPointer(e.pageX, e.pageY, _this)}); + $('body').mousemove(function(e) + { + _this.refreshMainPointer(e.pageX, e.pageY, _this); + _this.mousePosX = e.pageX; + _this.mousePosY = e.pageY; + }); } - // if(false) - // { - if(_this.prephaseEnabled) + if(_this.prephaseEnabled && !_this.mouseInteractions) { _this.init(); _this.showNImages(0); @@ -390,7 +387,6 @@ _this.showNImages(20); _this.currentMode = "MOSAIC"; } - // } // /!\ // // _this.currentMode = "FILTER"; @@ -408,6 +404,197 @@ } }); } + + if(this.mouseInteractions) + { + //On bind le clic pour supprimer une recherche. + $('body').click(function(e) + { + _this.removeSearchNotificationIfOnIt(e.pageX, e.pageY); + }); + + //Si on fait un mouse down sur le body, on vérifie enregistre le déplacement de la souris jusqu'au prochain mouse up. + $(window).mousedown(function () + { + if(_this.isSearchByCurvesOn) + { + _this.searchCanvas.onPointerIn(_this.mousePosX, _this.mousePosY, null, null); + } + + console.log('mdown'); + //On écoute le déplacement de la souris. + $(window).mousemove(function(e) + { + if(_this.isSearchByCurvesOn) + { + _this.searchCanvas.onPointerMove(_this.mousePosX, _this.mousePosY - _this.MPTop_margin, null, null); + } + + //On met à jour l'ancienne position de la souris si elle est nulle. + if(!_this.mousePosLastX && _this.mousePosLastX != 0) + { + _this.mousePosLastX = _this.mousePosX; + } + if(!_this.mousePosLastY && _this.mousePosLastY != 0) + { + _this.mousePosLastY = _this.mousePosY; + } + + //Le delta s'accroît si la souris bouge. + _this.mouseUpDownDelta += Math.floor(Math.sqrt((_this.mousePosLastX - e.pageX) * (_this.mousePosLastX - e.pageX) + (_this.mousePosLastY - e.pageY) * (_this.mousePosLastY - e.pageY))); + + // console.log(_this.mouseUpDownDelta, _this.mousePosLastX, e.pageX); + + if(_this.mousePosLastX != _this.mousePosX) + { + _this.mousePosLastX = _this.mousePosX; + } + if(_this.mousePosLastY != _this.mousePosY) + { + _this.mousePosLastY = _this.mousePosY; + } + + //Si la souris a parcouru une trop grande distance, on entre en recherche. + if(_this.mouseUpDownDelta > _this.config['mouseUpDownDeltaTreshold']) + { + //Si on est en mosaique, on entre en filtrage. + if(_this.currentMode == "MOSAIC") + { + _this.preUnzoom(); + _this.currentMode = "FILTER"; + _this.isMosaicFiltered = true; + + console.log(_this.date() + ' - ENTRE EN MODE FILTRAGE'); + + _this.isSearchByCurvesOn = true; + _this.startSearch(); + + if(!_this.curvesGesturesFound) + { + $('.notifications').remove(); + _this.filterSearch(); + } + + _this.searchCanvas.onPointerIn(_this.mousePosX, _this.mousePosY - _this.MPTop_margin, null, null); + } + else if(_this.currentMode == "FILTER" && !_this.isSearchByCurvesOn) + { + console.log('after search'); + _this.preUnzoom(); + _this.isSearchByCurvesOn = true; + _this.startSearch(); + _this.searchCanvas.onPointerIn(_this.mousePosX, _this.mousePosY - _this.MPTop_margin, null, null); + } + //Si on est dans une vidéo, on entre en recherche. + else if(_this.currentMode == "VIDEO" || _this.currentMode == "TIMELINE") + { + _this.currentMode = "SEARCH"; + + console.log(_this.date() + ' - ENTRE EN MODE RECHERCHE'); + + _this.isSearchByCurvesOn = true; + _this.startSearch(); + + if(!_this.curvesGesturesFound) + { + $('.notifications').remove(); + _this.searchSearch(); + } + + _this.searchCanvas.onPointerIn(_this.mousePosX, _this.mousePosY - _this.MPTop_margin, null, null); + } + else if(_this.currentMode == "SEARCH" && !_this.isSearchByCurvesOn) + { + _this.isSearchByCurvesOn = true; + _this.startSearch(); + _this.searchCanvas.onPointerIn(_this.mousePosX, _this.mousePosY - _this.MPTop_margin, null, null); + } + + //Il est possible d'afficher l'aide. + if(!_this.canNotifyHelp) + { + _this.canNotifyHelpTimeout = setTimeout(function() + { + _this.canNotifyHelp = true; + }, _this.config['timeoutCanNotifyHelp']); + } + } + }); + + //Si on fait un mouse up après ce mouse down. + $(window).mouseup(function() + { + console.log('mup'); + + if(_this.isSearchByCurvesOn) + { + var gesture_match = _this.gestureWithSameCode(_this.actualCode); + _this.actualCode = ''; + + if(gesture_match.length > 0) + { + if(_this.currentMode == "SEARCH" && _this.playerIsReady) + { + _this.player.widgets[0].searchByGesture(gesture_match); + _this.isCurrentlyInASearchByGesture = _this.player.widgets[0].isCurrentlyInASearchByGesture; + + $('.notifications').remove(); + _this.searchGesture(gesture_match, 'valid'); + _this.curvesGesturesFound = false; + } + else if(_this.currentMode == "FILTER") + { + if(_this.isMosaicFiltered) + { + $('.notifications').remove(); + _this.filterSearchedType = gesture_match; + _this.filterGesture(gesture_match, 'valid'); + _this.searchFilter(gesture_match); + _this.curvesGesturesFound = false; + } + } + } + + _this.searchCanvas.onPointerOut(); + } + + //On unbind ce qui a été bindé après le mouse up. + $(window).unbind('mousemove'); + $(window).unbind('mouseup'); + //On rebind le mousemove principal du body, car ils ont tous été unbindés. + $('body').mousemove(function(e) + { + _this.refreshMainPointer(e.pageX, e.pageY, _this); + _this.mousePosX = e.pageX; + _this.mousePosY = e.pageY; + }); + + _this.mousePosLastX = null; + _this.mousePosLastY = null; + + //Si la distance parcourue par la souris entre le mouse down et le mouse up est inférieure ou égale au seuil. + if(_this.mouseUpDownDelta <= _this.config['mouseUpDownDeltaTreshold']) + { + //Si on est sur un snapshot prézoomé. + if(_this.isOnAPrezoomSN && _this.previousZoomedSN != '' && (_this.currentMode == 'MOSAIC' || _this.currentMode == 'FILTER')) + { + _this.zoom(); + } + } + + _this.mouseUpDownDelta = 0; + _this.isSearchByCurvesOn = false; + _this.leaveSearch(); + + if(_this.currentMode == 'FILTER' && _this.filterSearchedType != '')//if(_this.currentSearchGesture != '') + { + $('.notifications').remove(); + _this.filterGesture(_this.currentSearchGesture, 'valid'); + } + + }); + }); + } } /* @@ -417,7 +604,7 @@ { var _this = this; - var supposedToBeInt = ['length', 'imagesToShow', 'totalImages', 'timePrezoom', 'timePreUnzoom', 'timeZoom', 'zoomTime', 'timeUnzoom', 'timeNeighbourGlowing', 'timeNeighbourUnglowing', 'timeMovingToNeighbour', 'timeSearchFade', 'timeNotifyFade', 'timeFilterFade', 'timeANFade', 'timeFilling', 'zoomedMargin', 'timeoutZoom', 'timeoutUnzoom', 'timeoutMoveToNeighbour', 'timeoutPointersIdle', 'timeoutAreBothPointersHere', 'timeoutRemoveNotificationByGesture', 'timeoutRemoveFailedNotificationByGesture', 'timeoutNotifySwipe', 'timeoutSelectTL', 'timeoutSlideTL', 'timeoutCanNotifyHelp', 'timeoutRemoveSpinner', 'timeoutNouser', 'timeoutNextDrawCurve']; + var supposedToBeInt = ['length', 'imagesToShow', 'totalImages', 'timePrezoom', 'timePreUnzoom', 'timeZoom', 'zoomTime', 'timeUnzoom', 'timeNeighbourGlowing', 'timeNeighbourUnglowing', 'timeMovingToNeighbour', 'timeSearchFade', 'timeNotifyFade', 'timeFilterFade', 'timeANFade', 'timeFilling', 'zoomedMargin', 'timeoutZoom', 'timeoutUnzoom', 'timeoutMoveToNeighbour', 'timeoutPointersIdle', 'timeoutAreBothPointersHere', 'timeoutRemoveNotificationByGesture', 'timeoutRemoveFailedNotificationByGesture', 'timeoutNotifySwipe', 'timeoutSelectTL', 'timeoutSlideTL', 'timeoutCanNotifyHelp', 'timeoutRemoveSpinner', 'timeoutNouser', 'timeoutNextDrawCurve', 'mouseUpDownDeltaTreshold']; var supposedToBeFloat = ['zoomPercentage', 'prezoomPercentage']; $.getJSON(file_path, function(data) @@ -489,7 +676,12 @@ } //On initialise le client. - _this.client = new client(_this.config['host'], _this.config['port'], _this); + if(!_this.mouseInteractions) + { + _this.client = new client(_this.config['host'], _this.config['port'], _this); + } + + _this.getDictionary(); }); } @@ -554,8 +746,12 @@ // this.unzoom(); if(this.currentMode == "NO-USER" || this.currentMode.indexOf("INCOMING-") > -1) { - this.currentMode = "INCOMING-20"; - this.unzoom(); + if(!this.mouseInteractions) + { + this.currentMode = "INCOMING-20"; + this.unzoom(); + } + this.currentMode = "MOSAIC"; $('.notifications').remove(); this.mosaicSelectionAndSearch(); @@ -565,8 +761,8 @@ //On affiche les notifications. // this.notifySelectionSearchMosaicFull(); - // $('#mainPointer').fadeTo(this.config['timePrezoom'], 1); - // $('#secondPointer').fadeTo(this.config['timePrezoom'], 1); + //$('#mainPointer').fadeTo(this.config['timePrezoom'], 1); + //$('#secondPointer').fadeTo(this.config['timePrezoom'], 1); } //Pour les snapshots à afficher. @@ -939,6 +1135,7 @@ // console.log(_this.player); // console.log(_this.player.popcorn); } + //Lorsque le player est en pause (par exemple lorsque le curseur arrive à la fin de la timeline). if(_this.player.popcorn) { @@ -987,6 +1184,11 @@ { _this.playerIsReady = true; + if(_this.player.widgets[0]) + { + _this.player.widgets[0].setMouseInteractions(_this.mouseInteractions); + } + if(_this.currentMode == 'VIDEO' || _this.currentMode == 'SEARCH' || _this.currentMode == 'TIMELINE') { _this.canSwipe = true; diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/mosaic/js/neighbours.js --- a/front_idill/src/mosaic/js/neighbours.js Fri Jun 29 16:16:24 2012 +0200 +++ b/front_idill/src/mosaic/js/neighbours.js Thu Jul 05 16:04:33 2012 +0200 @@ -238,22 +238,43 @@ opacity: '1' }, _this.config['timeNeighbourGlowing'], function() { - console.log('SWAG !!!', _this.currentMode, _this.currentSearchGesture); - if(_this.currentMode == 'VIDEO') - { - $('.notifications').remove(); - _this.videoMoveAndUnzoom(snapshotId); - } - else if(_this.currentMode == 'SEARCH' && !_this.currentSearchGesture) + if(_this.mouseInteractions) { - $('.notifications').remove(); - _this.searchSearchAndMoveAndUnzoom(snapshotId); + if(_this.currentMode == 'VIDEO') + { + $('.notifications').remove(); + _this.videoMove(snapshotId); + } + else if(_this.currentMode == 'SEARCH' && !_this.currentSearchGesture) + { + $('.notifications').remove(); + _this.searchSearchAndMove(snapshotId); + } + else if(_this.currentMode == 'SEARCH' && _this.currentSearchGesture) + { + $('.notifications').remove(); + _this.searchGestureAndMove(_this.currentSearchGesture, 'valid', snapshotId); + } + + _this.canMoveToNeighbour = true; } - else if(_this.currentMode == 'SEARCH' && _this.currentSearchGesture) + else { - $('.notifications').remove(); - console.log('swag'); - _this.searchGestureAndMoveAndUnzoom(_this.currentSearchGesture, 'valid', snapshotId); + if(_this.currentMode == 'VIDEO') + { + $('.notifications').remove(); + _this.videoMoveAndUnzoom(snapshotId); + } + else if(_this.currentMode == 'SEARCH' && !_this.currentSearchGesture) + { + $('.notifications').remove(); + _this.searchSearchAndMoveAndUnzoom(snapshotId); + } + else if(_this.currentMode == 'SEARCH' && _this.currentSearchGesture) + { + $('.notifications').remove(); + _this.searchGestureAndMoveAndUnzoom(_this.currentSearchGesture, 'valid', snapshotId); + } } }); diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/mosaic/js/notifications.js --- a/front_idill/src/mosaic/js/notifications.js Fri Jun 29 16:16:24 2012 +0200 +++ b/front_idill/src/mosaic/js/notifications.js Thu Jul 05 16:04:33 2012 +0200 @@ -5,366 +5,6 @@ =============================================== */ /* - * Affiche la notification de sélection/recherche lorsque la mosaique est complète. -*/ -mosaic.prototype.notifySelectionSearchMosaicFull = function() -{ - if(this.currentMode != "MOSAIC" && this.currentMode != "FILTER" || this.isCurrentlyInASearchByGesture || $('#notify_selection').length > 0 || $('#notify_search').length > 0 || $('#notify_point').length > 0) - { - return; - } - - console.log('NOTIFY SEL SEA'); - - //On spécifie les notifications en div. - var notification_selection = ""; - var notification_search = ""; - - //On les ajoute à la mosaïque. - $('#mainPanel').append(notification_selection + notification_search); - - //On calcule leurs coordonnées et dimensions. - var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); - var notify_margin = parseInt($('.notifications').css('margin')); - var selection_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; - var search_left = selection_left + notify_width + notify_margin; - - //On les positionne. - $('#notify_selection').css( - { - left: selection_left - }); - $('#notify_search').css( - { - left: search_left - }); - - //On les fait apparaître. - $('.notifications').css( - { - opacity: "0.9" - }); -} - -/* - * Supprime la notification de sélection/recherche lorsque la mosaique est complète. -*/ -mosaic.prototype.removeSelectionSearchMosaicFull = function() -{ - if(this.isOnASnapshot) - { - // console.log('DEL SEL SEA'); - $('#notify_selection, #notify_search').remove(); - } -} - -/* - * Affiche la notification de maintient du pointage lors d'une phase de prézoom. -*/ -mosaic.prototype.notifyPointMosaicPrezoom = function() -{ - this.removeSelectionSearchMosaicFull(); - if($('#notify_point').length > 0 || $('#notify_search').length > 0 || this.currentMode != 'MOSAIC' && this.currentMode != 'FILTER' && !this.isOnASnapshot) - { - this.removePointMosaicPrezoom(); - return; - } - - //On spécifie les notifications en div. - var notification_point = ""; - - //On les ajoute à la mosaïque. - $('#mainPanel').append(notification_point); - - //On calcule leurs coordonnées et dimensions. - var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); - var notify_margin = parseInt($('.notifications').css('margin')); - var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; - - //On les positionne. - $('#notify_point').css( - { - left: point_left - }); - - //On les fait apparaître. - $('.notifications').css( - { - opacity: "0.9" - }); -} - -/* - * Supprime la notification de maintient du pointage. -*/ -mosaic.prototype.removePointMosaicPrezoom = function() -{ - //if(!this.isOnASnapshot) - //{ - $('#notify_point').remove(); - //} -} - -/* - * Affiche la notification de recherche (qu'elle soit par gesture ou par courbes). -*/ -mosaic.prototype.notifySearch = function() -{ - /*this.removeSelectionSearchMosaicFull(); - if($('#notify_point').length > 0 || $('#notify_search').length > 0 || this.currentMode != 'MOSAIC' && this.currentMode != 'FILTER' && !this.isOnASnapshot) - { - //this.removeNotifySearch(); - //return; - }*/ - - if($('.notifications').length > 0) - { - $('.notifications').remove(); - } - - //On spécifie les notifications en div. - var notification_search = ""; - - //On les ajoute à la mosaïque. - $('body').append(notification_search); - - //On calcule leurs coordonnées et dimensions. - var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); - var notify_margin = parseInt($('.notifications').css('margin')); - var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; - - //On les positionne. - $('#notify_search').css( - { - left: point_left - }); - - //On les fait apparaître. - $('.notifications').css( - { - opacity: "0.9" - }); -} - -/* - * Supprime la notification de maintient du pointage. -*/ -mosaic.prototype.removeNotifySearch = function() -{ - //if(!this.isOnASnapshot) - //{ - //$('#notify_search').remove(); - //} -} - -/* - * Affiche la notification de changement de voisin et de dezoom. -*/ -mosaic.prototype.notifyMoveUnzoom = function(targetId) -{ - console.log('MOVE & UNZOOM'); - - if($('.notifications').length > 0 || !this.neighboursIds || this.neighboursIds.length == 0 || targetId == -1 || this.currentMode != 'VIDEO' && this.currentMode != 'SEARCH' && this.currentMode != 'TIMELINE') - { - return; - } - - console.log('NOT'); - - var _this = this; - - //On spécifie les notifications en div. - var notification_move_unzoom = ""; - - //On les ajoute à la mosaïque. - $('body').append(notification_move_unzoom); - - // console.log(this.player.config.gui.zoomTop + " " + this.player.config.gui.zoomLeft); - - //On calcule leurs coordonnées et dimensions. - var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); - var notify_margin = parseInt($('.notifications').css('margin')); - var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; - - var side = $.inArray(parseInt(targetId), this.neighboursIds); - // console.log(this.neighboursIds, parseInt(targetId), side); - if(side == -1) - { - return; - } - - var sides = ['left', 'right', 'up', 'down']; - var unzooms = ['horizontal', 'vertical']; - - // var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; - var notifyTop = 0, notifyLeft = 0; - - //On les positionne. - $('#notify_move').css( - { - top: -notifyTop, - left: -notifyLeft + ($(window).width() - notify_width * 2 - notify_margin * 2) / 2, - 'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' - }); - - $('#notify_unzoom').css( - { - top: -notifyTop, - left: -notifyLeft + ($(window).width()) / 2, - 'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)' - }); - - // console.log('url(./pictos/notifications/move_' + sides[side] + '.png)'); - // console.log($('#notify_move').css('background-image', 'url(./pictos/notifications/move_' + sides[side] + '.png)')); - // console.log($('#notify_move').css('background-image')); - - //On les fait apparaître. - $('.notifications').css( - { - opacity: "0.9" - }); -} - -/* - * Supprime la notification de recherche de gesture. -*/ -mosaic.prototype.removeNotifyMoveUnzoom = function() -{ - $('#notify_move').remove(); - $('#notify_unzoom').remove(); -} - -/* - * Affiche la notification de dezoom. -*/ -mosaic.prototype.notifyUnzoom = function(targetId) -{ - console.log('UNZOOM'); - - if($('.notifications').length > 0 || !this.neighboursIds || this.neighboursIds.length == 0 || targetId == -1 || this.currentMode != 'VIDEO' && this.currentMode != 'SEARCH' && this.currentMode != 'TIMELINE') - { - return; - } - - console.log('NOT'); - - var _this = this; - - //On spécifie les notifications en div. - var notification_move_unzoom = ""; - - //On les ajoute à la mosaïque. - $('body').append(notification_move_unzoom); - - // console.log(this.player.config.gui.zoomTop + " " + this.player.config.gui.zoomLeft); - - //On calcule leurs coordonnées et dimensions. - var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); - var notify_margin = parseInt($('.notifications').css('margin')); - var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; - - var side = $.inArray(parseInt(targetId), this.neighboursIds); - // console.log(this.neighboursIds, parseInt(targetId), side); - if(side == -1) - { - return; - } - - var sides = ['left', 'right', 'up', 'down']; - var unzooms = ['horizontal', 'vertical']; - - // var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; - var notifyTop = 0, notifyLeft = 0; - - //On les positionne. - $('#notify_move').css( - { - top: -notifyTop, - left: -notifyLeft + ($(window).width() - notify_width * 2 - notify_margin * 2) / 2, - 'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' - }); - - $('#notify_unzoom').css( - { - top: -notifyTop, - left: -notifyLeft + ($(window).width()) / 2, - 'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)' - }); - - // console.log('url(./pictos/notifications/move_' + sides[side] + '.png)'); - // console.log($('#notify_move').css('background-image', 'url(./pictos/notifications/move_' + sides[side] + '.png)')); - // console.log($('#notify_move').css('background-image')); - - //On les fait apparaître. - $('.notifications').css( - { - opacity: "0.9" - }); -} - -/* - * Supprime la notification de dezoom. -*/ -mosaic.prototype.removeNotifyUnzoom = function() -{ - $('#notify_unzoom').remove(); -} - -/* - * Affiche la notification de dezoom. - * Direction vaut left ou right. -*/ -mosaic.prototype.notifySwipe = function(direction) -{ - console.log('TRY SWIPE'); - - if($('.notifications').length > 0 || this.currentMode != 'VIDEO' && this.currentMode != 'SEARCH' && this.currentMode != 'TIMELINE' && !this.isSwipe) - { - return; - } - - console.log('IN SWIPE'); - - var _this = this; - - //On spécifie les notifications en div. - var notification_swipe = ""; - - //On les ajoute à la mosaïque. - $('body').append(notification_swipe); - - //On calcule leurs coordonnées et dimensions. - var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); - var notify_margin = parseInt($('.notifications').css('margin')); - var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; - - // var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; - var notifyTop = 0, notifyLeft = 0; - - //On les positionne. - $('#notify_swipe').css( - { - top: -notifyTop, - left: -notifyLeft + ($(window).width() - notify_width - notify_margin) / 2, - 'background-image': 'url(./pictos/notifications/swipe_' + direction + '.png)' - }); - - //On les fait apparaître. - $('.notifications').css( - { - opacity: "0.9" - }); -} - -/* - * Supprime la notification de dezoom. -*/ -mosaic.prototype.removeNotifyUnzoom = function() -{ - $('#notify_unzoom').remove(); -} - -/* * Affiche l'aide. */ mosaic.prototype.notifyHelp = function(inMosaic) @@ -835,9 +475,11 @@ var notify_margin = parseInt($('.notifications').css('margin')); var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin; + // console.log('url("./pictos/big/' + (this.mouseInteractions ? 'MI' : '') + '/' + mode + '/' + gestureName + '.png")'); + if(_.include(this.gestures, gestureName)) { - $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + mode + '/' + gestureName + '.png")'); + $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI' : '') + '/' + (this.gestureDelRequested ? 'hover' : 'valid') + '/' + gestureName + '.png")'); } else if(mode == 'none') { @@ -883,7 +525,7 @@ if(_.include(this.gestures, gestureName)) { - $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + mode + '/' + gestureName + '.png")'); + $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI' : '') + '/' + mode + '/' + gestureName + '.png")'); } else if(mode == 'none') { @@ -950,6 +592,56 @@ } /* + * Affichage de la notification de résultat de move vers un voisin. +*/ +mosaic.prototype.videoMove = function(targetId) +{ + if(this.currentMode != 'VIDEO') + { + return; + } + + var _this = this; + + //On spécifie les notifications en div. + var notification_move = ""; + + //On les ajoute à la mosaïque. + $('body').append(notification_move); + + //On calcule leurs coordonnées et dimensions. + var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); + var notify_margin = parseInt($('.notifications').css('margin')); + var move_left = $(window).width() / 2 - (notify_width) / 2 + notify_margin; + + var side = $.inArray(parseInt(targetId), this.neighboursIds); + // console.log(this.neighboursIds, parseInt(targetId), side); + if(side == -1) + { + return; + } + + var sides = ['left', 'right', 'up', 'down']; + + // var notifyTop = this.notifyTopVideo, notifyLeft = this.notifyLeftVideo; + var notifyTop = 0, notifyLeft = 0; + + //On les positionne. + $('#notify_move').css( + { + top: -notifyTop, + left: -notifyLeft + move_left, + 'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' + }); + + //On les fait apparaître. + $('.notifications').css( + { + opacity: "0.9" + }); +} + +/* * Affichage de la notification de résultat de move vers un voisin & de dézoom dans une vidéo. */ mosaic.prototype.videoMoveAndUnzoom = function(targetId) @@ -1187,6 +879,60 @@ } /* + * Affichage de la notification de recherche, de move vers un voisin. +*/ +mosaic.prototype.searchSearchAndMove = function(targetId) +{ + if(this.currentMode != 'SEARCH' || this.isCurrentlyInASearchByGesture) + { + return; + } + + //On spécifie les notifications en div. + var notification_search = ""; + var notification_move = ""; + + //On les ajoute à la mosaïque. + $('body').append(notification_search + notification_move); + + //On calcule leurs coordonnées et dimensions. + var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); + var notify_margin = parseInt($('.notifications').css('margin')); + var search_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; + var move_left = search_left + notify_width + notify_margin; + + var side = $.inArray(parseInt(targetId), this.neighboursIds); + + if(side == -1) + { + return; + } + + var sides = ['left', 'right', 'up', 'down']; + + var notifyTop = 0, notifyLeft = 0; + + //On les positionne. + $('#notify_search').css( + { + top: -notifyTop, + left: -notifyLeft + search_left + }); + $('#notify_move').css( + { + top: -notifyTop, + left: -notifyLeft + move_left, + 'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' + }); + + //On les fait apparaître. + $('.notifications').css( + { + opacity: "0.9" + }); +} + +/* * Affichage de la notification de recherche, de move vers un voisin & de dézoom dans une vidéo de recherche. */ mosaic.prototype.searchSearchAndMoveAndUnzoom = function(targetId) @@ -1335,7 +1081,7 @@ if(_.include(this.gestures, gestureName)) { - $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + mode + '/' + gestureName + '.png")'); + $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")'); } else if(mode == 'none') { @@ -1385,7 +1131,7 @@ if(_.include(this.gestures, gestureName)) { - $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + mode + '/' + gestureName + '.png")'); + $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")'); } else if(mode == 'none') { @@ -1411,6 +1157,69 @@ } /* + * Affichage de la notification de résultat, de move vers un voisin. +*/ +mosaic.prototype.searchGestureAndMove = function(gestureName, mode, targetId) +{ + if(this.currentMode != 'SEARCH' || !this.isCurrentlyInASearchByGesture) + { + return; + } + + var _this = this; + + //On spécifie les notifications en div. + var notification_search_1gesture = ""; + var notification_move = ""; + + //On les ajoute à la mosaïque. + $('body').append(notification_search_1gesture + notification_move); + + // console.log(this.player.config.gui.zoomTop + " " + this.player.config.gui.zoomLeft); + + //On calcule leurs coordonnées et dimensions. + var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); + var notify_margin = parseInt($('.notifications').css('margin')); + var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2; + var move_left = search_1gesture_left + notify_width + notify_margin; + + if(_.include(this.gestures, gestureName)) + { + $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")'); + } + else if(mode == 'none') + { + $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")'); + } + + var side = $.inArray(parseInt(targetId), this.neighboursIds); + + if(side == -1) + { + return; + } + + var sides = ['left', 'right', 'up', 'down']; + + //On les positionne. + $('#notify_search_1gesture').css( + { + left: search_1gesture_left + }); + $('#notify_move').css( + { + left: move_left, + 'background-image': 'url(./pictos/notifications/move_' + sides[side] + '.png)' + }); + + //On les fait apparaître. + $('.notifications').css( + { + opacity: "0.9" + }); +} + +/* * Affichage de la notification de résultat, de move vers un voisin & de dézoom dans une vidéo de recherche. */ mosaic.prototype.searchGestureAndMoveAndUnzoom = function(gestureName, mode, targetId) @@ -1441,7 +1250,7 @@ if(_.include(this.gestures, gestureName)) { - $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + mode + '/' + gestureName + '.png")'); + $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")'); } else if(mode == 'none') { @@ -1484,7 +1293,7 @@ /* * Affichage de la notification de résultat & de dézoom dans une vidéo de recherche. */ -mosaic.prototype.searchGestureAndUnzoom = function() +mosaic.prototype.searchGestureAndUnzoom = function(gestureName, mode, targetId) { if(this.currentMode != 'SEARCH' || !this.isCurrentlyInASearchByGesture) { @@ -1510,13 +1319,22 @@ if(_.include(this.gestures, gestureName)) { - $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + mode + '/' + gestureName + '.png")'); + $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")'); } else if(mode == 'none') { $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")'); } + var side = $.inArray(parseInt(targetId), this.neighboursIds); + + if(side == -1) + { + return; + } + + var unzooms = ['horizontal', 'vertical']; + //On les positionne. $('#notify_search_1gesture').css( { @@ -1524,7 +1342,8 @@ }); $('#notify_unzoom').css( { - left: unzoom_left + left: unzoom_left, + 'background-image': 'url(./pictos/notifications/unzoom_' + unzooms[Math.floor(side / 2)] + '.png)' }); //On les fait apparaître. @@ -1532,4 +1351,76 @@ { opacity: "0.9" }); +} + +/* + * Affichage des notifications de gestures trouvées dans une recherche par courbes. +*/ +mosaic.prototype.curvesGestures = function(gestures) +{ + //S'il n'y a pas de gestures à afficher. + if(gestures.length == 0) + { + console.log('NONE'); + //On ajoute une seule notification. + var notification_curves = ""; + $('body').append(notification_curves); + + //On calcule leurs dimensions et coordonnées. + var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); + var notify_margin = parseInt($('.notifications').css('margin')); + var curves_left = $(window).width() / 2 - (notify_width + notify_margin * 2) / 2; + + $('#notify_curves').css( + { + left: curves_left, + 'background-image': 'url("./pictos/big/normal/inconnu.png")', + opacity: '0.9' + }); + return; + } + + //Sinon, on les met dans un tableau. + var gestures_tab = gestures.split(';'); + + var notifications_curves_gestures = ''; + + //On crée autant de notifications qu'il y a de gestures. + for(var i = 0 ; i < gestures_tab.length ; i++) + { + notifications_curves_gestures += ""; + } + + //On les ajoute à la mosaïque. + $('body').append(notifications_curves_gestures); + + //On calcule leurs dimensions. + var notify_width = $('.notifications').width(), notify_height = $('.notifications').height(); + var notify_margin = parseInt($('.notifications').css('margin')); + var curves_gestures_left = []; + + //On calcule leurs dimensions et leur backgrounds. + curves_gestures_left[0] = $(window).width() / 2 - (notify_width * (gestures_tab.length) + notify_margin * (gestures_tab.length + 2)) / 2; + + for(var i = 0 ; i < gestures_tab.length ; i++) + { + //On va chercher leurs backgrounds. + $('#notify_curves_' + gestures_tab[i]).css('background-image', 'url("./pictos/big/' + (this.mouseInteractions ? 'MI/' : '') + 'normal/' + gestures_tab[i] + '.png")'); + // console.log('url("./pictos/big/MI/normal/' + gestures_tab[i] + '.png")'); + + //On calcule leurs coordonnées. + if(i+1 < gestures_tab.length) + { + curves_gestures_left[i+1] = curves_gestures_left[i] + notify_width + notify_margin * 2; + } + + //On les place. + $('#notify_curves_' + gestures_tab[i]).css('left', curves_gestures_left[i]); + } + + //On les fait apparaître. + $('.notifications').css( + { + opacity: "0.9" + }); } \ No newline at end of file diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/mosaic/js/playerControl.js --- a/front_idill/src/mosaic/js/playerControl.js Fri Jun 29 16:16:24 2012 +0200 +++ b/front_idill/src/mosaic/js/playerControl.js Thu Jul 05 16:04:33 2012 +0200 @@ -38,12 +38,24 @@ return false; } - var pointer = (mainPointer ? $('#mainPointer') : $('#secondPointer')); + var pointer; + var Px, Py; + + if(this.mouseInteractions) + { + Px = this.mousePosX; + Py = this.mousePosY; + } + else + { + pointer = (mainPointer ? $('#mainPointer') : $('#secondPointer')); + Px = pointer.position().left + pointer.width() / 2; + Py = pointer.position().top + pointer.height() / 2; + } var TL = $('.Ldt-Timeline'); var TLwidth = TL.width(), TLheight = TL.height(); var TLtop = (+$('.LdtPlayer').position().top + $('.LdtPlayer').height() - TLheight), TLleft = $('.LdtPlayer').position().left; - var Px = pointer.position().left + pointer.width() / 2, Py = pointer.position().top + pointer.height() / 2; var correctHorizontalPosition = (entering ? (Px > TLleft && Px < (+TLleft + TLwidth)) : (true)); diff -r 8393d3473b98 -r 0e29ae4568a0 front_idill/src/mosaic/js/pointers.js --- a/front_idill/src/mosaic/js/pointers.js Fri Jun 29 16:16:24 2012 +0200 +++ b/front_idill/src/mosaic/js/pointers.js Thu Jul 05 16:04:33 2012 +0200 @@ -3,6 +3,11 @@ */ mosaic.prototype.addPointers = function() { + if(this.mouseInteractions) + { + return; + } + var mainPointer = ''; var secondPointer = ''; $('body').append(mainPointer + secondPointer); @@ -181,7 +186,18 @@ this.mainPointerLastY = y; } - var pointerX = x - $('#mainPointer').width()/2, pointerY = y - $('#mainPointer').height()/2; + var pointerX, pointerY; + + if(this.mouseInteractions) + { + pointerX = x; + pointerY = y; + } + else + { + pointerX = x - $('#mainPointer').width()/2; + pointerY = y - $('#mainPointer').height()/2; + } var _this = this; $('#mainPointer').css( @@ -234,7 +250,7 @@ // /!\ // RAJOUTE EN ATTENDANT UN GESTE DE CANCEL. if(this.isMosaicFiltered && !this.isMosaicFiltering) { - console.log('CHECK IF ON NOTIFY GESTURE'); + //console.log('CHECK IF ON NOTIFY GESTURE'); this.checkIfPointerIsOnSearchNotification(pointerX, pointerY, $('#mainPointer')); } } @@ -257,19 +273,22 @@ this.player.widgets[0].selectTimeline(); $('#mainPointer').css('background-image', 'url(./img/cursors/selector_gray.png)'); - //On met le spinner gif sur le pointeur. - var spinner = "