PageSourceSearch

https://gim-idf.fr/wp-content/themes/gim-idf/js/custom.js?ver=1715087773

js gim-idf.fr collected 2026-10-04 20:22:32 UTC 24,636 bytes, 728 lines download raw bytes

1(function ($) {
2    //Fixed Header
3
4
5    $(document).ready(function () {
6
7
8        $(window).on('scroll', function (e) {
9            var scroll = $(window).scrollTop();
10            if (scroll) {
11                // Get the 6-digit number from the span
12                var sixDigitNumber = $('#numberSpan').text().trim();
13
14                // Check if the number has exactly six digits
15                if (sixDigitNumber.length === 6) {
16                    // Insert a space between each pair of numbers
17                    var modifiedNumber = sixDigitNumber.replace(/(\d{3})(\d{3})/, '$1 $2');
18
19                    // Update the content of the span with the modified number
20                    $('#numberSpan').text(modifiedNumber);
21                }
22            }
23        });
24
25        onloadajaxrequest();
26
27        $('.navbar-toggler').click(function () {
28            $('.collapse.navbar-collapse').slideToggle(500);
29            $(this).toggleClass('menu-active');
30            $('.menu').toggleClass('menu-active');
31
32        });
33
34
35
36        // new dtae
37        if($('#datepicker').length > 0) {
38            $("#datepicker").datepicker({
39                dateFormat: 'dd-mm-yy',
40                dayNamesMin: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
41                monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
42                monthNamesShort: ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun', 'Jul', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc'],
43                onChangeMonthYear: function (year, month, inst) {
44                    onloadajaxrequest(); // Function to fetch event dates
45                },
46                beforeShowDay: function (date) {
47                    var mm = ('0' + (date.getMonth() + 1)).slice(-2); // convert month to 2 digits
48                    var dd = ('0' + date.getDate()).slice(-2); // convert date to 2 digits
49                    var yyyy = date.getFullYear();
50                    var dateClass = "date-" + yyyy + "-" + mm + "-" + dd;
51    
52                    return [true, dateClass];
53                },
54                onSelect: function (dateText, inst) {
55                    performAjaxRequest(dateText);
56                    onloadajaxrequest();
57                    // var selectedDate = $(this).find('.ui-datepicker-current-day');
58                    // var tdClass = selectedDate.attr('class');
59                    // var extractedClass = extractClass(tdClass, "date-");
60                    // console.log(tdClass);
61                    // $('.date-2023-12-15 a').addClass('ui-state-selected');
62                    // $(this).find('.date-2023-12-15').addClass('adrien');
63                    // console.log(dateText);
64                }
65            });
66        }
67
68        function onloadajaxrequest() {
69            $.ajax({
70                url: ajax_url, // This URL is localized in the previous step
71                type: 'GET',
72                data: {
73                    action: 'filter_test',
74                    // Add any additional parameters you may need
75                },
76                dataType: 'JSON',
77                success: function (response) {
78                    // console.log(response);  
79                    var arrayLength = response.data.length;
80                    // console.log(arrayLength);
81                    for (i = 0; i < arrayLength; i++) {
82                        var date = response.data[i];
83                        var parts = date.split('/');
84                        var formattedDate = parts[2] + '-' + parts[1] + '-' + parts[0];
85
86                        var customClass = "date-" + formattedDate;
87                        var $element = $('.' + customClass + ' a');
88
89                        if ($element.length > 0) {
90                            $element.addClass('ui-state-active');
91                        } else {
92                            console.log('no element found');
93                        }
94
95                        // console.log('onloadajaxrequest');
96                    }
97
98
99                },
100                error: function (error) {
101                    console.error('Error:', error);
102                }
103            });
104        }
105
106
107
108        function performAjaxRequest(dateText) {
109            var selected = dateText;
110            $.ajax({
111                url: ajax_url, // This URL is localized in the previous step
112                type: 'GET',
113                data: {
114                    action: 'selectedEvent',
115                    selected: selected,
116                    // Add any additional parameters you may need
117                },
118                dataType: 'JSON',
119                beforeSend: function () {
120                    $.blockUI({ message: '<i class="fa-duotone fa-loader fa-spin" style="--fa-primary-color: #000000; --fa-secondary-color: #000000;"></i>' });
121                },
122                success: function (response) {
123                    // console.log('performAjaxRequest');
124                    // console.log(response);
125
126                    $('#test-block').css("display", "block");
127                    $('#test-block').html(response.data);
128
129                    $('.close-icon').click(function () {
130                        $('#test-block').css("display", "none");
131                    });
132
133                    $.unblockUI();
134                },
135                error: function (error) {
136                    console.error('Error:', error);
137                }
138            });
139        }
140
141
142        $("#datepicker").on("change", function () {
143            var selected = $(this).val();
144            console.log(selected);
145
146            $.ajax({
147                url: ajax_url, // This URL is localized in the previous step
148                type: 'GET',
149                data: {
150                    action: 'filter_test',
151                    selected: selected,
152                    // Add any additional parameters you may need
153                },
154                dataType: 'JSON',
155                success: function (response) {
156                    // console.log(response);
157                    $('#test-block').html(response.data);
158
159                },
160                error: function (error) {
161                    console.error('Error:', error);
162                }
163            });
164        });
165
166
167        $('.accordion-title').click(function (j) {
168
169            var dropDown = $(this).closest('.accordion-inner').find('.accordion-content');
170            $(this).closest('.accordion-custom-wrapper').find('.accordion-content').not(dropDown).slideUp();
171
172            if ($(this).hasClass('active')) {
173                $(this).removeClass('active');
174                $(this).closest('.accordion-custom-wrapper').find('.accordion-inner.active').removeClass('active');
175
176            } else {
177                $(this).closest('.accordion-custom-wrapper').find('.accordion-title.active').removeClass('active');
178                $(this).closest('.accordion-custom-wrapper').find('.accordion-inner.active').removeClass('active');
179                $(this).closest('.accordion-inner').addClass('active');
180                $(this).addClass('active');
181            }
182
183            dropDown.stop(false, true).slideToggle();
184            j.preventDefault();
185        });
186
187        //Counter
188        var section = $('.counter-content-holder');
189        var hasEntered = false;
190
191        $(window).on('scroll', function (e) {
192
193            var shouldAnimate = false;
194
195            if (section.offset() != null) {
196                shouldAnimate = ($(window).scrollTop() + $(window).innerHeight()) >= section.offset().top;
197            }
198
199            if (shouldAnimate && !hasEntered) {
200                hasEntered = true;
201
202                $('.counter-value').each(function () {
203                    $(this).prop('Counter', 0).animate({
204                        Counter: $(this).data('count')
205                    }, {
206                        duration: 2500,
207                        easing: 'swing',
208                        step: function (now) {
209                            $(this).text(Math.ceil(now));
210                        }
211
212                    });
213                });
214
215
216            }
217
218            // Get the 6-digit number from the span
219
220        });
221
222        // fancy box to open video modal on button click
223        $('.responsibility-button-1 a').on('click', function (e) {
224            $("#button-1-video-content.video-container-1 .video-container").css("display", "block");
225            e.preventDefault();
226            $.fancybox.open({
227                src: '#button-1-video-content.video-container-1 .video-container',
228                type: 'inline',
229                opts: {
230                    iframe: {
231                        css: {
232                            width: '100%',
233                            height: '100%'
234                        }
235                    }
236                }
237            });
238        });
239
240        /*Click events*/
241
242        // $('i.fa-light.fa-circle-xmark').on('click', function () {
243        //         $('.events-wrapper-outer').css("display", "none");
244        // });
245
246
247        $('.responsibility-button-2 a').on('click', function (e) {
248            $("#button-2-video-content.video-container-2 .video-container").css("display", "block");
249            e.preventDefault();
250            $.fancybox.open({
251                src: '#button-2-video-content.video-container-2 .video-container',
252                type: 'inline',
253                opts: {
254                    iframe: {
255                        css: {
256                            width: '100%',
257                            height: '100%'
258                        }
259                    }
260                }
261            });
262        });
263
264
265        $('.company-brands-tabs.26').addClass("active");
266        $(".company-brands-tabs-for-26").addClass("active");
267
268        $('.company-brands-tabs').click(function () {
269            var data_id = $(this).data("id");
270
271            $('.company-brands-tabs').removeClass('active');
272            $(this).addClass("active");
273            $(".company-brands-tabs-for-" + data_id).addClass("active");
274            $(".company-brands-tabs-for-" + data_id).siblings().removeClass("active");
275
276
277        });
278
279
280        /*Essonne*/
281
282        $("path.st5").hover(
283            // Function for mouseenter
284            function () {
285                $("#Essonne_00000115478042483854191860000002145099574843133577_").removeClass('inactive-yes');
286            },
287            function () {
288                $("#Essonne_00000115478042483854191860000002145099574843133577_").addClass('inactive-yes');
289            }
290        );
291
292        $("circle.st10").hover(
293            function () {
294                $("#Essonne_00000115478042483854191860000002145099574843133577_").removeClass('inactive-yes');
295            },
296            function () {
297                $("#Essonne_00000115478042483854191860000002145099574843133577_").addClass('inactive-yes');
298            }
299        );
300
301
302        $("path.st2").hover(
303            function () {
304                $("g#Sein-et-Marne").removeClass('inactive-yes');
305            },
306            function () {
307                $("g#Sein-et-Marne").addClass('inactive-yes');
308            }
309        );
310        /*Yveslines*/
311
312        $("path.st3").hover(
313            // Function for mouseenter
314            function () {
315                $("#Yvelines_00000065765402179391735320000001379711963964223679_").removeClass('inactive-yes');
316            },
317            function () {
318                $("#Yvelines_00000065765402179391735320000001379711963964223679_").addClass('inactive-yes');
319            }
320        );
321
322        /*Yveslines*/
323
324        $("path.st6").hover(
325            // Function for mouseenter
326            function () {
327                $("g#Val-de-Marne_00000148661736324468043440000003985483597391926939_").removeClass('inactive-yes');
328            },
329            function () {
330                $("g#Val-de-Marne_00000148661736324468043440000003985483597391926939_").addClass('inactive-yes');
331            }
332        );
333        /*
334        $("g#Val-d_x27_Oise").hover(
335            // Function for mouseenter
336            function () {
337                $("#Val-d_x27_Oise").removeClass('inactive-yes');
338            },
339            function () {
340                $("#Val-d_x27_Oise").addClass('inactive-yes');
341            }
342        );
343*/
344        /*SEINE ET MARNE*/
345
346        $("path.st2").hover(
347            // Function for mouseenter
348            function () {
349                $("g#Val-de-Marne_00000110446955988252180280000005665765662544988034_").removeClass('inactive-yes');
350            },
351            function () {
352                $("g#Val-de-Marne_00000110446955988252180280000005665765662544988034_").addClass('inactive-yes');
353            }
354        );
355
356        /*Val De Marne'*/
357
358        $("path.st4").hover(
359            // Function for mouseenter
360            function () {
361                $('g#Val-d_x27_Oise').removeClass('inactive-yes');
362            },
363            function () {
364                $('g#Val-d_x27_Oise').addClass('inactive-yes');
365            }
366        );
367
368        /*PARIS*/
369
370        $("path.st9").hover(
371            // Function for mouseenter
372            function () {
373
374                $('#Paris_00000158001768602623302410000016532787505065764286_').removeClass("inactive-yes");
375
376            },
377            function () {
378                $('#Paris_00000158001768602623302410000016532787505065764286_').addClass("inactive-yes");
379            }
380        );
381
382        /*HAUTS*/
383
384        $("path.st8").hover(
385            // Function for mouseenter
386            function () {
387                $('#Hauts-de-Seine_00000155852581829347408890000007165376509193306776_').removeClass("inactive-yes");
388
389            },
390            function () {
391                $('#Hauts-de-Seine_00000155852581829347408890000007165376509193306776_').addClass("inactive-yes");
392            }
393        );
394
395        /*SEINE -SAINT -DENIS*/
396
397        $("path.st7").hover(
398            // Function for mouseenter
399            function () {
400                $('#Seine-Saint-Denis_00000001662017308719169180000001470419197828507839_').removeClass("inactive-yes");
401
402            },
403            function () {
404                $('#Seine-Saint-Denis_00000001662017308719169180000001470419197828507839_').addClass("inactive-yes");
405            }
406        );
407
408/*Second map GIM*/
409
410        $("path#AFORP_Vaux-le-Pénil").hover(
411            function () {
412                $('#AFORP_Vaux-le-Pénil_00000089532367290859497580000002423179873832061102_').removeClass("inactive-yes");
413
414            },
415            function () {
416                $('#AFORP_Vaux-le-Pénil_00000089532367290859497580000002423179873832061102_').addClass("inactive-yes");
417            }
418        );
419
420        $("path#vaux").hover(
421            function () {
422                $('#AFORP_Vaux-le-Pénil_00000089532367290859497580000002423179873832061102_').removeClass("inactive-yes");
423
424            },
425            function () {
426                $('#AFORP_Vaux-le-Pénil_00000089532367290859497580000002423179873832061102_').addClass("inactive-yes");
427            }
428        );
429
430        //text
431
432
433        $("path#tremblay").hover(
434            function () {
435                $('g#AFORP_Vaux-le-Pénil_00000089532367290859497580000002423179873832061102_').removeClass("inactive-yes");
436
437            },
438            function () {
439                $('g#AFORP_Vaux-le-Pénil_00000089532367290859497580000002423179873832061102_').addClass("inactive-yes");
440            }
441        );
442
443        // selector
444
445        $("path#tremblay-point").hover(
446            function () {
447                $('g#AFORP_Vaux-le-Pénil_00000089532367290859497580000002423179873832061102_').removeClass("inactive-yes");
448
449            },
450            function () {
451                $('g#AFORP_Vaux-le-Pénil_00000089532367290859497580000002423179873832061102_').addClass("inactive-yes");
452            }
453        );
454
455
456        /*puto*/
457
458        $("path#Mecavenir_Puteaux_00000155115072732414168440000005482787930730473117_").hover(
459            function () {
460                $('g#Mecavenir_Puteaux_00000065072865453975796720000007146273652754222249_').removeClass("inactive-yes");
461
462            },
463            function () {
464                $('g#Mecavenir_Puteaux_00000065072865453975796720000007146273652754222249_').addClass("inactive-yes");
465            }
466        );
467
468        $("path#puteaux").hover(
469            function () {
470                $('g#Mecavenir_Puteaux_00000065072865453975796720000007146273652754222249_').removeClass("inactive-yes");
471
472            },
473            function () {
474                $('g#Mecavenir_Puteaux_00000065072865453975796720000007146273652754222249_').addClass("inactive-yes");
475            }
476        );
477
478        /*mante*/
479        $("path#Mecavenir_Mantes").hover(
480            function () {
481                $('g#Mecavenir_Mantes_00000170279782508496355320000006944091737057827737_').removeClass("inactive-yes");
482
483            },
484            function () {
485                $('g#Mecavenir_Mantes_00000170279782508496355320000006944091737057827737_').addClass("inactive-yes");
486            }
487        );
488
489        $("path#mecavenir").hover(
490            function () {
491                $('g#Mecavenir_Mantes_00000170279782508496355320000006944091737057827737_').removeClass("inactive-yes");
492
493            },
494            function () {
495                $('g#Mecavenir_Mantes_00000170279782508496355320000006944091737057827737_').addClass("inactive-yes");
496            }
497        );
498
499
500        //sceuax
501
502        $("path#CEFIPA_Sceaux_00000023964498125751299340000011238193300184926849_").hover(
503            function () {
504                $('g#CEFIPA_Sceaux').removeClass("inactive-yes");
505
506            },
507            function () {
508                $('g#CEFIPA_Sceaux').addClass("inactive-yes");
509            }
510        );
511
512        $("path#sceaux").hover(
513            function () {
514                $('g#CEFIPA_Sceaux').removeClass("inactive-yes");
515
516            },
517            function () {
518                $('g#CEFIPA_Sceaux').addClass("inactive-yes");
519            }
520        );
521
522        // nanterre
523        $("path#CEFIPA_Nanterre_00000161609838474969703640000001421107347484476289_").hover(
524            function () {
525                $('g#CEFIPA_Nanterre').removeClass("inactive-yes");
526
527            },
528            function () {
529                $('g#CEFIPA_Nanterre').addClass("inactive-yes");
530            }
531        );
532        $("path#nanterre").hover(
533            function () {
534                $('g#CEFIPA_Nanterre').removeClass("inactive-yes");
535
536            },
537            function () {
538                $('g#CEFIPA_Nanterre').addClass("inactive-yes");
539            }
540        );
541
542        // mantes-aforp
543
544        $("path#Groupe_AFORP_Mantes_00000146499118544230087700000010511602049345956228_").hover(
545            function () {
546                $('g#Groupe_AFORP_Mantes_00000033362311926883286520000013826829715718506669_').removeClass("inactive-yes");
547
548            },
549            function () {
550                $('g#Groupe_AFORP_Mantes_00000033362311926883286520000013826829715718506669_').addClass("inactive-yes");
551            }
552        );
553        // texte mantes aforp
554        $("path#mantes").hover(
555            function () {
556                $('g#Groupe_AFORP_Mantes_00000033362311926883286520000013826829715718506669_').removeClass("inactive-yes");
557
558            },
559            function () {
560                $('g#Groupe_AFORP_Mantes_00000033362311926883286520000013826829715718506669_').addClass("inactive-yes");
561            }
562        );
563
564
565
566
567
568        $("path#Groupe_AFORP_Issy-les-Moulineaux_00000133529907237711702050000009582097864648881594_").hover(
569            function () {
570                $('g#Groupe_AFORP_Issy-les-Moulineaux').removeClass("inactive-yes");
571
572            },
573            function () {
574                $('g#Groupe_AFORP_Issy-les-Moulineaux').addClass("inactive-yes");
575            }
576        );
577
578
579        $("path#Groupe_AFORP_Issy-les-Moulineaux_00000133529907237711702050000009582097864648881594_").hover(
580            function () {
581                $('g#Groupe_AFORP_Issy-les-Moulineaux').removeClass("inactive-yes");
582
583            },
584            function () {
585                $('g#Groupe_AFORP_Issy-les-Moulineaux').addClass("inactive-yes");
586            }
587        );
588
589        $("path#issy").hover(
590            function () {
591                $('g#Groupe_AFORP_Issy-les-Moulineaux').removeClass("inactive-yes");
592
593            },
594            function () {
595                $('g#Groupe_AFORP_Issy-les-Moulineaux').addClass("inactive-yes");
596            }
597        );
598
599        //emerainville 
600        $("path#AFORP_Emerainville").hover(
601            function () {
602                $('g#AFORP_Emerainville_00000092435157504799137290000003513804643888702393_').removeClass("inactive-yes");
603
604            },
605            function () {
606                $('g#AFORP_Emerainville_00000092435157504799137290000003513804643888702393_').addClass("inactive-yes");
607            }
608        );
609        $("path#rainville").hover(
610            function () {
611                $('g#AFORP_Emerainville_00000092435157504799137290000003513804643888702393_').removeClass("inactive-yes");
612
613            },
614            function () {
615                $('g#AFORP_Emerainville_00000092435157504799137290000003513804643888702393_').addClass("inactive-yes");
616            }
617        );
618
619        // stdenis
620
621        $("path#CEFIPA_St_Denis_00000106848815009223606410000001162863286137231509_").hover(
622            function () {
623                $('g#CEFIPA_St_Denis').removeClass("inactive-yes");
624
625            },
626            function () {
627                $('g#CEFIPA_St_Denis').addClass("inactive-yes");
628            }
629        );
630
631        $("path#denis").hover(
632            function () {
633                $('g#CEFIPA_St_Denis').removeClass("inactive-yes");
634
635            },
636            function () {
637                $('g#CEFIPA_St_Denis').addClass("inactive-yes");
638            }
639        );
640
641        // aforp tremblay
642
643        $("path#Groupe_AFORP_Tremblay-en-France").hover(
644            function () {
645                $('g#Groupe_AFORP_Tremblay-en-France_00000173868027117757897850000006823189924604360093_').removeClass("inactive-yes");
646
647            },
648            function () {
649                $('g#Groupe_AFORP_Tremblay-en-France_00000173868027117757897850000006823189924604360093_').addClass("inactive-yes");
650            }
651        );
652
653
654
655
656
657
658
659
660
661
662
663        $('#first-seine-amp').on('hover', function (e) {
664            $('#first-seine').css('stroke', '#e2001a');
665        });
666
667        //qui sommes nous page - change title GIM text color to red
668        var textNodes = $(".gim-heading-groupe h2").contents();
669
670        textNodes.each(function () {
671            if (this.nodeType === 3) {
672                // If it's a text node, replace 'GIM' with a span
673                var modifiedText = this.nodeValue.replace(/(GIM)/g, '<span style="color: red;">$1</span>');
674                $(this).replaceWith(modifiedText);
675            }
676        });
677
678
679        if (window.matchMedia("(min-width: 320px) and (max-width: 767px)").matches) {
680            // Homepage
681            $('.rejoindre-lindustrie-icons-container').slick({
682                slidesToShow: 1,
683                slidesToScroll: 1,
684                arrows: false,
685                dots: true,
686            });
687
688            // Footer
689            $('.et-aussi-icons, .logo-section .secondary-logo').wrapAll('<div class="et-aussi-icons-mobile"></div>');
690
691
692            // Convention collective de la métallurgie
693            $('.les-textes-nationaux-inner-row .tele-icon').wrapAll('<div class="les-textes-nationaux-icon-wrapper"></div>');
694
695            $('.les-textes-nationaux-icon-wrapper').slick({
696                slidesToShow: 1,
697                slidesToScroll: 1,
698                arrows: false,
699                dots: true,
700                adaptiveHeight: true,
701            });
702
703
704            //qui sommes nous swap div
705
706            $(".engine-img-right").appendTo(".emgine-inner-row");
707
708        }
709
710        $('.dropdown-menu li a').click(function(e) {
711            e.preventDefault();
712            var dataTitle      =    $(this).attr('title'); // retrieve title from a tag
713            var titleLower     =    dataTitle.toLowerCase(); // convert to lowercase
714            var titleNoSpace   =    titleLower.replace(/ /g, '-'); // replace space to -
715            var newTitle       =    titleNoSpace.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); // Remove french accent
716
717            console.log(newTitle);
718
719            // scoll to title id section
720            $('html,body').animate({
721                scrollTop: $('#' +newTitle).offset().top - 220},
722                'slow');
723        });
724
725    });
726
727})(jQuery);
728

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.