Move javascript admin code to resto.js