 		canvas = document.getElementById("cubic-bezier")
 		@context = canvas.getContext("2d")
 		@drawInitialCurve()
+
+		$('#okButton').click (e) => @applyToEditor()
 
 
 		drag = () =>

		$(canvas).on 'mousemove', (e) => @timeDelay e
		@plotCurve()
		@playBall()


	validateBezierPoint : (p) ->

		clearInterval(@playBallPlayer)
		@playBallPlaying = false

	applyToEditor: () ->
		editor = atom.workspace.getActiveEditor()
		editor.replaceSelectedText null, =>  "cubic-bezier(" + @points.join() + ")"
