<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">// let _ = require('lodash')
$('img').each(function() {
    $(this).addClass('img img-fluid');
})

if (typeof $('#iframe_container') != 'undefined') {
    $('#iframe_container').find('iframe').each(function() {
        const elt = $(this);
        const ratio = elt.width() / elt.height();
        const limite = parseInt(elt.attr('width'));
        const largeur = Math.min(elt.parent().width(), limite);
        elt.width(largeur).height(largeur / ratio);
    })
    // $('iframe').each(function() {
    //     var elt = $(this);
    //     var ratio = elt.width() / elt.height();
    //     var limite = parseInt(elt.attr('width'));
    //     var largeur = Math.min(elt.parent().width(), limite);
    //     elt.width(largeur).height(largeur / ratio);
    // });
}

// $('[data-fancybox="gallery"]').fancybox({
//     /*beforeLoad : function() {
//         // this.href = this.href + '?index=' + this.index;
//         console.log(this.pos);
//         console.log(this);
//     },*/
//     afterShow : function( instance, current ) {
//         let next_instance = instance.group[33];
//         // instance.slides[1] = next_instance;
//         // let newindex = instance.currIndex + 33;
//         // instance.jumpTo( newindex, 100000 );
//     }
// });

$('#txtSearch').on('keypress', function(e) {
    if (e.which === 13) {
        $('#goToSearch').trigger('click');
    }
})


$('#goToSearch').on('click', function() {
    $('#resultSearch').html('');
    let search = $('#txtSearch').val();
    let url = $('#route_for_search').html()
    $.ajax({
        url: url,
        type: 'POST',
        data: {
            search: search
        },
        dataType: 'JSON',
        success: function (data) {
            if (data.total &gt; 0) {
                let chaine = '';
                if (data.taille_pages &gt; 0) {
                    chaine += "&lt;div class='ml-3 mt-3'&gt;&lt;b&gt;Pages du site&lt;/b&gt;&lt;/div&gt;";
                    $.each(data.pages, function(key, value) {
                        chaine += "&lt;div class='ml-5 mt-1 mb-2'&gt;&lt;a target='_blank' href='" + value.url + "'&gt;" + value.title + "&lt;/a&gt; - &lt;small&gt;PubliÃ©e le " + value.creation + "&lt;/small&gt;&lt;/div&gt;";
                    })
                }

                if (data.taille_posts &gt; 0) {
                    chaine += "&lt;div class='ml-3 mt-3'&gt;&lt;b&gt;Articles&lt;/b&gt;&lt;/div&gt;";
                    $.each(data.posts, function (key, value) {
                        chaine += "&lt;div class='ml-5 mt-1 mb-2'&gt;&lt;a target='_blank' href='" + value.url + "'&gt;" + value.title + "&lt;/a&gt; - &lt;small&gt;PubliÃ© le " + value.creation + "&lt;/small&gt;&lt;/div&gt;";
                    })
                }
                $('#resultSearch').html(chaine);
                $('#modal-search').modal('show');
            } else {
                $('#modal-infos-body').html("Aucun contenu ne correspond Ã&nbsp; votre recherche.");
                $('#modal-infos').modal('show');
            }
        },
        error: function (e) {
            console.log(e.responseText)
        }
    })

})
$('#acceptationCookies').on('click', function(e){
    e.preventDefault()

    let url = $('#route_for_register_rgpd_cookies').html()
    $.ajax({
        url: url,
        type: 'POST',
        data: {
        },
        dataType: 'JSON',
        success: function (data) {
            $('#cookie-banner').hide()
        },
        error: function (e) {
            console.log(e.responseText)
        }
    })
})
</pre></body></html>