<commit_before>/*
 * jQuery Pico Slider v0.1
 * https://github.com/LuizArmesto/JQuery-Pico-Slider
 *
 * Copyright 2011, <NAME>
 * Dual licensed under the MIT or GPL Version 2 licenses, just like jQuery itself.
 * 
 * November 2011
 */
 (function($) {
    Slider = function(element, args) {
        var me = $(element);
        var effect = args["effect"];
        var animTime = args["animSpeed"];
        this.pauseTime = args["pauseTime"];
        var pauseOnMouseOver = args["pauseOnMouseOver"];
        var showControls = args["showControls"];
     
        var slides = me.children()
        slides.css("position", "absolute");
        slides.css("top", "0px");
        slides.slice(1).hide()
        
        var current = 0;
        this.showNext = function() {
            var next = current + 1;
            if (current == slides.length - 1) { 
                next = 0;
            }

            var slide = $(slides[current]);
            var next_slide = $(slides[next]);
            
            next_slide.zIndex(1000);
            slide.zIndex(1001);
            next_slide.show();
            slide.fadeOut(animTime)
            
            current++;
            if (current >= slides.length) { 
                current = 0;
            }
        }
        
        this.showPrev = function() {
            var prev = current - 1;
            if (current == 0) { 
                prev = slides.length - 1;
            }

            if (window.console) console.log(me);
            var slide = $(slides[current]);
            var prev_slide = $(slides[prev]);
            
            prev_slide.zIndex(1000);
            slide.zIndex(1001);
            prev_slide.show();
            slide.fadeOut(animTime)
            
            current--;
            if (current < 0) { 
                current = slides.length - 1;
            }
        }
        				            
        this.flip = function() {
            this.showNext();
        }
        
        this.timer = setInterval(this.showNext, this.pauseTime);
        this.paused = false;
        
        if (pauseOnMouseOver) {
            me.hover(
                function() {
                    var slider = $(this).data('picoslider');
                    slider.paused = true;
                    clearInterval(slider.timer);
                },
                function() {
                    var slider = $(this).data('picoslider');
                    if (slider.paused) {
                        slider.timer = setInterval(slider.showNext, slider.pauseTime);
                        slider.paused = false;
                    }
                }
            );
        }
        
        var nextNav = $("<div>");
        var prevNav = $("<div>");
        nextNav.addClass("nextNav");
        prevNav.addClass("prevNav");
        me.append(nextNav);
        me.append(prevNav);
        $(".nextNav", me).live("click", this.showNext);
        $(".prevNav", me).live("click", this.showPrev);
        
    }
        
    $.fn.picoSlider = function(args) {
        return this.each(function(key, value){
            var element = $(this);
            var slider = new Slider(element, args);
            element.data("picoslider", slider);
        });			        
    }
    
})(jQuery);<commit_msg>Renames Slider to PicoSlider<commit_after>/*
 * jQuery Pico Slider v0.1
 * https://github.com/LuizArmesto/JQuery-Pico-Slider
 *
 * Copyright 2011, <NAME>
 * Dual licensed under the MIT or GPL Version 2 licenses, just like jQuery itself.
 * 
 * November 2011
 */
 (function($) {
    PicoSlider = function(element, args) {
        var me = $(element);
        var effect = args["effect"];
        var animTime = args["animSpeed"];
        this.pauseTime = args["pauseTime"];
        var pauseOnMouseOver = args["pauseOnMouseOver"];
        var showControls = args["showControls"];
     
        var slides = me.children()
        slides.css("position", "absolute");
        slides.css("top", "0px");
        slides.slice(1).hide()
        
        var current = 0;
        this.showNext = function() {
            var next = current + 1;
            if (current == slides.length - 1) { 
                next = 0;
            }

            var slide = $(slides[current]);
            var next_slide = $(slides[next]);
            
            next_slide.zIndex(1000);
            slide.zIndex(1001);
            next_slide.show();
            slide.fadeOut(animTime)
            
            current++;
            if (current >= slides.length) { 
                current = 0;
            }
        }
        
        this.showPrev = function() {
            var prev = current - 1;
            if (current == 0) { 
                prev = slides.length - 1;
            }

            if (window.console) console.log(me);
            var slide = $(slides[current]);
            var prev_slide = $(slides[prev]);
            
            prev_slide.zIndex(1000);
            slide.zIndex(1001);
            prev_slide.show();
            slide.fadeOut(animTime)
            
            current--;
            if (current < 0) { 
                current = slides.length - 1;
            }
        }
        				            
        this.flip = function() {
            this.showNext();
        }
        
        this.timer = setInterval(this.showNext, this.pauseTime);
        this.paused = false;
        
        if (pauseOnMouseOver) {
            me.hover(
                function() {
                    var slider = $(this).data('picoslider');
                    slider.paused = true;
                    clearInterval(slider.timer);
                },
                function() {
                    var slider = $(this).data('picoslider');
                    if (slider.paused) {
                        slider.timer = setInterval(slider.showNext, slider.pauseTime);
                        slider.paused = false;
                    }
                }
            );
        }
        
        var nextNav = $("<div>");
        var prevNav = $("<div>");
        nextNav.addClass("nextNav");
        prevNav.addClass("prevNav");
        me.append(nextNav);
        me.append(prevNav);
        $(".nextNav", me).live("click", this.showNext);
        $(".prevNav", me).live("click", this.showPrev);
        
    }
        
    $.fn.picoSlider = function(args) {
        return this.each(function(key, value){
            var element = $(this);
            var slider = new PicoSlider(element, args);
            element.data("picoslider", slider);
        });			        
    }
    
})(jQuery);
{'fraction_non_alphanumeric': 0.12764017626500532, 'fraction_numerical': 0.011852302081750494, 'mean_word_length': 1.288595271210014, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5485167', 'n_tokens_mistral': 1887, 'n_tokens_neox': 1744, 'n_words': 358}