move js in file
(cherry picked from commit 4d4b399)