PageSourceSearch

https://devay.fr/tpl/2/js/main.js

js devay.fr collected 2026-10-03 02:46:25 UTC 9,588 bytes, 312 lines download raw bytes

1$(document).ready(function(){
2
3  // Homepage - survey
4  // The form appears when user click on the "participate" button
5//   $(".btn-participate").click(function(){
6//       $(".form-container").toggleClass("show");
7//       $(".counter-container").toggleClass("hide");
8//   });
9
10  // Internal pages
11  // Display the options according to the select selected
12  // User has to choose between category or type
13  $( "#main-select" ).change(function(){
14    $(".search-option").removeClass("show");
15    var option = $( "#main-select" ).val();
16
17    if (option === "categorie"){
18      $("#search-category").addClass("show");
19    }
20
21    if (option === "type"){
22      $("#search-type").addClass("show");
23    }
24  });
25
26    $(".dropdown").on("shown.bs.dropdown", function(){
27        var $this = $(this);
28        var submenu = $this.find('.dropdown-menu');
29
30        var posTop = $this.offset().top - $(window).scrollTop();
31        var posBottom = posTop + submenu.outerHeight();
32
33        if (posBottom > window.innerHeight)
34            submenu.css('top', (window.innerHeight - posBottom - 10) + 'px');
35        else
36            submenu.css('top', 0);
37    });
38
39  // Internal page (equipement.html)
40  // Rapid access (a fixed bottom section on the internal page)
41  // Not used for now
42//   $(".rapid-access-btn").click(function(){
43//     $(this).closest(".rapid-access").toggleClass("show");
44//   });
45
46    if ($('.eventCarousel1').length) {
47        $('.eventCarousel1').slick({
48            dots: true,
49            arrows: false,
50            infinite: false,
51            slidesPerRow: 2,
52            rows: 2,
53            responsive: [
54                {
55                    breakpoint: 1024,
56                    settings: {
57                        slidesPerRow: 2,
58                        rows: 2,
59                    }
60                },
61                {
62                    breakpoint: 768,
63                    settings: {
64                        slidesToShow: 1,
65                        slidesPerRow: 1,
66                        rows: 1,
67                    }
68                },
69                {
70                    breakpoint: 480,
71                    settings: {
72                        slidesToShow: 1,
73                        slidesPerRow: 1,
74                        rows: 1,
75                    }
76                }
77            ]
78        });
79    }
80
81    if ($('.carousel-3').length) {
82        $('.carousel-3').slick({
83            dots: true,
84            arrows: false,
85            centerMode: false,
86            infinite: false,
87            slidesToShow: 3,
88            slidesToScroll: 3,
89            responsive: [
90                {
91                    breakpoint: 1024,
92                    settings: {
93                        slidesToShow: 3,
94                        slidesToScroll: 3,
95                    }
96                },
97                {
98                    breakpoint: 768,
99                    settings: {
100                        slidesToShow: 1,
101                        slidesToScroll: 1
102                    }
103                },
104                {
105                    breakpoint: 480,
106                    settings: {
107                        slidesToShow: 1,
108                        slidesToScroll: 1
109                    }
110                }
111            ]
112        });
113    }
114
115    if ($('.carousel-5').length) {
116        $('.carousel-5').slick({
117            dots: true,
118            arrows: false,
119            infinite: false,
120            slidesToShow: 4,
121            slidesToScroll: 4,
122            responsive: [
123                {
124                    breakpoint: 1024,
125                    settings: {
126                        slidesToShow: 3,
127                        slidesToScroll: 3,
128                        infinite: false,
129                        dots: true
130                    }
131                },
132                {
133                    breakpoint: 768,
134                    settings: {
135                        slidesToShow: 2,
136                        slidesToScroll: 2
137                    }
138                },
139                {
140                    breakpoint: 480,
141                    settings: {
142                        slidesToShow: 1,
143                        slidesToScroll: 1
144                    }
145                }
146            ]
147        });
148    }
149
150  $('.pictureGallery').each(function (element) {
151    let elm = $(this);
152    let carouselType = elm.data('type');
153
154    switch (carouselType) {
155        case 'simple':
156            elm.slick({
157                dots: true,
158                arrows: false,
159            });
160            break;
161        case 'multiple':
162            elm.slick({
163                infinite: true,
164                dots: true,
165                arrows: false,
166                slidesToShow: 3,
167                slidesToScroll: 3,
168                responsive: [
169                    {
170                        breakpoint: 1024,
171                        settings: {
172                            slidesToShow: 3,
173                            slidesToScroll: 3,
174                            infinite: true,
175                            dots: true,
176                            arrows: false,
177                        }
178                    },
179                    {
180                        breakpoint: 768,
181                        settings: {
182                            slidesToShow: 2,
183                            slidesToScroll: 2
184                        }
185                    },
186                    {
187                        breakpoint: 480,
188                        settings: {
189                            slidesToShow: 1,
190                            slidesToScroll: 1
191                        }
192                    }
193                ]
194            });
195            break;
196        case 'responsive':
197            elm.slick({
198                dots: true,
199                arrows: false,
200                infinite: false,
201                speed: 300,
202                slidesToShow: 4,
203                slidesToScroll: 4,
204                responsive: [
205                    {
206                        breakpoint: 1024,
207                        settings: {
208                            slidesToShow: 3,
209                            slidesToScroll: 3,
210                            infinite: true,
211                            dots: true,
212                            arrows: false,
213                        }
214                    },
215                    {
216                        breakpoint: 768,
217                        settings: {
218                            slidesToShow: 2,
219                            slidesToScroll: 2
220                        }
221                    },
222                    {
223                        breakpoint: 480,
224                        settings: {
225                            slidesToShow: 1,
226                            slidesToScroll: 1
227                        }
228                    }
229                ]
230            });
231            break;
232        case 'center':
233            elm.slick({
234                dots: true,
235                arrows: false,
236                centerMode: true,
237                centerPadding: '60px',
238                slidesToShow: 3,
239                responsive: [
240                    {
241                        breakpoint: 768,
242                        settings: {
243                            arrows: false,
244                            centerMode: true,
245                            centerPadding: '40px',
246                            slidesToShow: 3
247                        }
248                    },
249                    {
250                        breakpoint: 480,
251                        settings: {
252                            arrows: false,
253                            centerMode: true,
254                            centerPadding: '40px',
255                            slidesToShow: 1
256                        }
257                    }
258                ]
259            });
260            break;
261        case 'fade':
262            elm.slick({
263                dots: true,
264                arrows: false,
265                infinite: true,
266                speed: 500,
267                fade: true,
268                cssEase: 'linear'
269            });
270            break;
271    }
272  });
273
274});
275
276$(function () {
277    $('[data-toggle="tooltip"]').tooltip({
278        container: 'body'
279    });
280
281    $('[data-toggle="popover"]').popover({
282        container: 'body',
283        template:  '<div class="popover tooltip" role="tooltip"><div class="arrow"></div><div class="popover-body tooltip-inner"></div></div>'
284    });
285    $('*[data-type="PDF"] a, a[data-type="PDF"]').on('click', function(e) {
286        if ($('#pdfModal').length > 0) {
287            e.preventDefault();
288            $('#pdfModal').find('embed').attr('src', $(this).attr('data-href') || $(this).attr('href'));
289            $('#pdfModal').modal('show');
290        }
291    });
292})
293
294window.addEventListener('load', function () {
295    setTimeout(function() {
296        let input_for_label = document.getElementsByName("g-recaptcha-response");
297        let label = document.createElement("label");
298        if (input_for_label.length) {
299            label.setAttribute('aria-label', 'CAPTCHA Label');
300            label.setAttribute('for', input_for_label[0].getAttribute('id'));
301            input_for_label[0].insertAdjacentElement("beforebegin", label);
302        }
303
304        input_for_label = document.getElementsByName("h-captcha-response");
305        if (input_for_label.length) {
306            label = document.createElement("label");
307            label.setAttribute('aria-label', 'CAPTCHA Label');
308            label.setAttribute('for', input_for_label[0].getAttribute('id'));
309            input_for_label[0].insertAdjacentElement("beforebegin", label);
310        }
311    }, 1000)
312}
312)

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.