{"size": 2429, "ext": "js", "max_stars_repo_path": "_assets/js/script.js", "max_stars_repo_name": "ingcarlosmrivera/ci_starter_template", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "_assets/js/script.js", "max_issues_repo_name": "ingcarlosmrivera/ci_starter_template", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "_assets/js/script.js", "max_forks_repo_name": "ingcarlosmrivera/ci_starter_template", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.5764705882, "max_line_length": 97, "alphanum_fraction": 0.5800741046}
// Own scripts
// override jquery validate plugin defaults
if ($.validator) {
	$.validator.setDefaults({
	    highlight: function(element) {
	    	$(element).closest('.form-group').addClass('has-error');
	    },
	    unhighlight: function(element) {
	        $(element).closest('.form-group').removeClass('has-error').addClass('has-success');
	    },
	    errorElement: 'span',
	    errorClass: 'help-block',
	    errorPlacement: function(error, element) {
	    	if( $(element).hasClass('select2-hidden-accessible') ) {
	    		error.insertAfter(element.next('span.select2'));
	    		console.log('select2', element)
	    	} else {
	    		if(element.parent('.input-group').length) {
		            error.insertAfter(element.parent());
		        } else {
		            error.insertAfter(element);
		        }
	    	}	        
	    }
	});
}

// document ready
$(function() {
	// li.error -> add fa-cancel and text-danger class
	$.each($('li.error'), function(i, val) {
		 $(this).addClass('text-danger').prepend('<span class="glyphicon glyphicon-remove"></span> ');
	});

	// li.success -> add fa-check and text-success class
	$.each($('li.success'), function(i, val) {
		 $(this).addClass('text-success').prepend('<span class="glyphicon glyphicon-ok"></span> ');
	});

	// li.warning -> add fa-check and text-warning class
	$.each($('li.warning'), function(i, val) {
		 $(this).addClass('text-warning').prepend('<span class="glyphicon glyphicon-alert"></span> ');
	});

	// li.info -> add fa-check and text-info class
	$.each($('li.info'), function(i, val) {
		 $(this).addClass('text-info').prepend('<span class="glyphicon glyphicon-info-sign"></span> ');
	});

	$.each($('.alert-temp'), function(index, val) {
		var time  = ($(this).data('time') !== undefined) ? $(this).data('time') : 5000;
		var t = parseFloat(parseFloat(time) / 1000) + 's';
		var alert = $(this);
		var bar   = $(this).find('.progress-bar');
		
		$(bar).css({
    		transition: parseFloat(parseFloat(time) / 1000) + 's',
    		width: '100%'
    	});
		setTimeout(function() {
			$(alert).fadeOut('400', function() {
				// callback if required
			});
		},
			time
		);
	});

	function fill_bar(selector, time)
	{
		var t = time/100;
		var i = 0;
		var counterBack = setInterval(function () {
		  i++;
		  if (i < 100) {
		    selector.css('width', i + '%');
		    console.log( + ' -> ' + i)
		  } else {
		    clearInterval(counterBack);
		  }

		}, t);
	}

})