integration/js/main.js
author Anthony Ly <anthonyly.com@gmail.com>
Tue, 27 Nov 2012 18:08:06 +0100
changeset 20 c86141a8570d
parent 11 95df5542a1ce
child 21 c2dd00471b2d
permissions -rwxr-xr-x
maj retours / modifications
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
43d9dff6758a premiers ajout front périples
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     1
$(function(){
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
     2
//CLUSTER
2
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
     3
	var clusterWidth=0;
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
     4
	$('.cluster li').each( function(){ clusterWidth += $(this).width() + 10; });
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
     5
	$('.cluster').width( clusterWidth );
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
     6
	var clusterVisibleWidth = $(".cluster-visible").width();
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
     7
	var clusterVisibleLeft = 20;
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
     8
	$(".arrow-left").addClass('bute');
2
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
     9
	if (clusterWidth>clusterVisibleWidth) {
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    10
		$(".cluster-containment").css({
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    11
			"left": -(clusterWidth-clusterVisibleWidth),
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    12
			"width":clusterWidth+(clusterWidth-clusterVisibleWidth+clusterVisibleLeft)
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    13
		});
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    14
		$(".cluster-visible").css({"left": (clusterWidth-912+clusterVisibleLeft)});
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    15
		
2
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    16
		$("a.cluster-arrow").bind("click",function(e){
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    17
			e.preventDefault();
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    18
			$(".cluster").stop();
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    19
			moveCluster(this, 5);
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    20
		});
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    21
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    22
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    23
		$("a.cluster-arrow").hover(
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    24
			function(){
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    25
				moveCluster(this, 20);
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    26
			},
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    27
			function(){
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    28
				$(".cluster").stop();
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    29
			}
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    30
		);
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    31
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    32
		function moveCluster(arrow, speed){
2
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    33
			var clusterContainmentLeft = parseInt($(".cluster-containment").css("left"));
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    34
			var clusterContainmentRight = parseInt($(".cluster-containment").css("left")) + $(".cluster-containment").width();
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    35
			var clusterLeft = parseInt($(".cluster").css("left"));
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    36
			var clusterRight = parseInt($(".cluster").css("left"))+$(".cluster").width();
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    37
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    38
			if ($(arrow).hasClass("arrow-right")) {
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    39
				$(".arrow-left").removeClass('bute');
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    40
				vitesse = (clusterLeft-clusterContainmentLeft)*speed;
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    41
				$(".cluster").animate({
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    42
					"left":clusterContainmentLeft
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    43
				},vitesse,'linear',function(){
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    44
					$(arrow).addClass('bute');
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    45
				});
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    46
			}else{
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    47
				$(".arrow-right").removeClass('bute');
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    48
				vitesse = (clusterContainmentRight-clusterRight)*speed;
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    49
				$(".cluster").animate({
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    50
					"left":0
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    51
				},vitesse,'linear',function(){
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    52
					$(arrow).addClass('bute');
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    53
				});
2
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    54
			}
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    55
		}
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    56
2
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    57
		//DRAGGABLE
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    58
		$(".cluster").draggable({ axis: "x",containment: ".cluster-containment"  });
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    59
	};
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    60
//WIDGET
11
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
    61
	//HEIGHT
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    62
	function resizeWidgetSidebar(){
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    63
		var contentRightHeight = $(".content-right").height();
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    64
		var contentLeftHeight = $(".content-left").height();
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    65
		if(contentRightHeight>contentLeftHeight){
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    66
			$(".content-left .widget-wrap").css({
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    67
				"height":"+="+(contentRightHeight-contentLeftHeight)
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    68
			});
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    69
		}
11
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
    70
	}
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    71
	resizeWidgetSidebar();
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    72
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    73
	//VOLET
4
b00fdbef41d4 ajout du header sur pages articles
Anthony Ly <anthonyly.com@gmail.com>
parents: 3
diff changeset
    74
	//Tout fermer par défaut
b00fdbef41d4 ajout du header sur pages articles
Anthony Ly <anthonyly.com@gmail.com>
parents: 3
diff changeset
    75
	//$("div.content-left div.widget-wrap div.widget div.widget-inner").hide().removeClass("open");
b00fdbef41d4 ajout du header sur pages articles
Anthony Ly <anthonyly.com@gmail.com>
parents: 3
diff changeset
    76
	//$("div.dossier-similaire div.widget div.widget-inner").hide().removeClass("open");
b00fdbef41d4 ajout du header sur pages articles
Anthony Ly <anthonyly.com@gmail.com>
parents: 3
diff changeset
    77
b00fdbef41d4 ajout du header sur pages articles
Anthony Ly <anthonyly.com@gmail.com>
parents: 3
diff changeset
    78
	$("div.content-left div.widget-wrap div.widget h3 a, div.dossier-similaire div.widget h3 a").bind("click",function(e){
2
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    79
		e.preventDefault();
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    80
		var widgetInner = $(this).parents("h3").siblings("div.widget-inner");
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    81
		widgetInner.stop();
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    82
		if ($(this).hasClass("open")) {
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    83
			widgetInner.slideUp();
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    84
			$(this).removeClass("open");
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    85
		}else{
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    86
			widgetInner.slideDown();
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    87
			$(this).addClass("open");
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    88
		}
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
    89
	});
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    90
	//AFFICHAGE
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    91
	$('.widget.affichage li a').bind('click',function(e){
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    92
		e.preventDefault();
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    93
		if ($(this).hasClass("treemap") && !$(this).hasClass("active")) {
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    94
			$('.widget.affichage li a.liste').removeClass("active");
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    95
			$(this).addClass('active');
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
    96
			$('#liste').hide();$('#treemap').show();
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    97
		}else if($(this).hasClass("liste") && !$(this).hasClass("active")){
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    98
			$('.widget.affichage li a.treemap').removeClass("active");
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
    99
			$(this).addClass('active');
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   100
			$('#liste').show();$('#treemap').hide();
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   101
		}
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   102
		resizeWidgetSidebar();
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   103
	});
5
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   104
	//DATE PICKER
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   105
	$(".dateBegin").datepicker({
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   106
		onSelect: function( selectedDate ) {
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   107
        	$( ".dateEnd" ).datepicker( "option", "minDate", selectedDate );
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   108
        }
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   109
	});
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   110
	$(".dateEnd").datepicker({
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   111
		onSelect: function( selectedDate ) {
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   112
        	$( ".dateBegin" ).datepicker( "option", "maxDate", selectedDate );
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   113
        }
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   114
	});
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   115
//VOLET DOCUMENTAIRE
2
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   116
	$("div.dossier-documentaire").hide();
11
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
   117
	/*
2
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   118
	$("div.header a.dossier-button").bind("click",function(e){
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   119
		e.preventDefault();
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   120
		$("div.dossier-documentaire").stop()
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   121
		if($("div.dossier-documentaire").is(":visible")){
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   122
			$("div.dossier-documentaire").slideUp();
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   123
		}else{
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   124
			$("div.dossier-documentaire").slideDown();
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   125
		}
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   126
	});
11
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
   127
*/
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   128
	$(".header .dossier-button").bind("click",function(e){e.preventDefault();});
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   129
	$(".header .dossier-button, .header .dossier-documentaire").hover(
11
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
   130
		function(){
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
   131
			$("div.dossier-documentaire").stop().slideDown();
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
   132
		},
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
   133
		function(){
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
   134
			$("div.dossier-documentaire").stop().slideUp();
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
   135
		}
95df5542a1ce traitement des retours
Anthony Ly <anthonyly.com@gmail.com>
parents: 9
diff changeset
   136
	);
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   137
//ARTICLES
2
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   138
	$(".article-visuel-wrap").each(function(){
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   139
		var contentHeight = $(this).parents(".article-content").height();
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   140
		//$(this).height(contentHeight);
6e47ed0c413c maj periplus front
Anthony Ly <anthonyly.com@gmail.com>
parents: 1
diff changeset
   141
	});
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   142
	$(".article-annotations a").hover(
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   143
		function(){
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   144
			var x = $(this).offset().left + $(this).width()/2;
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   145
			var y = $(this).offset().top;
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   146
			var text = $(this).attr('title');
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   147
			showTooltip(x,y,text);
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   148
		},
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   149
		function(){
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   150
			var tip = $(".tooltip");
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   151
			tip.hide();
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   152
		}
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   153
	);
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   154
//FRISE
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   155
	//valeurs init du slider à définir
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   156
	var valSlider1 = 75;
5
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   157
	var valSlider2 = 300;
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   158
	var diffSlide = valSlider2-valSlider1;
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   159
	var widthFrise = $('.frise').width();
5
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   160
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   161
	$( "#slider-range" ).dragslider({
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   162
		range: true,
5
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   163
		rangeDrag: true,
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   164
		min: 0,
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   165
		max: widthFrise,
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   166
		values: [ valSlider1, valSlider2 ],
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   167
		slide: function( event, ui ) {
9
86ddd934464a Paired streamgraph with slider
veltr
parents: 6
diff changeset
   168
            if (window.streamgraph) {
86ddd934464a Paired streamgraph with slider
veltr
parents: 6
diff changeset
   169
                streamgraph.slidevalues(ui.values[0], ui.values[1]);
86ddd934464a Paired streamgraph with slider
veltr
parents: 6
diff changeset
   170
            }
5
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   171
		},
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   172
		change: function( event, ui ){
6
a3e60d7addb3 ajout des boutons annotations / montage
Anthony Ly <anthonyly.com@gmail.com>
parents: 5
diff changeset
   173
			//ici on récup les valeurs après un slide
a3e60d7addb3 ajout des boutons annotations / montage
Anthony Ly <anthonyly.com@gmail.com>
parents: 5
diff changeset
   174
			var value1 = ui.values[ 0 ];
a3e60d7addb3 ajout des boutons annotations / montage
Anthony Ly <anthonyly.com@gmail.com>
parents: 5
diff changeset
   175
			var value2 = ui.values[ 1 ];
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   176
		}
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   177
	});
5
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   178
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   179
//TOOLTIP
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   180
	function showTooltip(x,y, text) {
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   181
		//white_arrow_long.png
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   182
		var tip = $(".tooltip");
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   183
		tip.show();
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   184
	    tip.css({
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   185
	        "left" : Math.floor(x - tip.outerWidth() / 2) + "px",
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   186
	        "top" : Math.floor(y - tip.outerHeight()) + "px"
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   187
	    }).text(text);
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   188
	}
5
16413123bc8c ajout date picker / avancement
Anthony Ly <anthonyly.com@gmail.com>
parents: 4
diff changeset
   189
20
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   190
//HOME TREEMAP
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   191
	var lastActuBind = false;
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   192
	$('#treemap').on('mouseover', '.actu', function(){
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   193
		if(this == lastActuBind) return;
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   194
		lastActuBind = this;
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   195
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   196
		console.log('mouseover', $(this));
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   197
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   198
	});
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   199
c86141a8570d maj retours / modifications
Anthony Ly <anthonyly.com@gmail.com>
parents: 11
diff changeset
   200
3
b5b13ce6935f ajout de jquery ui
Anthony Ly <anthonyly.com@gmail.com>
parents: 2
diff changeset
   201
});//jQuery