samolds / principia

An educational physics playground emphasizing visualizations and interactability.
https://theprincipiaxyz.appspot.com
MIT License
1 stars 0 forks source link

Image Upload and Persistence Support #204

Closed samolds closed 8 years ago

samolds commented 8 years ago

Simulations now have thumbnail images generated and persisted with a simulation whenever you save. Also, users can now upload a profile image if they would like.

The Google App Engine Blobstore stuff seems a little wonky to me. We have to generate a specific google url to post against every time we post to the blobstore. This blobstore url generation happens on page load, so this means that we can't save a simulation asynchronously. We have to refresh the page every time to generate that new google url to post against for images.

Ironically, the cleanest way I found to generate images as blobs of a canvas element and then post using javascript has depreciated synchronous posting?! So I asynchronously post, then wait for the server to respond with the new route to redirect to, then use javascript to redirect there. Hmmmmm.

Fixes #95 Fixes #127

daltonwallace commented 8 years ago

@samolds this is seriously awesome. I haven't had a chance to look at the actual code yet, but everything seems to work perfectly.