       cx += dx
       cy += dy
 
+  saving = null
+  save = ->
+    if not saving
+      setTimeout ->
+        localStorage.setItem 'nodes', JSON.stringify nodes
+        saving = false
+      , 1000
+
+  $('#title').on 'input propertychange', ->
+    if selected
+      selected.title = $(this).val()
+      save()
+
+  $('#notes').on 'input propertychange', ->
+    if selected
+      selected.notes = $(this).val()
+      save()
+
   if nodes.length is 0
     head = new Node()
     head.x = w / 2


  nodes = JSON.parse localStorage.getItem 'nodes' or '[]'
  links = JSON.parse localStorage.getItem 'links' or '[]'
  nodes = []
  links = []

  sx = null
  sy = null
  lastClicked = null
  cx = 0
  cy = 0


        new Node().setParent node
        refresh()
      )

    node.append('circle')
      .on('mouseover', (d) ->
        d.over = true
      )
      .on('mouseout', (d) ->
        d.over = false
      )
      .on('click', (node) ->
        if selected
          selected.selected = false
        node.selected = true
        selected = node
        $('#notes').val selected.notes
        $('#title').val selected.title
        $('#panel a').html node.link
      )

    node.append('text')

    localStorage.setItem 'nodes', JSON.stringify nodes
