anchor.diff:  ###
   @save_new_item = ->
     # Get the parameters from the form
  -  data = {}
  +  item = {}
     $.each $('#new-item-form').serializeArray(), (_, field) ->
  -    data[field.name] = field.value
  +    item[field.name] = field.value
   
  -  if !data.name
  +  if !item.name
       flash_error("Please enter a name for the item.", selector: '#new-item-errors')
       return
  -  if !data.category_id
  +  if !item.category_id
       flash_error("Please choose a category for the item.", selector: '#new-item-errors')
       return
   
  
positive.code:       # Close the dialog
        $('#new-item').modal('hide')
  
        # Add the new item to the items picker (maintaining sorted order) and display it
        index = _.sortedIndex(items_by_category[data.category_id], data, 'name')
        items_by_category[data.category_id].splice index, 0, data
        filter_by_category(data.category_id, force: true)
  
        # Let the user know we did it
        flash_success("Item \"#{data.name}\" created")
      else
        res.errors.forEach (err) -> flash_error(err, selector: '#new-item-errors')
    .fail (xhr, status, msg) ->
  
negative.code: Helper function to create a button for each JS Item
  ###
  create_button = (name) ->
    list_item = $('<li>')
    list_item.attr('name', name)
    list_item.addClass 'list-group-item btn btn-default'
    list_item.append name
  
    list_item.click ->
      toggle_active list_item
  