convert index embedded js to index.coffee