   constructor: (@container, @editor) ->
     @container = document.getElementById(@container) if _.isString(@container)
     initFormats.call(this)
-    initLinkFormat.call(this)
     initActiveFormatListener.call(this)
     this.on(Scribe.Toolbar.events.FORMAT, =>
       @editor.root.focus()

      return unless input?
      eventName = if formatGroup == 'SELECT' then 'change' else 'click'
      input.addEventListener(eventName, =>
        value = if formatGroup == 'SELECT' then input.options[input.selectedIndex].value else Scribe.DOM.hasClass(input, 'active')
        @editor.selection.format(format, value, { source: 'user' })
        this.emit(Scribe.Toolbar.events.FORMAT, format, value)
      )
    )

Scribe = require('../scribe')


getValue = (input) ->
  if input.tagName == 'SELECT'
    return input.options[input.selectedIndex].value
  else if Scribe.DOM.hasClass(input, 'link')
    if !Scribe.DOM.hasClass(input, 'active')
      range = @editor.selection.getRange()
      return range.getText()
    else
      return false
  else
    return Scribe.DOM.hasClass(input, 'active')

initActiveFormatListener = ->
  @editor.on(Scribe.Editor.events.SELECTION_CHANGE, (selection) =>
    _.each(@container.querySelectorAll('.active'), (button) =>
      Scribe.DOM.removeClass(button, 'active')
    )
    _.each(@container.querySelectorAll('select'), (select) =>
      select.querySelector('option[selected]').selected = true
    )
    return unless selection?
    _.each(selection.getFormats(), (value, key) =>
      if value?
        elem = @container.querySelector(".#{key}")
        return unless elem?
