<commit_before>//
// KEYBOARD MAGIC
//
// initially grabbed from
//   http://www.howtocreate.co.uk/tutorials/javascript/eventinfo

// completely gutted for now, just supporting "Ctrl-ENTER" to submit the text area
// once we have more sophisticated features, we can plug some keyboard navigation in
var Keyboard = {
  verbose: false, // for debugging

  init: function() {
    Event.observe(document, 'keyup', Keyboard.handleKeyEvent);
  },

  // the keyboard event handler function
  handleKeyEvent: function(e) {
    var k;
    if( !e ) {
      //if the browser did not pass the event information to the
      //function, we will have to obtain it from the event register
      if( window.event ) {
        //Internet Explorer
        e = window.event;
      } else {
        //total failure, we have no way of referencing the event
        return;
      }
    }

    if( typeof( e.keyCode ) == 'number'  ) {
      k = e.keyCode; // DOM
    } else if( typeof( e.which ) == 'number' ) {
      k = e.which; //NS 4 compatible
    } else if( typeof( e.charCode ) == 'number'  ) {
      k = e.charCode; //also NS 6+, Mozilla 0.9+
    } else {
      return; //total failure, we have no way of obtaining the key code
    }
    if (Keyboard.verbose) {<commit_msg>enter key in a middle of string is not breaking the line up any more<commit_after>//
// KEYBOARD MAGIC
//
// initially grabbed from
//   http://www.howtocreate.co.uk/tutorials/javascript/eventinfo

// completely gutted for now, just supporting "Ctrl-ENTER" to submit the text area
// once we have more sophisticated features, we can plug some keyboard navigation in
var Keyboard = {
  verbose: false, // for debugging

  init: function() {
    Event.observe(document, 'keydown', Keyboard.handleKeyEvent);
  },

  // the keyboard event handler function
  handleKeyEvent: function(e) {
    var k;
    if( !e ) {
      //if the browser did not pass the event information to the
      //function, we will have to obtain it from the event register
      if( window.event ) {
        //Internet Explorer
        e = window.event;
      } else {
        //total failure, we have no way of referencing the event
        return;
      }
    }

    if( typeof( e.keyCode ) == 'number'  ) {
      k = e.keyCode; // DOM
    } else if( typeof( e.which ) == 'number' ) {
      k = e.which; //NS 4 compatible
    } else if( typeof( e.charCode ) == 'number'  ) {
      k = e.charCode; //also NS 6+, Mozilla 0.9+
    } else {
      return; //total failure, we have no way of obtaining the key code
    }
    if (Keyboard.verbose) {
{'fraction_non_alphanumeric': 0.11435239206534423, 'fraction_numerical': 0.0031116297160637884, 'mean_word_length': 2.318709677419355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '496218', 'n_tokens_mistral': 793, 'n_tokens_neox': 760, 'n_words': 290}