<commit_before>/*
 * jQuery Plus Slider 1.4.6
 * By <NAME>
 * http://css-plus.com
 * @jamygolden
 *
 * Copyright 2011
 * Free to use under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 */
( function( $ ) {

    $.plusSlider = function( el, options ) {

        // To avoid scope issues, use 'base' instead of 'this'
        // To reference this class from internal events and functions.
        var base = this;

        // Access to jQuery and DOM versions of element
        base.$el = $( el );
        base.el = el;

        // Add a reverse reference to the DOM object
        base.$el.data('plusSlider', base);
        
        base.init = function () {

            base.options = $.extend( {}, $.plusSlider.defaults, options );
            base.$el.addClass('plusslider-container').wrap('<div class="plusslider" />');
            base.$wrap                  = base.$el.parent();              // References the .plusslider jQuery object
            base.$slides                = base.$el.children();            // References all slide jQuery slide objects
            base.$slideCloneFirst;                                        // First clone needed for infinite slide
            base.$slideCloneLast;                                         // Last clone needed for infinite slide
            base.$wrapContainer         = base.$wrap.parent();            // References the jQuery object of .plusSlider's container - This object isn't part of PlusSlider
            base.slideCount             = base.$slides.length;            // A numerical value of the amount of slides
            base.slideIndexCount        = base.slideCount - 1;            // The index value of the amount of slides
            base.sliderWidth            = 0;                              //Stores the slider width value. This changes on resize if fullWidth is enableds
            base.animating              = false;                          // Boolean - true means the slider is busy animating.
            base.wrapContainerWidth     = base.$wrapContainer.width();    // A numerical value of the width of base.$wrapContainer
            base.wrapContainerHeight    = base.$wrapContainer.height();   // A numerical value of the height of base.$wrapContainer
            base.currentSlideIndex      = base.options.defaultSlide;      // References the index number of the current slide
            base.$currentSlide          = base.$slides.eq( base.currentSlideIndex ); // References the current/active slide's jQuery object
            base.currentSlideWidth      = base.$currentSlide.outerWidth(); // References a numerical value of the width of the current/active slide
            base.currentSlideHeight     = base.$currentSlide.outerHeight(); // References a numerical value of the height of the current/active slide

            // base.functions
            base.calculateSliderWidth = function() {

                for ( var i = 0; i < base.slideCount; i++ ) {
                    if ( i == 0 ) base.sliderWidth = 0;
                    base.sliderWidth += base.$slides.eq( i ).outerWidth();
                };

                if ( base.options.infiniteSlide ) {
                    base.sliderWidth += base.$slides.eq(0).outerWidth();
                    base.sliderWidth += base.$slides.eq(base.slideIndexCount).outerWidth();
                }

            }; // base.calculateSliderWidth

            base.beginTimer = function() {

                base.timer = window.setInterval( function () {
                    base.toSlide('next');
                }, base.options.displayTime);

            }; // base.beginTimer

            base.clearTimer = function() {
                
                if ( base.timer) { // If the timer is set, clear it
                    window.clearInterval(base.timer);
                };

            }; // base.clearTimer

            base.setSliderDimensions = function() {

                // Set values
                base.calculateSliderWidth();
                base.currentSlideWidth  = base.$currentSlide.outerWidth();
                base.currentSlideHeight = base.$currentSlide.outerHeight();
                // Values Set
                
                if ( base.options.fullWidth ) {

                    base.sliderWidth = base.wrapContainerWidth * base.slideCount;
                    if ( base.options.infiniteSlide == true ) {
                        base.sliderWidth = base.wrapContainerWidth * base.slideCount + 2;
                    }
                    base.wrapContainerWidth = base.$wrapContainer.width();

                    base.$slides.width( base.wrapContainerWidth );

                    if ( base.options.infiniteSlide ) {
                        base.$slideCloneFirst.width( base.wrapContainerWidth );
                        base.$slideCloneLast.width( base.wrapContainerWidth );
                    }

                    base.calculateSliderWidth();

                    base.$wrap.width( base.wrapContainerWidth ).height( base.currentSlideHeight );
                    base.$el.width( base.sliderWidth ).height( base.currentSlideHeight ).css('left', base.$currentSlide.position().left * -1 + 'px');

                } else {

                    // Set wrapper dimensions to equal the slide
                    base.$wrap.width( base.currentSlideWidth ).height( base.currentSlideHeight );

                }

            }; // base.setSliderDimensions

            base.toSlide = function( slide ) {

                if ( base.animating == false ) {

                    // Set values
                    base.animating = true;
                    // Values set

                    // Handling of slide values
                    var lastSlideIndex = base.currentSlideIndex;
                    if ( slide === 'next' || slide === '' ) {
                        base.currentSlideIndex += 1;
                    } else if ( slide === 'prev' ) {
                        base.currentSlideIndex -= 1;
                    } else {
                        base.currentSlideIndex = parseInt(slide);
                    }
                    // End Handling of slide values

                    // Disable first and last buttons on the first and last slide respectively
                    if ( ( base.options.disableLoop == 'first' || base.options.disableLoop == 'both' && base.currentSlideIndex < 0 ) || ( base.options.disableLoop == 'last' || base.options.disableLoop == 'both' && base.currentSlideIndex > base.slideIndexCount )) {
                         return;
                    }  // End Disable first and last buttons on the first and last slide respectively

                    // Handle possible slide values
                    if ( base.currentSlideIndex > base.slideIndexCount ) {
                        base.currentSlideIndex = 0;
                    } else if ( base.currentSlideIndex < 0 ) {
                        base.currentSlideIndex = base.slideIndexCount;
                    }; // Handle possible slide values

                    // Set values
                    base.$currentSlide      = base.$slides.eq( base.currentSlideIndex );
                    base.currentSlideWidth  = base.$currentSlide.width();
                    base.currentSlideHeight = base.$currentSlide.height();
                    // Values set

                    // onSlide callback
                    if ( base.options.onSlide && typeof( base.options.onSlide ) == 'function' ) base.options.onSlide( base );
                    // End onSlide callback

                    if ( base.options.createPagination ) {
                        base.$sliderControls.find('li').removeClass('current').eq( base.currentSlideIndex ).addClass('current');
                    }; // base.options.createPagination

                    if ( base.options.sliderType == 'slider' ) {

                        var toPosition = base.$currentSlide.position().left; // Position for slider position to animate to next

                        // Edit animation position to achieve the infinite slide effect
                        if ( base.options.infiniteSlide === true ) {
                            if ( base.currentSlideIndex == 0 && slide == 'next') { // only animate to the clone if toSlide('next') is run.
                                toPosition = base.$slideCloneFirst.position().left;
                            } else if ( base.currentSlideIndex == base.slideIndexCount && slide == 'prev') { // only animate to the clone if toSlide('prev') is run.
                                toPosition = base.$slideCloneLast.position().left;
                            };
                        };

                        // Animate slide position
                        base.$el.animate({
                            height: base.$currentSlide.outerHeight(),
                            left: toPosition * -1 + 'px'
                        }, base.options.speed, base.options.sliderEasing, function() {

                            if ( base.currentSlideIndex == 0 ) {
                                base.$el.css('left', base.$slides.eq(0).position().left * -1);
                            } else if ( base.currentSlideIndex == base.slideIndexCount ) {
                                base.$el.css('left', base.$slides.eq(base.slideIndexCount).position().left * -1);
                            }

                            base.endToSlide();

                        });

                    // End slider

                    } else { 
                
                    // Begin Fader

                        base.$slides.eq( lastSlideIndex ).fadeOut(base.options.speed);
                        
                        base.$slides.eq( base.currentSlideIndex ).fadeIn(base.options.speed, function() {

                            base.endToSlide();

                        });<commit_msg>do not fade out slide if moving to the same slide (when pagination control is clicked for slide that is already current)<commit_after>/*
 * jQuery Plus Slider 1.4.6
 * By <NAME>
 * http://css-plus.com
 * @jamygolden
 *
 * Copyright 2011
 * Free to use under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 */
( function( $ ) {

    $.plusSlider = function( el, options ) {

        // To avoid scope issues, use 'base' instead of 'this'
        // To reference this class from internal events and functions.
        var base = this;

        // Access to jQuery and DOM versions of element
        base.$el = $( el );
        base.el = el;

        // Add a reverse reference to the DOM object
        base.$el.data('plusSlider', base);
        
        base.init = function () {

            base.options = $.extend( {}, $.plusSlider.defaults, options );
            base.$el.addClass('plusslider-container').wrap('<div class="plusslider" />');
            base.$wrap                  = base.$el.parent();              // References the .plusslider jQuery object
            base.$slides                = base.$el.children();            // References all slide jQuery slide objects
            base.$slideCloneFirst;                                        // First clone needed for infinite slide
            base.$slideCloneLast;                                         // Last clone needed for infinite slide
            base.$wrapContainer         = base.$wrap.parent();            // References the jQuery object of .plusSlider's container - This object isn't part of PlusSlider
            base.slideCount             = base.$slides.length;            // A numerical value of the amount of slides
            base.slideIndexCount        = base.slideCount - 1;            // The index value of the amount of slides
            base.sliderWidth            = 0;                              //Stores the slider width value. This changes on resize if fullWidth is enableds
            base.animating              = false;                          // Boolean - true means the slider is busy animating.
            base.wrapContainerWidth     = base.$wrapContainer.width();    // A numerical value of the width of base.$wrapContainer
            base.wrapContainerHeight    = base.$wrapContainer.height();   // A numerical value of the height of base.$wrapContainer
            base.currentSlideIndex      = base.options.defaultSlide;      // References the index number of the current slide
            base.$currentSlide          = base.$slides.eq( base.currentSlideIndex ); // References the current/active slide's jQuery object
            base.currentSlideWidth      = base.$currentSlide.outerWidth(); // References a numerical value of the width of the current/active slide
            base.currentSlideHeight     = base.$currentSlide.outerHeight(); // References a numerical value of the height of the current/active slide

            // base.functions
            base.calculateSliderWidth = function() {

                for ( var i = 0; i < base.slideCount; i++ ) {
                    if ( i == 0 ) base.sliderWidth = 0;
                    base.sliderWidth += base.$slides.eq( i ).outerWidth();
                };

                if ( base.options.infiniteSlide ) {
                    base.sliderWidth += base.$slides.eq(0).outerWidth();
                    base.sliderWidth += base.$slides.eq(base.slideIndexCount).outerWidth();
                }

            }; // base.calculateSliderWidth

            base.beginTimer = function() {

                base.timer = window.setInterval( function () {
                    base.toSlide('next');
                }, base.options.displayTime);

            }; // base.beginTimer

            base.clearTimer = function() {
                
                if ( base.timer) { // If the timer is set, clear it
                    window.clearInterval(base.timer);
                };

            }; // base.clearTimer

            base.setSliderDimensions = function() {

                // Set values
                base.calculateSliderWidth();
                base.currentSlideWidth  = base.$currentSlide.outerWidth();
                base.currentSlideHeight = base.$currentSlide.outerHeight();
                // Values Set
                
                if ( base.options.fullWidth ) {

                    base.sliderWidth = base.wrapContainerWidth * base.slideCount;
                    if ( base.options.infiniteSlide == true ) {
                        base.sliderWidth = base.wrapContainerWidth * base.slideCount + 2;
                    }
                    base.wrapContainerWidth = base.$wrapContainer.width();

                    base.$slides.width( base.wrapContainerWidth );

                    if ( base.options.infiniteSlide ) {
                        base.$slideCloneFirst.width( base.wrapContainerWidth );
                        base.$slideCloneLast.width( base.wrapContainerWidth );
                    }

                    base.calculateSliderWidth();

                    base.$wrap.width( base.wrapContainerWidth ).height( base.currentSlideHeight );
                    base.$el.width( base.sliderWidth ).height( base.currentSlideHeight ).css('left', base.$currentSlide.position().left * -1 + 'px');

                } else {

                    // Set wrapper dimensions to equal the slide
                    base.$wrap.width( base.currentSlideWidth ).height( base.currentSlideHeight );

                }

            }; // base.setSliderDimensions

            base.toSlide = function( slide ) {

                if ( base.animating == false ) {

                    // Set values
                    base.animating = true;
                    // Values set

                    // Handling of slide values
                    var lastSlideIndex = base.currentSlideIndex;
                    if ( slide === 'next' || slide === '' ) {
                        base.currentSlideIndex += 1;
                    } else if ( slide === 'prev' ) {
                        base.currentSlideIndex -= 1;
                    } else {
                        base.currentSlideIndex = parseInt(slide);
                    }
                    // End Handling of slide values

                    // Disable first and last buttons on the first and last slide respectively
                    if ( ( base.options.disableLoop == 'first' || base.options.disableLoop == 'both' && base.currentSlideIndex < 0 ) || ( base.options.disableLoop == 'last' || base.options.disableLoop == 'both' && base.currentSlideIndex > base.slideIndexCount )) {
                         return;
                    }  // End Disable first and last buttons on the first and last slide respectively

                    // Handle possible slide values
                    if ( base.currentSlideIndex > base.slideIndexCount ) {
                        base.currentSlideIndex = 0;
                    } else if ( base.currentSlideIndex < 0 ) {
                        base.currentSlideIndex = base.slideIndexCount;
                    }; // Handle possible slide values

                    // Set values
                    base.$currentSlide      = base.$slides.eq( base.currentSlideIndex );
                    base.currentSlideWidth  = base.$currentSlide.width();
                    base.currentSlideHeight = base.$currentSlide.height();
                    // Values set

                    // onSlide callback
                    if ( base.options.onSlide && typeof( base.options.onSlide ) == 'function' ) base.options.onSlide( base );
                    // End onSlide callback

                    if ( base.options.createPagination ) {
                        base.$sliderControls.find('li').removeClass('current').eq( base.currentSlideIndex ).addClass('current');
                    }; // base.options.createPagination

                    if ( base.options.sliderType == 'slider' ) {

                        var toPosition = base.$currentSlide.position().left; // Position for slider position to animate to next

                        // Edit animation position to achieve the infinite slide effect
                        if ( base.options.infiniteSlide === true ) {
                            if ( base.currentSlideIndex == 0 && slide == 'next') { // only animate to the clone if toSlide('next') is run.
                                toPosition = base.$slideCloneFirst.position().left;
                            } else if ( base.currentSlideIndex == base.slideIndexCount && slide == 'prev') { // only animate to the clone if toSlide('prev') is run.
                                toPosition = base.$slideCloneLast.position().left;
                            };
                        };

                        // Animate slide position
                        base.$el.animate({
                            height: base.$currentSlide.outerHeight(),
                            left: toPosition * -1 + 'px'
                        }, base.options.speed, base.options.sliderEasing, function() {

                            if ( base.currentSlideIndex == 0 ) {
                                base.$el.css('left', base.$slides.eq(0).position().left * -1);
                            } else if ( base.currentSlideIndex == base.slideIndexCount ) {
                                base.$el.css('left', base.$slides.eq(base.slideIndexCount).position().left * -1);
                            }

                            base.endToSlide();

                        });

                    // End slider

                    } else { 
                
                    // Begin Fader

                        if (lastSlideIndex !== base.currentSlideIndex) {
                            base.$slides.eq( lastSlideIndex ).fadeOut(base.options.speed);
                        }
                        
                        base.$slides.eq( base.currentSlideIndex ).fadeIn(base.options.speed, function() {

                            base.endToSlide();

                        });
{'fraction_non_alphanumeric': 0.10016025641025642, 'fraction_numerical': 0.0026041666666666665, 'mean_word_length': 1.3358287519008072, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '320193', 'n_tokens_mistral': 4791, 'n_tokens_neox': 4460, 'n_words': 1146}