<commit_before>(function($) {
	$.fn.slider = function(opts) {
		// default configuration
		var config = $.extend({}, {
			speed: 1000, //移動速度
            waiting: 2000, //等待時間
            quickSpeed: 1000, //利用prev/next button切換slide的速度
            start: -1140, //起始位置(px)
            imageWidth: 560, //每次移動的距離(px)
            controlBtn: true, //是否開啟左右控制button
            autoRun: true //是否自動執行
		}, opts);
		// main function
		function init(obj) {
            var dSlider = $(obj);
            var dFrame = dSlider.find('.js-sliderList');
            var dItemList = dSlider.find('.js-sliderItem');
            var itemArray = [];
            var dPrevBtn = dSlider.find('.js-btnPrev');
            var dNextBtn = dSlider.find('.js-btnNext');
            var stop = false;
            var reset = false;

            function autoRun(){
                setInterval(function(){
                    if(!stop){
                        if(reset){
                            itemArray = [];
                            dItemList = dSlider.find('.js-sliderItem');
                            $.each( dItemList, function( key, value ) {
                                $(value).clone().appendTo(dFrame);
                                itemArray.push(value);
                            });
                            reset = false;
                        }

                        var dCurrent = $(itemArray.shift());
                        dCurrent.clone().appendTo(dFrame);
                        itemArray.push(dCurrent);
                        dFrame.animate({left: '-=' + config.imageWidth + 'px'}, config.speed, function(){
                            dSlider.find('.js-sliderItem').eq(0).remove();
                            dFrame.css('left', config.start + 'px');
                        });
                    }
                }, config.waiting);
            }

            dSlider.on('mouseover mouseout', function(e){
                var dThisWrapper = $(this);
                if(e.type == 'mouseover') {
                    stop = true;
                } 
                else{ //mouseout
                    stop = false;
                }
            });

            dPrevBtn.click(function(e){
                e.preventDefault();
                stop = true;
                reset = true;
                var dThisBtn = $(this);
                if(!dThisBtn.hasClass('disabled')){
                    dThisBtn.addClass('disabled');
                    dFrame.animate({left: '+=' + config.imageWidth + 'px'}, config.quickSpeed, function(){
                        var dLastItem = dSlider.find('.js-sliderItem').last();
                        itemArray.push(dLastItem);
                        dLastItem.remove();
                        dLastItem.prependTo(dFrame);  

                        dFrame.css('left', config.start + 'px');
                        dThisBtn.removeClass('disabled');
                    });
                }
            });

            dNextBtn.click(function(e){
                e.preventDefault();
                stop = true;
                var dThisBtn = $(this);
                if(!dThisBtn.hasClass('disabled')){
                    dThisBtn.addClass('disabled');
                    var dCurrent =  dSlider.find('.js-sliderItem').eq(0);
                    dCurrent.clone().appendTo(dFrame);
                    itemArray.push(dCurrent);
                    dFrame.animate({left: '-=' + config.imageWidth + 'px'}, config.quickSpeed, function(){
                        dSlider.find('.js-sliderItem').eq(0).remove();
                        dFrame.css('left', config.start + 'px');
                        dThisBtn.removeClass('disabled');
                    });                    
                }
            });            

            //init
            //double slide list
            $.each( dItemList, function( key, value ) {
                $(value).clone().appendTo(dFrame);<commit_msg>slider example 2<commit_after>(function($) {
	$.fn.slider = function(opts) {
		// default configuration
		var config = $.extend({}, {
			speed: 1000, //移動速度
            waiting: 2000, //等待時間
            quickSpeed: 1000, //利用prev/next button切換slide的速度
            start: -1140, //起始位置(px)
            imageWidth: 560, //每次移動的距離(px)
            controlBtn: true, //是否開啟左右控制button
            autoRun: true //是否自動執行
		}, opts);
		// main function
		function init(obj) {
            var dSlider = $(obj);
            var dFrame = dSlider.find('.js-sliderList');
            var dItemList = dSlider.find('.js-sliderItem');
            var itemArray = [];
            var dPrevBtn = dSlider.find('.js-btnPrev');
            var dNextBtn = dSlider.find('.js-btnNext');
            var stop = false;
            var reset = false;

            function autoRun(){
                var dCurrent;
                setInterval(function(){
                    if(!stop){
                        if(reset){
                            itemArray = [];
                            dItemList = dSlider.find('.js-sliderItem');
                            $.each( dItemList, function( key, value ) {
                                $(value).clone().appendTo(dFrame);
                                itemArray.push(value);
                            });
                            reset = false;
                        }

                        dCurrent = $(itemArray.shift());
                        dCurrent.clone().appendTo(dFrame);
                        itemArray.push(dCurrent);
                        dFrame.animate({left: '-=' + config.imageWidth + 'px'}, config.speed, function(){
                            dSlider.find('.js-sliderItem').eq(0).remove();
                            dFrame.css('left', config.start + 'px');
                        });
                    }
                }, config.waiting);
            }

            dSlider.on('mouseover mouseout', function(e){
                var dThisWrapper = $(this);

                if(e.type == 'mouseover'){
                    stop = true;
                } 
                else{ //mouseout
                    stop = false;
                }
            });

            dPrevBtn.click(function(e){
                var dThisBtn = $(this);

                e.preventDefault();
                stop = true;
                reset = true;
                
                if(!dThisBtn.hasClass('disabled')){
                    dThisBtn.addClass('disabled');
                    dFrame.animate({left: '+=' + config.imageWidth + 'px'}, config.quickSpeed, function(){
                        var dLastItem = dSlider.find('.js-sliderItem').last();
                        itemArray.push(dLastItem);
                        dLastItem.remove();
                        dLastItem.prependTo(dFrame);  

                        dFrame.css('left', config.start + 'px');
                        dThisBtn.removeClass('disabled');
                    });
                }
            });

            dNextBtn.click(function(e){
                var dThisBtn = $(this);

                e.preventDefault();
                stop = true;
                
                if(!dThisBtn.hasClass('disabled')){
                    dThisBtn.addClass('disabled');
                    var dCurrent =  dSlider.find('.js-sliderItem').eq(0);
                    dCurrent.clone().appendTo(dFrame);
                    itemArray.push(dCurrent);
                    dFrame.animate({left: '-=' + config.imageWidth + 'px'}, config.quickSpeed, function(){
                        dSlider.find('.js-sliderItem').eq(0).remove();
                        dFrame.css('left', config.start + 'px');
                        dThisBtn.removeClass('disabled');
                    });                    
                }
            });            

            //init
            //double slide list
            $.each( dItemList, function( key, value ) {
                $(value).clone().appendTo(dFrame);
{'fraction_non_alphanumeric': 0.12855175866816873, 'fraction_numerical': 0.005632745024408562, 'mean_word_length': 1.0688762299326773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3398695', 'n_tokens_mistral': 2083, 'n_tokens_neox': 1969, 'n_words': 330}