<commit_before>
/**
 *
 */
meta.LoadMoreTips = function(config) {

    var that = this;

    that.context = {
        is_loading : false,
        itemsNumber : 0
    };

    that.config = {
        $button : false,
        class   : 'line',
        speed   : 500,
        easing  : 'easeInOutCubic'
    };


    /* Public attributes. */
    that._setupEvents = function(){

        /*that.config.$button.on('click', function(e)
        {
            e.preventDefault();
            that._updateContent();
        });*/
    };

    that._updateContent = function() {

        if(that.context.is_loading) return;

        var $target     = that.context.$container.find('.load-target');

        /* Récupérer la traduction pour loading */
        that.config.$button.addClass('loading').text(TRAD.common.loadmore);
        that._loadAjax(that.config.url, $target, function()
        {

        });
    };



    that._setupContext = function(){

        that.context.$container = that.config.$button.closest('.load-container');
    };


    that._animate = function($target, $elements, callback ){

        var target_height = $target.show().height();

        $elements.addClass('enable3d').css({opacity:0, top:'6em', position:'relative'}).each(function(index){

            $(this).delay(100*(index+1)).velocity({opacity:1, top:0}, that.config.speed, that.config.easing);
        });

        setTimeout(function()
        {
            if(callback) callback();
            $elements.removeClass('enable3d');

        }, 100*$elements.length+that.config.speed );
    };

    that._loadAjax = function( url, $target, callback)
    {

        that.context.is_loading = true;
        $.ajax({
            type: "GET",
            url: url,
            dataType: "json",
            success: function(msg) {
                $target.append(msg.htmldata);
                if(parseInt(msg.difference)==0)
                   that.config.$button.hide();
                if(parseInt(msg.difference)==0 && $(".line .three").length<=1)
                {
                    $('.line .three').addClass('six').removeClass('three');
                }
                if( callback ) callback();
                that._animate($target, $target.find(".line:last-child").find('> *').not('br') );
                that.context.is_loading = false;
                that.config.$button.removeClass('loading').text( TRAD.common.morebars);
            },
            error: function(e) {
                console.log('Error : ' + e);
            }
        });
    };


    /**
     *
     */
    that.__construct = function( config )
    {
        that.config = $.extend(that.config, config);

        that._setupContext();
        that._setupEvents();
    };

    that.__construct( config );
};
<commit_msg>Tips load more<commit_after>
/**
 *
 */
meta.LoadMoreTips = function(config) {

    var that = this;

    that.context = {
        is_loading : false,
        itemsNumber : 0
    };

    that.config = {
        $button : false,
        class   : 'line',
        speed   : 500,
        easing  : 'easeInOutCubic'
    };


    /* Public attributes. */
    that._setupEvents = function(){

        /*that.config.$button.on('click', function(e)
        {
            e.preventDefault();
            that._updateContent();
        });*/
    };

    that._updateContent = function() {

        if(that.context.is_loading) return;

        var $target     = that.context.$container.find('.load-target');

        /* Récupérer la traduction pour loading */
        that.config.$button.addClass('loading').text(TRAD.common.loadmore);
        that._loadAjax(that.config.url, $target, function()
        {

        });
    };



    that._setupContext = function(){

        that.context.$container = that.config.$button.closest('.load-container');
    };


    that._animate = function($target, $elements, callback ){

        var target_height = $target.show().height();

        $elements.addClass('enable3d').css({opacity:0, top:'6em', position:'relative'}).each(function(index){

            $(this).delay(100*(index+1)).velocity({opacity:1, top:0}, that.config.speed, that.config.easing);
        });

        setTimeout(function()
        {
            if(callback) callback();
            $elements.removeClass('enable3d');

        }, 100*$elements.length+that.config.speed );
    };

    that._loadAjax = function( url, $target, callback)
    {

        that.context.is_loading = true;
        $.ajax({
            type: "GET",
            url: url,
            dataType: "json",
            success: function(msg) {
                $target.append(msg.htmldata);
                if(parseInt(msg.difference)==0)
                   that.config.$button.hide();
                if(parseInt(msg.difference)==0 && $(".line .three").length<=1)
                {
                    $('.line .three').addClass('six').removeClass('three');
                }
                if( callback ) callback();
                that._animate($target, $target.find(".line:last-child").find('> *').not('br') );
                that.context.is_loading = false;
                that.config.$button.removeClass('loading').text( TRAD.common.loadmore);
            },
            error: function(e) {
                console.log('Error : ' + e);
            }
        });
    };


    /**
     *
     */
    that.__construct = function( config )
    {
        that.config = $.extend(that.config, config);

        that._setupContext();
        that._setupEvents();
    };

    that.__construct( config );
};

{'fraction_non_alphanumeric': 0.16225939917251303, 'fraction_numerical': 0.007195538765965102, 'mean_word_length': 1.7786106946526736, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3749754', 'n_tokens_mistral': 1644, 'n_tokens_neox': 1547, 'n_words': 232}