<commit_before>document.addEventListener('DOMContentLoaded', function () {
  const socket = io.connect()
  const title = document.getElementById('title')
  const description = document.getElementById('description')
  const assignedTo = document.getElementById('assignedTo')
  const dueDate = document.getElementById('dueDate')
  const createTask = document.getElementById('createTask')


  createTask.onclick = () => {
    console.log('title = ', title.value, ' description = ', description.value)
    socket.emit('createTask', {
      title: title.value,
      description: description.value,
      assignedTo: assignedTo.value,
      dueDate: dueDate.value
    })
    return false
  }

  socket.on('updateTaskList', task => {
    updateTable(task)
  })

  const updateTable = (task) => {
    const taskTable = document.getElementById('taskTable')
    console.log('taskTable = ', taskTable)
    let rowCount = taskTable.rows.length
    console.log('rowCount = ', rowCount)
    let row = taskTable.insertRow(rowCount)
    row.insertCell(0).innerHTML = rowCount
    row.insertCell(1).innerHTML = task.title
    row.insertCell(1).innerHTML = task.status
    row.insertCell(2).innerHTML = task.assignedTo
    row.insertCell(3).innerHTML = task.dueDate
  }

})<commit_msg>[clientSocket.js] Add client createTask on and emit evet with mock data<commit_after>document.addEventListener('DOMContentLoaded', function () {
  const socket = io.connect()
  const title = document.getElementById('title')
  const description = document.getElementById('description')
  const assignedTo = document.getElementById('assignedTo')
  const dueDate = document.getElementById('dueDate')
  const createTask = document.getElementById('createTask')

  createTask.onclick = () => {
    console.log('title = ', title.value, ' description = ', description.value)
    socket.emit('createTask', {
      title: title.value,
      description: description.value,
      assignedTo: assignedTo.value,
      dueDate: dueDate.value
    })
    return false
  }
  
  const updateTable = (data) => {
    const taskTable = document.getElementById('taskTable')
    let rowCount = taskTable.rows.length
    let row = taskTable.insertRow(rowCount)
    row.insertCell(0).innerHTML = rowCount
    row.insertCell(1).innerHTML = data.task.title
    row.insertCell(2).innerHTML = data.status
    row.insertCell(3).innerHTML = data.task.assignedTo
    row.insertCell(4).innerHTML = data.task.dueDate
  }

})
{'fraction_non_alphanumeric': 0.12449145646867373, 'fraction_numerical': 0.0040683482506102524, 'mean_word_length': 4.018367346938776, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1174355', 'n_tokens_mistral': 690, 'n_tokens_neox': 685, 'n_words': 133}