{"size": 1297, "ext": "js", "max_stars_repo_path": "client/assets/js/reset.js", "max_stars_repo_name": "Wangrek/eventos", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/assets/js/reset.js", "max_issues_repo_name": "Wangrek/eventos", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/assets/js/reset.js", "max_forks_repo_name": "Wangrek/eventos", "max_forks_repo_forks_event_min_datetime": "2019-01-28T20:09:02.000Z", "max_forks_repo_forks_event_max_datetime": "2019-01-28T20:09:02.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 29.4772727273, "max_line_length": 169, "alphanum_fraction": 0.4980724749}
(function () {
  var app = {
    init: function () {
      app.interactions();
    },

    interactions: function () {
      app.validate_login();
    },

    validate_login: function () {
      var $email = $('#reset-email');
      var $submit = $('button[type="submit"]');

      // Se valida el email al refrescarse la web
      if (app.validate_email($email.val())) {
        $submit.attr('disabled', false);
      } else {
        $submit.attr('disabled', true);
      }

      // Valida el email cada que se presiona una tecla
      $email.keyup(function () {
        $('.invalid-text').remove();

        if ( app.validate_email($email.val()) ) {
          $email.removeClass('is-invalid');
          $submit.attr('disabled', false);
        } else {
          $email.addClass('is-invalid');
          $email.parent().append('<small class="invalid-text">Por favor ingresa un correo electrónico válido</small>');
          $submit.attr('disabled', true);
        }
      });
    },

    validate_email: function (email) {
      var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
      return re.test(String(email).toLowerCase());
    }
  };

  $(document).ready(app.init);
})();