|
27
|
1 |
$(function(){ |
|
|
2 |
//CLUSTER |
|
|
3 |
var clusterWidth=0; |
|
|
4 |
$('.cluster li').each( function(){ clusterWidth += $(this).width() + 10; }); |
|
|
5 |
$('.cluster').width( clusterWidth ); |
|
|
6 |
var clusterVisibleWidth = $(".cluster-visible").width(); |
|
|
7 |
var clusterVisibleLeft = 20; |
|
|
8 |
if (clusterWidth>clusterVisibleWidth) { |
|
|
9 |
$(".cluster-containment").css({ |
|
|
10 |
"left": -(clusterWidth-clusterVisibleWidth), |
|
|
11 |
"width":clusterWidth+(clusterWidth-clusterVisibleWidth+clusterVisibleLeft) |
|
|
12 |
}); |
|
|
13 |
$(".cluster-visible").css({"left": (clusterWidth-912+clusterVisibleLeft)}); |
|
|
14 |
$("a.cluster-arrow").bind("click",function(e){ |
|
|
15 |
|
|
|
16 |
e.preventDefault(); |
|
|
17 |
var clusterContainmentLeft = parseInt($(".cluster-containment").css("left")); |
|
|
18 |
var clusterContainmentRight = parseInt($(".cluster-containment").css("left")) + $(".cluster-containment").width(); |
|
|
19 |
var clusterLeft = parseInt($(".cluster").css("left")); |
|
|
20 |
var clusterRight = parseInt($(".cluster").css("left"))+$(".cluster").width(); |
|
|
21 |
if ($(this).hasClass("arrow-right")) { |
|
|
22 |
if (clusterLeft-40>clusterContainmentLeft) { |
|
|
23 |
$(".cluster").css({ |
|
|
24 |
"left":"-="+40 |
|
|
25 |
}); |
|
|
26 |
}else{ |
|
|
27 |
$(".cluster").css({ |
|
|
28 |
"left":clusterContainmentLeft |
|
|
29 |
}); |
|
|
30 |
} |
|
|
31 |
|
|
|
32 |
}else if($(this).hasClass("arrow-left")){ |
|
|
33 |
|
|
|
34 |
if (clusterRight+40<clusterContainmentRight) { |
|
|
35 |
$(".cluster").css({ |
|
|
36 |
"left":"+="+40 |
|
|
37 |
}); |
|
|
38 |
}else{ |
|
|
39 |
$(".cluster").css({ |
|
|
40 |
"left":0 |
|
|
41 |
}); |
|
|
42 |
} |
|
|
43 |
} |
|
|
44 |
}); |
|
|
45 |
|
|
|
46 |
//DRAGGABLE |
|
|
47 |
$(".cluster").draggable({ axis: "x",containment: ".cluster-containment" }); |
|
|
48 |
}; |
|
|
49 |
//WIDGET |
|
|
50 |
//HEIGHT |
|
|
51 |
var contentRightHeight = $(".content-right").height(); |
|
|
52 |
var contentLeftHeight = $(".content-left").height(); |
|
|
53 |
if(contentRightHeight>contentLeftHeight){ |
|
|
54 |
$(".content-left .widget-wrap").css({ |
|
|
55 |
"height":"+="+(contentRightHeight-contentLeftHeight) |
|
|
56 |
}); |
|
|
57 |
} |
|
|
58 |
//VOLET |
|
|
59 |
//Tout fermer par défaut |
|
|
60 |
//$("div.content-left div.widget-wrap div.widget div.widget-inner").hide().removeClass("open"); |
|
|
61 |
//$("div.dossier-similaire div.widget div.widget-inner").hide().removeClass("open"); |
|
|
62 |
|
|
|
63 |
$("div.content-left div.widget-wrap div.widget h3 a, div.dossier-similaire div.widget h3 a").bind("click",function(e){ |
|
|
64 |
e.preventDefault(); |
|
|
65 |
var widgetInner = $(this).parents("h3").siblings("div.widget-inner"); |
|
|
66 |
widgetInner.stop(); |
|
|
67 |
if ($(this).hasClass("open")) { |
|
|
68 |
widgetInner.slideUp(); |
|
|
69 |
$(this).removeClass("open"); |
|
|
70 |
}else{ |
|
|
71 |
widgetInner.slideDown(); |
|
|
72 |
$(this).addClass("open"); |
|
|
73 |
} |
|
|
74 |
}); |
|
|
75 |
//AFFICHAGE |
|
|
76 |
$('.widget.affichage li a').bind('click',function(e){ |
|
|
77 |
e.preventDefault(); |
|
|
78 |
if ($(this).hasClass("treemap") && !$(this).hasClass("active")) { |
|
|
79 |
$('.widget.affichage li a.liste').removeClass("active"); |
|
|
80 |
$(this).addClass('active'); |
|
|
81 |
}else if($(this).hasClass("liste") && !$(this).hasClass("active")){ |
|
|
82 |
$('.widget.affichage li a.treemap').removeClass("active"); |
|
|
83 |
$(this).addClass('active'); |
|
|
84 |
} |
|
|
85 |
}); |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
//DATE PICKER |
|
|
90 |
$(".dateBegin").datepicker({ |
|
|
91 |
minDate: new Date(2007, 7 - 1, 01), |
|
|
92 |
maxDate: new Date(2012,12 - 1 , 31), |
|
|
93 |
onSelect: function(selectedDate) { |
|
|
94 |
$("#pickeddatebegin").val(selectedDate); |
|
|
95 |
$("#ajax2").submit(); |
|
|
96 |
$( "#pickeddateend" ).datepicker( "option", "minDate", selectedDate ); |
|
|
97 |
} |
|
|
98 |
}); |
|
|
99 |
$(".dateEnd").datepicker({ |
|
|
100 |
minDate: new Date(2007, 7 - 1, 01), |
|
|
101 |
maxDate: new Date(2012, 12 - 1, 31), |
|
|
102 |
onSelect: function( selectedDate ) { |
|
|
103 |
$("#pickeddateend").val(selectedDate); |
|
|
104 |
$("#ajax2").submit(); |
|
|
105 |
$( "#pickeddatebegin" ).datepicker( "option", "maxDate", selectedDate ); |
|
|
106 |
} |
|
|
107 |
}); |
|
|
108 |
//VOLET DOCUMENTAIRE |
|
|
109 |
$("div.dossier-documentaire").hide(); |
|
|
110 |
/* |
|
|
111 |
$("div.header a.dossier-button").bind("click",function(e){ |
|
|
112 |
e.preventDefault(); |
|
|
113 |
$("div.dossier-documentaire").stop() |
|
|
114 |
if($("div.dossier-documentaire").is(":visible")){ |
|
|
115 |
$("div.dossier-documentaire").slideUp(); |
|
|
116 |
}else{ |
|
|
117 |
$("div.dossier-documentaire").slideDown(); |
|
|
118 |
} |
|
|
119 |
}); |
|
|
120 |
*/ |
|
|
121 |
//$("div.header p.dossier-button").bind("click",function(){alert('tutu';}); |
|
|
122 |
$("div.header p.dossier-button, div.header div.dossier-documentaire").hover( |
|
|
123 |
function(){ |
|
|
124 |
$("div.dossier-documentaire").stop().slideDown(); |
|
|
125 |
}, |
|
|
126 |
function(){ |
|
|
127 |
$("div.dossier-documentaire").stop().slideUp(); |
|
|
128 |
} |
|
|
129 |
); |
|
|
130 |
|
|
|
131 |
//ARTICLES |
|
|
132 |
$(".article-visuel-wrap").each(function(){ |
|
|
133 |
var contentHeight = $(this).parents(".article-content").height(); |
|
|
134 |
//$(this).height(contentHeight); |
|
|
135 |
}); |
|
|
136 |
//FRISE |
|
|
137 |
//valeurs init du slider à définir |
|
|
138 |
var valSlider1 = 75; |
|
|
139 |
var valSlider2 = 300; |
|
|
140 |
var diffSlide = valSlider2-valSlider1; |
|
|
141 |
var widthFrise = $('.frise').width(); |
|
|
142 |
|
|
|
143 |
$( "#slider-range" ).dragslider({ |
|
|
144 |
range: true, |
|
|
145 |
rangeDrag: true, |
|
|
146 |
min: 0, |
|
|
147 |
max: widthFrise, |
|
|
148 |
values: [ valSlider1, valSlider2 ], |
|
|
149 |
slide: function( event, ui ) { |
|
|
150 |
if (window.streamgraph) { |
|
|
151 |
streamgraph.slidevalues(ui.values[0], ui.values[1]); |
|
|
152 |
} |
|
|
153 |
}, |
|
|
154 |
change: function( event, ui ){ |
|
|
155 |
//ici on récup les valeurs après un slide |
|
|
156 |
var value1 = ui.values[ 0 ]; |
|
|
157 |
var value2 = ui.values[ 1 ]; |
|
|
158 |
} |
|
|
159 |
}); |
|
|
160 |
|
|
|
161 |
|
|
|
162 |
|
|
|
163 |
});//jQuery |