 	getSelectedElement: ->
 		el = $(@selection().getRangeAt(0).commonAncestorContainer)
 		return if el[0].nodeType == 3 then el.parent() else el
-	clearStatus: ->
-		$('.debug-status').addClass 'hidden'
-		@status.cmd = @status.ctrl = @status.alt = @status.shift = false
-	rand: (len=4)->
-		result = ''
-		result += Math.random().toString(36).substr(2,1) for i in new Array(len)
-		result.toUpperCase()
+
 	autosave: (durationInMilliseconds=5000)->
 		(update= =>
 			setTimeout =>

			when 91
				@status.cmd = false
				$('.cmd').addClass('hidden')
	constructor: (options={})->
		@id = options.id
		@status.new = !@id
		@newPostCallback = options.newPostCallback
		@autosaveCallback = options.autosaveCallback
		@articleCreateURL = options.articleCreateURL
		@articleSaveURL = options.articleSaveURL
		@articleDeleteURL = options.articleDeleteURL

	init: ()->
		self = @
		$('#editor').html '<p><br></p>' if @status.new
		@autosave 5000
		@update()
		@checkTitleEmpty()
		@checkEmpty()
		@displayTitlePrompt() if @status.titleEmpty
		@displayPrompt() if @status.empty
		@bindEditorTitleEvents()
		@bindEditorEvents()

	bindEditorTitleEvents:->
		$('#editor-title').on 'keydown', (e)=>

				cursorEnd.id = 'cursorEnd'
				range.collapse()
				range.insertNode cursorEnd
	restoreSelection: ->
		cursorStart = document.getElementById 'cursorStart'
		cursorEnd = document.getElementById 'cursorEnd'
