<commit_before>/*
	jQuery Glider Plugin
	by <NAME>
	https://github.com/Steve-Fenton/jquery-glider
 */

(function ($) {
    var resizeTimer;
    var $window = $(window);
    $window.on('resize', function () {
        clearTimeout(resizeTimer);
        resizeTimer = setTimeout(function () {
            $window.trigger('gliderResizeDone');
        }, 100);
    });

    var idIndex = 0;

    function Glider($this, settings) {

        this.id = 'glider-' + idIndex++;
        this.settings = settings;

        // Default link function
        this.linkFunction = function (idx) {
            return '<span class="glider-circle-icon">&nbsp;</span>';
        };

        // Direction
        this.direction = $this.attr('dir') || 'ltr';

        this.container = $this.attr('data-glider-id', this.id).addClass('glider glider-' + this.direction + ' ' + settings.animation);
        this.list = $(settings.list, $this).first().addClass('glider-list');
        this.items = $(settings.item, this.list).addClass('glider-item');

        this.currentSlide = 0;

        // Boolean attributes
        this.hasMultiple = $this[0].hasAttribute('data-glider-multiple');
        this.hasAutoplay = $this[0].hasAttribute('data-glider-autoplay');
        this.hasControls = $this[0].hasAttribute('data-glider-controls');
        this.hasLinks = $this[0].hasAttribute('data-glider-links');

        // Place controls at the bottom by default, or use the attribute
        this.controlLocation = $this.attr('data-glider-controls') || 'glider-bottom';

        // Place links at the bottom by default, or use the attribute
        this.linkLocation = $this.attr('data-glider-links') || 'glider-bottom';

        // Show one slide by default, or use the attribute
        this.fixedSlideWidth = "100%";
        this.widthInfo = [];
        this.slidesToShow = 1;

        var multipleAttribute = $this.attr('data-glider-multiple') || '1';

        if (multipleAttribute.indexOf('%') > -1 || multipleAttribute.indexOf('px') > -1) {
            this.fixedSlideWidth = multipleAttribute;
            this.setWidthInformation();
        } else {
            var multipleValue = parseInt(multipleAttribute, 10);
            this.slidesToShow = (isNaN(multipleValue)) ? 1 : multipleValue;
        }

        this.interval = null;
        this.classTimer = null;

        var _this = this;

        // Determine where controls should be placed        
        this.controlElement = $this;
        if (this.settings.controls) {
            this.controlElement = $this.parent().closest(this.settings.controls).css('position', 'relative').attr('dir', this.direction);
        }
        
        this.controlElement.addClass('glider-controls-' + this.direction);

        if (this.hasControls) {
            this.controlElement.append(this.getBackControl(this.controlLocation, this.settings.backIcon));
            this.controlElement.append(this.getNextControl(this.controlLocation, this.settings.nextIcon));
        }

        if (this.hasLinks) {
            this.controlElement.append($('<div>').append(this.getLinkControl(this.linkLocation, this.linkFunction)));
        }

        if (this.hasAutoplay) {
            this.interval = window.setInterval(function () {
                _this.next();
            }, 5000);
        }

        _this.goto(0);
        _this.resize();
        $window.on('gliderResizeDone', function () { _this.resize() });
    }

    Glider.prototype = {
        constructor: Glider,
        setWidthInformation: function () {
            if (this.fixedSlideWidth.charAt(0) === '[') {
                // Parses DSL for responsive sizes, i.e. [1200:300px,0:200px]
                var data = this.fixedSlideWidth.replace(/[\[\]]/g, '').split(',');
                for (var i = 0; i < data.length; i++) {<commit_msg>Introducing a set up method.<commit_after>/*
	jQuery Glider Plugin
	by <NAME>
	https://github.com/Steve-Fenton/jquery-glider
 */

(function ($) {
    var resizeTimer;
    var $window = $(window);
    $window.on('resize', function () {
        clearTimeout(resizeTimer);
        resizeTimer = setTimeout(function () {
            $window.trigger('gliderResizeDone');
        }, 100);
    });

    var idIndex = 0;

    function Glider($this, settings) {

        this.id = 'glider-' + idIndex++;
        this.settings = settings;

        // Default link function
        this.linkFunction = function (idx) {
            return '<span class="glider-circle-icon">&nbsp;</span>';
        };

        // Direction
        this.direction = $this.attr('dir') || 'ltr';

        this.container = $this.attr('data-glider-id', this.id).addClass('glider glider-' + this.direction + ' ' + settings.animation);
        this.list = $(settings.list, $this).first().addClass('glider-list');
        this.items = $(settings.item, this.list).addClass('glider-item');

        this.currentSlide = 0;

        // Boolean attributes
        this.hasMultiple = $this[0].hasAttribute('data-glider-multiple');
        this.hasAutoplay = $this[0].hasAttribute('data-glider-autoplay');
        this.hasControls = $this[0].hasAttribute('data-glider-controls');
        this.hasLinks = $this[0].hasAttribute('data-glider-links');

        // Place controls at the bottom by default, or use the attribute
        this.controlLocation = $this.attr('data-glider-controls') || 'glider-bottom';

        // Place links at the bottom by default, or use the attribute
        this.linkLocation = $this.attr('data-glider-links') || 'glider-bottom';

        // Show one slide by default, or use the attribute
        this.fixedSlideWidth = "100%";
        this.widthInfo = [];
        this.slidesToShow = 1;

        var multipleAttribute = $this.attr('data-glider-multiple') || '1';

        if (multipleAttribute.indexOf('%') > -1 || multipleAttribute.indexOf('px') > -1) {
            this.fixedSlideWidth = multipleAttribute;
            this.setWidthInformation();
        } else {
            var multipleValue = parseInt(multipleAttribute, 10);
            this.slidesToShow = (isNaN(multipleValue)) ? 1 : multipleValue;
        }

        this.interval = null;
        this.classTimer = null;

        // Determine where controls should be placed        
        this.controlElement = $this;
        if (this.settings.controls) {
            this.controlElement = $this.parent().closest(this.settings.controls).css('position', 'relative').attr('dir', this.direction);
        }
        
        this.controlElement.addClass('glider-controls-' + this.direction);

        if (this.hasControls) {
            this.controlElement.append(this.getBackControl(this.controlLocation, this.settings.backIcon));
            this.controlElement.append(this.getNextControl(this.controlLocation, this.settings.nextIcon));
        }

        if (this.hasLinks) {
            this.controlElement.append($('<div>').append(this.getLinkControl(this.linkLocation, this.linkFunction)));
        }

        var _this = this;
        $window.on('gliderResizeDone', function () { _this.resize() });
        this.setUp();
    }

    Glider.prototype = {
        constructor: Glider,
        setUp: function () {
            var _this = this;
            if (this.hasAutoplay) {
                this.interval = window.setInterval(function () {
                    _this.next();
                }, 5000);
            }

            this.goto(0);
            this.resize();
        },
        setWidthInformation: function () {
            if (this.fixedSlideWidth.charAt(0) === '[') {
                // Parses DSL for responsive sizes, i.e. [1200:300px,0:200px]
                var data = this.fixedSlideWidth.replace(/[\[\]]/g, '').split(',');
                for (var i = 0; i < data.length; i++) {
{'fraction_non_alphanumeric': 0.14824832560535806, 'fraction_numerical': 0.0095311695002576, 'mean_word_length': 2.2763713080168775, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '1288426', 'n_tokens_mistral': 2288, 'n_tokens_neox': 2174, 'n_words': 410}