refactor snippets/javascript.js require requirejs