cordova-app-loader
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -38,7 +38,8 @@ var path = require('path'); | ||
var versionChecksum = ""; | ||
for(var filename in manifest.files) { | ||
for(var key in manifest.files) { | ||
try { | ||
var filename = manifest.files[key].filename; | ||
var version = checksum(path.resolve(rootDir,filename)); | ||
versionChecksum += version; | ||
manifest.files[filename].version = version; | ||
manifest.files[key].version = version; | ||
} catch(e){ | ||
@@ -45,0 +46,0 @@ console.error('Could not hash file.',e); |
{ | ||
"name": "cordova-app-loadaer", | ||
"main": "www/lib/CordovaAppLoader.js", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"homepage": "https://github.com/markmarijnissen/cordova-file-cache", | ||
@@ -6,0 +6,0 @@ "authors": [ |
30
index.js
var CordovaFileCache = require('cordova-file-cache'); | ||
var Promise = null; | ||
function createFilemap(files){ | ||
var result = {}; | ||
Object.keys(files).forEach(function(key){ | ||
result[files[key].filename] = files[key]; | ||
}); | ||
return result; | ||
} | ||
function AppLoader(options){ | ||
@@ -45,8 +53,11 @@ if(!options) throw new Error('CordovaAppLoader has no options!'); | ||
} | ||
var newFiles = createFilemap(newManifest.files); | ||
var oldFiles = createFilemap(manifest.files); | ||
// Create the diff | ||
self._toBeDownloaded = Object.keys(newManifest.files) | ||
self._toBeDownloaded = Object.keys(newFiles) | ||
.filter(function(file){ | ||
return !manifest.files[file] | ||
|| manifest.files[file].version !== newManifest.files[file].version | ||
return !oldFiles[file] | ||
|| oldFiles[file].version !== newFiles[file].version | ||
|| !self.cache.isCached(file); | ||
@@ -61,3 +72,3 @@ }); | ||
.filter(function(file){ | ||
return !newManifest.files[file]; | ||
return !newFiles[file]; | ||
}) | ||
@@ -111,3 +122,6 @@ .concat(self._toBeDownloaded); | ||
},function(files){ | ||
self.cache.remove(files); | ||
// on download error, remove files... | ||
if(!!files && files.length){ | ||
self.cache.remove(files); | ||
} | ||
return files; | ||
@@ -117,7 +131,7 @@ }); | ||
AppLoader.prototype.update = function(){ | ||
AppLoader.prototype.update = function(reload){ | ||
if(this._updateReady) { | ||
// update manifest | ||
localStorage.setItem('manifest',JSON.stringify(this.newManifest)); | ||
location.reload(); | ||
if(reload !== false) location.reload(); | ||
return true; | ||
@@ -124,0 +138,0 @@ } |
{ | ||
"name": "cordova-app-loader", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "Cordova App Loader - remote update your cordova app", | ||
@@ -23,4 +23,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"cordova-file-cache": "^0.4.0" | ||
"cordova-file-cache": "^0.4.1" | ||
} | ||
} |
173
README.md
@@ -5,13 +5,25 @@ cordova-app-loader | ||
1. Write a `manifest.json` to describe which files your app uses. | ||
2. Build and deploy your Cordova App. | ||
3. Update your app. Upload the new `manifest.json` together with the files to a server. | ||
4. `CordovaAppLoader` will check this `manifest.json`, download new files, and relaunch! | ||
Based on [cordova-promise-fs](https://github.com/markmarijnissen/cordova-promise-fs) and [cordova-file-cache](https://github.com/markmarijnissen/cordova-file-cache). | ||
## Getting started | ||
## Installation | ||
### Get javascript | ||
Download and include [CordovaPromiseFS.js](https://raw.githubusercontent.com/markmarijnissen/cordova-promise-fs/master/dist/CordovaPromiseFS.js) and [CordovaAppLoader.js](https://raw.githubusercontent.com/markmarijnissen/cordova-app-loader/master/www/lib/CordovaAppLoader.js) | ||
With `npm` or `bower`: | ||
```bash | ||
# fetch code using bower | ||
bower install cordova-app-loader cordova-promise-fs | ||
# ...or npm... | ||
npm install cordova-app-loader cordova-promise-fs | ||
# install Cordova and plugins | ||
``` | ||
### Setup Cordova | ||
```bash | ||
cordova platform add ios@3.7.0 | ||
@@ -24,6 +36,4 @@ cordova plugin add org.apache.cordova.file | ||
Or just download and include [CordovaPromiseFS.js](https://raw.githubusercontent.com/markmarijnissen/cordova-promise-fs/master/dist/CordovaPromiseFS.js) and [CordovaAppLoader.js](https://raw.githubusercontent.com/markmarijnissen/cordova-app-loader/master/www/lib/CordovaAppLoader.js) | ||
## Demo Time! | ||
## Demo | ||
Check out [Cordova App Loader](http://data.madebymark.nl/cordova-app-loader/index.html) in Chrome for a demo! (**Chrome only!**) | ||
@@ -40,21 +50,50 @@ | ||
Want to run your own server? Modify `serverRoot` in `www/test/test.js`! | ||
**Note:** Want to run your own server? Modify `serverRoot` in `www/test/test.js`! | ||
## Usage | ||
### Overview | ||
1. Write `manifest.json` to describe your app files | ||
2. Add `bootstrap.js` script to your `index.html` to dynamically load JS and CSS. | ||
3. Instantiate a `CordovaAppLoader` | ||
4. Check for updates: Download a new `manifest.json` | ||
5. Download (only files that have changed!) | ||
6. Apply update: Store the new manifest and reload page to bootstrap the updated app! | ||
### Step 1: Write a `manifest.json` | ||
```json | ||
```javascript | ||
{ | ||
"files":{ // Files to download. Only newer versions will be downloaded! | ||
"lib/jquery.min.js": { "version": 0 }, | ||
"lib/bluebird.js": { "version": 0 }, | ||
"lib/CordovaPromiseFS.js": { "version": 0 }, | ||
"lib/CordovaAppLoader.js": { "version": 0 }, | ||
"test/template.html": {"version": 0}, | ||
"test/test.js": { "version": 0 }, | ||
"update2/index.js": { "version": 2 }, | ||
"update2/style2.css": { "version": 2 } | ||
}, | ||
"load":[ // Files to insert when bootstrapping app. | ||
"files": { // these files are downloaded (only when "version" is different from current version!) | ||
"jquery": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178", | ||
"filename": "lib/jquery.min.js" | ||
}, | ||
"bluebird": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749", | ||
"filename": "lib/bluebird.js" | ||
}, | ||
"CordovaPromiseFS": { | ||
"version": "635bd29385fe6664b1cf86dc16fb3d801aa9461a", | ||
"filename": "lib/CordovaPromiseFS.js" | ||
}, | ||
"CordovaAppLoader": { | ||
"version": "76f1eecd3887e69d7b08c60be4f14f90069ca8b8", | ||
"filename": "lib/CordovaAppLoader.js" | ||
}, | ||
"template": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23", | ||
"filename": "template.html" | ||
}, | ||
"app": { | ||
"version": "8c99369a825644e68e21433d78ed8b396351cc7d", | ||
"filename": "app.js" | ||
}, | ||
"style": { | ||
"version": "6e76f36f27bf29402a70c8adfee0f84b8a595973", | ||
"filename": "style.css" | ||
} | ||
}, | ||
"load": [ // these files are loaded in your index.html | ||
"lib/jquery.min.js", | ||
@@ -64,10 +103,12 @@ "lib/bluebird.js", | ||
"lib/CordovaAppLoader.js", | ||
"test/test.js", | ||
"update2/index.js", | ||
"update2/style2.css" | ||
] | ||
"app.js", | ||
"style.css" | ||
], | ||
"root":"./", // root location of files to be loaded. Defaults to current location: `./` | ||
} | ||
``` | ||
You can automatically create a version based on the checksum of the file: | ||
**Workflow tip:** | ||
You can update your existing manifest like this: | ||
```bash | ||
@@ -77,44 +118,82 @@ bin/update-manifest www www/manifest.json | ||
It will update file versions (by hashing the content, so only changed files will update). | ||
* `www` is the root directory for the files | ||
* `www/manifest.json` is the manifest to be updated. | ||
### Step 2: Add [bootstrap.js](https://raw.githubusercontent.com/markmarijnissen/cordova-app-loader/master/www/bootstrap.js) to your [index.html](https://raw.githubusercontent.com/markmarijnissen/cordova-app-loader/master/www/index.html) | ||
```html | ||
<script type="text/javascript" timeout="5000" manifest="update1/manifest.json" src="bootstrap.js"></script> | ||
<script type="text/javascript" timeout="5000" manifest="manifest.json" src="bootstrap.js"></script> | ||
``` | ||
1. The `manifest.json` is downloaded once. Second time it is retrieved from localStorage. | ||
2. Javascript and CSS is inserted on the page. | ||
3. Your javascript codes calls `window.BOOTSTRAP_OK = true` to indicate bootstrap was a success. | ||
4. If the manifest is updated and fails to bootstrap the app after `timeout` milliseconds, the manifest in localStorage is deleted and the app reloads the original manifest (and application). | ||
* On the first run, the bootstrap script retrieves `manifest.json` and starts loading JS/CSS in `manifest.load`. | ||
* The `manifest.json` is stored in localStorage for the second run. | ||
* If after `timeout` milliseconds `window.BOOTSTRAP_OK` is **not** true, the (corrupt?) manifest in localStorage is destroyed, and the page will reload. | ||
**Notes:** | ||
* The `manifest` attribute should point to a local manifest (i.e. bundled with the app) to guarantee the app can bootstrap even without internet connection. | ||
* Don't forget to set `BOOTSTRAP_OK` to `true`! | ||
Make sure you set `window.BOOTSTRAP_OK = true` when your app has succesfully loaded! | ||
### Step 3: Use CordovaAppLoader to `check`, `download` and `update` your app. | ||
**Tips:** | ||
* Bundle a `manifest.json` with your app. This way, your app will also launch when not connected to the internet. | ||
* When your app is updated, it will write a new `manifest.json` to localStorage. If this update is corrupt, it can safely revert to the bundled `manifest.json` | ||
### Step 3: Intialize CordovaAppLoader | ||
```javascript | ||
// Step 3a: Initialize | ||
var fs = new CordovaPromiseFS({}); | ||
var loader = window.loader = new CordovaAppLoader({ | ||
fs: fs, | ||
serverRoot: 'http://data.madebymark.nl/cordova-app-loader/', | ||
localRoot: 'app', | ||
mode: 'mirror' | ||
mode: 'mirror', | ||
cacheBuster: true // make sure we're not downloading cached files. | ||
}); | ||
``` | ||
// Step 3b: Check for updates | ||
loader.check().then( ... ) // used `serverRoot` in your `manifest.json` | ||
loader.check('http://yourserver.com/manifest.json').then( ... ) // custom `manifest.json` url | ||
loader.check({ files: { ... } }).then( ... ) // or just check an actual Manifest object. | ||
### Step 4: Check for updates | ||
// Step 3c: Download | ||
loader.download(onprogress).then(function(manifest){},function(failedDownloadUrlArray){ ... }); | ||
```javascript | ||
// download manifest from: serverRoot+'manifest.json' | ||
loader.check().then( ... ) | ||
// Step 4d: Update | ||
loader.update() // reloads page to bootstrap new manifest. Returns true if app will be updated. | ||
// download from custom url | ||
loader.check('http://yourserver.com/manifest.json').then( ... ) | ||
// or just check an actual Manifest object. | ||
loader.check({ files: { ... } }).then( ... ) | ||
``` | ||
**Note:** When downloading and updating, the new manifest is written to localStorage. The `manifest.root` is set to the location of the downloaded files. (Default is `""` - i.e. it loads files relative to your `index.html`) | ||
**Note:** Check returns `true` or `false` when a new version is available. **Only file versions are compared ** - if you change other data (like `manifest.load`) then `manifest.check()` will return `false`! | ||
### Step 5: Download update | ||
```javascript | ||
loader.download(onprogress).then(function(manifest){ ... },function(failedDownloadUrlArray){ ... }); | ||
``` | ||
**Note:** When downloading, invalid files are deleted first. This invalidates the current manifest. Therefore, the current manifest is removed from localStorage! The app is reverted to "factory settings" (the `manifest.json` that comes bundled with the app). | ||
### Step 6: Apply update (reload page to bootstrap new files) | ||
When download is a success, the new manifest can be written to localStorage. | ||
When the page is reloaded, it will load the app update. | ||
```javascript | ||
// write manifest to localStorage and reload page: | ||
loader.update() // returns `true` when update can be applied | ||
// write manifest to localStorage, but DO NOT reload page: | ||
loader.update(false) | ||
``` | ||
**Note:** CordovaAppLoader changes the `manifest.root` to point to the file cache - otherwise the bootstrap script can't find the downloaded files! | ||
## Changelog | ||
### 0.4.0 (13/11/2014) | ||
* Changed `manifest.json` format. | ||
### 0.3.0 (13/11/2014) | ||
@@ -121,0 +200,0 @@ |
var fs = new CordovaPromiseFS({ persistent: false }); | ||
var SERVER = 'http://data.madebymark.nl/cordova-app-loader/'; | ||
//var SERVER = 'http://localhost:8000/ios/www/'; | ||
//var SERVER = 'http://localhost:8080/'; | ||
@@ -6,0 +6,0 @@ var loader = window.loader = new CordovaAppLoader({ |
{ | ||
"files": { | ||
"lib/jquery.min.js": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178" | ||
}, | ||
"lib/bootstrap.min.css": { | ||
"version": "35e0b4e5ac71901d9919b1a32b5ae69cc660d470" | ||
}, | ||
"lib/bluebird.js": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749" | ||
}, | ||
"lib/CordovaPromiseFS.js": { | ||
"version": "b647e53cf40a40b3a68017f1a5c04ac20cfa2fb7" | ||
}, | ||
"lib/CordovaAppLoader.js": { | ||
"version": "addb258103efc624f5c21a6a9f68a06feaa47db5" | ||
}, | ||
"template.html": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23" | ||
}, | ||
"app.js": { | ||
"version": "dc24c37d42663c7d7b156eb7debd166c50eac542" | ||
}, | ||
"broken-app/style.css": { | ||
"version": "d4e50639e4f43dbc76812530fe9003e7f6d70b0c" | ||
}, | ||
"broken-app/index.js": { | ||
"version": "399f512218d083db777e7e74c7737f07c501037f" | ||
} | ||
"files": { | ||
"jquery": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178", | ||
"filename": "lib/jquery.min.js" | ||
}, | ||
"load": [ | ||
"lib/jquery.min.js", | ||
"lib/bootstrap.min.css", | ||
"lib/bluebird.js", | ||
"lib/CordovaPromiseFS.js", | ||
"lib/CordovaAppLoader.js", | ||
"app.js", | ||
"broken-app/index.js", | ||
"broken-app/style.css" | ||
] | ||
"bootstrap": { | ||
"version": "35e0b4e5ac71901d9919b1a32b5ae69cc660d470", | ||
"filename": "lib/bootstrap.min.css" | ||
}, | ||
"bluebird": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749", | ||
"filename": "lib/bluebird.js" | ||
}, | ||
"CordovaPromiseFS": { | ||
"version": "635bd29385fe6664b1cf86dc16fb3d801aa9461a", | ||
"filename": "lib/CordovaPromiseFS.js" | ||
}, | ||
"CordovaAppLoader": { | ||
"version": "76f1eecd3887e69d7b08c60be4f14f90069ca8b8", | ||
"filename": "lib/CordovaAppLoader.js" | ||
}, | ||
"template": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23", | ||
"filename": "template.html" | ||
}, | ||
"app": { | ||
"version": "8c99369a825644e68e21433d78ed8b396351cc7d", | ||
"filename": "app.js" | ||
}, | ||
"style": { | ||
"version": "d4e50639e4f43dbc76812530fe9003e7f6d70b0c", | ||
"filename": "broken-app/style.css" | ||
}, | ||
"index": { | ||
"version": "399f512218d083db777e7e74c7737f07c501037f", | ||
"filename": "broken-app/index.js" | ||
} | ||
}, | ||
"load": [ | ||
"lib/jquery.min.js", | ||
"lib/bootstrap.min.css", | ||
"lib/bluebird.js", | ||
"lib/CordovaPromiseFS.js", | ||
"lib/CordovaAppLoader.js", | ||
"app.js", | ||
"broken-app/index.js", | ||
"broken-app/style.css" | ||
], | ||
"version": "d521f7c2366da633ce02ed6da5fd273830c6fd81" | ||
} |
{ | ||
"files": { | ||
"lib/jquery.min.js": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178" | ||
}, | ||
"lib/bootstrap.min.css": { | ||
"version": "35e0b4e5ac71901d9919b1a32b5ae69cc660d470" | ||
}, | ||
"lib/bluebird.js": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749" | ||
}, | ||
"lib/CordovaPromiseFS.js": { | ||
"version": "b647e53cf40a40b3a68017f1a5c04ac20cfa2fb7" | ||
}, | ||
"lib/CordovaAppLoader.js": { | ||
"version": "addb258103efc624f5c21a6a9f68a06feaa47db5" | ||
}, | ||
"template.html": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23" | ||
}, | ||
"app.js": { | ||
"version": "dc24c37d42663c7d7b156eb7debd166c50eac542" | ||
}, | ||
"broken-url/this-file-does-not-exist.jpg": { | ||
"version": "not-really-here" | ||
} | ||
"files": { | ||
"jquery": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178", | ||
"filename": "lib/jquery.min.js" | ||
}, | ||
"load": [ | ||
"lib/jquery.min.js", | ||
"lib/bootstrap.min.css", | ||
"lib/bluebird.js", | ||
"lib/CordovaPromiseFS.js", | ||
"lib/CordovaAppLoader.js", | ||
"app.js" | ||
] | ||
"bootstrap": { | ||
"version": "35e0b4e5ac71901d9919b1a32b5ae69cc660d470", | ||
"filename": "lib/bootstrap.min.css" | ||
}, | ||
"bluebird": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749", | ||
"filename": "lib/bluebird.js" | ||
}, | ||
"CordovaPromiseFS": { | ||
"version": "635bd29385fe6664b1cf86dc16fb3d801aa9461a", | ||
"filename": "lib/CordovaPromiseFS.js" | ||
}, | ||
"CordovaAppLoader": { | ||
"version": "76f1eecd3887e69d7b08c60be4f14f90069ca8b8", | ||
"filename": "lib/CordovaAppLoader.js" | ||
}, | ||
"template": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23", | ||
"filename": "template.html" | ||
}, | ||
"app": { | ||
"version": "8c99369a825644e68e21433d78ed8b396351cc7d", | ||
"filename": "app.js" | ||
}, | ||
"this-file-does-not-exist": { | ||
"version": "not-really-here", | ||
"filename": "broken-url/this-file-does-not-exist.jpg" | ||
} | ||
}, | ||
"load": [ | ||
"lib/jquery.min.js", | ||
"lib/bootstrap.min.css", | ||
"lib/bluebird.js", | ||
"lib/CordovaPromiseFS.js", | ||
"lib/CordovaAppLoader.js", | ||
"app.js" | ||
], | ||
"version": "231d0a27056ae367ba7aa0e2272f115c48e4eeed" | ||
} |
@@ -51,2 +51,10 @@ var CordovaAppLoader = | ||
function createFilemap(files){ | ||
var result = {}; | ||
Object.keys(files).forEach(function(key){ | ||
result[files[key].filename] = files[key]; | ||
}); | ||
return result; | ||
} | ||
function AppLoader(options){ | ||
@@ -93,8 +101,11 @@ if(!options) throw new Error('CordovaAppLoader has no options!'); | ||
} | ||
var newFiles = createFilemap(newManifest.files); | ||
var oldFiles = createFilemap(manifest.files); | ||
// Create the diff | ||
self._toBeDownloaded = Object.keys(newManifest.files) | ||
self._toBeDownloaded = Object.keys(newFiles) | ||
.filter(function(file){ | ||
return !manifest.files[file] | ||
|| manifest.files[file].version !== newManifest.files[file].version | ||
return !oldFiles[file] | ||
|| oldFiles[file].version !== newFiles[file].version | ||
|| !self.cache.isCached(file); | ||
@@ -109,3 +120,3 @@ }); | ||
.filter(function(file){ | ||
return !newManifest.files[file]; | ||
return !newFiles[file]; | ||
}) | ||
@@ -159,3 +170,6 @@ .concat(self._toBeDownloaded); | ||
},function(files){ | ||
self.cache.remove(files); | ||
// on download error, remove files... | ||
if(!!files && files.length){ | ||
self.cache.remove(files); | ||
} | ||
return files; | ||
@@ -165,7 +179,7 @@ }); | ||
AppLoader.prototype.update = function(){ | ||
AppLoader.prototype.update = function(reload){ | ||
if(this._updateReady) { | ||
// update manifest | ||
localStorage.setItem('manifest',JSON.stringify(this.newManifest)); | ||
location.reload(); | ||
if(reload !== false) location.reload(); | ||
return true; | ||
@@ -198,3 +212,2 @@ } | ||
var isCordova = typeof cordova !== 'undefined'; | ||
var SERVER_DETECT = isCordova? '://':'filesystem:'; | ||
@@ -263,2 +276,3 @@ if(!isCordova) { | ||
FileCache.prototype.add = function add(urls){ | ||
if(!urls) urls = []; | ||
if(typeof urls === 'string') urls = [urls]; | ||
@@ -276,2 +290,3 @@ var self = this; | ||
FileCache.prototype.remove = function remove(urls,returnPromises){ | ||
if(!urls) urls = []; | ||
var promises = []; | ||
@@ -424,3 +439,3 @@ if(typeof urls === 'string') urls = [urls]; | ||
if(path[0] === '/') path = path.substr(1); | ||
return path.indexOf(SERVER_DETECT) < 0? this._serverRoot + path: path; | ||
return path.indexOf('://') < 0? this._serverRoot + path: path; | ||
}; | ||
@@ -427,0 +442,0 @@ |
@@ -132,3 +132,2 @@ var CordovaPromiseFS = | ||
/* the filesystem! */ | ||
@@ -157,4 +156,4 @@ var fs = new Promise(function(resolve,reject){ | ||
function ensure(folders) { | ||
return fs.then(function(fs){ | ||
return new Promise(function(resolve,reject){ | ||
return new Promise(function(resolve,reject){ | ||
return fs.then(function(fs){ | ||
if(!folders) { | ||
@@ -168,3 +167,3 @@ resolve(fs.root); | ||
} | ||
}); | ||
},reject); | ||
}); | ||
@@ -199,26 +198,27 @@ } | ||
/* convert path to URL to be used in JS/CSS/HTML */ | ||
var toInternalURL,toInternalURLSync; | ||
if(isCordova) { | ||
/* synchronous helper to get internal URL. */ | ||
function toInternalURLSync(path){ | ||
toInternalURLSync = function(path){ | ||
if(path[0] !== '/') path = '/' + path; | ||
return 'cdvfile://localhost/'+(options.persistent? 'persistent':'temporary') + path; | ||
} | ||
}; | ||
function toInternalURL(path) { | ||
toInternalURL = function(path) { | ||
return file(path).then(function(fileEntry) { | ||
return fileEntry.toInternalURL(); | ||
}); | ||
} | ||
}; | ||
} else { | ||
/* synchronous helper to get internal URL. */ | ||
function toInternalURLSync(path){ | ||
toInternalURLSync = function(path){ | ||
if(path[0] !== '/') path = '/' + path; | ||
return 'filesystem:'+location.origin+(options.persistent? '/persistent':'/temporary') + path; | ||
} | ||
}; | ||
function toInternalURL(path) { | ||
toInternalURL = function(path) { | ||
return file(path).then(function(fileEntry) { | ||
return fileEntry.toURL(); | ||
}); | ||
} | ||
}; | ||
} | ||
@@ -400,6 +400,6 @@ | ||
} else if(isDownload){ | ||
ft.download.call(ft,serverUrl,localPath,win,fail,transferOptions,trustAllHosts); | ||
ft.download.call(ft,serverUrl,localPath,win,fail,trustAllHosts,transferOptions); | ||
if(ft.onprogress) ft.onprogress(new ProgressEvent()); | ||
} else { | ||
ft.upload.call(ft,localPath,serverUrl,win,fail,trustAllHosts,transferOptions); | ||
ft.upload.call(ft,localPath,serverUrl,win,fail,transferOptions,trustAllHosts); | ||
} | ||
@@ -406,0 +406,0 @@ } |
{ | ||
"files": { | ||
"lib/jquery.min.js": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178" | ||
}, | ||
"lib/bootstrap.min.css": { | ||
"version": "35e0b4e5ac71901d9919b1a32b5ae69cc660d470" | ||
}, | ||
"lib/bluebird.js": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749" | ||
}, | ||
"lib/CordovaPromiseFS.js": { | ||
"version": "b647e53cf40a40b3a68017f1a5c04ac20cfa2fb7" | ||
}, | ||
"lib/CordovaAppLoader.js": { | ||
"version": "addb258103efc624f5c21a6a9f68a06feaa47db5" | ||
}, | ||
"template.html": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23" | ||
}, | ||
"app.js": { | ||
"version": "dc24c37d42663c7d7b156eb7debd166c50eac542" | ||
}, | ||
"style.css": { | ||
"version": "6e76f36f27bf29402a70c8adfee0f84b8a595973" | ||
} | ||
"files": { | ||
"jquery": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178", | ||
"filename": "lib/jquery.min.js" | ||
}, | ||
"load": [ | ||
"lib/jquery.min.js", | ||
"lib/bootstrap.min.css", | ||
"lib/bluebird.js", | ||
"lib/CordovaPromiseFS.js", | ||
"lib/CordovaAppLoader.js", | ||
"app.js", | ||
"style.css" | ||
] | ||
"bootstrap": { | ||
"version": "35e0b4e5ac71901d9919b1a32b5ae69cc660d470", | ||
"filename": "lib/bootstrap.min.css" | ||
}, | ||
"bluebird": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749", | ||
"filename": "lib/bluebird.js" | ||
}, | ||
"CordovaPromiseFS": { | ||
"version": "635bd29385fe6664b1cf86dc16fb3d801aa9461a", | ||
"filename": "lib/CordovaPromiseFS.js" | ||
}, | ||
"CordovaAppLoader": { | ||
"version": "76f1eecd3887e69d7b08c60be4f14f90069ca8b8", | ||
"filename": "lib/CordovaAppLoader.js" | ||
}, | ||
"template": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23", | ||
"filename": "template.html" | ||
}, | ||
"app": { | ||
"version": "8c99369a825644e68e21433d78ed8b396351cc7d", | ||
"filename": "app.js" | ||
}, | ||
"style": { | ||
"version": "6e76f36f27bf29402a70c8adfee0f84b8a595973", | ||
"filename": "style.css" | ||
} | ||
}, | ||
"load": [ | ||
"lib/jquery.min.js", | ||
"lib/bootstrap.min.css", | ||
"lib/bluebird.js", | ||
"lib/CordovaPromiseFS.js", | ||
"lib/CordovaAppLoader.js", | ||
"app.js", | ||
"style.css" | ||
], | ||
"version": "d4a957c194b7ecedb47c8422ea2703d2dfff2183" | ||
} |
{ | ||
"files": { | ||
"lib/jquery.min.js": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178" | ||
}, | ||
"lib/bootstrap.min.css": { | ||
"version": "35e0b4e5ac71901d9919b1a32b5ae69cc660d470" | ||
}, | ||
"lib/bluebird.js": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749" | ||
}, | ||
"lib/CordovaPromiseFS.js": { | ||
"version": "b647e53cf40a40b3a68017f1a5c04ac20cfa2fb7" | ||
}, | ||
"lib/CordovaAppLoader.js": { | ||
"version": "addb258103efc624f5c21a6a9f68a06feaa47db5" | ||
}, | ||
"template.html": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23" | ||
}, | ||
"app.js": { | ||
"version": "dc24c37d42663c7d7b156eb7debd166c50eac542" | ||
}, | ||
"slow-download/style.css": { | ||
"version": "16285dcb3fc5d9f7c1af162e58aa0009853e5db7" | ||
}, | ||
"slow-download/index.js": { | ||
"version": "b0918f9c79c40b677c6d2cfa6f090e90ab0d2f0a" | ||
}, | ||
"slow-download/slow.php": { | ||
"version": "2986433b87aee2d34725a14c4b1ee6637dcd40a4" | ||
} | ||
"files": { | ||
"jquery": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178", | ||
"filename": "lib/jquery.min.js" | ||
}, | ||
"load": [ | ||
"lib/jquery.min.js", | ||
"lib/bootstrap.min.css", | ||
"lib/bluebird.js", | ||
"lib/CordovaPromiseFS.js", | ||
"lib/CordovaAppLoader.js", | ||
"app.js", | ||
"slow-download/index.js", | ||
"slow-download/style.css" | ||
] | ||
"bootstrap": { | ||
"version": "35e0b4e5ac71901d9919b1a32b5ae69cc660d470", | ||
"filename": "lib/bootstrap.min.css" | ||
}, | ||
"bluebird": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749", | ||
"filename": "lib/bluebird.js" | ||
}, | ||
"CordovaPromiseFS": { | ||
"version": "635bd29385fe6664b1cf86dc16fb3d801aa9461a", | ||
"filename": "lib/CordovaPromiseFS.js" | ||
}, | ||
"CordovaAppLoader": { | ||
"version": "76f1eecd3887e69d7b08c60be4f14f90069ca8b8", | ||
"filename": "lib/CordovaAppLoader.js" | ||
}, | ||
"template": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23", | ||
"filename": "template.html" | ||
}, | ||
"app": { | ||
"version": "8c99369a825644e68e21433d78ed8b396351cc7d", | ||
"filename": "app.js" | ||
}, | ||
"style": { | ||
"version": "16285dcb3fc5d9f7c1af162e58aa0009853e5db7", | ||
"filename": "slow-download/style.css" | ||
}, | ||
"index": { | ||
"version": "b0918f9c79c40b677c6d2cfa6f090e90ab0d2f0a", | ||
"filename": "slow-download/index.js" | ||
}, | ||
"slow": { | ||
"version": "2986433b87aee2d34725a14c4b1ee6637dcd40a4", | ||
"filename": "slow-download/slow.php" | ||
} | ||
}, | ||
"load": [ | ||
"lib/jquery.min.js", | ||
"lib/bootstrap.min.css", | ||
"lib/bluebird.js", | ||
"lib/CordovaPromiseFS.js", | ||
"lib/CordovaAppLoader.js", | ||
"app.js", | ||
"slow-download/index.js", | ||
"slow-download/style.css" | ||
], | ||
"version": "98c273529ce000f8713a04fdc5704eb0c352e02f" | ||
} |
{ | ||
"files": { | ||
"lib/jquery.min.js": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178" | ||
}, | ||
"lib/bootstrap.min.css": { | ||
"version": "35e0b4e5ac71901d9919b1a32b5ae69cc660d470" | ||
}, | ||
"lib/bluebird.js": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749" | ||
}, | ||
"lib/CordovaPromiseFS.js": { | ||
"version": "b647e53cf40a40b3a68017f1a5c04ac20cfa2fb7" | ||
}, | ||
"lib/CordovaAppLoader.js": { | ||
"version": "addb258103efc624f5c21a6a9f68a06feaa47db5" | ||
}, | ||
"template.html": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23" | ||
}, | ||
"app.js": { | ||
"version": "dc24c37d42663c7d7b156eb7debd166c50eac542" | ||
}, | ||
"update/time.php": { | ||
"version": "86a6fef9a4e2957e434343a7b65c683dda2a82c4" | ||
}, | ||
"update/style.css": { | ||
"version": "092dff7bb63e9e6bcd5b1ef382695d315538db6a" | ||
}, | ||
"update/index.js": { | ||
"version": "8390932657cb2ca317469a92d69a38408ad9115a" | ||
} | ||
"files": { | ||
"jquery": { | ||
"version": "afb90752e0a90c24b7f724faca86c5f3d15d1178", | ||
"filename": "lib/jquery.min.js" | ||
}, | ||
"load": [ | ||
"lib/jquery.min.js", | ||
"lib/bootstrap.min.css", | ||
"lib/bluebird.js", | ||
"lib/CordovaPromiseFS.js", | ||
"lib/CordovaAppLoader.js", | ||
"app.js", | ||
"update/index.js", | ||
"update/style.css" | ||
] | ||
"bootstrap": { | ||
"version": "35e0b4e5ac71901d9919b1a32b5ae69cc660d470", | ||
"filename": "lib/bootstrap.min.css" | ||
}, | ||
"bluebird": { | ||
"version": "f37ff9832449594d1cefe98260cae9fdc13e0749", | ||
"filename": "lib/bluebird.js" | ||
}, | ||
"CordovaPromiseFS": { | ||
"version": "635bd29385fe6664b1cf86dc16fb3d801aa9461a", | ||
"filename": "lib/CordovaPromiseFS.js" | ||
}, | ||
"CordovaAppLoader": { | ||
"version": "76f1eecd3887e69d7b08c60be4f14f90069ca8b8", | ||
"filename": "lib/CordovaAppLoader.js" | ||
}, | ||
"template": { | ||
"version": "3e70f2873de3d9c91e31271c1a59b32e8002ac23", | ||
"filename": "template.html" | ||
}, | ||
"app": { | ||
"version": "8c99369a825644e68e21433d78ed8b396351cc7d", | ||
"filename": "app.js" | ||
}, | ||
"time": { | ||
"version": "86a6fef9a4e2957e434343a7b65c683dda2a82c4", | ||
"filename": "update/time.php" | ||
}, | ||
"style": { | ||
"version": "092dff7bb63e9e6bcd5b1ef382695d315538db6a", | ||
"filename": "update/style.css" | ||
}, | ||
"index": { | ||
"version": "8390932657cb2ca317469a92d69a38408ad9115a", | ||
"filename": "update/index.js" | ||
} | ||
}, | ||
"load": [ | ||
"lib/jquery.min.js", | ||
"lib/bootstrap.min.css", | ||
"lib/bluebird.js", | ||
"lib/CordovaPromiseFS.js", | ||
"lib/CordovaAppLoader.js", | ||
"app.js", | ||
"update/index.js", | ||
"update/style.css" | ||
], | ||
"version": "9d25453106ad5d3e935ffcd7bc3d8b9460f85c31" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
446466
35
6768
223
9
Updatedcordova-file-cache@^0.4.1