move js code from application to posts