<commit_before><!DOCTYPE html>
<html>
  <head>
    <title>Adopt a Hydrant</title>
    <%= stylesheet_link_tag "main" %>
    <%= javascript_include_tag "http://maps.google.com/maps/api/js?sensor=false" %>
    <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" %>
    <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" %>
    <%= javascript_include_tag "https://github.com/scottschiller/Snowstorm/raw/master/snowstorm-min.js" %>
    <script type="text/javascript">
    $(function() {
      var map;
      var latlng = new google.maps.LatLng(<%= @lat %>, <%= @lng %>);
      var myOptions = {
        mapTypeControl: false,
        scaleControl: true,
        scaleControlOptions: {
          position: google.maps.ControlPosition.BOTTOM_CENTER
        },
        zoom: <%= @zoom %>,
        zoomControl: false,
        center: latlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
      var openInfoWindow;
      var formString = '<%= render(:partial => "combo_form").gsub("\n", "") %>'
      function addMarker(point, color, contentString) {
        var image = new google.maps.MarkerImage(color,
          new google.maps.Size(27.0, 37.0),
          new google.maps.Point(0, 0),
          new google.maps.Point(13.0, 18.0)
        );
        var shadow = new google.maps.MarkerImage('/images/markers/shadow.png',
          new google.maps.Size(46.0, 37.0),
          new google.maps.Point(0, 0),
          new google.maps.Point(13.0, 18.0)
        );
        var marker = new google.maps.Marker({
          position: point,
          map: map,
          icon: image,
          shadow: shadow
        });
        var infoWindow = new google.maps.InfoWindow({
            content: contentString
        });
        google.maps.event.addListener(marker, 'click', function() {
          if(openInfoWindow) {
            openInfoWindow.close();
          }
          infoWindow.open(map, marker);
          $('.combo_form').data('state', 'new');
          $('.combo_form').submit(function() {
            var errors = []
            if(!/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]+$/.test($('.email').val())) {
              errors.push($('.email'));
              $('.email_label').addClass('error', 500);
              $('.email').addClass('error', 500);
            } else {
              $('.email_label').removeClass('error', 500);
              $('.email').removeClass('error', 500);
            }
            if($(this).data('state') === 'new') {
              if($('.name').val() === '') {
                errors.push($('.name'));
                $('.name_label').addClass('error', 500);
                $('.name').addClass('error', 500);
              } else {
                $('.name_label').removeClass('error', 500);
                $('.name').removeClass('error', 500);
              }
              if($('.choose_password').val() === '') {
                errors.push($('.choose_password'));
                $('.choose_password_label').addClass('error', 500);
                $('.choose_password').addClass('error', 500);
              } else {
                $('.choose_password_label').removeClass('error', 500);
                $('.choose_password').removeClass('error', 500);
              }
            } else if($(this).data('state') === 'existing') {
              if($('.password').val() === '') {
                errors.push($('.password'));
                $('.password_label').addClass('error', 500);
                $('.password').addClass('error', 500);
              } else {<commit_msg>Update email regex to match Rails<commit_after><!DOCTYPE html>
<html>
  <head>
    <title>Adopt a Hydrant</title>
    <%= stylesheet_link_tag "main" %>
    <%= javascript_include_tag "http://maps.google.com/maps/api/js?sensor=false" %>
    <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" %>
    <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" %>
    <%= javascript_include_tag "https://github.com/scottschiller/Snowstorm/raw/master/snowstorm-min.js" %>
    <script type="text/javascript">
    $(function() {
      var map;
      var latlng = new google.maps.LatLng(<%= @lat %>, <%= @lng %>);
      var myOptions = {
        mapTypeControl: false,
        scaleControl: true,
        scaleControlOptions: {
          position: google.maps.ControlPosition.BOTTOM_CENTER
        },
        zoom: <%= @zoom %>,
        zoomControl: false,
        center: latlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
      var openInfoWindow;
      var formString = '<%= render(:partial => "combo_form").gsub("\n", "") %>'
      function addMarker(point, color, contentString) {
        var image = new google.maps.MarkerImage(color,
          new google.maps.Size(27.0, 37.0),
          new google.maps.Point(0, 0),
          new google.maps.Point(13.0, 18.0)
        );
        var shadow = new google.maps.MarkerImage('/images/markers/shadow.png',
          new google.maps.Size(46.0, 37.0),
          new google.maps.Point(0, 0),
          new google.maps.Point(13.0, 18.0)
        );
        var marker = new google.maps.Marker({
          position: point,
          map: map,
          icon: image,
          shadow: shadow
        });
        var infoWindow = new google.maps.InfoWindow({
            content: contentString
        });
        google.maps.event.addListener(marker, 'click', function() {
          if(openInfoWindow) {
            openInfoWindow.close();
          }
          infoWindow.open(map, marker);
          $('.combo_form').data('state', 'new');
          $('.combo_form').submit(function() {
            var errors = []
            if(!/[\w.!#\$%+-]+@[\w-]+(?:\.[\w-]+)+/.test($('.email').val())) {
              errors.push($('.email'));
              $('.email_label').addClass('error', 500);
              $('.email').addClass('error', 500);
            } else {
              $('.email_label').removeClass('error', 500);
              $('.email').removeClass('error', 500);
            }
            if($(this).data('state') === 'new') {
              if($('.name').val() === '') {
                errors.push($('.name'));
                $('.name_label').addClass('error', 500);
                $('.name').addClass('error', 500);
              } else {
                $('.name_label').removeClass('error', 500);
                $('.name').removeClass('error', 500);
              }
              if($('.choose_password').val() === '') {
                errors.push($('.choose_password'));
                $('.choose_password_label').addClass('error', 500);
                $('.choose_password').addClass('error', 500);
              } else {
                $('.choose_password_label').removeClass('error', 500);
                $('.choose_password').removeClass('error', 500);
              }
            } else if($(this).data('state') === 'existing') {
              if($('.password').val() === '') {
                errors.push($('.password'));
                $('.password_label').addClass('error', 500);
                $('.password').addClass('error', 500);
              } else {
{'fraction_non_alphanumeric': 0.19030860855441256, 'fraction_numerical': 0.020032485110990796, 'mean_word_length': 1.9508785942492013, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 35, 'https://': 6, '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': '3614761', 'n_tokens_mistral': 2327, 'n_tokens_neox': 2115, 'n_words': 325}