<commit_before>import 'font-awesome/css/font-awesome.css';
import '../scss/app.scss';
import './vendors';
import './overrides';
import './collections';
import LazyLoad from "vanilla-lazyload";

class App {
    init(selecteur) {
        const self = this;
        $(document).ready(function () {
            self.initComponents(selecteur);
            self.initPopups();
            self.initScrollTo();
            self.initMenuOnScrollListener();
            self.initHeaderSearch();
            self.initBreadcrumb();
        });
    }

    initBreadcrumb() {
        var bread = $('#bread .breadcrumb');
        var btnCollapse = $('#bread .btn');

        btnCollapse.click(function () {
            bread.toggleClass('collapsed');
            $(this).find('.fa').toggleClass('fa-chevron-down').toggleClass('fa-chevron-right');
        });
    }

    initHeaderSearch() {
        var searchForm = $('.navbar .search-form');
        var searchBackdrop = $('#search-menu-backdrop');
        searchForm.find("input").focus(function () {
            searchForm.addClass('focus');
            searchBackdrop.addClass('open');
        }).blur(function () {
            searchForm.removeClass('focus');
            searchBackdrop.removeClass('open');
        });
    }

    initPopups() {
        $('a.popup').click(function () {
            var width = 520,
                height = 350,
                leftPosition = (window.screen.width / 2) - ((width / 2) + 10),
                topPosition = (window.screen.height / 2) - ((height / 2) + 50),
                windowFeatures = "status=no,height=" + height + ",width=" + width + ",left=" + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY=" + topPosition + ",toolbar=0,status=0";

            window.open($(this).attr('href'), 'sharer', windowFeatures);
            return false;
        });
    }

    initLazyLoading(selecteur) {
        var images = $("img.loading", selecteur || document);
        var scrollAreas = $(".scroll-area", selecteur || document);
        if (images.length === 0 && scrollAreas.length === 0) {
            return;
        }

        var callback_enter = function (element) {
            var width = $(element).width();
            var ratio = $(element).attr('width') / $(element).attr('height');

            var placeholder = $('<div>')
                .addClass('placeholder')
                .width(width)
                .height(width / ratio);

            placeholder.append($('<div>').addClass('loading-background'));
            $(element).addClass('d-none');
            $(element).after($(placeholder));
        };

        var callback_loaded = function (element) {
            $(element).siblings('.placeholder').remove();
            $(element).removeClass('d-none');
        };

        var callback_error = function (element) {
            $(element).siblings('.placeholder').find('.loading-background').remove();
        };

        if (images.length > 0) {
            new LazyLoad({
                elements_selector: "img.loading",
                threshold: 200,
                container: (selecteur && selecteur[0]) || document,
                /*callback_enter: callback_enter,
                callback_loaded: callback_loaded,
                callback_error: callback_error,*/
            });
        }

        if (scrollAreas.length > 0) {
            new LazyLoad({
                elements_selector: ".scroll-area",
                container: (selecteur && selecteur[0]) || document,

                callback_enter: function (el) {
                    new LazyLoad({
                        elements_selector: "img.loading",
                        threshold: 200,
                        container: el,
                        /*callback_enter: callback_enter,
                        callback_loaded: callback_loaded,
                        callback_error: callback_error,*/
                    });
                }
            });
        }<commit_msg>Removed unused js functions<commit_after>import 'font-awesome/css/font-awesome.css';
import '../scss/app.scss';
import './vendors';
import './overrides';
import './collections';
import LazyLoad from "vanilla-lazyload";

class App {
    init(selecteur) {
        const self = this;
        $(document).ready(function () {
            self.initComponents(selecteur);
            self.initPopups();
            self.initScrollTo();
            self.initMenuOnScrollListener();
            self.initHeaderSearch();
            self.initBreadcrumb();
        });
    }

    initBreadcrumb() {
        var bread = $('#bread .breadcrumb');
        var btnCollapse = $('#bread .btn');

        btnCollapse.click(function () {
            bread.toggleClass('collapsed');
            $(this).find('.fa').toggleClass('fa-chevron-down').toggleClass('fa-chevron-right');
        });
    }

    initHeaderSearch() {
        var searchForm = $('.navbar .search-form');
        var searchBackdrop = $('#search-menu-backdrop');
        searchForm.find("input").focus(function () {
            searchForm.addClass('focus');
            searchBackdrop.addClass('open');
        }).blur(function () {
            searchForm.removeClass('focus');
            searchBackdrop.removeClass('open');
        });
    }

    initPopups() {
        $('a.popup').click(function () {
            var width = 520,
                height = 350,
                leftPosition = (window.screen.width / 2) - ((width / 2) + 10),
                topPosition = (window.screen.height / 2) - ((height / 2) + 50),
                windowFeatures = "status=no,height=" + height + ",width=" + width + ",left=" + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY=" + topPosition + ",toolbar=0,status=0";

            window.open($(this).attr('href'), 'sharer', windowFeatures);
            return false;
        });
    }

    initLazyLoading(selecteur) {
        var images = $("img.loading", selecteur || document);
        var scrollAreas = $(".scroll-area", selecteur || document);
        if (images.length === 0 && scrollAreas.length === 0) {
            return;
        }

        if (images.length > 0) {
            new LazyLoad({
                elements_selector: "img.loading",
                threshold: 200,
                container: (selecteur && selecteur[0]) || document,
            });
        }

        if (scrollAreas.length > 0) {
            new LazyLoad({
                elements_selector: ".scroll-area",
                container: (selecteur && selecteur[0]) || document,
                callback_enter: function (el) {
                    new LazyLoad({
                        elements_selector: "img.loading",
                        threshold: 200,
                        container: el,
                    });
                }
            });
        }
{'fraction_non_alphanumeric': 0.15088843577046315, 'fraction_numerical': 0.00815613166326828, 'mean_word_length': 1.7413173652694611, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5675767', 'n_tokens_mistral': 1872, 'n_tokens_neox': 1756, 'n_words': 333}