{"size": 1180, "ext": "js", "max_stars_repo_path": "src/js/contact.js", "max_stars_repo_name": "markwinpanerio/ililani", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/js/contact.js", "max_issues_repo_name": "markwinpanerio/ililani", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/js/contact.js", "max_forks_repo_name": "markwinpanerio/ililani", "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": 34.7058823529, "max_line_length": 319, "alphanum_fraction": 0.5508474576}
const $contactForm = $('#js-contact-form');
const $inputText = $contactForm.find('.js-input-text');
const $inputEmail = $contactForm.find('.js-input-email');
const baseURL = window.location.origin;

$contactForm.on('submit', function() {
  let flag = false;
  let thisInputText,
      emailInputText;

  for (let inputTextArray = 0; inputTextArray < $inputText.length; inputTextArray++) {
    thisInputText = $inputText.eq(inputTextArray);

    if (thisInputText.val() !== '') {
      flag = true;
      thisInputText.next('.contact-error').fadeOut();
    } else {
      thisInputText.next('.contact-error').fadeIn();
      flag = false;
    }
  }

  if (!flag) {
    return flag;
  } else {
    return flag;
    window.location.replace(`${baseURL}/contact-thanks.html`)
  }
});

function checkEmailFormat(emailAddress) {
  const pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i);
  return pattern.test(emailAddress);
}