Put javascript in templates in right place
Merge pull request #1547 from xillibit/k30_bugs10

Put javascript in templates in right place