<commit_before>jQuery(function($){
    $("img").each(function(){
        console.log("dans fonction")
        if(  $(this).height() > $(this).width() ){
            $(this).addClass("imgHeight");
        } else {
            $(this).addClass("imgWidth");
        }
        var $container = $('.page-list');
        // initialize Masonry after all images have loaded  
        $container.imagesLoaded( function() {
            $container.masonry({
                isAnimated: true,
                gutter: 10,
                columnWidth: 10,
                itemSelector: '.item',
            });
        });
    });
});

$(".btn-favorite").click(function(){
    $.ajax({
        url: Routing.generate('add_favorite_notice'),
        dataType: "json",
        data: {
            param: $(this).val()
        },
        success: function(message){
            console.log(message);
        }
    });
});

$("img").hover(function() {
    $img = $(this);
    $.ajax({
        url: Routing.generate('notice_hover'),
        dataType: "json",
        data: {
            id: $img.attr("alt")
        },
        complete: function(data){
            var image = /^[^;]*/i.exec(data.responseJSON[0].video);
            var response = " auteur : "+data.responseJSON[0].autr+"<br />"
                +'<img src="http://www.culture.gouv.fr/Wave/image/joconde'+image[0]+'"/>';
            $('.notice-hover').html(response);
        }
    });
}
, function() {
    console.log('out');
    $('.notice-hover').text("");
})

$(".btn-question").click(function(){
    var result = $(this).val();
    if(result == "none" || result == "no" ) {
        $.ajax({
            url: Routing.generate('change_question'),
            dataType: "json",
            data: {
                answer: $(this).val()
            },
            complete: function(question){

                $('.question').fadeOut(500,function(){
                    var responseQuestion = question.responseJSON.question;
                    var splitResponse = responseQuestion.split(",");
                    var newQuestion = splitResponse[0];
                    var typeQuestion = splitResponse[1];
                    var response = '<p>'+newQuestion+' ?</p><button class="btn-question" value="'+typeQuestion+',yes">oui</button><button class="btn-question" value="no">non</button><button class="btn-question" value="none">ne sais pas</button>'
                    $('.question').html(response);
                    $('.question').fadeIn(500);
                });
            }
        });
    } else {
        console.log("yes");
    }

});<commit_msg>change load image for mansonry<commit_after>jQuery(function($){
    $("img").each(function(){
        if(  $(this).height() > $(this).width() ){
            console.log("height : "+$(this).height()+" ; width : "+$(this).width()+" ; imgHeight");
            $(this).addClass("imgHeight");
        } else {
            console.log("height : "+$(this).height()+" ; width : "+$(this).width()+" ; imgWidth");
            $(this).addClass("imgWidth");
        }
    });
    var $container = $('.page-list');
    // initialize Masonry after all images have loaded
    $container.imagesLoaded( function() {
        $container.masonry({
            isAnimated: true,
            gutter: 10,
            columnWidth: 10,
            itemSelector: '.item',
        });
    });
});

$(".btn-favorite").click(function(){
    $.ajax({
        url: Routing.generate('add_favorite_notice'),
        dataType: "json",
        data: {
            param: $(this).val()
        },
        success: function(message){
            console.log(message);
        }
    });
});

$("img").hover(function() {
    $img = $(this);
    $.ajax({
        url: Routing.generate('notice_hover'),
        dataType: "json",
        data: {
            id: $img.attr("alt")
        },
        complete: function(data){
            var image = /^[^;]*/i.exec(data.responseJSON[0].video);
            var response = " auteur : "+data.responseJSON[0].autr+"<br />"
                +'<img src="http://www.culture.gouv.fr/Wave/image/joconde'+image[0]+'"/>';
            $('.notice-hover').html(response);
        }
    });
}
, function() {
    console.log('out');
    $('.notice-hover').text("");
})

$(".btn-question").click(function(){
    var result = $(this).val();
    if(result == "none" || result == "no" ) {
        $.ajax({
            url: Routing.generate('change_question'),
            dataType: "json",
            data: {
                answer: $(this).val()
            },
            complete: function(question){

                $('.question').fadeOut(500,function(){
                    var responseQuestion = question.responseJSON.question;
                    var splitResponse = responseQuestion.split(",");
                    var newQuestion = splitResponse[0];
                    var typeQuestion = splitResponse[1];
                    var response = '<p>'+newQuestion+' ?</p><button class="btn-question" value="'+typeQuestion+',yes">oui</button><button class="btn-question" value="no">non</button><button class="btn-question" value="none">ne sais pas</button>'
                    $('.question').html(response);
                    $('.question').fadeIn(500);
                });
            }
        });
    } else {
        console.log("yes");
    }

});
{'fraction_non_alphanumeric': 0.19334952363160846, 'fraction_numerical': 0.005604334018307491, 'mean_word_length': 1.8388123011664899, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3521080', 'n_tokens_mistral': 1538, 'n_tokens_neox': 1487, 'n_words': 244}