add preview of post and update attribute 'published' via ajax