     e.preventDefault()
 
 
+  # Auth button click listener
+  #
+  # Sends message to background script to run 'vk_notification_auth' action
+  #
   $('#auth').click (e) ->
     chrome.runtime.sendMessage {action: "vk_notification_auth"}, (response) ->
       if response.content is 'OK'

    e.preventDefault()


  chrome.storage.local.get 'vkaccess_token': {}, (items) ->
    if items.vkaccess_token.length is undefined
      $('.auth-actions').show()



$ ->

  # Remove all group-items from local storage
  #
  $('#clean-items').click (e) ->
    chrome.storage.local.remove 'group_items', ->
      $('.item').remove()

    e.preventDefault()


  # Add controls for adding a group-item
  #
  $('#add-item').click (e) ->
    $input = $('<input />', {type: 'text', name: 'pageUrl', placeholder: 'Ссылка на группу'})
    $('<div />', {class: 'item'})
      .append($input)
