front_idill/src/mosaic/js/notifications.js
changeset 58 a28488078053
parent 55 afd60399a7b5
child 77 205409da0f32
equal deleted inserted replaced
57:d0c393730443 58:a28488078053
    66     {
    66     {
    67         search_2hands_tab = ['arret', 'contact', 'grandjete', 'group_spin', 'port_de_bras', 'spin', 'up_down', 'wave'];
    67         search_2hands_tab = ['arret', 'contact', 'grandjete', 'group_spin', 'port_de_bras', 'spin', 'up_down', 'wave'];
    68         search_2hands_tab_text = ['no-motion', 'contact', 'grand-jete', 'screw', 'arc', 'circle', 'up-down', 'wave'];
    68         search_2hands_tab_text = ['no-motion', 'contact', 'grand-jete', 'screw', 'arc', 'circle', 'up-down', 'wave'];
    69         search_body_tab = ['chute', 'knee_up', 'jump', 'bend'];
    69         search_body_tab = ['chute', 'knee_up', 'jump', 'bend'];
    70         search_body_tab_text = ['fall', 'knee-up', 'jump', 'bend'];
    70         search_body_tab_text = ['fall', 'knee-up', 'jump', 'bend'];
    71         search_2hands_tab_opacities = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5];
    71         search_2hands_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1];
    72         search_body_tab_opacities = [1, 1, 1, 1];
    72         search_body_tab_opacities = [1, 1, 1, 1];
    73     }
    73     }
    74     
    74     
    75     //Dans la mosaique, on ne peut que sélectionner un snapshot.
    75     //Dans la mosaique, on ne peut que sélectionner un snapshot.
    76     if(inMosaic)
    76     if(inMosaic)
    89 			controls_1hand_tab_opacities = [1, 1, 1, 1, 1];
    89 			controls_1hand_tab_opacities = [1, 1, 1, 1, 1];
    90 		}
    90 		}
    91 		else
    91 		else
    92 		{
    92 		{
    93 			controls_1hand_tab = ['deplacer', 'precedent', 'suivant', 'mosaique_horizontal', 'mosaique_vertical', 'move_down', 'move_up', 'move_right', 'move_left'];
    93 			controls_1hand_tab = ['deplacer', 'precedent', 'suivant', 'mosaique_horizontal', 'mosaique_vertical', 'move_down', 'move_up', 'move_right', 'move_left'];
    94 			controls_1hand_tab = ['controls_timeline', 'controls_previous', 'controls_next', 'controls_mos_horizontal', 'controls_mos_vertical', 'controls_move_down', 'controls_move_up', 'controls_move_right', 'controls_move_left'];
    94 			controls_1hand_tab_text = ['controls_timeline', 'controls_previous', 'controls_next', 'controls_mos_horizontal', 'controls_mos_vertical', 'controls_move_down', 'controls_move_up', 'controls_move_right', 'controls_move_left'];
    95 			controls_1hand_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1, 1];
    95 			controls_1hand_tab_opacities = [1, 1, 1, 1, 1, 1, 1, 1, 1];
    96 		}
    96 		}
    97     }
    97     }
    98     
    98     
    99     //Colonne de recherche.
    99     //Colonne de recherche.
   277     
   277     
   278     //Actions de contrôle de l'interface.
   278     //Actions de contrôle de l'interface.
   279     $('#controls_title').html(this.helpText.controls_title);
   279     $('#controls_title').html(this.helpText.controls_title);
   280     $('#controls_1hand_text').html(this.helpText.controls_1hand_text);
   280     $('#controls_1hand_text').html(this.helpText.controls_1hand_text);
   281     
   281     
   282     //On affecte les images des actions de contrôle de l'interface.
   282 	//On affecte les images des actions de contrôle de l'interface.
   283     for(var i = 0 ; i < controls_1hand_tab.length ; i++)
   283 	for(var i = 0 ; i < controls_1hand_tab.length ; i++)
   284     {
   284 	{
   285         $("#1hand_" + controls_1hand_tab[i]).css("background-image", "url('" + img_directory + controls_1hand_tab[i] + ".png')");
   285 		$("#1hand_" + controls_1hand_tab[i]).css("background-image", "url('" + img_directory + controls_1hand_tab[i] + ".png')");
   286         $("#1hand_" + controls_1hand_tab[i]).html(this.helpText[controls_1hand_tab_text[i]]);
   286 		$("#1hand_" + controls_1hand_tab[i]).html(this.helpText[controls_1hand_tab_text[i]]);
   287     }
   287 	}
   288     
   288     
   289     //On les fait apparaître.
   289     //On les fait apparaître.
   290     $('#notify_help').css(
   290     $('#notify_help').css(
   291     {
   291     {
   292         opacity: "1"
   292         opacity: "1"
   305  * mosaic > fonction manageControlEvents et onClick.
   305  * mosaic > fonction manageControlEvents et onClick.
   306  * curvesDetector > fonction updateDists.
   306  * curvesDetector > fonction updateDists.
   307 */
   307 */
   308 Mosaic.prototype.removeHelp = function()
   308 Mosaic.prototype.removeHelp = function()
   309 {
   309 {
       
   310 	// console.trace();
       
   311 	
   310     //Si l'aide n'est pas affichée, on part.
   312     //Si l'aide n'est pas affichée, on part.
   311     if(!this.helpDisplayed)
   313     if(!this.helpDisplayed)
   312     {
   314     {
   313         return;
   315         return;
   314     }
   316     }
   551     //Si on n'est pas en mode filtrage ou qu'aucune recherche n'est affectée au filtrage, on part.
   553     //Si on n'est pas en mode filtrage ou qu'aucune recherche n'est affectée au filtrage, on part.
   552     if(this.currentMode != 'FILTER' || !this.filterSearchedType)
   554     if(this.currentMode != 'FILTER' || !this.filterSearchedType)
   553     {
   555     {
   554         return;
   556         return;
   555     }
   557     }
   556     
   558 	
   557     var _this = this;
   559     var _this = this;
   558     
   560     
   559     //On spécifie les notifications en div.
   561     //On spécifie les notifications en div.
   560     var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
   562     var notification_search_1gesture = "<div id='notify_search_1gesture' class='notifications'></div>";
   561     
   563     
   567     var notify_margin = parseInt($('.notifications').css('margin'));
   569     var notify_margin = parseInt($('.notifications').css('margin'));
   568     var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
   570     var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
   569     
   571     
   570     if(_.include(this.gestures, gestureName))
   572     if(_.include(this.gestures, gestureName))
   571     {
   573     {
   572         $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI' : '') + '/' + (this.gestureDelRequested ? 'hover' : 'valid') + '/' + gestureName + '.png")');
   574         $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + (this.gestureDelRequested ? 'hover' : 'valid') + '/' + gestureName + '.png")');
   573     }
   575     }
   574     else if(mode == 'none')
   576     else if(mode == 'none')
   575     {
   577     {
   576         $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
   578         $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
   577     }
   579     }
   618     var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
   620     var search_1gesture_left = $(window).width() / 2 - (notify_width * 2 + notify_margin * 3) / 2;
   619     var selection_left = search_1gesture_left + notify_width + notify_margin;
   621     var selection_left = search_1gesture_left + notify_width + notify_margin;
   620     
   622     
   621     if(_.include(this.gestures, gestureName))
   623     if(_.include(this.gestures, gestureName))
   622     {
   624     {
   623         $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI' : '') + '/' + mode + '/' + gestureName + '.png")');
   625         $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/' + (this.config.mouseInteractions ? 'MI/' : '') + mode + '/' + gestureName + '.png")');
   624     }
   626     }
   625     else if(mode == 'none')
   627     else if(mode == 'none')
   626     {
   628     {
   627         $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
   629         $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
   628     }
   630     }
   680     var notify_margin = parseInt($('.notifications').css('margin'));
   682     var notify_margin = parseInt($('.notifications').css('margin'));
   681     var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
   683     var point_left = $(window).width() / 2 - (notify_width) / 2 - notify_margin;
   682     
   684     
   683     var notifyTop = 0, notifyLeft = 0;
   685     var notifyTop = 0, notifyLeft = 0;
   684     
   686     
   685 	if(direction.equals("left"))
   687 	if(direction == "left")
   686 	{
   688 	{
   687 		this.putText($('#notify_swipe'), this.notificationStrings.next);
   689 		this.putText($('#notify_swipe'), this.notificationStrings.next);
   688 	}
   690 	}
   689 	else
   691 	else
   690 	{
   692 	{
   997     var swipe_left = search_left + notify_width + notify_margin;
   999     var swipe_left = search_left + notify_width + notify_margin;
   998     
  1000     
   999     var notifyTop = 0, notifyLeft = 0;
  1001     var notifyTop = 0, notifyLeft = 0;
  1000     
  1002     
  1001 	this.putText($('#notify_search'), this.notificationStrings.search);
  1003 	this.putText($('#notify_search'), this.notificationStrings.search);
  1002 	if(direction.equals("left"))
  1004 	if(direction == "left")
  1003 	{
  1005 	{
  1004 		this.putText($('#notify_swipe'), this.notificationStrings.next);
  1006 		this.putText($('#notify_swipe'), this.notificationStrings.next);
  1005 	}
  1007 	}
  1006 	else
  1008 	else
  1007 	{
  1009 	{
  1310     else if(mode == 'none')
  1312     else if(mode == 'none')
  1311     {
  1313     {
  1312         $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
  1314         $('#notify_search_1gesture').css('background-image', 'url("./pictos/big/normal/inconnu.png")');
  1313     }
  1315     }
  1314 	
  1316 	
  1315 	if(direction.equals("left"))
  1317 	if(direction == "left")
  1316 	{
  1318 	{
  1317 		this.putText($('#notify_swipe'), this.notificationStrings.next);
  1319 		this.putText($('#notify_swipe'), this.notificationStrings.next);
  1318 	}
  1320 	}
  1319 	else
  1321 	else
  1320 	{
  1322 	{