refactored public/javascripts/uploader.js