Revert "Changed JS code from inline to external file"

This reverts commit 207d6619d0c4c21ce713b627652ed19925ff06b7.