<commit_before>/*
 *  Project: Slidefull Plugin
 *  Description: jQuery plugin to create a simple and responsive image slideshow.
 *  Author: <NAME> <<EMAIL>>
 *  License: MIT
 */
;(function ($, window, document) {

	var pluginName = "Slidefull";
	var defaults = {
		auto: true,
		prev: null,
		next: null,
		speed: 500,
		duration: 3000
	};

	function Plugin(element, options) {
		this.element = element;
		this.options = $.extend({}, defaults, options);
		this._defaults = defaults;
		this._name = pluginName;
		this.init();
	}

	Plugin.prototype = {
		init: function () {
			var itens
			var pages = '';
			var controls = '';
			var pagination = '';

			this.options.itens = [];
			this.options.wrapper = jQuery(this.element);
			itens = this.options.wrapper.find('.slidefull-item');

			itens.each(function(index, item){
				item = jQuery(item);
				item.hide();
				this.options.itens.push(item);
				pages = pages + this.getPageTemplate(index);
			}.bind(this));

			pagination = this.getPagination(pages);
			controls = this.getControls();

			this.options.wrapper.append(pagination);
			this.options.wrapper.append(controls);

			this.options.atual = 0;
			this.options.total = this.options.itens.length;

			this.show(this.options.atual);
		},

		getPageTemplate: function (index) {
			return '<div class="slidefull-page" data-page="' + index + '">'+ (index + 1)+ '</div>';
		},

		getPagination: function(pages){
			return '<div class="slidefull-pagination">' + pages + '</div>';
		},

		getControls: function(){
			return '<div class="slidefull-controls">'+
						'<div class="slidefull-arrow next"></div>'+
						'<div class="slidefull-arrow prev"></div>'+
					'</div>';
		},

		updateActivePage: function(index){
			var activePage = this.options.wrapper.find('.slidefull-page.active');
			var indexPage = this.options.wrapper.find('.slidefull-page[data-page=' + index + ']');

			activePage.removeClass('active');
			indexPage.addClass('active');
		},

		show: function(index){
			index = index + 1;

			if(index == this.options.total){
				index = 0;
			}
			else if(index < 0){
				index = this.options.total - 1;
			}

			clearTimeout(this.options.timeout);

			this.options.itens[index].fadeIn();
			this.options.itens[this.options.atual].fadeOut();

			this.updateActivePage(index);<commit_msg>Enable custom speed slide transition<commit_after>/*
 *  Project: Slidefull Plugin
 *  Description: jQuery plugin to create a simple and responsive image slideshow.
 *  Author: <NAME> <<EMAIL>>
 *  License: MIT
 */
;(function ($, window, document) {

	var pluginName = "Slidefull";
	var defaults = {
		auto: true,
		prev: null,
		next: null,
		speed: 500,
		duration: 3000
	};

	function Plugin(element, options) {
		this.element = element;
		this.options = $.extend({}, defaults, options);
		this._defaults = defaults;
		this._name = pluginName;
		this.init();
	}

	Plugin.prototype = {
		init: function () {
			var itens
			var pages = '';
			var controls = '';
			var pagination = '';

			this.options.itens = [];
			this.options.wrapper = jQuery(this.element);
			itens = this.options.wrapper.find('.slidefull-item');

			itens.each(function(index, item){
				item = jQuery(item);
				item.hide();
				this.options.itens.push(item);
				pages = pages + this.getPageTemplate(index);
			}.bind(this));

			pagination = this.getPagination(pages);
			controls = this.getControls();

			this.options.wrapper.append(pagination);
			this.options.wrapper.append(controls);

			this.options.atual = 0;
			this.options.total = this.options.itens.length;

			this.show(this.options.atual);
		},

		getPageTemplate: function (index) {
			return '<div class="slidefull-page" data-page="' + index + '">'+ (index + 1)+ '</div>';
		},

		getPagination: function(pages){
			return '<div class="slidefull-pagination">' + pages + '</div>';
		},

		getControls: function(){
			return '<div class="slidefull-controls">'+
						'<div class="slidefull-arrow next"></div>'+
						'<div class="slidefull-arrow prev"></div>'+
					'</div>';
		},

		updateActivePage: function(index){
			var activePage = this.options.wrapper.find('.slidefull-page.active');
			var indexPage = this.options.wrapper.find('.slidefull-page[data-page=' + index + ']');

			activePage.removeClass('active');
			indexPage.addClass('active');
		},

		show: function(index){
			index = index + 1;

			if(index == this.options.total){
				index = 0;
			}
			else if(index < 0){
				index = this.options.total - 1;
			}

			clearTimeout(this.options.timeout);

			this.options.itens[index].fadeIn({
				queue: false,
				duration: this.options.speed
			});

			this.options.itens[this.options.atual].fadeOut({
				queue: false,
				duration: this.options.speed
			});

			this.updateActivePage(index);
{'fraction_non_alphanumeric': 0.16876574307304787, 'fraction_numerical': 0.0054575986565911, 'mean_word_length': 3.4783834586466167, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 29, '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': '563140', 'n_tokens_mistral': 1846, 'n_tokens_neox': 1524, 'n_words': 309}