<commit_before><!doctype html>
<meta charset=utf-8>
<title>Chat</title>

<section id=log></section>

<form id=sofa>
  <div id=prompt><input id=in type=text placeholder="Start Chatting!"></div>
</form>

<style>
  #log { position:fixed; top:0px; bottom:2em; right:0px;
    width:100%; overflow-x:auto; }
  #log p { margin-left: 5px; text-indent:5px; }
  #sofa { position:fixed; bottom:0px; left:0px; width:100%; }
  #prompt { padding:0px 3px; }
  #in { width:100%; border:0px; padding:0px 0px; font-size:1.5em; }
</style>

<script src=/js/scout.js>/* Ajax library. */</script>
<script>
(function(){

  function log(nick, message) {
    var p = document.createElement('p');
    Scout('#log').appendChild(p).textContent = nick + ': ' + message;
    Scout('#in').focus();
    p.scrollIntoView();
  }

  Scout('#sofa').on('submit', function (query) {
    var box = Scout('#in'),
        message = box.value;
    box.value = '';

    query.action = 'talk';
    query.data = { nick:nick, message:message };
  });

  // Local variables.
  var nick = '<NAME>';

  // Main function.
  window.onload = function loading () {
    nick = prompt ('What do you want your nickname to be?');

    (function listen () {
      Scout.maker().send(function (query) {
        query.action = 'all';
        query.data = {a:0};
        query.resp = function (data) {
          if (data.message) log(data.nick, data.message);
          listen();
        };
        query.error = function () { listen(); };
      })();
    }());
  };

}());
</script>

<commit_msg>shorter and more sensible js<commit_after><!doctype html>
<meta charset=utf-8>
<title>Chat</title>

<section id=log></section>

<form id=sofa>
  <div id=prompt><input id=in type=text placeholder="Start Chatting!"></div>
</form>

<style>
  #log { position:fixed; top:0px; bottom:2em; right:0px;
    width:100%; overflow-x:auto; }
  #log p { margin-left: 5px; text-indent:5px; }
  #sofa { position:fixed; bottom:0px; left:0px; width:100%; }
  #prompt { padding:0px 3px; }
  #in { width:100%; border:0px; padding:0px 0px; font-size:1.5em; }
</style>

<script src=/js/scout.js>/* Ajax library. */</script>
<script>
(function(){

  function log(nick, message) {
    var p = document.createElement('p');
    Scout('#log').appendChild(p).textContent = nick + ': ' + message;
    Scout('#in').focus();
    p.scrollIntoView();
  }

  Scout('#sofa').on('submit', function (query) {
    var box = Scout('#in');
    query.action = 'talk';
    query.data = { nick:nick, message:box.value };
    box.value = '';
  });

  // Local variables.
  var nick = '<NAME>';

  // Main function.
  window.onload = function loading () {
    nick = prompt ('What do you want your nickname to be?');

    (function listen () {
      Scout.maker().send(function (query) {
        query.action = 'all';
        query.data = {a:0};
        query.resp = function (data) {
          if (data.message) log(data.nick, data.message);
          listen();
        };
        query.error = function () { listen(); };
      })();
    }());
  };

}());
</script>


{'fraction_non_alphanumeric': 0.19810395554102647, 'fraction_numerical': 0.016345210853220007, 'mean_word_length': 3.0422721268163806, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, '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': '7339986', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1056, 'n_words': 234}