<commit_before>/*{
  "id":"console",
	"scope":["client"],
	"desc":"cli",
  "deps":["console.html","console.styl"]
}*/
var telepath = require('tele')

module.exports = function () {
  var self = this
  telepath(this)

  this.recv = function (buffer) {
    var data = JSON.parse(buffer.toString())
    console.dir(data)
  }

  setInterval(function () {
    self.send({test:Math.random()})
  }, 300)

  // this.template = null;
  // this.output = new Stream();

  // this.init = function () {

  //   var container = document.getElementById('container')
  //   , log = document.createElement('div');

  //   log.setAttribute('id','console');
  //   log.innerHTML = self.template;

  //   container.appendChild(log);

  //   var form = document.getElementById('x')
  //   , prompt = form.querySelector('.console');

  //   form.onsubmit = function (e) {
  //     e.preventDefault();
  //     var cmd = e.target[0].value; // entered text
  //     self.output.emit('data',cmd);
  //     prompt.blur();
  //   }
  //   
  //   prompt.onfocus = function () {
  //     prompt.value = '';
  //   }

  //   prompt.onblur = function () {
  //     prompt.value = '>';
  //   }
  // }

  // this.output.on('data', function (data) {
  //   console.dir(data);
  // });<commit_msg>fixed console module form methods<commit_after>/*{
  "id":"console",
	"scope":["client"],
	"desc":"cli",
  "deps":["console.html","console.styl"]
}*/
var telepath = require('tele')

module.exports = function () {
  var self = this
  telepath(this)

  this.recv = function (buffer) {
    var data = JSON.parse(buffer.toString())
    console.dir(data)
  }

  this.render = function (html) {
    var container = document.getElementById('container')
    , log = document.createElement('div')
    log.innerHTML = html
    container.appendChild(log)
    var form = document.getElementById('x')
    , prompt = form.querySelector('.console')

    form.onsubmit = function (e) {
      e.preventDefault()
      var cmd = e.target[0].value
      self.send({cmd:cmd})
      prompt.blur()
    }

    prompt.onfocus = function () {
      prompt.value = ''
    }

    prompt.onblur = function () {
      prompt.value = '>'
    }
  }
{'fraction_non_alphanumeric': 0.19303071985327833, 'fraction_numerical': 0.0022925263640531865, 'mean_word_length': 2.542207792207792, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 5, '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': '2436793', 'n_tokens_mistral': 726, 'n_tokens_neox': 703, 'n_words': 122}