<commit_before>project_key = 'test_key'

add_task = (name) ->
  # send to server
  task_id = null
  $.ajax({
    async: false,
    type: "POST",
    url: "<%= url_for "/new_task" %>",
    data: { project: project_key, name: name }
  }).done((id) ->
    task_id = id
  )

  add_task_html(task_id, name)

add_task_html = (id, name) ->
  # copy element
  new_task = $('#task-template').clone()
  new_task.attr('id', id)
  new_task.find('.task').text(name)
  new_task.show()

  # in-place task edit
  new_task.find('.task').editable('/edit_task',{
    submitdata : (value, settings) ->
      {
        project: project_key,
        task_id: $(this).parent().attr('id'),
      }
    event: 'edit_event',
    cssclass: 'editing-task',
    # onblur: 'ignore'
  })

  new_task.find('.edit').click(()->
    $(this).prev().trigger('edit_event')
  )

  new_task.find('.delete').click(()->
    $.ajax({<commit_msg>さらに変更漏れ<commit_after>project_key = 'test_key'

add_task = (name) ->
  # send to server
  task_id = null
  $.ajax({
    async: false,
    type: "POST",
    url: "<%= url_for "/new_task" %>",
    data: { project: project_key, name: name }
  }).done((id) ->
    task_id = id
  )

  add_task_html(task_id, name)

add_task_html = (id, name) ->
  # copy element
  new_task = $('#task-template').clone()
  new_task.attr('id', id)
  new_task.find('.task').text(name)
  new_task.show()

  # in-place task edit
  new_task.find('.task').editable("<%= url_for "/edit_task" %>", {
    submitdata : (value, settings) ->
      {
        project: project_key,
        task_id: $(this).parent().attr('id'),
      }
    event: 'edit_event',
    cssclass: 'editing-task',
    # onblur: 'ignore'
  })

  new_task.find('.edit').click(()->
    $(this).prev().trigger('edit_event')
  )

  new_task.find('.delete').click(()->
    $.ajax({
{'fraction_non_alphanumeric': 0.2053964757709251, 'fraction_numerical': 0.0, 'mean_word_length': 2.9586056644880174, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 18, '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': '639325', 'n_tokens_mistral': 693, 'n_tokens_neox': 678, 'n_words': 119}