Closed asayler closed 8 years ago
I was inspecting the code at js/cog_api.js#L58; is there any specific reason that the request is performed synchronously? On a cursory inspection, the code already appears to be written in such a way that it would work fine even if the request were nonblocking.
No real reason, just laziness (and lack of js expertise) on my part. Patches welcome!
Also, using async we may need some form of progress bar or other UI interaction to make sure the user doesn't try to change any settings or otherwise disrupt the submission fow while the upload is in progress. Not sure if that will be an issue or not, but may be worth considering.
Since the current code already uses callbacks, I believe the functionality is already in place, but I do think it'd be worthwhile to implement a progress feature of some sort. For larger file uploads, where a user might mistake long upload times for an unresponsive web page, a progress indicator might lead to less prematurely-terminated file uploads on the API server side.
jquery-2.1.1.min.js:4 - Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.