Skip to content

Commit

Permalink
Add timeout + prepare 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benrom committed Jan 16, 2017
1 parent b54cebd commit 00a100a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

## master ##

## 1.1.0 ##

### NEW ###

* Add `withCredentials` option (#179 thanks oliver-schoendorn)
* Add `cordovaFilesystemRoot` option (#111 thanks tjwoon)
* Add `timeout` option (#190 thanks gabrielstuff)

### FIXED ###

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Wrapper for Ionic Framework:

License
-------
Copyright 2012-2016 (c) Christophe BENOIT
Copyright 2012-2017 (c) Christophe BENOIT

Apache License - see LICENSE.md

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imgcache.js",
"version": "1.0.0",
"version": "1.1.0",
"homepage": "https://github.com/chrisben/imgcache.js",
"authors": [
{
Expand Down
8 changes: 5 additions & 3 deletions js/imgcache.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*! imgcache.js
Copyright 2012-2016 Christophe BENOIT
Copyright 2012-2017 Christophe BENOIT
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@
/*global console,LocalFileSystem,device,FileTransfer,define,module*/

var ImgCache = {
version: '1.0.0',
version: '1.1.0',
// options to override before using the library (but after loading this script!)
options: {
debug: false, /* call the log method ? */
Expand All @@ -30,7 +30,8 @@ var ImgCache = {
headers: {}, /* HTTP headers for the download requests -- e.g: headers: { 'Accept': 'application/jpg' } */
withCredentials: false, /* indicates whether or not cross-site Access-Control requests should be made using credentials */
skipURIencoding: false, /* enable if URIs are already encoded (skips call to sanitizeURI) */
cordovaFilesystemRoot: null /* if specified, use one of the Cordova File plugin's app directories for storage */
cordovaFilesystemRoot: null, /* if specified, use one of the Cordova File plugin's app directories for storage */
timeout: 0 /* timeout delay in ms for xhr request */
},
overridables: {
hash: function (s) {
Expand Down Expand Up @@ -452,6 +453,7 @@ var ImgCache = {
xhr.withCredentials = true;
}

xhr.timeout = ImgCache.options.timeout
xhr.responseType = 'blob';
for (var key in headers) {
xhr.setRequestHeader(key, headers[key]);
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
summary: "JS library that stores images locally for offline apps using PhoneGap/Cordova or browsers supporting the new html5 File API",
version: "1.0.0",
version: "1.1.0",
git: "https://github.com/chrisben/imgcache.js"
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imgcache.js",
"version": "1.0.0",
"version": "1.1.0",
"description": "JS library based on the File API to cache images for offline recovery (target: cordova/phonegap & chrome)",
"main": "js/imgcache.js",
"directories": {
Expand Down

0 comments on commit 00a100a

Please sign in to comment.