move back some js code to html file due to wysihtml5 and tagsinput issue with turbolinks and back button