Javascripts for editor