3 var clusterWidth=0; |
3 var clusterWidth=0; |
4 $('.cluster li').each( function(){ clusterWidth += $(this).width() + 10; }); |
4 $('.cluster li').each( function(){ clusterWidth += $(this).width() + 10; }); |
5 $('.cluster').width( clusterWidth ); |
5 $('.cluster').width( clusterWidth ); |
6 var clusterVisibleWidth = $(".cluster-visible").width(); |
6 var clusterVisibleWidth = $(".cluster-visible").width(); |
7 var clusterVisibleLeft = 20; |
7 var clusterVisibleLeft = 20; |
|
8 $(".arrow-left").addClass('bute'); |
8 if (clusterWidth>clusterVisibleWidth) { |
9 if (clusterWidth>clusterVisibleWidth) { |
9 $(".cluster-containment").css({ |
10 $(".cluster-containment").css({ |
10 "left": -(clusterWidth-clusterVisibleWidth), |
11 "left": -(clusterWidth-clusterVisibleWidth), |
11 "width":clusterWidth+(clusterWidth-clusterVisibleWidth+clusterVisibleLeft) |
12 "width":clusterWidth+(clusterWidth-clusterVisibleWidth+clusterVisibleLeft) |
12 }); |
13 }); |
13 $(".cluster-visible").css({"left": (clusterWidth-912+clusterVisibleLeft)}); |
14 $(".cluster-visible").css({"left": (clusterWidth-912+clusterVisibleLeft)}); |
|
15 |
14 $("a.cluster-arrow").bind("click",function(e){ |
16 $("a.cluster-arrow").bind("click",function(e){ |
15 |
|
16 e.preventDefault(); |
17 e.preventDefault(); |
|
18 $(".cluster").stop(); |
|
19 moveCluster(this, 5); |
|
20 }); |
|
21 |
|
22 |
|
23 $("a.cluster-arrow").hover( |
|
24 function(){ |
|
25 moveCluster(this, 20); |
|
26 }, |
|
27 function(){ |
|
28 $(".cluster").stop(); |
|
29 } |
|
30 ); |
|
31 |
|
32 function moveCluster(arrow, speed){ |
17 var clusterContainmentLeft = parseInt($(".cluster-containment").css("left")); |
33 var clusterContainmentLeft = parseInt($(".cluster-containment").css("left")); |
18 var clusterContainmentRight = parseInt($(".cluster-containment").css("left")) + $(".cluster-containment").width(); |
34 var clusterContainmentRight = parseInt($(".cluster-containment").css("left")) + $(".cluster-containment").width(); |
19 var clusterLeft = parseInt($(".cluster").css("left")); |
35 var clusterLeft = parseInt($(".cluster").css("left")); |
20 var clusterRight = parseInt($(".cluster").css("left"))+$(".cluster").width(); |
36 var clusterRight = parseInt($(".cluster").css("left"))+$(".cluster").width(); |
21 if ($(this).hasClass("arrow-right")) { |
37 |
22 if (clusterLeft-40>clusterContainmentLeft) { |
38 if ($(arrow).hasClass("arrow-right")) { |
23 $(".cluster").css({ |
39 $(".arrow-left").removeClass('bute'); |
24 "left":"-="+40 |
40 vitesse = (clusterLeft-clusterContainmentLeft)*speed; |
25 }); |
41 $(".cluster").animate({ |
26 }else{ |
42 "left":clusterContainmentLeft |
27 $(".cluster").css({ |
43 },vitesse,'linear',function(){ |
28 "left":clusterContainmentLeft |
44 $(arrow).addClass('bute'); |
29 }); |
45 }); |
30 } |
46 }else{ |
31 |
47 $(".arrow-right").removeClass('bute'); |
32 }else if($(this).hasClass("arrow-left")){ |
48 vitesse = (clusterContainmentRight-clusterRight)*speed; |
33 |
49 $(".cluster").animate({ |
34 if (clusterRight+40<clusterContainmentRight) { |
50 "left":0 |
35 $(".cluster").css({ |
51 },vitesse,'linear',function(){ |
36 "left":"+="+40 |
52 $(arrow).addClass('bute'); |
37 }); |
53 }); |
38 }else{ |
|
39 $(".cluster").css({ |
|
40 "left":0 |
|
41 }); |
|
42 } |
|
43 } |
54 } |
44 }); |
55 } |
45 |
56 |
46 //DRAGGABLE |
57 //DRAGGABLE |
47 $(".cluster").draggable({ axis: "x",containment: ".cluster-containment" }); |
58 $(".cluster").draggable({ axis: "x",containment: ".cluster-containment" }); |
48 }; |
59 }; |
49 //WIDGET |
60 //WIDGET |
50 //HEIGHT |
61 //HEIGHT |
51 var contentRightHeight = $(".content-right").height(); |
62 function resizeWidgetSidebar(){ |
52 var contentLeftHeight = $(".content-left").height(); |
63 var contentRightHeight = $(".content-right").height(); |
53 if(contentRightHeight>contentLeftHeight){ |
64 var contentLeftHeight = $(".content-left").height(); |
54 $(".content-left .widget-wrap").css({ |
65 if(contentRightHeight>contentLeftHeight){ |
55 "height":"+="+(contentRightHeight-contentLeftHeight) |
66 $(".content-left .widget-wrap").css({ |
56 }); |
67 "height":"+="+(contentRightHeight-contentLeftHeight) |
|
68 }); |
|
69 } |
57 } |
70 } |
|
71 resizeWidgetSidebar(); |
|
72 |
58 //VOLET |
73 //VOLET |
59 //Tout fermer par défaut |
74 //Tout fermer par défaut |
60 //$("div.content-left div.widget-wrap div.widget div.widget-inner").hide().removeClass("open"); |
75 //$("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"); |
76 //$("div.dossier-similaire div.widget div.widget-inner").hide().removeClass("open"); |
62 |
77 |
76 $('.widget.affichage li a').bind('click',function(e){ |
91 $('.widget.affichage li a').bind('click',function(e){ |
77 e.preventDefault(); |
92 e.preventDefault(); |
78 if ($(this).hasClass("treemap") && !$(this).hasClass("active")) { |
93 if ($(this).hasClass("treemap") && !$(this).hasClass("active")) { |
79 $('.widget.affichage li a.liste').removeClass("active"); |
94 $('.widget.affichage li a.liste').removeClass("active"); |
80 $(this).addClass('active'); |
95 $(this).addClass('active'); |
|
96 $('#liste').hide();$('#treemap').show(); |
81 }else if($(this).hasClass("liste") && !$(this).hasClass("active")){ |
97 }else if($(this).hasClass("liste") && !$(this).hasClass("active")){ |
82 $('.widget.affichage li a.treemap').removeClass("active"); |
98 $('.widget.affichage li a.treemap').removeClass("active"); |
83 $(this).addClass('active'); |
99 $(this).addClass('active'); |
84 } |
100 $('#liste').show();$('#treemap').hide(); |
|
101 } |
|
102 resizeWidgetSidebar(); |
85 }); |
103 }); |
86 //DATE PICKER |
104 //DATE PICKER |
87 $(".dateBegin").datepicker({ |
105 $(".dateBegin").datepicker({ |
88 onSelect: function( selectedDate ) { |
106 onSelect: function( selectedDate ) { |
89 $( ".dateEnd" ).datepicker( "option", "minDate", selectedDate ); |
107 $( ".dateEnd" ).datepicker( "option", "minDate", selectedDate ); |
119 //ARTICLES |
137 //ARTICLES |
120 $(".article-visuel-wrap").each(function(){ |
138 $(".article-visuel-wrap").each(function(){ |
121 var contentHeight = $(this).parents(".article-content").height(); |
139 var contentHeight = $(this).parents(".article-content").height(); |
122 //$(this).height(contentHeight); |
140 //$(this).height(contentHeight); |
123 }); |
141 }); |
|
142 $(".article-annotations a").hover( |
|
143 function(){ |
|
144 var x = $(this).offset().left + $(this).width()/2; |
|
145 var y = $(this).offset().top; |
|
146 var text = $(this).attr('title'); |
|
147 showTooltip(x,y,text); |
|
148 }, |
|
149 function(){ |
|
150 var tip = $(".tooltip"); |
|
151 tip.hide(); |
|
152 } |
|
153 ); |
124 //FRISE |
154 //FRISE |
125 //valeurs init du slider à définir |
155 //valeurs init du slider à définir |
126 var valSlider1 = 75; |
156 var valSlider1 = 75; |
127 var valSlider2 = 300; |
157 var valSlider2 = 300; |
128 var diffSlide = valSlider2-valSlider1; |
158 var diffSlide = valSlider2-valSlider1; |