 fs = require "fs-plus"
 
 ### TODO
-- Able to remove existing link
 - Support link with id
 ###
 


  onConfirm: ->
    text = @textEditor.getText()
    title = @titleEditor.getText()
    url = @urlEditor.getText()
    @insertLinkToEditor(text, title, url)
    @saveLink(text, title, url) if @saveCheckbox.prop("checked")
    @detach()

  display: ->


  initialize: ->
    @fetchPosts()
    @loadSavedLinks()
    @handleEvents()
    @on "core:confirm", => @onConfirm()
    @on "core:cancel", => @detach()
