PageSourceSearch

https://reseaumtlnetwork.com/wp-content/themes/reseaumtlnetwork/assets/js/main.js

js reseaumtlnetwork.com collected 2026-09-25 19:20:54 UTC 19,659 bytes, 447 lines download raw bytes

1var getPopup = function () {
2    var instance = jQuery.fancybox.getInstance() || jQuery.fancybox.open({
3        src  : '',
4        type : 'html',
5        opts : { beforeLoad: () => false }
6    });
7    var slide = instance.current;
8    jQuery(instance.current.$slide).find('.fancybox-content').fadeOut(100);
9    instance.current.$slide.trigger("onReset");
10    slide.isLoading = true;
11    instance.showLoading( slide );
12    return instance;
13}
14
15/**
16 * jQuery Validation Custom methods
17 */
18jQuery.validator && jQuery.validator.setDefaults({
19    ignore: [],
20    // any other default options and/or rules
21    errorPlacement: function(error, element) {
22        error.appendTo( element.parents('.field-wrap') );
23    }
24});
25
26
27jQuery.ajaxSetup({
28    url: selectrum.ajax_url,
29    //global: false, //disables global handlers
30    type: "POST",
31    //dataType: 'json',
32    error: function(jqXHR, textStatus, errorThrown) {
33        //jQuery.fancybox.open( 'Something went wrong. Please try again later or contact the website administrator.' )
34        /*if(textStatus==="timeout") {
35            //do something on timeout
36        }*/
37    }
38});
39
40
41jQuery(document).ready( function($) {
42    var $window = $(window);
43    var $document = $(document);
44    var windowWidth = $window.width();
45    var windowHeight = $window.height();
46    var $body = $('body');
47    var $header = $('#header');
48    var $mainNav = $('#mainNav');
49    var headerHeight = $header.outerHeight();
50
51    $window.resize(function () {
52        windowWidth = $window.width();
53        windowHeight = $window.height();
54        headerHeight = $header.outerHeight();
55    });
56
57
58    /**
59     * Process Scroll event
60     */
61    var previousScrollTop = 0;
62    $window.on("load scroll", function () {
63        var scrollTop = $document.scrollTop();
64        if (scrollTop > 0) {
65            $body.addClass('scrolled');
66            $header.addClass('siteHeader--sticky');
67            $mainNav.addClass('mainNav--sticky');
68        } else {
69            $body.removeClass('scrolled');
70            $header.removeClass('siteHeader--sticky');
71            $mainNav.removeClass('mainNav--sticky');
72        }
73
74        previousScrollTop = scrollTop;
75    });
76
77
78    /**
79     * Process hash links
80     */
81    $body.on('click', 'a[href*=\\#]', function (e) {
82
83        if ( $(this).hasClass('ui-tabs-anchor') )
84            return false;
85
86        var url = $(this).attr('href');
87        var hash = url.substring(url.indexOf('#'));
88        if ($(hash).length) {
89            e.preventDefault();
90            processHash(hash);
91        }
92    });
93
94    function processHash(hash) {
95        var $element = $(hash);
96        var hashValue = hash.substr(1);
97
98        if ($element.length) {
99            var elementOffset = $element.offset().top;
100            $('html, body').animate({
101                scrollTop: elementOffset + 1 - headerHeight
102            }, 'normal');
103        }
104    }
105
106    $window.on("load", function () {
107        if (window.location.hash) {
108            processHash(window.location.hash);
109        }
110    });
111
112
113    /**
114     * Menu
115     */
116    var $menu = {
117        list: $mainNav,
118        btn: $('#btnMenu'),
119        btnClose: $('#btnMenuClose'),
120        overlay: $('#navOverlay'),
121        init: function () {
122            $menu.list.css('max-height', windowHeight);
123            $document.on('scroll', function () {
124                $menu.list.css('max-height', windowHeight);
125            });
126            $menu.btn.on('click', $menu.toggle);
127            $menu.btnClose.on('click', $menu.close);
128            $document.on('click', '.menu-item-has-children > a', function () {
129                if ( windowWidth <= 1260 ) {
130                    $(this).parents('.menu-item').toggleClass('open');
131                    $(this).next('ul').slideToggle();
132                }
133            });
134        },
135        toggle: function (e) {
136            $menu.isOpen() ? $menu.close(e) : $menu.open(e);
137        },
138        open: function (e) {
139            e.stopPropagation();
140            //$header.addClass('navOpened');
141            //$menu.btn.addClass('close');
142            $menu.list.addClass('visible');
143            $menu.overlay.addClass('visible');
144            //$body.css('overflow', 'hidden');
145        },
146        close: function (e) {
147            //$header.removeClass('navOpened');
148            //$menu.btn.removeClass('close');
149            $menu.list.removeClass('visible');
150            $menu.overlay.removeClass('visible');
151            //$body.css('overflow', '');
152        },
153        isOpen: function () {
154            return $menu.list.hasClass('visible');
155        }
156    };
157    $menu.init();
158
159
160    if ( windowWidth < 1260 ) {
161        $('#publicationCarousel').owlCarousel({
162            items: 1,
163            loop: true,
164            dots: false,
165            nav: true,
166            navText: []
167        });
168    }
169
170
171    //Stats animation
172    var statsHandler = function () {
173        $('.statsSection__itemNumber').each(function (index, element) {
174            var $element = $(element);
175
176            if ( $element.offset().top < ( $document.scrollTop() + windowHeight*.7 ) )
177
178                var number = parseInt($element.data('number'));
179            $element.text(0);
180            $element.prop('Counter', 0).animate({
181                Counter: number
182            }, {
183                duration: 1000,
184                easing: "swing",
185                step: function(now) {
186                    $element.text(parseInt(now).toLocaleString('fr')+'+');
187                }
188            });
189        });
190    }
191    statsHandler();
192    $window.on("scroll", statsHandler);
193
194
195    /**
196     * News
197     */
198    /*
199    $document.on('submit', '.filtersSection__form', function (e) {
200        e.preventDefault();
201        getPopup();
202        $.post({
203            url: location.href,
204            data: $(this).serialize(),
205            success: function (response) {
206                $('main').replaceWith( $(response).filter('#main') );
207                initPostsListing();
208                getPopup().close();
209            },
210            error: function () {
211                getPopup().setError(getPopup().current);
212            }
213        });
214    });
215    $document.on('change', 'input[name="category"]', function () {
216        $('.filtersSection__form').trigger('submit');
217    });
218    */
219
220
221    /**
222     * History
223     */
224    $document.on('click', '.historyBlock__navLink', function (e) {
225        e.preventDefault();
226        var $item = $(this).parents('.historyBlock__navItem');
227        $('.historyBlock__navItem').not( $item )
228          .removeClass('active');
229        $item.toggleClass('active');
230    });
231    $document.on('click', '.historyContent__btnClose', function (e) {
232        e.preventDefault();
233        $(this).parents('.historyBlock__navItem').toggleClass('active');
234    });
235
236
237    /**
238     * Mission
239     */
240    $document.on('click', '.missionAccordion__header', function (e) {
241        e.preventDefault();
242        var $item = $(this).parents('.missionAccordion__item');
243        $('.missionAccordion__item').not( $item )
244          .removeClass('active');
245        $item.toggleClass('active');
246    });
247    $document.on('click', '.missionAccordion__btnClose', function (e) {
248        e.preventDefault();
249        e.stopPropagation();
250        $(this).parents('.missionAccordion__item').toggleClass('active');
251    });
252
253
254
255    //Listing pagination
256    function initPostsListing() {
257        var $listing = $('.postsListing');
258        $listing.each(function (index, element) {
259            var teasersPerPage = 9;
260            var $this = $(element);
261            var $pagination = $this.find('.postsListing__pagination');
262            var responsive = $listing.data('responsive');
263            for (const key in responsive) {
264                var breakpoint = Number.parseInt( key );
265                if ( windowWidth >= breakpoint ) {
266                    teasersPerPage = responsive[breakpoint];
267                }
268            }
269            var numVisibleTeasers = teasersPerPage;
270            $this.find('.teaser').each((index, element) => $(element).toggle( index+1 <= numVisibleTeasers ));
271            $pagination.find('.btn').toggle( Boolean( $this.find('.teaser:hidden').length ) );
272            $pagination.find('.postsListing__pages').toggle( !Boolean( $this.find('.teaser:hidden').length ) );
273            $pagination.on('click', '.btn', function () {
274                numVisibleTeasers += teasersPerPage;
275                $this.find('.teaser').each((index, element) => $(element).toggle( index+1 <= numVisibleTeasers ));
276                $pagination.find('.btn').toggle( Boolean( $this.find('.teaser:hidden').length ) );
277                $pagination.find('.postsListing__pages').toggle( !Boolean( $this.find('.teaser:hidden').length ) );
278            });
279        });
280    }
281    initPostsListing();
282
283
284    CookieConsent.run({
285        onConsent: ({cookie}) => {
286            if ( cookie.categories.includes('analytics') ) {
287                jQuery('.iframeContainer').addClass('consent');
288            }
289        },
290        guiOptions: {
291            consentModal: {
292                layout: "cloud inline",
293                position: "bottom right",
294                equalWeightButtons: true,
295                flipButtons: false
296            },
297            preferencesModal: {
298                layout: "box",
299                position: "right",
300                equalWeightButtons: true,
301                flipButtons: false
302            }
303        },
304        categories: {
305            necessary: {
306                readOnly: true
307            },
308            functionality: {},
309            analytics: {
310                services: {
311                    zeffy: {
312                        label: 'Zeffy Embed',
313                        onAccept: () => im.acceptService('zeffy'),
314                        onReject: () => im.rejectService('zeffy'),
315                    },
316                },
317            },
318            marketing: {}
319        },
320        language: {
321            default: "en-US",
322            translations: {
323                'en-US': {
324                    consentModal: {
325                        title: "We use cookies!",
326                        description: "We use cookies to improve your browsing experience, disseminate advertising or personalized content, and analyze our traffic. By clicking \"Accept All\", you consent to our use of cookies.",
327                        acceptAllBtn: "Accept all",
328                        acceptNecessaryBtn: "Reject all",
329                        showPreferencesBtn: "Manage preferences",
330                        footer: "<a href=\"/en/privacy-policy/\">Privacy Policy</a>\n"
331                    },
332                    preferencesModal: {
333                        title: "Consent Preferences Center",
334                        closeIconLabel: "Close modal",
335                        acceptAllBtn: "Accept all",
336                        acceptNecessaryBtn: "Reject all",
337                        savePreferencesBtn: "Save preferences",
338                        serviceCounterLabel: "Service|Services",
339                        sections: [
340                            {
341                                title: "Cookie preferences\t",
342                                description: "We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below. The cookies that are categorized as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. We also use third-party cookies that help us analyze how you use this website, store your preferences, and provide the content and advertisements that are relevant to you. These cookies will only be stored in your browser with your prior consent. You can choose to enable or disable some or all of these cookies but disabling some of them may affect your browsing experience. "
343                            },
344                            {
345                                title: "Strictly Necessary Cookies <span class=\"pm__badge\">Always Enabled</span>",
346                                description: "Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.",
347                                linkedCategory: "necessary"
348                            },
349                            {
350                                title: "Functionality Cookies",
351                                description: "Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.",
352                                linkedCategory: "functionality"
353                            },
354                            {
355                                title: "Analytics Cookies",
356                                description: "These cookies collect information about how you use the website, which pages you visited and which links you clicked on. All of the data is anonymized and cannot be used to identify you.",
357                                linkedCategory: "analytics"
358                            },
359                            {
360                                title: "Advertisement Cookies",
361                                description: "Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.",
362                                linkedCategory: "marketing"
363                            }
364                        ]
365                    }
366                },
367                'fr-FR': {
368                    consentModal: {
369                        title: "Nous utilisons des témoins",
370                        description: "Nous utilisons des cookies pour améliorer votre expérience de navigation, diffuser des publicités ou des contenus personnalisés et analyser notre trafic. En cliquant sur « Tout accepter », vous consentez à notre utilisation des cookies.",
371                        acceptAllBtn: "Tout accepter ",
372                        acceptNecessaryBtn: "Tout rejeter",
373                        showPreferencesBtn: "Personnaliser vos choix",
374                        footer: "<a href=\"/politique-de-confidentialite/\">Politique de confidentialité</a>"
375                    },
376                    preferencesModal: {
377                        title: "Personnaliser vos choix\t",
378                        closeIconLabel: "Fermer",
379                        acceptAllBtn: "Tout accepter ",
380                        acceptNecessaryBtn: "Tout rejeter",
381                        savePreferencesBtn: "Confirmer la sélection",
382                        serviceCounterLabel: "Services",
383                        sections: [
384                            {
385                                title: "Utilisation de Cookies",
386                                description: "Nous utilisons des cookies pour vous aider à naviguer eff
386icacement et à exécuter certaines fonctionnalités. Vous trouverez des informations détaillées sur tous les cookies sous chaque catégorie de consentement ci-dessous. Nous utilisons également des cookies tiers qui nous aident à analyser la façon dont vous utilisez ce site web, à enregistrer vos préférences et à vous fournir le contenu et les publicités qui vous sont pertinents. Ces cookies ne seront stockés dans votre navigateur qu'avec votre consentement préalable. Vous pouvez choisir d'activer ou de désactiver tout ou partie de ces cookies, mais la désactivation de certains d'entre eux peut affecter votre expérience de navigation."
387                            },
388                            {
389                                title: "Cookies Strictement Nécessaires <span class=\"pm__badge\">Toujours Activé</span>",
390                                description: "Les cookies nécessaires sont cruciaux pour les fonctions de base du site Web et celui-ci ne fonctionnera pas comme prévu sans eux. Ces cookies ne stockent aucune donnée personnellement identifiable.",
391                                linkedCategory: "necessary"
392                            },
393                            {
394                                title: "Cookies de Fonctionnalité",
395                                description: "Ces témoins nous permettent de mémoriser vos préférences et de personnaliser les contenus qui vous sont proposés en fonction de votre navigation et de vos choix antérieurs.",
396                                linkedCategory: "functionality"
397                            },
398                            {
399                                title: "Cookies Analytiques",
400                                description: "Les cookies de performance sont utilisés pour comprendre et analyser les indices de performance clés du site Web, ce qui permet de fournir une meilleure expérience utilisateur aux visiteurs.",
401                                linkedCategory: "analytics"
402                            },
403                            {
404                                title: "Cookies Publicitaires",
405                                description: "Les cookies de publicité sont utilisés pour fournir aux visiteurs des publicités personnalisées basées sur les pages visitées précédemment et analyser l'efficacité de la campagne publicitaire.",
406                                linkedCategory: "marketing"
407                            }
408                        ]
409                    }
410                }
411            },
412            autoDetect: "document"
413        }
414    });
415
416
417    const im = iframemanager();
418
419    im.run({
420        currLang: document.documentElement.lang,
421        onChange: ({ changedServices, eventSource }) => {
422            if (eventSource.type === 'click') {
423                jQuery('.iframeContainer').addClass('consent');
424            }
425        },
426        services: {
427            zeffy: {
428                embedUrl: 'https://www.zeffy.com/{data-id}',
429                thumbnailUrl: 'http://cdn.backgroundhost.com/backgrounds/subtlepatterns/blackmamba.png',
430                iframe: {
431                    allow: 'accelerometer; encrypted-media; gyroscope; picture-in-picture; fullscreen;',
432                },
433                languages: {
434                    'en-US': {
435                        notice: 'This content is hosted by a third party. By showing the external content you accept the <a rel="noreferrer noopener" href="https://support.zeffy.com/legal" target="_blank">terms and conditions</a> of zeffy.com.',
436                        loadAllBtn: 'Accept and load donation form',
437                    },
438                    'fr-FR': {
439                        notice: 'Ce contenu est hébergé par un tiers. En affichant le contenu externe, vous acceptez les <a rel="noreferrer noopener" href="https://support.zeffy.com/fr-ca/mentions-l%C3%A9gales" target="_blank">termes et conditions</a> de fr.zeffy.com.',
440                        /* loadBtn: 'Charger une seule fois',*/
441                        loadAllBtn: "Accepter et afficher le formulaire de don",
442                    },
443                },
444            },
445        }
446    });
vendor: 3 bytes, line 447
447});

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.