cordova-file-cache
Advanced tools
Comparing version 0.5.0 to 0.6.0
{ | ||
"name": "cordova-file-cache", | ||
"main": "dist/CordovaFileCache.js", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"homepage": "https://github.com/markmarijnissen/cordova-file-cache", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -75,3 +75,3 @@ var CordovaFileCache = | ||
if(this._localRoot[this._localRoot.length -1] !== '/') this._localRoot += '/'; | ||
if(this._localRoot[0] !== '/') this._localRoot = '/' + this._localRoot; | ||
if(this._localRoot[0] === '/') this._localRoot = this._localRoot.substr(1); | ||
@@ -260,6 +260,10 @@ this._serverRoot = options.serverRoot || ''; | ||
if(this._cached[path]) return this._cached[path].toInternalURL; | ||
return this.toServerURL(path); | ||
return this._fs.toInternalURLSync(path); | ||
}; | ||
FileCache.prototype.get = FileCache.prototype.toInternalURL; | ||
FileCache.prototype.get = function get(url){ | ||
path = this.toPath(url); | ||
if(this._cached[path]) return this._cached[path].toInternalURL; | ||
return this.toServerURL(url); | ||
}; | ||
@@ -272,3 +276,3 @@ FileCache.prototype.toDataURL = function toDataURL(url){ | ||
path = this.toPath(url); | ||
return this._cached[path]? this._cached[path].toURL: this.toServerURL(url); | ||
return this._cached[path]? this._cached[path].toURL: url; | ||
}; | ||
@@ -275,0 +279,0 @@ |
12
index.js
@@ -28,3 +28,3 @@ var hash = require('./murmerhash'); | ||
if(this._localRoot[this._localRoot.length -1] !== '/') this._localRoot += '/'; | ||
if(this._localRoot[0] !== '/') this._localRoot = '/' + this._localRoot; | ||
if(this._localRoot[0] === '/') this._localRoot = this._localRoot.substr(1); | ||
@@ -213,6 +213,10 @@ this._serverRoot = options.serverRoot || ''; | ||
if(this._cached[path]) return this._cached[path].toInternalURL; | ||
return this.toServerURL(path); | ||
return this._fs.toInternalURLSync(path); | ||
}; | ||
FileCache.prototype.get = FileCache.prototype.toInternalURL; | ||
FileCache.prototype.get = function get(url){ | ||
path = this.toPath(url); | ||
if(this._cached[path]) return this._cached[path].toInternalURL; | ||
return this.toServerURL(url); | ||
}; | ||
@@ -225,3 +229,3 @@ FileCache.prototype.toDataURL = function toDataURL(url){ | ||
path = this.toPath(url); | ||
return this._cached[path]? this._cached[path].toURL: this.toServerURL(url); | ||
return this._cached[path]? this._cached[path].toURL: url; | ||
}; | ||
@@ -228,0 +232,0 @@ |
{ | ||
"name": "cordova-file-cache", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Cordova File Cache", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -121,2 +121,7 @@ cordova-file-cache | ||
### 0.6.0 (19/11/2014) | ||
* Bugfix: changes to "get" and "toInternalURL" methods. | ||
* Bugfix: LocalRoot should NOT start with a slash (Android) | ||
### 0.5.0 (15/11/2014) | ||
@@ -123,0 +128,0 @@ |
27237
629
160