Moving JS into editor file

No need to dump the JS into the page itself.