chrisben/imgcache.js — pull request #54 by vincentjames501 (2014-04-21 15:25:03+00:00)
Title: Adding download progress callback so clients can obtain feedback of the status of a file transfer for cacheFile and cacheBackground methods

Following the progress spec as documented here:

http://www.w3.org/TR/2014/REC-progress-events-20140211/

```html

Waiting for Magical Unicorns

```

PhoneGap also appears to be following the spec as well since 3.x, therefore no wrapper is required:
```js
fileTransfer.onprogress = function(progressEvent) {
if (progressEvent.lengthComputable) {
loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
} else {
loadingStatus.increment();
}
};
fileTransfer.download(...); // or fileTransfer.upload(...);
```