<commit_before>/*!
 * Villa Mowe v0.1.0 (http://getvilla.org/)
 * Copyright 2013-2015 Noibe Developers
 * Licensed under MIT (https://github.com/noibe/villa/blob/master/LICENSE)
 */

var _emailService = '<EMAIL>';
var emailServiceCount = 4;
var emailServiceClickCount = 8;

$('#prices-scroll').click(function () {
	$("html, body").animate({
		scrollTop: $('#prices').offset().top
	}, '1200'
	);
});

$('.wow').click(function () {
	if (!$(this).hasClass('show')) {
		$(this).addClass('show');
	} else {
		$(this).removeClass('show');
	}
});

$('.navbar header .toggle').click(function () {
	$(this).closest('.navbar').find('.menu').toggleClass('show');
});

window.onload = function () {

	$('.block').scrollList({
		beforePadding: 65,
		startName: "block"
	});

	$('#prices .slide .nav>li').distinct({
		content: $("#prices .slide .content .pricelist"),
		defaultClass: $("#prices").attr("class"),
		startName: "slide",
		target: $("#prices")
	});

	/* CONTACT FUNCTIONS START HERE */

	// Append forms
	var contactForm = '<a class="action user-unselect cursor-pointer" data-toggle="contact-form">Assine Já</a>' +
		'<input type="date" class="contact-form" name="name" placeholder="Nome" autocomplete="off"/>' +
		'<input type="tel" class="contact-form" name="phone" placeholder="Telefone (apenas números)" autocomplete="off" maxlength="11"/>' +
		'<input type="submit" class="contact-form action send user-unselect cursor-pointer" value="Solicitar Contato!"/>' +
		'<span class="action sent">Obrigado! :D<br/>Entraremos em contato em breve!</span>' +
		'<span class="action not-sent">Ops! :(<br/>Houve algum problema! Tente novamente mais tarde!</span>';

	$('.pricelist .content > li').insertHTML(contactForm);

	// Add mask to phone fields
	//$('.pricelist .content > li [name=phone]').mask('(99) 999999999');

	// Active form
	$('.pricelist .content > li [data-toggle=contact-form]').click(function() {
		// Remove Success and Fail class and fix de title
		$('.pricelist .content > .success').removeClass('success').
			find('[data-toggle=contact-form]').
			html('Assine Já');
		$('.pricelist .content > .fail').removeClass('fail').
			find('[data-toggle=contact-form]').
			html('Assine Já');

		// Get the Parent and some possible element with form enabled
		var a = $(this).parent(), b, c;

		// If the current element has active, disable it
		if ($(a).hasClass('active-form')) {
			$(a).removeClass('active-form');
			// Fix the title of button
			$(a).find('[data-toggle=contact-form]').html('Assine Já');
			b = true;
		}

		// Disable the form of any element with form enabled
		c = $('.pricelist .content > .active-form');
		if (c.length) {
			$(c).removeClass('active-form');
			// Fix the title of button of enabled itens
			$(c).find('[data-toggle=contact-form]').html('Assine Já');
		}

		// IF var b is ok, enable the form of current element
		if (!b) {
			// Enable the form of current element
			$(a).addClass('active-form');

			// Add the fallback to title of button
			$(this).html('Voltar');

			$(a).find('[name=name]').focus();
		}

	});

	// Send response to server
	$('.pricelist .content > li .send').click(function() {
		// Test number of clicks to request (MAX = 4)
		if (emailServiceClickCount > 0) {
			var a = $(this).parent();
			var aa = $(a).find('[name=name]').val();
			var ab = $(a).find('[name=phone]').val();

			// Test if fields are null
			if ((aa.length > 0) && (ab.length > 0)) {
				emailServiceClickCount--;
				var b = $(a).parent().parent();
				var	c = {
					name: aa,
					phone: ab,
					product: $(a).find('.title').html(),
					reference: $(b).attr('data-product-reference'),
					mail: _emailService
				};
				// Test number of requests (MAX = 4)
				if (emailServiceCount > 0) {
					$.ajax({
						cache: false,
						data: c,
						fail: function(data) {
							$(a).removeClass('active-form');
							$(a).addClass('fail');
						},
						success: function(data) {
							$(a).removeClass('active-form');
							$(a).addClass('success');
							emailServiceCount--;
						},
						url: 'api/wtal/'
					});
				} else {
					$(a).removeClass('active-form');
					$(a).addClass('fail');
				}
			} else {
				alert('Campos vazios');
			}
		} else {
			$(a).removeClass('active-form');
			$(a).addClass('fail');
		}
	});

	/* CONTACT FUNCTIONS ENDS HERE */

};<commit_msg>Final version of WTAL Project<commit_after>/*!
 * Villa Mowe v0.1.0 (http://getvilla.org/)
 * Copyright 2013-2015 Noibe Developers
 * Licensed under MIT (https://github.com/noibe/villa/blob/master/LICENSE)
 */

var _emailService = '<EMAIL>';
var _emailServiceURL = 'http://letsmowe.com/wtal/api/wtal/';
var emailServiceCount = 4;
var emailServiceClickCount = 8;

$('#prices-scroll').click(function () {
	$("html, body").animate({
		scrollTop: $('#prices').offset().top
	}, '1200'
	);
});

$('.wow').click(function () {
	if (!$(this).hasClass('show')) {
		$(this).addClass('show');
	} else {
		$(this).removeClass('show');
	}
});

$('.navbar header .toggle').click(function () {
	$(this).closest('.navbar').find('.menu').toggleClass('show');
});

window.onload = function () {

	$('.block').scrollList({
		beforePadding: 65,
		startName: "block"
	});

	$('#prices .slide .nav>li').distinct({
		content: $("#prices .slide .content .pricelist"),
		defaultClass: $("#prices").attr("class"),
		startName: "slide",
		target: $("#prices")
	});

	/* CONTACT FUNCTIONS START HERE */

	// Append forms
	var contactForm = '<a class="action user-unselect cursor-pointer" data-toggle="contact-form">Assine Já</a>' +
		'<input type="date" class="contact-form" name="name" placeholder="Nome" autocomplete="off"/>' +
		'<input type="tel" class="contact-form" name="phone" placeholder="Telefone (apenas números)" autocomplete="off" maxlength="11"/>' +
		'<input type="submit" class="contact-form action send user-unselect cursor-pointer" value="Solicitar Contato!"/>' +
		'<span class="action sent">Obrigado! :D<br/>Entraremos em contato em breve!</span>' +
		'<span class="action not-sent">Ops! :(<br/>Houve algum problema! Tente novamente mais tarde!</span>';

	$('.pricelist .content > li').insertHTML(contactForm);

	// Add mask to phone fields
	//$('.pricelist .content > li [name=phone]').mask('(99) 999999999');

	// Active form
	$('.pricelist .content > li [data-toggle=contact-form]').click(function() {
		// Remove Success and Fail class and fix de title
		$('.pricelist .content > .success').removeClass('success').
			find('[data-toggle=contact-form]').
			html('Assine Já');
		$('.pricelist .content > .fail').removeClass('fail').
			find('[data-toggle=contact-form]').
			html('Assine Já');

		// Get the Parent and some possible element with form enabled
		var a = $(this).parent(), b, c;

		// If the current element has active, disable it
		if ($(a).hasClass('active-form')) {
			$(a).removeClass('active-form');
			// Fix the title of button
			$(a).find('[data-toggle=contact-form]').html('Assine Já');
			b = true;
		}

		// Disable the form of any element with form enabled
		c = $('.pricelist .content > .active-form');
		if (c.length) {
			$(c).removeClass('active-form');
			// Fix the title of button of enabled itens
			$(c).find('[data-toggle=contact-form]').html('Assine Já');
		}

		// IF var b is ok, enable the form of current element
		if (!b) {
			// Enable the form of current element
			$(a).addClass('active-form');

			// Add the fallback to title of button
			$(this).html('Voltar');

			$(a).find('[name=name]').focus();
		}

	});

	// Send response to server
	$('.pricelist .content > li .send').click(function() {
		// Test number of clicks to request (MAX = 4)
		if (emailServiceClickCount > 0) {
			var a = $(this).parent();
			var aa = $(a).find('[name=name]').val();
			var ab = $(a).find('[name=phone]').val();

			// Test if fields are null
			if ((aa.length > 0) && (ab.length > 0)) {
				emailServiceClickCount--;
				var b = $(a).parent().parent();
				var	c = {
					name: aa,
					phone: ab,
					product: $(a).find('.title').html(),
					reference: $(b).attr('data-product-reference'),
					mail: _emailService
				};
				// Test number of requests (MAX = 4)
				if (emailServiceCount > 0) {
					$.ajax({
						cache: false,
						data: c,
						fail: function(data) {
							$(a).removeClass('active-form');
							$(a).addClass('fail');
						},
						success: function(data) {
							$(a).removeClass('active-form');
							$(a).addClass('success');
							emailServiceCount--;
						},
						url: _emailServiceURL
					});
				} else {
					$(a).removeClass('active-form');
					$(a).addClass('fail');
				}
			} else {
				alert('Campos vazios');
			}
		} else {
			$(a).removeClass('active-form');
			$(a).addClass('fail');
		}
	});

	/* CONTACT FUNCTIONS ENDS HERE */

};
{'fraction_non_alphanumeric': 0.20964791952446274, 'fraction_numerical': 0.008687700045724738, 'mean_word_length': 3.423154701718908, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 51, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '4455274', 'n_tokens_mistral': 3448, 'n_tokens_neox': 2890, 'n_words': 681}