<commit_before><!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>The Hub - NOMS</title>
      
    <style>
        body { padding: 100px; font-family: Arial; font-size: 18px; color: #444; }
        h1 { font-size: 58px; }
        .form-group { margin: 10px 0 20px 0; font-size: 18px; }
        input[type="submit"] { border:none; background: #333; color: white; padding: 10px; margin-top: 20px; font-size: 24px; cursor: pointer; }
        input[type="text"] { padding: 10px; width: 420px; font-size: 28px; border: 2px solid #444; }
        input[type="file"] { font-size: 16px; padding: 10px 0;  }
    </style>  
      
  </head>
  <body>
      
  <div class="container">
      <h1>Hello. </h1><!-- Bonjour. 你好. -->
      <form method="post" enctype="multipart/form-data">
          <div class="form-group">
            <input type="text" name="title" placeholder="Enter title" />  
          </div>
          
          <!--
          <div class="form-group">
              <input type="file" name="file" />
          </div>
        -->
          
          <input type="submit" value="Upload" />
      </form>
  </div> 

  <script src="lib/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script type="text/javascript">
      
      /*
        $("form").submit(function (event) {
                    
          event.preventDefault();
          var formData = $(this).serialize();

          $.ajax({
              url: 'https://hub-admin.herokuapp.com/content-items',
              type: 'POST',
              data: formData,
              async: false,
              cache: false,
              contentType: false,
              processData: false,
              success: function (returndata) {
                  alert(formData);
              },
              error: function () {
                  alert("error in ajax form submission");
              }
          });


          //return false;
      });
      */
      
      
      function createCORSRequest(method, url) {
          var xhr = new XMLHttpRequest();
          if ("withCredentials" in xhr) {

            // Check if the XMLHttpRequest object has a "withCredentials" property.
            // "withCredentials" only exists on XMLHTTPRequest2 objects.
            xhr.open(method, url, true);

          } else if (typeof XDomainRequest != "undefined") {

            // Otherwise, check if XDomainRequest.
            // XDomainRequest only exists in IE, and is IE's way of making CORS requests.
            xhr = new XDomainRequest();
            xhr.open(method, url);

          } else {

            // Otherwise, CORS is not supported by the browser.
            xhr = null;

          }
          return xhr;
        }

        var xhr = createCORSRequest('POST', 'https://hub-admin.herokuapp.com/content-items');
        if (!xhr) {
          throw new Error('CORS not supported');
        }
      
        xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
        xhr.onload = function () {
            console.log(this.responseText);
        };
      
        var data = new FormData();
        data.append('title', 'Hello from Z');

      
        xhr.send(data);
      
  </script>
      
  </body>
</html><commit_msg>jquery form plugin added to test multipart submission<commit_after><!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>The Hub - NOMS</title>
      
    <style>
        body { padding: 100px; font-family: Arial; font-size: 18px; color: #444; }
        h1 { font-size: 58px; }
        .form-group { margin: 10px 0 20px 0; font-size: 18px; }
        input[type="submit"] { border:none; background: #333; color: white; padding: 10px; margin-top: 20px; font-size: 24px; cursor: pointer; }
        input[type="text"] { padding: 10px; width: 420px; font-size: 28px; border: 2px solid #444; }
        input[type="file"] { font-size: 16px; padding: 10px 0;  }
    </style>  
      
  </head>
  <body>
      
  <div class="container">
      <h1>Hello. </h1><!-- Bonjour. 你好. -->
      <form method="post" enctype="multipart/form-data" action="https://hub-admin.herokuapp.com/content-items">
          <div class="form-group">
            <input type="text" name="title" placeholder="Enter title" />  
          </div>
          

          <div class="form-group">
              <input type="file" name="file" />
          </div>

          
          <input type="submit" value="Upload" />
      </form>
  </div> 

  <script src="lib/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script> 
  <script src="http://malsup.github.com/jquery.form.js"></script> 
  <script type="text/javascript">
      
      
      $(document).ready(function() { 
            // bind 'myForm' and provide a simple callback function 
            $('form').ajaxForm(function() { 
                alert("DONE!"); 
            }); 
        }); 
      

      
  </script>
      
  </body>
</html>
{'fraction_non_alphanumeric': 0.1525592511451902, 'fraction_numerical': 0.020513841864170483, 'mean_word_length': 1.7593406593406593, 'pattern_counts': {'":': 0, '<': 68, '<?xml version=': 0, '>': 68, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, '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': '4455104', 'n_tokens_mistral': 1623, 'n_tokens_neox': 1505, 'n_words': 350}