PageSourceSearch

https://reseau-cen.org/wp-content/themes/fcen/assets/js/theme.js?ver=1.0

js reseau-cen.org collected 2026-10-02 14:47:44 UTC 8,522 bytes, 196 lines download raw bytes

1jQuery(function ($) {
2    // custom scrollbar - liste agenda home
3    if ($('body').hasClass('home')) {
4        new SimpleBar($('.home .liste-agenda')[0],
5            {
6                autoHide: false
7            });
8    }
9
10    // toggle du menu mobile
11    $('.container-menu-trigger').click(function () {
12        $('body').toggleClass('menu-outside-open');
13        $('.menu-fullscreen').toggleClass('visible');
14        $('.container-menu-trigger').toggleClass('clicked');
15    });
16    $('<span class="submenu-btn icon-chevron-bas"></span>').appendTo('#menu-principal-1 .menu-item-has-children');
17    $('.submenu-btn').on('click', function () {
18        if (!$(this).parent().find('.sub-menu').is(':animated')) {
19            $(this).toggleClass('active');
20            $(this).siblings('.sub-menu').slideToggle();
21            $(this).parent().toggleClass('active');
22        }
23    });
24    $('.menu-outside .menu > li.menu-item-has-children > a').on('click', function (e) {
25        e.preventDefault();
26        $(this).siblings('span').trigger('click');
27    });
28    // fin
29    $('.post-type-archive-annuaire .liste-annuaire-conservatoires li.type-annuaire').on('click', function (event) {
30        event.preventDefault();
31        window.location.href = $(this).find('a').attr('href');
32    });
33    $('.is-style-carrousel-home li.type-post').on('click', function (event) {
34        // event.preventDefault();
35        window.location.href = $(this).find('figure a').attr('href');
36    });
37    // Annuaire salarié
38    $('.annuaire_salaries li .container_image').on('click', function (e) {
39        e.preventDefault();
40        $(this).siblings('.autres_infos').slideToggle();
41        $(this).parent().toggleClass('open');
42    });
43    $('#liste_salaries').select2({
44        minimumInputLength: 3,
45        placeholder: 'Chercher un salarié',
46        language: {
47            inputTooShort: function () {
48                return "Veuillez taper au moins 3 caractères";
49            },
50            noResults: function(){
51                return "Aucun résultat";
52            }
53        }
54    });
55    $('#liste_mots_cles').select2({
56        minimumInputLength: 3,
57        placeholder: 'Chercher un mot clé',
58        language: {
59            inputTooShort: function () {
60                return "Veuillez taper au moins 3 caractères";
61            },
62            noResults: function(){
63                return "Aucun résultat";
64            }
65        }
66    });
67    $('.filter-people').on('click', function(){
68        $('#liste_mots_cles').val(null).trigger("change");
69        $('#annuaire_salaries_regions').val('');
70        $('.annuaire_salaries li').removeClass('visible');
71        var data = $('#liste_salaries').select2('data')[0];
72        $('.annuaire_salaries').find('li[data-key="' + data.id + '"]').addClass('visible');
73    });
74    $('.filter-mots-cles').on('click', function(){
75        $('#liste_salaries').val(null).trigger("change");
76        $('#annuaire_salaries_regions').val('');
77        $('.annuaire_salaries li').removeClass('visible');
78        var data = $('#liste_mots_cles').select2('data')[0];
79        $('.annuaire_salaries').find('li[data-mots~="' + data.id + '"]').addClass('visible');
80    });
81    function select_filter_region(elem) {
82        var slug_region = elem.val();
83        $('.annuaire_salaries li').each(function () {
84            $(this).removeClass('visible');
85            if (slug_region == "-1" || $(this).data('region') == slug_region) {
86                $(this).addClass('visible');
87            }
88        });
89    }
90    $('.filter-region').on('click', function(){
91        $('#liste_salaries').val(null).trigger("change");
92        $('#liste_mots_cles').val(null).trigger("change");
93        $('.annuaire_salaries li').removeClass('visible');
94        select_filter_region($('#annuaire_salaries_regions'));
95    });
96    $('.filtres_emplois select').on('change', function(){
97        let select_entite = $('.filtres_emplois .filtre_entite');
98        let select_contrat = $('.filtres_emplois .filtre_contrat');
99        console.log(select_contrat.val());
100        console.log(select_entite.val());
101        $('.is-style-boucle-emploi .wp-block-post-template li').removeClass('visible');
102        $('.is-style-boucle-emploi .wp-block-post-template').find('li[data-entite~="' + select_entite.val() + '"][data-contrat~="' + select_contrat.val() + '"]').addClass('visible');
103    });
104    $('.display_file span').on('click',function(){
105        if(!$(this).hasClass('active')){
106            $(this).addClass('active').siblings().removeClass('active');
107            $(this).parent().siblings().removeClass('active');
108            $(this).parent().siblings("." + $(this).data('role')).addClass('active');
109        }
110    });
111    $('.open-searchform').on('click', function(e){
112        e.preventDefault();
113        $(this).find('span').toggleClass('eplusicon-search1 eplusicon-cross');
114        $('.container-search-form').toggleClass('open');
115        $('body').toggleClass('search-opened');
116    });
117    $('.is-style-boucle-emploi li').on('click', function () {
118        let url = $(this).find('.url-pdf-emploi .value').html();
119        window.open(url, '_blank').focus();
120    });
121    $('.is-style-recherche li').on('click', function () {
122        let url = $(this).find('a').attr('href');
123        window.location.href = url;
124    });
125    if (window.location.pathname.startsWith('/actualites/') || window.location.pathname.startsWith('/tag/')) {
126        let array_pathname = window.location.pathname.split('/');
127        if(array_pathname.length == 5){
128            let url_to_check = window.location.href.split('/');
129            url_to_check.splice(-2, 1);
130            url_to_check = url_to_check.join('/');
131            $('.wp-block-categories li').each(function(){
132                ($(this).find('a').attr('href') == url_to_check) ? $(this).addClass('current-cat') : '' ;
133            });
134        }
135        if (!$('.wp-block-categories li').hasClass('current-cat')) {
136            $('.tous-les-articles').addClass('current-cat');
137        }
138        else {
139            $('h1').html($('.wp-block-categories li.current-cat a').html());
140        }
141        if (array_pathname.length == 5 && array_pathname[3] != "-1") {
142            $('#list_post_tag').val(array_pathname[3]);
143        }
144        else if (array_pathname.length == 4 && array_pathname[2] != "-1" && array_pathname[1] == "tag") {
145            $('#list_post_tag').val(array_pathname[2]);
146        }
147        $('#list_post_tag').on('change', function () {
148            let url_finale = window.location.origin;
149            let array_pathname = window.location.pathname.split('/');
150            array_pathname.shift();
151            array_pathname.pop();
152            if (array_pathname.length == 3) array_pathname.pop();
153            if (array_pathname.length != 1 && array_pathname[0] == "actualites") {
154                array_pathname.forEach(element => {
155                    if (element) {
156                        url_finale += '/' + element
157                    }
158                });
159            }
160            else if (array_pathname[0] != "actualites") {
161                url_finale += '/actualites';
162            }
163            else {
164                url_finale += '/tag';
165            }
166            ($(this).val() != "-1") ? url_finale += '/' + $(this).val() : '';
167            window.location.href = url_finale;
168        });
169    }
170    function rebindMemberInfosClick() {
171        // Ton handler avec délégation, version propre
172        $(document).off('click', '.member-infos').on('click', '.member-infos', function (e) {
173            if (e.target.closest('figure > a')) {
174                e.stopPropagation();
175                return;
176            }
177
178            $(this).toggleClass('is-toggled-on');
179            $(this).siblings('.autres-infos').slideToggle();
180        });
181    }
182
183    const targetNode = document.querySelector('.post-type-archive-membres > .wp-block-query > ul');
184
185    if (targetNode) {
186        const observer = new MutationObserver((mutationsList) => {
187            for (const mutation of mutationsList) {
188                if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
189                    rebindMemberInfosClick();
190                }
191            }
192        });
193        observer.observe(targetNode, { childList: true, subtree: true });
194    }
195    rebindMemberInfosClick();
196});

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.