<commit_before>//debate chat
import React from 'react';
import ReactDOM from 'react-dom';
import { Button, ControlLabel, Form, FormControl, FormGroup } from 'react-bootstrap';
const socket = require('socket.io-client')('http://localhost:3000');

export default class Chatview extends React.Component {
  constructor(props) {
    super(props);
    this.state = { 
      chat: {}
    }
    this.handleSubmit = (event) => {
      const username = ReactDOM.findDOMNode(this.refs.username).value.trim();
      const message = ReactDOM.findDOMNode(this.refs.message).value.trim();
      console.log('Send message');
      console.log('username', username);
      console.log('message', message);
      socket.emit('chat', {
        username: username,
        message: message
      });
    };
  }

 render () {
  return (
      <div>
        <ul className="pages">
          <li className="chat page">
            <div className="chatArea">
              <ul className="messages"></ul>
            </div>
            <input className="inputMessage" ref="message" placeholder="Type here..."/>
          </li><commit_msg>chat room is ready<commit_after>//debate chat
import React from 'react';
import ReactDOM from 'react-dom';
import { Button, ControlLabel, Form, FormControl, FormGroup } from 'react-bootstrap';
const socket = require('socket.io-client')('http://localhost:3000');

export default class Chatview extends React.Component {
  constructor(props) {
    super(props);
    this.state = { 
      chat: {}
    }
    
    this.handleSubmit = (event) => {
      const username = ReactDOM.findDOMNode(this.refs.username).value.trim();
      const message = ReactDOM.findDOMNode(this.refs.message).value.trim();
      // console.log('Send message');
      // console.log('username', username);
      // console.log('message', message);
      socket.emit('chat', {
        username: username,
        message: message
      });
    };
    
    // Listen for chats
    socket.on('chat', (data) => {
      const output = ReactDOM.findDOMNode(this.refs.output);
      output.innerHTML += `<p><strong>${data.username}:</strong>${data.message}</p>`;
      output.lastChild.scrollIntoView();
    });
  }

 render () {
  return (
      <div>
        <div id="chat-window">
          <div id="chat-window-output" ref="output"></div>
        </div>
        <ul className="pages">
          <li className="chat page">
            <div className="chatArea">
              <ul className="messages"></ul>
            </div>
            <input className="inputMessage" ref="message" placeholder="Type here..."/>
          </li>
{'fraction_non_alphanumeric': 0.15855993872079663, 'fraction_numerical': 0.003063960168517809, 'mean_word_length': 2.637883008356546, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 32, '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': '4253177', 'n_tokens_mistral': 745, 'n_tokens_neox': 726, 'n_words': 157}