Move inline JS into new file to be accessed by both `index.php` and `edit.php`.