   #
   # - in chrome sync,
   #
-  #     ticket = [ id, subject, project_url, project_id, show ]
+  #     ticket = [ id, subject, project_url_index, project_id, show ]
+  #
+  #     project = {
+  #       url:
+  #         id: name
+  #     }
+  #
+  #     index = [ project_url ]
   #
 
 

    ###
    sync: (callback) ->

      ticketArray = []
      for t in tickets
        ticketArray.push [t.id, t.subject, t.url, t.project.id, t.show]
      chrome.storage.sync.set TICKET: ticketArray, () ->
        if chrome.runtime.lastError?
          callback? false
        else
          callback? true

      projectObj = {}
      for t in tickets
        projectObj[t.url] = projectObj[t.url] or {}
        projectObj[t.url][t.project.id] = t.project.name
      chrome.storage.sync.set PROJECT: projectObj

  }
)


  TICKET = "TICKET"
  PROJECT = "PROJECT"
  INDEX = "INDEX"

  TICKET_ID        = 0
  TICKET_SUBJECT   = 1
  TICKET_URL_INDEX = 2
  TICKET_PRJ_ID    = 3
  TICKET_SHOW      = 4

  SHOW = { DEFAULT: 0, NOT: 1, SHOW: 2 }

