anchor.diff:  
       $("##{@id}").foundation('reveal', 'close')
   
  -  attashEvents: ->
  +  bindEvents: ->
       that = this
       $(document).on 'opened', "##{@id}", ->
         Initjs.initializePartial()
  -      that.attashEventsToView()
  +      that.bindEventsToView()
   
       $(document).on 'closed', "##{@id}", ->
         $("##{@id}").remove()
   
  -  attashEventsToView: ->
  +  bindEventsToView: ->
       that = this
       $("##{@id} .insert-image.button").unbind('click')
       $("##{@id} .insert-image.button").on 'click', (e)->
         e.preventDefault()
         that.insertMarkdownImage()
         return false
  +
  +Neighborly.MarkdownPreviewer =
  +  init: (markItUp)->
  +    @markItUp = markItUp
  +    @id = "markItUpMarkdownPreviewer_#{markItUp.textarea.id}"
  +    this.createHtmlModal()
  +    this.bindEvents(markItUp)
  +
  +    $("##{@id}").foundation 'reveal', 'open',
  +      url: '<%= Rails.application.routes.url_helpers.markdown_previewer_index_url %>'
  +      method: 'POST'
  +      data: { markdown: markItUp.textarea.value }
  +
  +    return false
  +
  +  createHtmlModal: ->
  +    html = $('<div>').attr('id', @id).
  +                    attr('data-reveal', '').
  +                    addClass('reveal-modal medium')
  +    $('body').append(html)
  +
  +  bindEvents: ->
  +    that = this
  +    $(document).on 'opened', "##{@id}", ->
  +      that.bindEventsToView()
  +
  +    $(document).on 'closed', "##{@id}", ->
  +      $("##{@id}").remove()
  +
  +  bindEventsToView: ->
  +    $("##{@id} .close.button").unbind('click')
  +    $("##{@id} .close.button").on 'click', (e)->
  +      e.preventDefault()
  +      $("##{@id}").foundation('reveal', 'close')
  +      return false
  
positive.code:     name: "Quotes"
      openWith: "> "
      className: 'button secondary tiny'
    #,
      #separator: "---------------"
    #,
      #name: 'Preview'
      #call: 'preview'
      #className: 'button tiny'
    ]
  
  
  
negative.code:     @markItUp = markItUp
      @id = "markItUpPictureUpload_#{markItUp.textarea.id}"
      this.createHtmlModal()
      this.bindEvents(markItUp)
  
      $("##{@id}").foundation 'reveal', 'open',
        'url': '<%= Rails.application.routes.url_helpers.new_image_url %>'
  