refactor code for autosave to use jquery keyboard event(s)