               insertable.appendTo(element)
             else
               console.log "can't insert #{insertType}", elementIndex, ev
-          console.log range = new CKEDITOR.dom.range( editor.document )
-          console.log range.moveToPosition(insertable, CKEDITOR.POSITION_BEFORE_END)
+          range = new CKEDITOR.dom.range( editor.document )
+          range.moveToPosition(insertable, CKEDITOR.POSITION_BEFORE_END)
           insertable.scrollIntoView()
           editor.focus()
           range = editor.createRange()

        realIndex = elementIndex.substr(elementIndex.indexOf('-') + 1)
        insertType = elementIndex.substr(0, elementIndex.indexOf('-'))
        element = editor._.txtElementsPath.list[realIndex]
        console.log "addElementHandler", element, elementIndex, realIndex, insertType, ev
        if !element
          return
        editor.focus()

          range.select()
        else
          editor.getSelection().selectElement element

      onClickHanlder = CKEDITOR.tools.addFunction(onClick)

      onClickEditHandler = CKEDITOR.tools.addFunction((elementIndex, ev) ->
        element = editor._.txtElementsPath.list[elementIndex]
        if !element
          return
        editor.focus()
        elementName = filterName(element, findName(element))
        attributes = CKEDITOR.textorum.schema.defs[elementName]?.attr
        if CKEDITOR.tools.isEmpty attributes
          window.alert "whoops, no attributes for #{elementName}"
          return
        attNames = []
        for own attName, v of attributes
          attNames.push attName
        attributeName = window.prompt "Enter an attribute name.  Attributes for #{elementName}: " + attNames.join(", ")
        if not attributeName in attNames
          window.alert "whoops, #{attributeName} not a valid attribute for #{elementName}"
          return
        attributeValue = window.prompt "Enter a value for #{attributeName}.  Previous value: " + element.getAttribute(attributeName)
        if attributeValue isnt null
          if attributeValue
            element.setAttribute attributeName, attributeValue
            window.alert "set #{elementName} #{attributeName} to #{attributeValue}"
            return
          else
            element.removeAttribute attributeName
            window.alert "removed #{elementName}'s #{attributeName}"
            return
        else
          window.alert "no change to #{elementName}'s #{attributeName}"
        return
        if element.equals(editor.editable())
          range = editor.createRange()
          range.selectNodeContents element
          range.select()
        else
          editor.getSelection().selectElement element
      )
      # LEFT-ARROW
      # TAB
      # RIGHT-ARROW
