 showCodeText = 'Show code'
 
 window.addEventListener('beforeunload', (e) ->
-  if dirty
+  if diskOutdated
     e.returnValue = 'Are you sure you want to leave this page?'
 )
 
 window.App =
   init: ->
     textarea = CodeMirror $('#source .panel-body').get(0),
-      value: '# Headline\n\nThis is some plain
-      text.\n\n    print("Hello World");'
+      value: code
       mode: 'markdown'
       indentUnit: 4
 

      textarea.setOption 'vimMode', $("#vimmode").is(":checked")

possiblyUpdate = ->
  return if code == textarea.getValue()

  code = textarea.getValue()
  dirty = true

  md = markdown(code)
  outputarea.find('.output').html(md)

    if reader.result == undefined
      console.log('file contents are undefined')
      return

    # Populate the text field with the new source code
    code = reader.result
    textarea.setValue(reader.result)
    diskOutdated = false
    renderOutdated = true

  reader.readAsText(file)

save = ->
