andreasgal/gaia — pull request #251 by benfrancis (2012-01-11 19:06:25+00:00)
Title: Gallery now stores photos as binary blobs in IndexedDB.

This does blow out some of @vingtetun's previous changes which are now a little obsolete, but let me know if you'd still rather use JSON to fetch sample_data.js now that it's just a list of filenames.

The sample photos are fetched asynchronously over HTTP one at a time using XHR and as soon as each one arrives it is saved to the local database and the thumbnail added to the screen.

There are now 24 sample photos in total so the first time the app is loaded it's going to be slow while it populates the database. Maybe we should add a message to say "Downloading and saving sample photos" but when shipping a device, the IndexedDB database should be pre-populated so the photos don't have to be fetched over HTTP.