front_idill/src/mosaic/js/pointers.js
author bastiena
Thu, 16 Aug 2012 14:32:19 +0200
changeset 79 9eff85166868
parent 77 205409da0f32
child 85 b244a7bc0844
permissions -rw-r--r--
Front IDILL : spaces in img names removed touch interactions finished can't select timeline before player is reading
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     1
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     2
* This file is part of the TraKERS\Front IDILL package.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     3
*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     4
* (c) IRI <http://www.iri.centrepompidou.fr/>
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     5
*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     6
* For the full copyright and license information, please view the LICENSE
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     7
* file that was distributed with this source code.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     8
*/
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
     9
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    10
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    11
 * Projet : TraKERS
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    12
 * Module : Front IDILL
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    13
 * Fichier : pointers.js
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    14
 * 
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    15
 * Auteur : alexandre.bastien@iri.centrepompidou.fr
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    16
 * 
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    17
 * Fonctionnalités : Définit les fonctions d'interaction avec les pointeurs.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    18
 */
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    19
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    20
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    21
 * Affiche les pointeurs.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    22
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    23
 * mosaic > fonction loadMosaic.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    24
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    25
Mosaic.prototype.addPointers = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    26
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    27
    //On n'affiche pas les pointeurs en mode d'interaction souris.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    28
    if(this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    29
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    30
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    31
    }
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
    32
	
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
    33
	this.minX = $(window).width();
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
    34
	this.minY = $(window).height();
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
    35
	this.maxX = 0;
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
    36
	this.maxY = 0;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    37
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    38
    //On crée et ajoute les pointeurs.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    39
    var mainPointer = '<div id="mainPointer" class="pointers"></div>';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    40
    var secondPointer = '<div id="secondPointer" class="pointers"></div>';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    41
    $('body').append(mainPointer + secondPointer);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    42
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    43
    //On les place au centre de l'écran.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    44
    $('#secondPointer').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    45
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    46
        top: $(window).height() / 2 - $('#secondPointer').height() / 2,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    47
        left: $(window).width() / 4 - $('#secondPointer').width() / 2
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    48
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    49
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    50
    this.secondPointerLastX = $(window).width() / 4 - $('#secondPointer').width() / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    51
    this.secondPointerLastY = $(window).height() / 2 - $('#secondPointer').height() / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    52
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    53
    $('#mainPointer').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    54
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    55
        top: $(window).height() / 2 - $('#mainPointer').height() / 2,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    56
        left: $(window).width() * 3 / 4 - $('#mainPointer').width() / 2
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    57
    });
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    58
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    59
    this.mainPointerLastX = $(window).width() * 3 / 4 - $('#mainPointer').width() / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    60
    this.mainPointerLastY = $(window).height() / 2 - $('#mainPointer').height() / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    61
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    62
    //On met à jour les anciennes coordonnées des pointeurs.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    63
    this.mainPointerIdleStartX = this.mainPointerLastX;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    64
    this.mainPointerIdleStartY = this.mainPointerLastY;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    65
    this.secondPointerIdleStartX = this.secondPointerLastX;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    66
    this.secondPointerIdleStartY = this.secondPointerLastY;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    67
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    68
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    69
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    70
 * Affiche/Masque le pointeur principal.
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    71
 * Main est un booléen valant vrai s'il faut afficher le pointeur.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    72
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    73
 * client > fonction processMsg.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    74
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    75
Mosaic.prototype.mainPointerDisplay = function(main)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
    76
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    77
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    78
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    79
    //On n'affiche pas les pointeurs dans le mode sans utilisateur ni utilisateur en phase d'approche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    80
    if(this.currentMode != 'NO-USER' && this.currentMode.indexOf('INCOMING-') == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    81
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    82
        if(main)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    83
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    84
            clearTimeout(this.arrowSpinnerTimeout);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    85
            
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    86
            $('#mainPointer').fadeTo(this.config.timeFilling, '1');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    87
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    88
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    89
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    90
    //Si le booléen est à faux, on masque le pointeur.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    91
    if(!main)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    92
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    93
        $('#spinner').remove();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    94
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    95
        $('#mainPointer').fadeTo(this.config.timeFilling, '0');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    96
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    97
        //Si on a zoomé sur une vidéo.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    98
        if(this.currentMode == 'VIDEO' || this.currentMode == 'SEARCH')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
    99
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   100
            //On annule aussi la TL s'il y a lieu.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   101
            if(this.isTLSelected())
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   102
            {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   103
                this.isTLRequested = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   104
                clearTimeout(this.selectTLTimeout);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   105
            }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   106
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   107
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   108
        if(this.isTLSelectedByMainPointer)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   109
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   110
            //On déselectionne la TL.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   111
            this.exitTimeline('');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   112
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   113
    }
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   114
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   115
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   116
 * Affiche/Masque le pointeur secondaire.
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   117
 * Main est un booléen valant vrai s'il faut afficher le pointeur.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   118
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   119
 * client > fonction processMsg.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   120
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   121
Mosaic.prototype.secondPointerDisplay = function(second)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   122
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   123
    //On n'affiche pas les pointeurs dans le mode sans utilisateur ni utilisateur en phase d'approche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   124
    if(this.currentMode != 'NO-USER' && this.currentMode.indexOf('INCOMING-') == -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   125
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   126
        if(second)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   127
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   128
            clearTimeout(this.arrowSpinnerTimeout);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   129
            
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   130
            $('#secondPointer').fadeTo(this.config.timeFilling, '1');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   131
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   132
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   133
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   134
    //Si le booléen est à faux, on masque le pointeur.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   135
    if(!second)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   136
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   137
        $('#spinner').remove();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   138
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   139
        $('#secondPointer').fadeTo(this.config.timeFilling, '0');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   140
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   141
        if(this.isTLSelectedBySecondPointer)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   142
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   143
            //On déselectionne la TL.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   144
            this.exitTimeline('');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   145
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   146
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   147
}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   148
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   149
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   150
 * Assure les interactions des pointeurs avec la mosaique.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   151
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   152
 * pointers > fonction refreshPointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   153
*/
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   154
Mosaic.prototype.pointersMosaicInteractions = function(pointerX, pointerY, isMainPointer)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   155
{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   156
	var snapshot = null, isOtherPointerDisplayed, pointer, pointerImg;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   157
	
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   158
	if(isMainPointer)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   159
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   160
		isOtherPointerDisplayed = this.isSecondPointerDisplayed;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   161
		pointer = $('#mainPointer');
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   162
		
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   163
		if(!this.isSearchByCurvesOn)
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   164
		{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   165
			pointerImg = 'url(./img/cursors/pointer.png)';
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   166
		}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   167
	}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   168
	else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   169
	{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   170
		isOtherPointerDisplayed = this.isMainPointerDisplayed;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   171
		pointer = $('#secondPointer');
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   172
		
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   173
		if(!this.isSearchByCurvesOn)
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   174
		{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   175
			pointerImg = 'url(./img/cursors/pointer2.png)';
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   176
		}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   177
	}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   178
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   179
	//On regarde si on est sur un snapshot.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   180
	snapshot = this.pointerPositionToSN(pointerX, pointerY, true);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   181
	
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   182
	//Si c'est le cas, on récupère son id.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   183
	if(this.previousZoomedSN != null)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   184
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   185
		var id = this.previousZoomedSN.attr('id').replace('snapshotDiv-', '');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   186
	}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   187
	
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   188
	//Sinon, on effectue un preunzoom et on redonne son apparence au pointeur principal.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   189
	if(snapshot == null)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   190
	{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   191
		this.isOnASnapshot = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   192
		this.lastNonNullSN = this.previousZoomedSN;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   193
		this.preUnzoom();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   194
		
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   195
		var image
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   196
		
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   197
		pointer.css('background-image', pointerImg);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   198
	}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   199
	
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   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.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   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)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   202
	{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   203
		//On prézoom sur le snapshot sélectionné et on change l'apparence du pointeur.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   204
		this.isOnASnapshot = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   205
		this.previousZoomedSN = snapshot;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   206
		this.lastNonNullSN = null;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   207
		this.preZoom(snapshot);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   208
		
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   209
		pointer.css('background-image', 'url(./img/cursors/selector_gray.png)');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   210
	}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   211
	
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   212
	//Si on se trouve actuellement dans une recherche par gestures.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   213
	if(this.isMosaicFiltered && !this.isMosaicFiltering)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   214
	{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   215
		//On vérifie si on se trouve sur une notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   216
		this.checkIfPointerIsOnSearchNotification(pointerX, pointerY, pointer);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   217
	}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   218
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   219
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   220
/*
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   221
 * Assure les interactions des pointeurs avec la mosaique.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   222
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   223
 * pointers > fonction refreshPointers.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   224
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   225
Mosaic.prototype.pointersVideoInteractions = function(pointerX, pointerY, isMainPointer)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   226
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   227
	var _this = this, pointer, thisPointerNeighbourSelectedId, pointerImg, thisPointerExitBorder, otherPointerExitBorder;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   228
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   229
	if(isMainPointer)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   230
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   231
		pointer = $('#mainPointer');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   232
		thisPointerNeighbourSelectedId = this.mainPointerNeighbourSelectedId;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   233
		thisPointerExitBorder = this.mainPointerExitBorder;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   234
		otherPointerExitBorder = this.secondPointerExitBorder;
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   235
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   236
		if(!this.isSearchByCurvesOn)
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   237
		{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   238
			pointerImg = 'url(./img/cursors/pointer.png)';
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   239
		}
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   240
	}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   241
	else
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   242
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   243
		pointer = $('#secondPointer');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   244
		thisPointerNeighbourSelectedId = this.secondPointerNeighbourSelectedId;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   245
		thisPointerExitBorder = this.secondPointerExitBorder;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   246
		otherPointerExitBorder = this.mainPointerExitBorder;
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   247
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   248
		if(!this.isSearchByCurvesOn)
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   249
		{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   250
			pointerImg = 'url(./img/cursors/pointer2.png)';
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   251
		}
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   252
	}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   253
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   254
	var zoomX = pointerX - this.notifyLeftVideo, zoomY = pointerY - this.notifyTopVideo;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   255
		
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   256
	//On calcule les interactions du pointeur avec la timeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   257
	this.pointersTimelineSelection(pointerX, pointerY, isMainPointer);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   258
	
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   259
	//Si on se trouve actuellement dans une recherche par gestures.
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   260
	if(this.currentSearchGesture[this.centerId])
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   261
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   262
		this.checkIfPointerIsOnSearchNotification(pointerX, pointerY, pointer);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   263
	}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   264
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   265
	//on vérifie si le pointeur est sur un snapshot zoomé.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   266
	snapshot = this.pointerPositionToSN(zoomX, zoomY, true);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   267
	if(snapshot == null)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   268
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   269
		pointer.css('background-image', pointerImg);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   270
		snapshot = this.pointerPositionToAN(pointerX, pointerY);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   271
	}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   272
	
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   273
	var intValueOfId;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   274
	//Si c'est le cas.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   275
	if(snapshot != null && snapshot.length > 0)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   276
	{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   277
		//S'il s'agit d'un voisin additionnel.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   278
		if(snapshot.attr('id').indexOf('borderNeighbour') != -1)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   279
		{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   280
			intValueOfId = parseInt(snapshot.attr('id').replace('borderNeighbour-', ''));
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   281
		}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   282
		//Sinon si c'est un voisin normal.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   283
		else
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   284
		{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   285
			intValueOfId = parseInt(snapshot.attr('id').replace('snapshotDiv-', ''));
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   286
		}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   287
	}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   288
	else
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   289
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   290
		intValueOfId = -2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   291
	}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   292
	
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   293
	//Si c'est un voisin additionnel.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   294
	if(snapshot != null && snapshot.attr('id').indexOf('borderNeighbour') != -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   295
	{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   296
		//S'il a été trouvé parmi les voisins du centre.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   297
		if(intValueOfId > -1 && intValueOfId < 5)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   298
		{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   299
			//On le sélectionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   300
			this.selectNeighbour(snapshot, pointer);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   301
			if(isMainPointer)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   302
			{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   303
				this.mainPointerExitBorder = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   304
				this.mainPointerNeighbourSelectedId = intValueOfId + this.config.imagesToShow;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   305
			}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   306
			else
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   307
			{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   308
				this.secondPointerExitBorder = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   309
				this.secondPointerNeighbourSelectedId = intValueOfId + this.config.imagesToShow;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   310
			}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   311
		}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   312
		else
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   313
		{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   314
			//Sinon on le déselectionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   315
			if(thisPointerNeighbourSelectedId != null && thisPointerNeighbourSelectedId > -1)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   316
			{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   317
				this.deselectNeighbour(thisPointerNeighbourSelectedId);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   318
			}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   319
		}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   320
	}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   321
	else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   322
	{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   323
		//Si c'est un voisin.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   324
		if(_.include(this.neighboursIds, intValueOfId))
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   325
		{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   326
			//On le sélectionne.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   327
			this.selectNeighbour(snapshot, pointer);
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   328
			if(!this.config.mouseInteractions)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   329
			{
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   330
				clearTimeout(this.moveToNeighbourTimeout);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   331
				if(isMainPointer)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   332
				{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   333
					clearTimeout(this.mainPointerExitBorderTimeout);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   334
					this.mainPointerExitBorder = true;
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   335
					this.mainPointerNeighbourSelectedId = intValueOfId;
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   336
				}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   337
				else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   338
				{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   339
					clearTimeout(this.secondPointerExitBorderTimeout);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   340
					this.secondPointerExitBorder = true;
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   341
					this.secondPointerNeighbourSelectedId = intValueOfId;
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   342
				}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   343
			}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   344
			else
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   345
			{
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   346
				this.mainPointerNeighbourSelectedId = intValueOfId;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   347
			}
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   348
			
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   349
		}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   350
		else
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   351
		{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   352
			//Sinon on déselectionne le snapshot.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   353
			if(thisPointerNeighbourSelectedId != null && thisPointerNeighbourSelectedId > -1)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   354
			{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   355
				this.deselectNeighbour(thisPointerNeighbourSelectedId);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   356
				
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   357
				if(!this.config.mouseInteractions)
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   358
				{
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   359
					//Si le pointeur quitte le voisin sans que l'autre pointeur ne fasse de même ailleurs.
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   360
					if(thisPointerExitBorder && !otherPointerExitBorder)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   361
					{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   362
						//On va vers le voisin.
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   363
						this.correctMoveToNeighbour(thisPointerNeighbourSelectedId, zoomX, zoomY);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   364
					}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   365
					
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   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.
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   367
					this.moveToNeighbourTimeout = setTimeout(function()
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   368
					{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   369
						_this.canMoveToNeighbour = false;
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   370
					}, this.config.timeoutMoveToNeighbour);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   371
					
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   372
					if(isMainPointer)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   373
					{
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   374
						this.mainPointerExitBorderTimeout = setTimeout(function()
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   375
						{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   376
							_this.mainPointerExitBorder = false;
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   377
						}, this.config.timeoutUnzoom);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   378
					}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   379
					else
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   380
					{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   381
						this.secondPointerExitBorderTimeout = setTimeout(function()
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   382
						{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   383
							_this.secondPointerExitBorder = false;
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   384
						}, this.config.timeoutUnzoom);
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   385
					}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   386
					
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   387
					//On regarde si on a voulu faire de dézoom.
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   388
					this.checkForDezoom();
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   389
				}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   390
			}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   391
		}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   392
	}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   393
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   394
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   395
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   396
 * Assure les interactions des pointeurs avec la timeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   397
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   398
 * pointers > fonction pointersVideoInteractions.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   399
*/
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   400
Mosaic.prototype.pointersTimelineSelection = function(pointerX, pointerY, isMainPointer)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   401
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   402
	var _this = this, pointer, isTLSelectedByThisPointer, isTLSelectedByOtherPointer, isOtherPointerDisplayed;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   403
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   404
	if(isMainPointer)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   405
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   406
		pointer = $('#mainPointer');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   407
		isTLSelectedByThisPointer = this.isTLSelectedByMainPointer;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   408
		isTLSelectedByOtherPointer = this.isTLSelectedBySecondPointer;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   409
		isOtherPointerDisplayed = this.isSecondPointerDisplayed;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   410
	}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   411
	else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   412
	{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   413
		pointer = $('#secondPointer');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   414
		isTLSelectedByThisPointer = this.isTLSelectedBySecondPointer;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   415
		isTLSelectedByOtherPointer = this.isTLSelectedByMainPointer;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   416
		isOtherPointerDisplayed = this.isMainPointerDisplayed;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   417
	}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   418
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   419
	//On vérifie si on veut sélectionner la TL.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   420
	if((this.currentMode != 'TIMELINE' || this.isTLRequested) && this.playerIsReady && !isTLSelectedByOtherPointer && !this.helpDisplayed)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   421
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   422
		//Si la timeline est sélectionnée.
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   423
		if(this.isTLSelected(true, true) && !this.isTLRequested && this.isVideoReading)
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   424
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   425
			//On a demandé à aller dans la TL.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   426
			this.isTLRequested = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   427
			if(isMainPointer)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   428
			{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   429
				this.isTLSelectedByMainPointer = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   430
				this.isTLSelectedBySecondPointer = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   431
			}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   432
			else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   433
			{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   434
				this.isTLSelectedBySecondPointer = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   435
				this.isTLSelectedByMainPointer = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   436
			}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   437
			this.currentMode = 'TIMELINE';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   438
			this.player.widgets[0].selectTimeline();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   439
			pointer.css('background-image', 'url(./img/cursors/selector_gray.png)');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   440
			
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   441
			//Si on est en mode d'interaction Kinect.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   442
			if(!this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   443
			{
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   444
				//On met le spinner gif sur le pointeur s'il existe.
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   445
				if(pointer.length > 0)
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   446
				{
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   447
					var spinner = "<img id='spinner'></div>";
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   448
					$('body').append(spinner);
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   449
					$('#spinner').css(
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   450
					{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   451
						position: 'absolute',
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   452
						top: pointer.position().top,
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   453
						left: pointer.position().left,
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   454
						width: 85,
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   455
						height: 85,
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   456
						'z-index': 600
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   457
					});
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   458
					$('#spinner').attr('src', './img/cursors/selector_anim.gif');
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   459
				}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   460
			}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   461
			
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   462
			this.selectTLTimeout = setTimeout(function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   463
			{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   464
				//On permet l'interaction après un laps de temps.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   465
				_this.canSlideInTL = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   466
				_this.removeNotifications();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   467
				_this.timelineTimeline();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   468
			}, this.config.timeoutSlideTL);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   469
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   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
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   471
		else if(!this.isTLSelected(true, true) && this.isTLRequested || !this.isVideoReading)
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   472
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   473
			this.isTLRequested = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   474
			clearTimeout(this.selectTLTimeout);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   475
			//On déselectionne la TL.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   476
			this.exitTimeline('');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   477
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   478
	}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   479
	
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   480
	//Si on a quitté la timeline après une sélection.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   481
	if(isTLSelectedByThisPointer && !this.isTLSelected(false, true))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   482
	{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   483
		//On déselectionne la TL.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   484
		this.exitTimeline('');
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   485
	}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   486
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   487
	//Si on a sélectionné la TL et qu'on a le pointeur droit dessus, on peut modifier la position de lecture.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   488
	if(this.currentMode == 'TIMELINE' && this.playerIsReady && !isOtherPointerDisplayed && this.canSlideInTL)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   489
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   490
		var time, TL = $('.Ldt-Timeline'), P = $('.LdtPlayer');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   491
		
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   492
		//Si le pointeur est trop à gauche, on met le curseur de lecture à 0.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   493
		if(pointerX < P.position().left)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   494
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   495
			time = 0;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   496
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   497
		//S'il est trop à droite, on le place à la fin.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   498
		else if(pointerX > (+P.position().left + TL.width()))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   499
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   500
			time = this.player.widgets[0].source.getDuration().getSeconds();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   501
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   502
		//Sinon, on le met à la position du pointeur.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   503
		else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   504
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   505
			time = this.player.widgets[0].scaleIntervals(P.position().left, (+P.position().left + TL.width()), 0, this.player.widgets[0].source.getDuration().getSeconds(), pointerX);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   506
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   507
		
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   508
		this.player.popcorn.currentTime(time);
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
   509
		this.player.popcorn.play();
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   510
	}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   511
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   512
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   513
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   514
 * Raffraîchit la position des pointeurs.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   515
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   516
 * mosaic > fonction loadMosaic.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   517
 * client > fonction processMsg.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   518
*/
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   519
Mosaic.prototype.refreshPointers = function(x, y, isMainPointer)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   520
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   521
    if(this.currentMode == "NO-USER" || this.currentMode.indexOf('INCOMING-') != -1)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   522
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   523
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   524
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   525
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   526
    //Si on est en mode d'interaction Kinect, on effectue un réhaussement de la position.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   527
    if(!this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   528
    {
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   529
		this.minMax(x, y);
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   530
		x = this.scaleIntervals(this.config.kinectMinCoordX, this.config.kinectMaxCoordX, 0, $(window).width(), x);
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   531
		y = this.scaleIntervals(this.config.kinectMinCoordY, this.config.kinectMaxCoordY, 0, $(window).height(), y);
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   532
        /*x *= 7;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   533
        y *= 7;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   534
        x -= $(window).width() * 3 / 4;
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   535
        y -= $(window).height() * 2 / 4;*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   536
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   537
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   538
	var pointer;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   539
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   540
	//S'il s'agit du pointeur principal.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   541
	if(isMainPointer)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   542
	{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   543
		//On affecte les éléments relatifs au pointeur principal.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   544
		pointer = $('#mainPointer');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   545
		
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   546
		//Si le pointeur quitte la fenêtre en X, on ne le change pas.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   547
		if(x < 0 || x > $(window).width())
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   548
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   549
			x = this.mainPointerLastX;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   550
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   551
		//Sinon, on le met à jour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   552
		else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   553
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   554
			this.mainPointerLastX = x;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   555
		}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   556
		
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   557
		//Si le pointeur quitte la fenêtre en Y, on ne le change pas.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   558
		if(y < 0 || y > $(window).height())
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   559
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   560
			y = this.mainPointerLastY;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   561
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   562
		//Sinon, on le met à jour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   563
		else
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   564
		{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   565
			this.mainPointerLastY = y;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   566
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   567
	}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   568
	//Sinon.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   569
	else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   570
	{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   571
		//On affecte les éléments relatifs au pointeur principal.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   572
		pointer = $('#secondPointer');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   573
		
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   574
		//Si le pointeur quitte la fenêtre en X, on ne le change pas.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   575
		if(x < 0 || x > $(window).width())
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   576
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   577
			x = this.secondPointerLastX;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   578
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   579
		//Sinon, on le met à jour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   580
		else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   581
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   582
			this.secondPointerLastX = x;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   583
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   584
		
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   585
		//Si le pointeur quitte la fenêtre en Y, on ne le change pas.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   586
		if(y < 0 || y > $(window).height())
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   587
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   588
			y = this.secondPointerLastY;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   589
		}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   590
		//Sinon, on le met à jour.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   591
		else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   592
		{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   593
			this.secondPointerLastY = y;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   594
		}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   595
	}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   596
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   597
    var pointerX, pointerY;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   598
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   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.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   600
    //Sinon on se base sur les coordonnées des pointeurs.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   601
    if(this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   602
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   603
        pointerX = x;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   604
        pointerY = y;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   605
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   606
    else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   607
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   608
        pointerX = x - pointer.width()/2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   609
        pointerY = y - pointer.height()/2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   610
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   611
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   612
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   613
    pointer.css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   614
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   615
        top: pointerY,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   616
        left: pointerX
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   617
    });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   618
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   619
    if($('#spinner').length > 0)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   620
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   621
        $('#spinner').css(
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   622
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   623
            top: pointerY,
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   624
            left: pointerX
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   625
        });
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   626
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   627
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   628
    var snapshot = null;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   629
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   630
    //Si on est dans la mosaique ou en filtrage.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   631
    if(this.currentMode == 'MOSAIC' || this.currentMode == 'FILTER' && this.isMosaicFiltered)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   632
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   633
		this.pointersMosaicInteractions(pointerX, pointerY, isMainPointer);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   634
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   635
    //Si on est dans une vidéo ou dans une recherche ou dans la timeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   636
    else if(this.currentMode == 'VIDEO' || this.currentMode == 'SEARCH' || this.currentMode == 'TIMELINE')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   637
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   638
		this.pointersVideoInteractions(pointerX, pointerY, isMainPointer);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   639
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   640
}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   641
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   642
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   643
 * Détecte si les deux pointeurs sont dans la zone de recherche et qu'ils ne bougent pas.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   644
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   645
 * client > fonction processMsg.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   646
*/
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   647
Mosaic.prototype.detectIdlePointers = function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   648
{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   649
    var mainPointer = $('#mainPointer');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   650
    var secondPointer = $('#secondPointer');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   651
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   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.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   653
    if(Math.abs(this.mainPointerIdleStartX - this.mainPointerLastX) > mainPointer.width() || Math.abs(this.mainPointerIdleStartY - this.mainPointerLastY) > mainPointer.height() ||
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   654
    Math.abs(this.secondPointerIdleStartX - this.secondPointerLastX) > secondPointer.width() || Math.abs(this.secondPointerIdleStartY - this.secondPointerLastY) > secondPointer.height())
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   655
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   656
        //On réinitialise les dernières positions connues.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   657
        this.mainPointerIdleStartX = this.mainPointerLastX;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   658
        this.mainPointerIdleStartY = this.mainPointerLastY;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   659
        this.secondPointerIdleStartX = this.secondPointerLastX;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   660
        this.secondPointerIdleStartY = this.secondPointerLastY;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   661
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   662
        this.removeIdlePointers();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   663
        this.pointersIdleNeedLaunch = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   664
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   665
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   666
    //Si l'aide est affichée, on la masque.
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   667
    if(this.helpDisplayed && !this.mustTakeOutHands)
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   668
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   669
        this.removeHelp();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   670
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   671
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   672
    if((this.currentMode == 'SEARCH' || this.currentMode == 'FILTER') && !this.isSearchByCurvesOn)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   673
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   674
        // this.isSearchByCurvesOn = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   675
        // this.startSearch();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   676
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   677
}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   678
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   679
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   680
 * Enlève la vérification sur les pointeurs qui ne bougent pas.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   681
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   682
 * pointers > detectIdlePointers.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   683
 * client > fonction processMsg.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   684
*/
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   685
Mosaic.prototype.removeIdlePointers = function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   686
{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   687
    clearTimeout(this.pointersSearchIdleTimeout);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   688
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   689
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   690
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   691
 * Lance une vérification sur les pointeurs qui ne bougent pas.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   692
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   693
 * client > fonction processMsg.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   694
*/
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   695
Mosaic.prototype.launchIdlePointers = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   696
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   697
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   698
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   699
    //Si on est en mode TL, on ne peut pas effectuer de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   700
    if(this.currentMode == 'TIMELINE' || (!this.playerIsReady && (this.currentMode == 'VIDEO' || this.currentMode == 'SEARCH')))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   701
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   702
        return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   703
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   704
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   705
    if(this.currentMode == 'VIDEO')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   706
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   707
        //On peut le faire que sur la video au dessus de la TL.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   708
        var mainPointer = $('#mainPointer'), secondPointer = $('#secondPointer'), TL = $('.Ldt-Timeline');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   709
        var TLwidth = TL.width(), TLheight = TL.height();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   710
        var Ptop = $('.LdtPlayer').position().top, Pleft = $('.LdtPlayer').position().left;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   711
        var Pheight = $('.LdtPlayer').height();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   712
        var MPx = mainPointer.position().left + mainPointer.width() / 2, MPy = mainPointer.position().top + mainPointer.height() / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   713
        var SPx = secondPointer.position().left + secondPointer.width() / 2, SPy = secondPointer.position().top + secondPointer.height() / 2;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   714
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   715
        //Si les pointeurs ne sont pas sur le player, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   716
        if(MPx < Pleft || MPx > (+Pleft + TLwidth) || MPy < Ptop || MPy > (+Ptop + Pheight - TLheight) ||
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   717
        SPx < Pleft || SPx > (+Pleft + TLwidth) || SPy < Ptop || SPy > (+Ptop + Pheight - TLheight))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   718
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   719
            return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   720
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   721
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   722
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   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.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   724
    this.pointersSearchIdleTimeout = setTimeout(function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   725
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   726
        //Si les deux pointeurs ne sont pas dans la zone de recherche, on part.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   727
        if(!_this.areBothPointersHere)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   728
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   729
            return;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   730
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   731
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   732
        //Si on est dans la mosaique.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   733
        if(_this.currentMode == "MOSAIC")
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   734
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   735
            //On passe en filtrage.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   736
            _this.currentMode = "FILTER";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   737
            _this.isMosaicFiltered = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   738
            //On notifie.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   739
            _this.removeNotifications();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   740
            _this.filterSearch();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   741
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   742
        //Si on est dans la video ou dans la timeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   743
        else if(_this.currentMode == "VIDEO" || _this.currentMode == "TIMELINE")
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   744
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   745
            //On entre en recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   746
            _this.currentMode = "SEARCH";
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   747
            //On notifie.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   748
            _this.removeNotifications();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   749
            _this.searchSearch();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   750
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   751
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   752
        //Si on ne peut pas afficher l'aide.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   753
        if(!_this.canNotifyHelp)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   754
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   755
            //On peut l'afficher après un laps de temps.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   756
            _this.canNotifyHelpTimeout = setTimeout(function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   757
            {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   758
                _this.canNotifyHelp = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   759
            }, _this.config.timeoutCanNotifyHelp);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   760
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   761
    }, this.config.timeoutPointersIdle);
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   762
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   763
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   764
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   765
 * Vérifie si les deux pointeurs sont dans la zone de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   766
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   767
 * client > fonction processMsg.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   768
*/
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   769
Mosaic.prototype.checkForBothPointersHere = function()
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   770
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   771
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   772
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   773
    //Si le timeout de vérification n'a pas été lancé.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   774
    if(!this.areBothPointersTimeoutLaunched)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   775
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   776
        //On le lance.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   777
        this.areBothPointersHereTimeout = setTimeout(function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   778
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   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.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   780
            _this.areBothPointersHere = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   781
        }, this.config.timeoutAreBothPointersHere);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   782
        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   783
        //On spécifie qu'on l'a lancé.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   784
        this.areBothPointersHereTimeoutLaunched = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   785
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   786
}
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   787
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   788
/*
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   789
 * Enlève la vérification de présence des deux pointeurs dans la zone de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   790
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   791
 * client > fonction processMsg.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   792
*/
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   793
Mosaic.prototype.removeCheckForBothPointersHere = function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   794
{
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   795
    //On désactive le timeout.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   796
    clearTimeout(this.areBothPointersHereTimeout);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   797
    //On indique que la vérification n'est pas lancée.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   798
    this.areBothPointersHereTimeoutLaunched = false;
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   799
}
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   800
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   801
/*
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   802
 * Vérifie si on se trouve sur la notification de recherche par gesture.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   803
 * Est appelé dans le fichier :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   804
 * pointers > fonctions pointersMosaicInteractions et pointersVideoInteractions.
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   805
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   806
Mosaic.prototype.checkIfPointerIsOnSearchNotification = function(x, y, pointer)
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
   807
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   808
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   809
    var notification_search = $('#notify_search_1gesture');
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   810
	
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   811
    //Si la notification de recherche existe (dans le player).
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   812
    if(notification_search.length > 0)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   813
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   814
        //Pictogramme actuel de la notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   815
        var currentPicto = notification_search.css('background-image');
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   816
		
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   817
        //Si le pointeur est sur la notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   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()))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   819
        {
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   820
            if(!this.alreadyOnNotification && ($('#spinner').length == 0 && !this.config.mouseInteractions || this.config.mouseInteractions) && !this.isTablet)
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   821
            {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   822
                notification_search.css('background-image', currentPicto.replace('/big/' + (this.config.mouseInteractions ? 'MI/' : '') + 'valid/', '/big/' + (this.config.mouseInteractions ? 'MI/' : '') + 'hover/'));
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   823
                
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   824
                //On émet la requete de suppression de la notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   825
                this.gestureDelRequested = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   826
                
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   827
                //Si on est en interaction Kinect.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   828
                if(!this.config.mouseInteractions)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   829
                {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   830
                    //On met le spinner gif sur le pointeur.
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   831
					if(pointer != null && pointer.length > 0)
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   832
					{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   833
						//On modifie l'apparence du pointeur.
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   834
						pointer.css('background-image', 'url(./img/cursors/selector_gray.png)');
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   835
						var spinner = "<img id='spinner'></div>";
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   836
						$('body').append(spinner);
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   837
						$('#spinner').css(
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   838
						{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   839
							position: 'absolute',
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   840
							top: pointer.position().top,
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   841
							left: pointer.position().left,
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   842
							width: 85,
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   843
							height: 85,
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   844
							'z-index': 600
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   845
						});
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   846
						$('#spinner').attr('src', './img/cursors/selector_anim.gif');
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   847
					}
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   848
                    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   849
                    //Après un laps de temps sur la notification, on supprime la recherche et on revient au mode précédent.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   850
                    this.removeNotificationByGestureTimeout = setTimeout(function()
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   851
                    {
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   852
						if(pointer.attr('id') == 'mainPanel')
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   853
						{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   854
							pointer.css('background-image', 'url(./img/cursors/pointer.png)');
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   855
						}
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   856
						else
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   857
						{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   858
							pointer.css('background-image', 'url(./img/cursors/pointer2.png)');
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   859
						}
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   860
						
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   861
                        //Si on est en recherche, on revient en video.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   862
                        if(_this.currentMode == 'SEARCH')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   863
                        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   864
                            _this.player.widgets[0].removeSearchByGesture();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   865
                            _this.currentMode = 'VIDEO';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   866
                        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   867
                        //Si on est en timeline, on revient en timeline.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   868
                        else if(_this.currentMode == 'TIMELINE')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   869
                        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   870
                            _this.player.widgets[0].removeSearchByGesture();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   871
                            _this.currentMode = 'TIMELINE';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   872
                        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   873
                        //Si on est en filtrage, on l'enlève.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   874
                        else if(_this.currentMode == 'FILTER')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   875
                        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   876
                            _this.removeFilter();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   877
                        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   878
                        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   879
                        _this.alreadyOnNotification = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   880
                        _this.isCurrentlyInASearchByGesture = false;
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
   881
						_this.gestureDelRequested = false;
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   882
                        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   883
                        //Si on n'est ni en recherche, ni en filtrage, on enlève la gesture de recherche.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   884
                        if(_this.currentMode != 'MOSAIC' && _this.currentMode != 'FILTER')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   885
                        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   886
                            _this.currentSearchGesture[_this.centerId] = '';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   887
                        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   888
                        
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   889
                        _this.canNotifyHelp = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   890
                    }, this.config.timeoutRemoveNotificationByGesture);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   891
                }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   892
                
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   893
                this.alreadyOnNotification = true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   894
            }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   895
            //On retourne vrai si on est sur la notification, et faux sinon.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   896
            return true;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   897
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   898
        //S'il n'est pas sur la notification.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   899
        else
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   900
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   901
            //Si on était sur la notification, on remet la notification dans l'état où elle était avant qu'on soit dessus.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   902
            if(this.alreadyOnNotification)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   903
            {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   904
                notification_search.css('background-image', currentPicto.replace('/big/' + (this.config.mouseInteractions ? 'MI/' : '') + 'hover/', '/big/' + (this.config.mouseInteractions ? 'MI/' : '') + 'valid/'));
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   905
                
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   906
                this.gestureDelRequested = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   907
                
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   908
                clearTimeout(this.removeNotificationByGestureTimeout);
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   909
                this.alreadyOnNotification = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   910
                $('#spinner').remove();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   911
            }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   912
            
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   913
            return false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   914
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   915
    }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   916
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   917
    return false;
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   918
}
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   919
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   920
/*
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   921
 * Si on se trouve sur la notification de recherche par gesture, on la supprime.
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   922
 * Est appelé dans les fichiers :
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   923
 * mosaic > onMouseDown.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   924
 * zoomInteractions > unzoom.
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   925
*/
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   926
Mosaic.prototype.removeSearchNotificationIfOnIt = function(x, y)
45
0e29ae4568a0 Front IDILL:
bastiena
parents: 44
diff changeset
   927
{
52
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   928
    var _this = this;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   929
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   930
    var notification_search = $('#notify_search_1gesture');
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   931
    
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   932
    //Si la notification de recherche existe (dans le player).
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   933
    if(notification_search.length > 0)
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   934
    {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   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()))
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   936
        {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   937
            _this.removeNotifications();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   938
            if(_this.currentMode == 'SEARCH')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   939
            {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   940
                _this.player.widgets[0].removeSearchByGesture();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   941
                _this.currentMode = 'VIDEO';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   942
                _this.currentSearchGesture[_this.centerId] = '';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   943
            }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   944
            else if(_this.currentMode == 'TIMELINE')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   945
            {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   946
                _this.player.widgets[0].removeSearchByGesture();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   947
                _this.currentMode = 'TIMELINE';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   948
                _this.currentSearchGesture[_this.centerId] = '';
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   949
            }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   950
            else if(_this.currentMode == 'FILTER')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   951
            {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   952
                _this.removeFilter();
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   953
            }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   954
            
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   955
            _this.alreadyOnNotification = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   956
            _this.isCurrentlyInASearchByGesture = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   957
            _this.curvesGesturesFound = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   958
            _this.canDrawNextCurve = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   959
            _this.isSearchByCurvesOn = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   960
            _this.canNotifyHelp = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   961
            
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   962
            //Si on est dans une vidéo, on laisse cette variable afin de ne pas dézoomer / bouger.
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   963
            if(_this.currentMode != 'VIDEO' && _this.currentMode != 'TIMELINE')
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   964
            {
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   965
                _this.gestureDelRequested = false;
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   966
            }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   967
        }
277c94533395 Front IDILL :
bastiena
parents: 47
diff changeset
   968
    }
55
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   969
}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   970
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   971
/*
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   972
 * Retourne vrai si la souris est sur la notification d'aide dans le mode d'interaction souris.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   973
 * Est appelé dans les fichiers :
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   974
 * mosaic > onMouseMove.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   975
*/
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   976
Mosaic.prototype.isOnHelpIcon = function(x, y)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   977
{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   978
	var helpIcon = $('#helpIcon');
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   979
	//S'il n'y a pas d'icone d'aide, on quitte.
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   980
	if(helpIcon.length <= 0)
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   981
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   982
		return;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   983
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   984
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
   985
	//Si la souris est sur l'icone, on retourne true.
77
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   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')))
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   987
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   988
		return true;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   989
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   990
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   991
	return false;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   992
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   993
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   994
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   995
 * Retourne vrai si le doigt est sur la notification de sortie dans le mode d'interaction tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   996
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   997
Mosaic.prototype.isOnExitIcon = function(x, y)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   998
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
   999
	var exitIcon = $('#exitIcon');
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1000
	//S'il n'y a pas d'icone d'aide, on quitte.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1001
	if(exitIcon.length <= 0)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1002
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1003
		return;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1004
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1005
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1006
	//Si la souris est sur l'icone, on retourne true.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1007
	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')))
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1008
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1009
		return true;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1010
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1011
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1012
	return false;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1013
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1014
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1015
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1016
 * Retourne vrai si le doigt est sur la notification de retour vers la mosaïque dans le mode d'interaction tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1017
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1018
Mosaic.prototype.isOnHomeIcon = function(x, y)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1019
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1020
	var homeIcon = $('#homeIcon');
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1021
	//S'il n'y a pas d'icone d'aide, on quitte.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1022
	if(homeIcon.length <= 0)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1023
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1024
		return;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1025
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1026
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1027
	//Si la souris est sur l'icone, on retourne true.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1028
	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')))
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1029
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1030
		return true;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1031
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1032
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1033
	return false;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1034
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1035
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1036
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1037
 * Retourne vrai si le doigt est sur la notification de sortie de recherche dans le mode d'interaction tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1038
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1039
Mosaic.prototype.isOnSearchExitIcon = function(x, y)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1040
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1041
	var searchExitIcon = $('#searchExitIcon');
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1042
	//S'il n'y a pas d'icone d'aide, on quitte.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1043
	if(searchExitIcon.length <= 0)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1044
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1045
		return;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1046
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1047
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1048
	//Si la souris est sur l'icone, on retourne true.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1049
	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')))
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1050
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1051
		return true;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1052
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1053
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1054
	return false;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1055
}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1056
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1057
/*
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1058
 * Retourne vrai si le doigt est sur la notification de recherche dans le mode d'interaction tablettes.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1059
*/
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1060
Mosaic.prototype.isOnSearchNotification = function(x, y)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1061
{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1062
	var searchNotification = $('#notify_search_1gesture');
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1063
	//S'il n'y a pas d'icone d'aide, on quitte.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1064
	if(searchNotification.length <= 0)
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1065
	{
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1066
		return;
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1067
	}
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1068
	
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1069
	//Si la souris est sur l'icone, on retourne true.
205409da0f32 Front IDILL:
bastiena
parents: 58
diff changeset
  1070
	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
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1071
	{
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1072
		return true;
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1073
	}
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1074
	
afd60399a7b5 Front IDILL :
bastiena
parents: 52
diff changeset
  1075
	return false;
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1076
}
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1077
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1078
/*
79
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1079
 * Retourne vrai si le doigt est sur le bouton de lecture de video dans le mode d'interaction tablettes.
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1080
*/
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1081
Mosaic.prototype.isOnPlayButton = function(x, y)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1082
{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1083
	var playButton = $('#tabletPlayButton');
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1084
	//S'il n'y a pas d'icone d'aide, on quitte.
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1085
	if(playButton.length <= 0)
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1086
	{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1087
		return;
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1088
	}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1089
	
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1090
	//Si la souris est sur l'icone, on retourne true.
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1091
	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')))
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1092
	{
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1093
		return true;
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1094
	}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1095
	
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1096
	return false;
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1097
}
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1098
9eff85166868 Front IDILL :
bastiena
parents: 77
diff changeset
  1099
/*
58
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1100
 * Change la couleur des pointeurs pendant le tracé d'une courbe.
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1101
*/
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1102
Mosaic.prototype.pointersGreen = function()
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1103
{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1104
	$('#mainPointer').css('background-image', 'url(./img/cursors/pointerC.png)');
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1105
	$('#secondPointer').css('background-image', 'url(./img/cursors/pointer2C.png)');
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1106
}
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1107
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1108
Mosaic.prototype.minMax = function(x, y)
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1109
{
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1110
	if(x < this.minX) {this.minX = x;}
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1111
	if(x > this.maxX) {this.maxX = x;}
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1112
	if(y < this.minY) {this.minY = y;}
a28488078053 Front IDILL:
bastiena
parents: 55
diff changeset
  1113
	if(y > this.maxY) {this.maxY = y;}
44
8393d3473b98 Front IDILL:
bastiena
parents:
diff changeset
  1114
}