cordova-app-loader
Advanced tools
Comparing version 0.12.0 to 0.13.0
@@ -61,3 +61,4 @@ /******/ (function(modules) { // webpackBootstrap | ||
var BUNDLE_ROOT = location.href.substr(0,location.href.lastIndexOf('/')+1); | ||
var BUNDLE_ROOT = location.href.replace(location.hash,''); | ||
var BUNDLE_ROOT = BUNDLE_ROOT.substr(0,BUNDLE_ROOT.lastIndexOf('/')+1); | ||
if(/ip(hone|ad|od)/i.test(navigator.userAgent)){ | ||
@@ -649,2 +650,3 @@ BUNDLE_ROOT = 'cdvfile://localhost/bundle/www/'; | ||
window.ProgressEvent = function ProgressEvent(){}; | ||
window.FileEntry = function FileEntry(){}; | ||
} else { | ||
@@ -707,3 +709,3 @@ window.requestFileSystem = function(x,y,z,fail){ | ||
return new Promise(function(resolve,reject){ | ||
if(path instanceof FileEntry) { | ||
if(typeof path === 'object') { | ||
return resolve(path); | ||
@@ -710,0 +712,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){window.CordovaAppLoader=n(1),window.CordovaFileCache=n(2),window.CordovaPromiseFS=n(3),window.Promise=n(4),window.setImmediate=window.setTimeout},function(t,e,n){function o(t){if(!t)throw new Error("CordovaAppLoader has no options!");if(!t.fs)throw new Error('CordovaAppLoader has no "fs" option (cordova-promise-fs)');if(!t.serverRoot)throw new Error('CordovaAppLoader has no "serverRoot" option.');if(!window.pegasus||!window.Manifest)throw new Error("CordovaAppLoader bootstrap.js is missing.");this.allowServerRootFromManifest=t.allowServerRootFromManifest===!0,i=t.fs.Promise,this.manifest=window.Manifest,this.newManifest=null,this.bundledManifest=null,this._lastUpdateFiles=localStorage.getItem("last_update_files"),t.serverRoot=t.serverRoot||"",t.serverRoot&&"/"!==t.serverRoot[t.serverRoot.length-1]&&(t.serverRoot+="/"),this.newManifestUrl=t.manifestUrl||t.serverRoot+(t.manifest||"manifest.json"),t.mode&&(t.mode="mirror"),this.cache=new r(t),this.corruptNewManifest=!1,this._toBeCopied=[],this._toBeDeleted=[],this._toBeDownloaded=[],this._updateReady=!1,this._checkTimeout=t.checkTimeout||1e4}var r=n(2),i=(n(3),null),a=location.href.substr(0,location.href.lastIndexOf("/")+1);/ip(hone|ad|od)/i.test(navigator.userAgent)&&(a="cdvfile://localhost/bundle/www/"),o.prototype._createFilemap=function(t){var e={},n=this.cache._fs.normalize;return Object.keys(t).forEach(function(o){t[o].filename=n(t[o].filename),e[t[o].filename]=t[o]}),e},o.prototype.copyFromBundle=function(t){var e=a+t;return this.cache._fs.download(e,this.cache.localRoot+t)},o.prototype.getBundledManifest=function(){var t=this,e=document.querySelector("script[manifest]"),n=(e?e.getAttribute("manifest"):null)||"manifest.json";return new i(function(e,o){t.bundledManifest?e(t.bundledManifest):(pegasus(n).then(function(n){t.bundledManifest=n,e(n)},o),setTimeout(function(){o(new Error("bundled manifest timeout"))},t._checkTimeout))})},o.prototype.check=function(t){var e=this,n=this.manifest;"string"==typeof t&&(e.newManifestUrl=t,t=void 0);var o=new i(function(n,o){"object"==typeof t?n(t):(pegasus(e.newManifestUrl).then(n,o),setTimeout(function(){o(new Error("new manifest timeout"))},e._checkTimeout))});return new i(function(t,r){i.all([o,e.getBundledManifest(),e.cache.list()]).then(function(o){var i=o[0],a=o[1];if(JSON.stringify(i.files)===e._lastUpdateFiles)return JSON.stringify(i.files)!==JSON.stringify(Manifest.files)&&(console.warn("New manifest available, but an earlier update attempt failed. Will not download."),e.corruptNewManifest=!0,t(null)),void t(!1);if(!i.files)return void r('Downloaded Manifest has no "files" attribute.');var s=o[2],u=e._createFilemap(n.files),c=e._createFilemap(i.files),f=e._createFilemap(a.files);e._toBeDownloaded=[],e._toBeCopied=[],e._toBeDeleted=[];var l=e.cache._fs.isCordova;Object.keys(c).filter(function(t){return!u[t]||u[t].version!==c[t].version||!e.cache.isCached(t)}).forEach(function(t){l&&f[t]&&f[t].version===c[t].version?e._toBeCopied.push(t):e._toBeDownloaded.push(t)}),e._toBeDeleted=s.map(function(t){return t.substr(e.cache.localRoot.length)}).filter(function(t){return!c[t]||e._toBeDownloaded.indexOf(t)>=0||e._toBeCopied.indexOf(t)>=0});var d=e._toBeDeleted.length+e._toBeDownloaded.length;d>0?(e.newManifest=i,e.newManifest.root=e.cache.localInternalURL,t(!0)):t(!1)})})},o.prototype.canDownload=function(){return!!this.newManifest&&!this._updateReady},o.prototype.canUpdate=function(){return this._updateReady},o.prototype.download=function(t){var e=this;return e.canDownload()?(localStorage.removeItem("manifest"),localStorage.setItem("last_update_files",JSON.stringify(this.newManifest.files)),this.manifest.files=Manifest.files={},e.cache.remove(e._toBeDeleted,!0).then(function(){return i.all(e._toBeCopied.map(function(t){return e.cache._fs.download(a+t,e.cache.localRoot+t)}))}).then(function(){return e.allowServerRootFromManifest&&e.newManifest.serverRoot&&(e.cache.serverRoot=e.newManifest.serverRoot),e.cache.add(e._toBeDownloaded),e.cache.download(t)}).then(function(){return e._toBeDeleted=[],e._toBeDownloaded=[],e._updateReady=!0,e.newManifest},function(t){return t&&t.length&&e.cache.remove(t),t})):i.resolve(null)},o.prototype.update=function(t){return this._updateReady?(localStorage.setItem("manifest",JSON.stringify(this.newManifest)),t!==!1&&location.reload(),!0):!1},o.prototype.clear=function(){return localStorage.removeItem("last_update_files"),localStorage.removeItem("manifest"),this.cache.clear()},o.prototype.reset=function(){return this.clear().then(function(){location.reload()},function(){location.reload()})},t.exports=o},function(t,e,n){function o(t){var e=this;if(this._fs=t.fs,!this._fs)throw new Error('Missing required option "fs". Add an instance of cordova-promise-fs.');i=this._fs.Promise,this._mirrorMode="hash"!==t.mode,this._retry=t.retry||[500,1500,8e3],this._cacheBuster=!!t.cacheBuster,this.localRoot=this._fs.normalize(t.localRoot||"data"),this.serverRoot=this._fs.normalize(t.serverRoot||""),this._downloading=[],this._added=[],this._cached={},this.ready=this._fs.ensure(this.localRoot).then(function(t){return e.localInternalURL=a?t.toInternalURL():t.toURL(),e.localUrl=t.toURL(),e.list()})}var r=n(5),i=null,a="undefined"!=typeof cordova;o.prototype.list=function(){var t=this;return new i(function(e){t._fs.list(t.localRoot,"rfe").then(function(n){t._cached={},n=n.map(function(e){var n=t._fs.normalize(e.fullPath);return t._cached[n]={toInternalURL:a?e.toInternalURL():e.toURL(),toURL:e.toURL()},n}),e(n)},function(){e([])})})},o.prototype.add=function(t){t||(t=[]),"string"==typeof t&&(t=[t]);var e=this;return t.forEach(function(t){t=e.toServerURL(t),-1===e._added.indexOf(t)&&e._added.push(t)}),e.isDirty()},o.prototype.remove=function(t,e){t||(t=[]);var n=[];"string"==typeof t&&(t=[t]);var o=this;return t.forEach(function(t){var e=o._added.indexOf(o.toServerURL(t));e>=0&&o._added.splice(e,1);var r=o.toPath(t);n.push(o._fs.remove(r)),delete o._cached[r]}),e?i.all(n):o.isDirty()},o.prototype.getDownloadQueue=function(){var t=this,e=t._added.filter(function(e){return!t.isCached(e)});return e},o.prototype.getAdded=function(){return this._added},o.prototype.isDirty=function(){return this.getDownloadQueue().length>0},o.prototype.download=function(t){var e=this._fs,n=this;return n.abort(),new i(function(o,r){e.ensure(n.localRoot).then(function(){return n.list()}).then(function(){if(!n.isDirty())return void o(n);var i=n.getDownloadQueue(),a=[],s=n._downloading.length,u=n._downloading.length,c=n._downloading.length+i.length;i.forEach(function(i){var f,l=n.toPath(i);"function"==typeof t&&(f=function(e){e.queueIndex=s,e.queueSize=c,e.url=i,e.path=l,e.percentage=s/c,e.loaded>0&&e.total>0&&s!==c&&(e.percentage+=e.loaded/e.total/c),a.indexOf(i)<0&&(a.push(i),s++),t(e)});var d=function(){u++,u===c&&(n._downloading=[],n.list().then(function(){f&&f(new ProgressEvent),n.isDirty()?r(n.getDownloadQueue()):o(n)},r))},h=i;n._cacheBuster&&(h+="?"+Date.now());var p=e.download(h,l,{retry:n._retry},f);p.then(d,d),n._downloading.push(p)})},r)})},o.prototype.abort=function(){this._downloading.forEach(function(t){t.abort()}),this._downloading=[]},o.prototype.isCached=function(t){return t=this.toPath(t),!!this._cached[t]},o.prototype.clear=function(){var t=this;return this._cached={},this._fs.removeDir(this.localRoot).then(function(){return t._fs.ensure(t.localRoot)})},o.prototype.toInternalURL=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toInternalURL:t},o.prototype.get=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toInternalURL:this.toServerURL(t)},o.prototype.toDataURL=function(t){return this._fs.toDataURL(this.toPath(t))},o.prototype.toURL=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toURL:t},o.prototype.toServerURL=function(t){return t=this._fs.normalize(t),t.indexOf("://")<0?this.serverRoot+t:t},o.prototype.toPath=function(t){return this._mirrorMode?(t=t=this._fs.normalize(t||""),len=this.serverRoot.length,t.substr(0,len)!==this.serverRoot?this.localRoot+t:this.localRoot+t.substr(len)):this.localRoot+r(t)+t.substr(t.lastIndexOf("."))},t.exports=o},function(t){function e(t,n,o,r){t.getDirectory(n[0],{create:!0},function(t){n.length>1?e(t,n.slice(1),o,r):o(t)},r)}function n(t){return t=t.substr(0,t.lastIndexOf("/")+1),"/"===t[0]&&(t=t.substr(1)),t}function o(t){return t.substr(t.lastIndexOf("/")+1)}function r(t){return t=t||"","/"===t[0]&&(t=t.substr(1)),t&&t.indexOf(".")<0&&"/"!==t[t.length-1]&&(t+="/"),"./"===t&&(t=""),t}var i=[],a=0;t.exports=function(t){function s(t){return new x(function(e){return e(t)})}function u(t){return new x(function(n,o){return B.then(function(r){t?(t=t.split("/").filter(function(t){return t&&t.length>0&&"."!==t[0]}),e(r.root,t,n,o)):n(r.root)},o)})}function c(t,e){return new x(function(n,o){return t instanceof FileEntry?n(t):(t=r(t),e=e||{},B.then(function(r){r.root.getFile(t,e,n,o)},o))})}function f(t,e){return t=r(t),e=e||{},new x(function(n,o){return B.then(function(r){t&&"/"!==t?r.root.getDirectory(t,e,n,o):n(r.root)},o)})}function l(t,e){e=e||"";var n=e.indexOf("r")>-1,o=e.indexOf("e")>-1,r=e.indexOf("f")>-1,i=e.indexOf("d")>-1;return r&&i&&(r=!1,i=!1),new x(function(e,a){return f(t).then(function(t){var u=t.createReader();u.readEntries(function(t){var u=[s(t)];n&&t.filter(function(t){return t.isDirectory}).forEach(function(t){u.push(l(t.fullPath,"re"))}),x.all(u).then(function(t){var n=[];n=n.concat.apply(n,t),r&&(n=n.filter(function(t){return t.isFile})),i&&(n=n.filter(function(t){return t.isDirectory})),o||(n=n.map(function(t){return t.fullPath})),e(n)},a)},a)},a)})}function d(t){return new x(function(e,n){c(t).then(function(t){e(t)},function(t){1===t.code?e(!1):n(t)})})}function h(t){return u(n(t)).then(function(){return c(t,{create:!0})})}function p(t){return c(t).then(function(t){return t.toURL()})}function w(t,e){return e=e||"readAsText",c(t).then(function(t){return new x(function(n,o){t.file(function(t){var o=new FileReader;o.onloadend=function(){n(this.result)},o[e](t)},o)})})}function v(t){return w(t,"readAsDataURL")}function y(t){return w(t).then(JSON.parse)}function m(t,e,o){return u(n(t)).then(function(){return c(t,{create:!0})}).then(function(t){return new x(function(n,r){t.createWriter(function(t){t.onwriteend=n,t.onerror=r,"string"==typeof e?e=new Blob([e],{type:o||"text/plain"}):e instanceof Blob!=!0&&(e=new Blob([JSON.stringify(e,null,4)],{type:o||"application/json"})),t.write(e)},r)})})}function _(t,e){return u(n(e)).then(function(n){return c(t).then(function(t){return new x(function(r,i){t.moveTo(n,o(e),r,i)})})})}function g(t,e){return u(n(e)).then(function(n){return c(t).then(function(t){return new x(function(r,i){t.copyTo(n,o(e),r,i)})})})}function R(t,e){var n=e?c:d;return new x(function(e,o){n(t).then(function(t){t!==!1?t.remove(e,o):e(1)},o)}).then(function(t){return 1===t?!1:!0})}function b(t){return f(t).then(function(t){return new x(function(e,n){t.removeRecursively(e,n)})})}function S(){for(;i.length>0&&a<t.concurrency;){a++;var e=i.pop(),n=e.shift(),o=e.shift(),r=e.shift(),s=e.shift(),u=e.shift(),c=e.shift(),f=e.shift(),l=e.shift();n._aborted?a--:o?(n.download.call(n,r,s,u,c,f,l),n.onprogress&&n.onprogress(new ProgressEvent)):n.upload.call(n,s,r,u,c,l,f)}}function U(t){return a--,S(),t}function D(e,n,o,r,s){"function"==typeof r&&(s=r,r={}),n=encodeURI(n),F&&(o=I(o)),r=r||{},r.retry&&r.retry.length||(r.retry=t.retry),r.retry=r.retry.concat();var u=new FileTransfer;s=s||r.onprogress,"function"==typeof s&&(u.onprogress=s);var c=new x(function(t,s){var c=function(a){if(0===r.retry.length)s(a);else{i.unshift([u,e,n,o,t,c,r.trustAllHosts||!1,r]);var f=r.retry.shift();f>0?setTimeout(U,f):U()}};r.retry.unshift(0),a++,c()});return c.then(U,U),c.progress=function(t){return u.onprogress=t,c},c.abort=function(){return u._aborted=!0,u.abort(),c},c}function L(t,e,n,o){return D(!0,t,e,n,o)}function M(t,e,n,o){return D(!1,e,t,n,o)}var x=t.Promise||window.Promise;if(!x)throw new Error("No Promise library given in options.Promise");this.options=t=t||{},t.persistent=void 0!==t.persistent?t.persistent:!0,t.storageSize=t.storageSize||20971520,t.concurrency=t.concurrency||3,t.retry=t.retry||[];var C,F="undefined"!=typeof cordova;F?C=new x(function(t,e){document.addEventListener("deviceready",t,!1),setTimeout(function(){e(new Error("deviceready has not fired after 5 seconds."))},5100)}):(C=s(!0),"undefined"!=typeof webkitRequestFileSystem?(window.requestFileSystem=webkitRequestFileSystem,window.FileTransfer=function(){},FileTransfer.prototype.download=function(t,e,n,o){var r=new XMLHttpRequest;return r.open("GET",t),r.responseType="blob",r.onreadystatechange=function(){4==r.readyState&&(200===r.status?m(e,r.response).then(n,o):o(r.status))},r.send(),r},window.ProgressEvent=function(){}):window.requestFileSystem=function(t,e,n,o){o(new Error("requestFileSystem not supported!"))});var B=new x(function(e,n){C.then(function(){var o=t.persistent?1:0;"number"==typeof t.fileSystem&&(o=t.fileSystem),!F&&o>1&&(console.warn('Chrome does not support fileSystem "'+o+'". Falling back on "0" (temporary).'),o=0),window.requestFileSystem(o,t.storageSize,e,n),setTimeout(function(){n(new Error("Could not retrieve FileSystem after 5 seconds."))},5100)},n)});B.then(function(t){window.__fs=t},function(t){console.error("Could not get Cordova FileSystem:",t)});var E,I;return F?(I=function(e){return e=r(e),"cdvfile://localhost/"+(t.persistent?"persistent/":"temporary/")+e},E=function(t){return c(t).then(function(t){return t.toInternalURL()})}):(I=function(e){return e=r(e),"filesystem:"+location.origin+(t.persistent?"/persistent/":"/temporary/")+e},E=function(t){return c(t).then(function(t){return t.toURL()})}),{fs:B,normalize:r,file:c,filename:o,dir:f,dirname:n,create:h,read:w,readJSON:y,write:m,move:_,copy:g,remove:R,removeDir:b,list:l,ensure:u,exists:d,download:L,upload:M,toURL:p,isCordova:F,toInternalURLSync:I,toInternalURL:E,toDataURL:v,deviceready:C,options:t,Promise:x}}},function(t){!function(e,n){function o(t,e){return(typeof e)[0]==t}function r(t,a){return a=function s(u,c,f,l,d,h){function p(t){return function(e){d&&(d=0,s(o,t,e))}}if(l=s.q,u!=o)return r(function(t,e){l.push({p:this,r:t,j:e,1:u,0:c})});if(f&&o(e,f)|o(n,f))try{d=f.then}catch(t){c=0,f=t}if(o(e,d))try{d.call(f,p(1),c=p(0))}catch(t){c(t)}else for(a=function(n,a){return o(e,n=c?n:a)?r(function(t,e){i(this,t,e,f,n)}):t},h=0;h<l.length;)d=l[h++],o(e,u=d[c])?i(d.p,d.r,d.j,f,u):(c?d.r:d.j)(f)},a.q=[],t.call(t={then:function(t,e){return a(t,e)},catch:function(t){return a(0,t)}},function(t){a(o,1,t)},function(t){a(o,0,t)}),t}function i(t,r,i,a,s){setImmediate(function(){try{a=s(a),s=a&&o(n,a)|o(e,a)&&a.then,o(e,s)?a==t?i(TypeError()):s.call(a,r,i):r(a)}catch(t){i(t)}})}function a(t){return r(function(e){e(t)})}t.exports=r,r.resolve=a,r.reject=function(t){return r(function(e,n){n(t)})},r.all=function(t){return r(function(e,n,o,r){r=[],o=t.length||e(r),t.map(function(t,i){a(t).then(function(t){r[i]=t,--o||e(r)},n)})})}}("f","o")},function(t){function e(t,e){var n,o,r,i,a,s,u,c;for(n=3&t.length,o=t.length-n,r=e,a=3432918353,s=461845907,c=0;o>c;)u=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u,r=r<<13|r>>>19,i=5*(65535&r)+((5*(r>>>16)&65535)<<16)&4294967295,r=(65535&i)+27492+(((i>>>16)+58964&65535)<<16);switch(u=0,n){case 3:u^=(255&t.charCodeAt(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:u^=255&t.charCodeAt(c),u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u}return r^=t.length,r^=r>>>16,r=2246822507*(65535&r)+((2246822507*(r>>>16)&65535)<<16)&4294967295,r^=r>>>13,r=3266489909*(65535&r)+((3266489909*(r>>>16)&65535)<<16)&4294967295,r^=r>>>16,r>>>0}t.exports=e}]); | ||
!function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){window.CordovaAppLoader=n(1),window.CordovaFileCache=n(2),window.CordovaPromiseFS=n(3),window.Promise=n(4),window.setImmediate=window.setTimeout},function(t,e,n){function o(t){if(!t)throw new Error("CordovaAppLoader has no options!");if(!t.fs)throw new Error('CordovaAppLoader has no "fs" option (cordova-promise-fs)');if(!t.serverRoot)throw new Error('CordovaAppLoader has no "serverRoot" option.');if(!window.pegasus||!window.Manifest)throw new Error("CordovaAppLoader bootstrap.js is missing.");this.allowServerRootFromManifest=t.allowServerRootFromManifest===!0,i=t.fs.Promise,this.manifest=window.Manifest,this.newManifest=null,this.bundledManifest=null,this._lastUpdateFiles=localStorage.getItem("last_update_files"),t.serverRoot=t.serverRoot||"",t.serverRoot&&"/"!==t.serverRoot[t.serverRoot.length-1]&&(t.serverRoot+="/"),this.newManifestUrl=t.manifestUrl||t.serverRoot+(t.manifest||"manifest.json"),t.mode&&(t.mode="mirror"),this.cache=new r(t),this.corruptNewManifest=!1,this._toBeCopied=[],this._toBeDeleted=[],this._toBeDownloaded=[],this._updateReady=!1,this._checkTimeout=t.checkTimeout||1e4}var r=n(2),i=(n(3),null),a=location.href.replace(location.hash,""),a=a.substr(0,a.lastIndexOf("/")+1);/ip(hone|ad|od)/i.test(navigator.userAgent)&&(a="cdvfile://localhost/bundle/www/"),o.prototype._createFilemap=function(t){var e={},n=this.cache._fs.normalize;return Object.keys(t).forEach(function(o){t[o].filename=n(t[o].filename),e[t[o].filename]=t[o]}),e},o.prototype.copyFromBundle=function(t){var e=a+t;return this.cache._fs.download(e,this.cache.localRoot+t)},o.prototype.getBundledManifest=function(){var t=this,e=document.querySelector("script[manifest]"),n=(e?e.getAttribute("manifest"):null)||"manifest.json";return new i(function(e,o){t.bundledManifest?e(t.bundledManifest):(pegasus(n).then(function(n){t.bundledManifest=n,e(n)},o),setTimeout(function(){o(new Error("bundled manifest timeout"))},t._checkTimeout))})},o.prototype.check=function(t){var e=this,n=this.manifest;"string"==typeof t&&(e.newManifestUrl=t,t=void 0);var o=new i(function(n,o){"object"==typeof t?n(t):(pegasus(e.newManifestUrl).then(n,o),setTimeout(function(){o(new Error("new manifest timeout"))},e._checkTimeout))});return new i(function(t,r){i.all([o,e.getBundledManifest(),e.cache.list()]).then(function(o){var i=o[0],a=o[1];if(JSON.stringify(i.files)===e._lastUpdateFiles)return JSON.stringify(i.files)!==JSON.stringify(Manifest.files)&&(console.warn("New manifest available, but an earlier update attempt failed. Will not download."),e.corruptNewManifest=!0,t(null)),void t(!1);if(!i.files)return void r('Downloaded Manifest has no "files" attribute.');var s=o[2],u=e._createFilemap(n.files),c=e._createFilemap(i.files),f=e._createFilemap(a.files);e._toBeDownloaded=[],e._toBeCopied=[],e._toBeDeleted=[];var l=e.cache._fs.isCordova;Object.keys(c).filter(function(t){return!u[t]||u[t].version!==c[t].version||!e.cache.isCached(t)}).forEach(function(t){l&&f[t]&&f[t].version===c[t].version?e._toBeCopied.push(t):e._toBeDownloaded.push(t)}),e._toBeDeleted=s.map(function(t){return t.substr(e.cache.localRoot.length)}).filter(function(t){return!c[t]||e._toBeDownloaded.indexOf(t)>=0||e._toBeCopied.indexOf(t)>=0});var d=e._toBeDeleted.length+e._toBeDownloaded.length;d>0?(e.newManifest=i,e.newManifest.root=e.cache.localInternalURL,t(!0)):t(!1)})})},o.prototype.canDownload=function(){return!!this.newManifest&&!this._updateReady},o.prototype.canUpdate=function(){return this._updateReady},o.prototype.download=function(t){var e=this;return e.canDownload()?(localStorage.removeItem("manifest"),localStorage.setItem("last_update_files",JSON.stringify(this.newManifest.files)),this.manifest.files=Manifest.files={},e.cache.remove(e._toBeDeleted,!0).then(function(){return i.all(e._toBeCopied.map(function(t){return e.cache._fs.download(a+t,e.cache.localRoot+t)}))}).then(function(){return e.allowServerRootFromManifest&&e.newManifest.serverRoot&&(e.cache.serverRoot=e.newManifest.serverRoot),e.cache.add(e._toBeDownloaded),e.cache.download(t)}).then(function(){return e._toBeDeleted=[],e._toBeDownloaded=[],e._updateReady=!0,e.newManifest},function(t){return t&&t.length&&e.cache.remove(t),t})):i.resolve(null)},o.prototype.update=function(t){return this._updateReady?(localStorage.setItem("manifest",JSON.stringify(this.newManifest)),t!==!1&&location.reload(),!0):!1},o.prototype.clear=function(){return localStorage.removeItem("last_update_files"),localStorage.removeItem("manifest"),this.cache.clear()},o.prototype.reset=function(){return this.clear().then(function(){location.reload()},function(){location.reload()})},t.exports=o},function(t,e,n){function o(t){var e=this;if(this._fs=t.fs,!this._fs)throw new Error('Missing required option "fs". Add an instance of cordova-promise-fs.');i=this._fs.Promise,this._mirrorMode="hash"!==t.mode,this._retry=t.retry||[500,1500,8e3],this._cacheBuster=!!t.cacheBuster,this.localRoot=this._fs.normalize(t.localRoot||"data"),this.serverRoot=this._fs.normalize(t.serverRoot||""),this._downloading=[],this._added=[],this._cached={},this.ready=this._fs.ensure(this.localRoot).then(function(t){return e.localInternalURL=a?t.toInternalURL():t.toURL(),e.localUrl=t.toURL(),e.list()})}var r=n(5),i=null,a="undefined"!=typeof cordova;o.prototype.list=function(){var t=this;return new i(function(e){t._fs.list(t.localRoot,"rfe").then(function(n){t._cached={},n=n.map(function(e){var n=t._fs.normalize(e.fullPath);return t._cached[n]={toInternalURL:a?e.toInternalURL():e.toURL(),toURL:e.toURL()},n}),e(n)},function(){e([])})})},o.prototype.add=function(t){t||(t=[]),"string"==typeof t&&(t=[t]);var e=this;return t.forEach(function(t){t=e.toServerURL(t),-1===e._added.indexOf(t)&&e._added.push(t)}),e.isDirty()},o.prototype.remove=function(t,e){t||(t=[]);var n=[];"string"==typeof t&&(t=[t]);var o=this;return t.forEach(function(t){var e=o._added.indexOf(o.toServerURL(t));e>=0&&o._added.splice(e,1);var r=o.toPath(t);n.push(o._fs.remove(r)),delete o._cached[r]}),e?i.all(n):o.isDirty()},o.prototype.getDownloadQueue=function(){var t=this,e=t._added.filter(function(e){return!t.isCached(e)});return e},o.prototype.getAdded=function(){return this._added},o.prototype.isDirty=function(){return this.getDownloadQueue().length>0},o.prototype.download=function(t){var e=this._fs,n=this;return n.abort(),new i(function(o,r){e.ensure(n.localRoot).then(function(){return n.list()}).then(function(){if(!n.isDirty())return void o(n);var i=n.getDownloadQueue(),a=[],s=n._downloading.length,u=n._downloading.length,c=n._downloading.length+i.length;i.forEach(function(i){var f,l=n.toPath(i);"function"==typeof t&&(f=function(e){e.queueIndex=s,e.queueSize=c,e.url=i,e.path=l,e.percentage=s/c,e.loaded>0&&e.total>0&&s!==c&&(e.percentage+=e.loaded/e.total/c),a.indexOf(i)<0&&(a.push(i),s++),t(e)});var d=function(){u++,u===c&&(n._downloading=[],n.list().then(function(){f&&f(new ProgressEvent),n.isDirty()?r(n.getDownloadQueue()):o(n)},r))},h=i;n._cacheBuster&&(h+="?"+Date.now());var p=e.download(h,l,{retry:n._retry},f);p.then(d,d),n._downloading.push(p)})},r)})},o.prototype.abort=function(){this._downloading.forEach(function(t){t.abort()}),this._downloading=[]},o.prototype.isCached=function(t){return t=this.toPath(t),!!this._cached[t]},o.prototype.clear=function(){var t=this;return this._cached={},this._fs.removeDir(this.localRoot).then(function(){return t._fs.ensure(t.localRoot)})},o.prototype.toInternalURL=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toInternalURL:t},o.prototype.get=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toInternalURL:this.toServerURL(t)},o.prototype.toDataURL=function(t){return this._fs.toDataURL(this.toPath(t))},o.prototype.toURL=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toURL:t},o.prototype.toServerURL=function(t){return t=this._fs.normalize(t),t.indexOf("://")<0?this.serverRoot+t:t},o.prototype.toPath=function(t){return this._mirrorMode?(t=t=this._fs.normalize(t||""),len=this.serverRoot.length,t.substr(0,len)!==this.serverRoot?this.localRoot+t:this.localRoot+t.substr(len)):this.localRoot+r(t)+t.substr(t.lastIndexOf("."))},t.exports=o},function(t){function e(t,n,o,r){t.getDirectory(n[0],{create:!0},function(t){n.length>1?e(t,n.slice(1),o,r):o(t)},r)}function n(t){return t=t.substr(0,t.lastIndexOf("/")+1),"/"===t[0]&&(t=t.substr(1)),t}function o(t){return t.substr(t.lastIndexOf("/")+1)}function r(t){return t=t||"","/"===t[0]&&(t=t.substr(1)),t&&t.indexOf(".")<0&&"/"!==t[t.length-1]&&(t+="/"),"./"===t&&(t=""),t}var i=[],a=0;t.exports=function(t){function s(t){return new x(function(e){return e(t)})}function u(t){return new x(function(n,o){return B.then(function(r){t?(t=t.split("/").filter(function(t){return t&&t.length>0&&"."!==t[0]}),e(r.root,t,n,o)):n(r.root)},o)})}function c(t,e){return new x(function(n,o){return"object"==typeof t?n(t):(t=r(t),e=e||{},B.then(function(r){r.root.getFile(t,e,n,o)},o))})}function f(t,e){return t=r(t),e=e||{},new x(function(n,o){return B.then(function(r){t&&"/"!==t?r.root.getDirectory(t,e,n,o):n(r.root)},o)})}function l(t,e){e=e||"";var n=e.indexOf("r")>-1,o=e.indexOf("e")>-1,r=e.indexOf("f")>-1,i=e.indexOf("d")>-1;return r&&i&&(r=!1,i=!1),new x(function(e,a){return f(t).then(function(t){var u=t.createReader();u.readEntries(function(t){var u=[s(t)];n&&t.filter(function(t){return t.isDirectory}).forEach(function(t){u.push(l(t.fullPath,"re"))}),x.all(u).then(function(t){var n=[];n=n.concat.apply(n,t),r&&(n=n.filter(function(t){return t.isFile})),i&&(n=n.filter(function(t){return t.isDirectory})),o||(n=n.map(function(t){return t.fullPath})),e(n)},a)},a)},a)})}function d(t){return new x(function(e,n){c(t).then(function(t){e(t)},function(t){1===t.code?e(!1):n(t)})})}function h(t){return u(n(t)).then(function(){return c(t,{create:!0})})}function p(t){return c(t).then(function(t){return t.toURL()})}function w(t,e){return e=e||"readAsText",c(t).then(function(t){return new x(function(n,o){t.file(function(t){var o=new FileReader;o.onloadend=function(){n(this.result)},o[e](t)},o)})})}function v(t){return w(t,"readAsDataURL")}function y(t){return w(t).then(JSON.parse)}function m(t,e,o){return u(n(t)).then(function(){return c(t,{create:!0})}).then(function(t){return new x(function(n,r){t.createWriter(function(t){t.onwriteend=n,t.onerror=r,"string"==typeof e?e=new Blob([e],{type:o||"text/plain"}):e instanceof Blob!=!0&&(e=new Blob([JSON.stringify(e,null,4)],{type:o||"application/json"})),t.write(e)},r)})})}function _(t,e){return u(n(e)).then(function(n){return c(t).then(function(t){return new x(function(r,i){t.moveTo(n,o(e),r,i)})})})}function g(t,e){return u(n(e)).then(function(n){return c(t).then(function(t){return new x(function(r,i){t.copyTo(n,o(e),r,i)})})})}function R(t,e){var n=e?c:d;return new x(function(e,o){n(t).then(function(t){t!==!1?t.remove(e,o):e(1)},o)}).then(function(t){return 1===t?!1:!0})}function b(t){return f(t).then(function(t){return new x(function(e,n){t.removeRecursively(e,n)})})}function S(){for(;i.length>0&&a<t.concurrency;){a++;var e=i.pop(),n=e.shift(),o=e.shift(),r=e.shift(),s=e.shift(),u=e.shift(),c=e.shift(),f=e.shift(),l=e.shift();n._aborted?a--:o?(n.download.call(n,r,s,u,c,f,l),n.onprogress&&n.onprogress(new ProgressEvent)):n.upload.call(n,s,r,u,c,l,f)}}function U(t){return a--,S(),t}function D(e,n,o,r,s){"function"==typeof r&&(s=r,r={}),n=encodeURI(n),F&&(o=I(o)),r=r||{},r.retry&&r.retry.length||(r.retry=t.retry),r.retry=r.retry.concat();var u=new FileTransfer;s=s||r.onprogress,"function"==typeof s&&(u.onprogress=s);var c=new x(function(t,s){var c=function(a){if(0===r.retry.length)s(a);else{i.unshift([u,e,n,o,t,c,r.trustAllHosts||!1,r]);var f=r.retry.shift();f>0?setTimeout(U,f):U()}};r.retry.unshift(0),a++,c()});return c.then(U,U),c.progress=function(t){return u.onprogress=t,c},c.abort=function(){return u._aborted=!0,u.abort(),c},c}function L(t,e,n,o){return D(!0,t,e,n,o)}function M(t,e,n,o){return D(!1,e,t,n,o)}var x=t.Promise||window.Promise;if(!x)throw new Error("No Promise library given in options.Promise");this.options=t=t||{},t.persistent=void 0!==t.persistent?t.persistent:!0,t.storageSize=t.storageSize||20971520,t.concurrency=t.concurrency||3,t.retry=t.retry||[];var C,F="undefined"!=typeof cordova;F?C=new x(function(t,e){document.addEventListener("deviceready",t,!1),setTimeout(function(){e(new Error("deviceready has not fired after 5 seconds."))},5100)}):(C=s(!0),"undefined"!=typeof webkitRequestFileSystem?(window.requestFileSystem=webkitRequestFileSystem,window.FileTransfer=function(){},FileTransfer.prototype.download=function(t,e,n,o){var r=new XMLHttpRequest;return r.open("GET",t),r.responseType="blob",r.onreadystatechange=function(){4==r.readyState&&(200===r.status?m(e,r.response).then(n,o):o(r.status))},r.send(),r},window.ProgressEvent=function(){},window.FileEntry=function(){}):window.requestFileSystem=function(t,e,n,o){o(new Error("requestFileSystem not supported!"))});var B=new x(function(e,n){C.then(function(){var o=t.persistent?1:0;"number"==typeof t.fileSystem&&(o=t.fileSystem),!F&&o>1&&(console.warn('Chrome does not support fileSystem "'+o+'". Falling back on "0" (temporary).'),o=0),window.requestFileSystem(o,t.storageSize,e,n),setTimeout(function(){n(new Error("Could not retrieve FileSystem after 5 seconds."))},5100)},n)});B.then(function(t){window.__fs=t},function(t){console.error("Could not get Cordova FileSystem:",t)});var E,I;return F?(I=function(e){return e=r(e),"cdvfile://localhost/"+(t.persistent?"persistent/":"temporary/")+e},E=function(t){return c(t).then(function(t){return t.toInternalURL()})}):(I=function(e){return e=r(e),"filesystem:"+location.origin+(t.persistent?"/persistent/":"/temporary/")+e},E=function(t){return c(t).then(function(t){return t.toURL()})}),{fs:B,normalize:r,file:c,filename:o,dir:f,dirname:n,create:h,read:w,readJSON:y,write:m,move:_,copy:g,remove:R,removeDir:b,list:l,ensure:u,exists:d,download:L,upload:M,toURL:p,isCordova:F,toInternalURLSync:I,toInternalURL:E,toDataURL:v,deviceready:C,options:t,Promise:x}}},function(t){!function(e,n){function o(t,e){return(typeof e)[0]==t}function r(t,a){return a=function s(u,c,f,l,d,h){function p(t){return function(e){d&&(d=0,s(o,t,e))}}if(l=s.q,u!=o)return r(function(t,e){l.push({p:this,r:t,j:e,1:u,0:c})});if(f&&o(e,f)|o(n,f))try{d=f.then}catch(t){c=0,f=t}if(o(e,d))try{d.call(f,p(1),c=p(0))}catch(t){c(t)}else for(a=function(n,a){return o(e,n=c?n:a)?r(function(t,e){i(this,t,e,f,n)}):t},h=0;h<l.length;)d=l[h++],o(e,u=d[c])?i(d.p,d.r,d.j,f,u):(c?d.r:d.j)(f)},a.q=[],t.call(t={then:function(t,e){return a(t,e)},catch:function(t){return a(0,t)}},function(t){a(o,1,t)},function(t){a(o,0,t)}),t}function i(t,r,i,a,s){setImmediate(function(){try{a=s(a),s=a&&o(n,a)|o(e,a)&&a.then,o(e,s)?a==t?i(TypeError()):s.call(a,r,i):r(a)}catch(t){i(t)}})}function a(t){return r(function(e){e(t)})}t.exports=r,r.resolve=a,r.reject=function(t){return r(function(e,n){n(t)})},r.all=function(t){return r(function(e,n,o,r){r=[],o=t.length||e(r),t.map(function(t,i){a(t).then(function(t){r[i]=t,--o||e(r)},n)})})}}("f","o")},function(t){function e(t,e){var n,o,r,i,a,s,u,c;for(n=3&t.length,o=t.length-n,r=e,a=3432918353,s=461845907,c=0;o>c;)u=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u,r=r<<13|r>>>19,i=5*(65535&r)+((5*(r>>>16)&65535)<<16)&4294967295,r=(65535&i)+27492+(((i>>>16)+58964&65535)<<16);switch(u=0,n){case 3:u^=(255&t.charCodeAt(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:u^=255&t.charCodeAt(c),u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u}return r^=t.length,r^=r>>>16,r=2246822507*(65535&r)+((2246822507*(r>>>16)&65535)<<16)&4294967295,r^=r>>>13,r=3266489909*(65535&r)+((3266489909*(r>>>16)&65535)<<16)&4294967295,r^=r>>>16,r>>>0}t.exports=e}]); |
@@ -52,3 +52,4 @@ var CordovaAppLoader = | ||
var BUNDLE_ROOT = location.href.substr(0,location.href.lastIndexOf('/')+1); | ||
var BUNDLE_ROOT = location.href.replace(location.hash,''); | ||
var BUNDLE_ROOT = BUNDLE_ROOT.substr(0,BUNDLE_ROOT.lastIndexOf('/')+1); | ||
if(/ip(hone|ad|od)/i.test(navigator.userAgent)){ | ||
@@ -640,2 +641,3 @@ BUNDLE_ROOT = 'cdvfile://localhost/bundle/www/'; | ||
window.ProgressEvent = function ProgressEvent(){}; | ||
window.FileEntry = function FileEntry(){}; | ||
} else { | ||
@@ -698,3 +700,3 @@ window.requestFileSystem = function(x,y,z,fail){ | ||
return new Promise(function(resolve,reject){ | ||
if(path instanceof FileEntry) { | ||
if(typeof path === 'object') { | ||
return resolve(path); | ||
@@ -701,0 +703,0 @@ } |
@@ -1,1 +0,1 @@ | ||
var CordovaAppLoader=function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){function o(t){if(!t)throw new Error("CordovaAppLoader has no options!");if(!t.fs)throw new Error('CordovaAppLoader has no "fs" option (cordova-promise-fs)');if(!t.serverRoot)throw new Error('CordovaAppLoader has no "serverRoot" option.');if(!window.pegasus||!window.Manifest)throw new Error("CordovaAppLoader bootstrap.js is missing.");this.allowServerRootFromManifest=t.allowServerRootFromManifest===!0,i=t.fs.Promise,this.manifest=window.Manifest,this.newManifest=null,this.bundledManifest=null,this._lastUpdateFiles=localStorage.getItem("last_update_files"),t.serverRoot=t.serverRoot||"",t.serverRoot&&"/"!==t.serverRoot[t.serverRoot.length-1]&&(t.serverRoot+="/"),this.newManifestUrl=t.manifestUrl||t.serverRoot+(t.manifest||"manifest.json"),t.mode&&(t.mode="mirror"),this.cache=new r(t),this.corruptNewManifest=!1,this._toBeCopied=[],this._toBeDeleted=[],this._toBeDownloaded=[],this._updateReady=!1,this._checkTimeout=t.checkTimeout||1e4}var r=n(1),i=(n(2),null),a=location.href.substr(0,location.href.lastIndexOf("/")+1);/ip(hone|ad|od)/i.test(navigator.userAgent)&&(a="cdvfile://localhost/bundle/www/"),o.prototype._createFilemap=function(t){var e={},n=this.cache._fs.normalize;return Object.keys(t).forEach(function(o){t[o].filename=n(t[o].filename),e[t[o].filename]=t[o]}),e},o.prototype.copyFromBundle=function(t){var e=a+t;return this.cache._fs.download(e,this.cache.localRoot+t)},o.prototype.getBundledManifest=function(){var t=this,e=document.querySelector("script[manifest]"),n=(e?e.getAttribute("manifest"):null)||"manifest.json";return new i(function(e,o){t.bundledManifest?e(t.bundledManifest):(pegasus(n).then(function(n){t.bundledManifest=n,e(n)},o),setTimeout(function(){o(new Error("bundled manifest timeout"))},t._checkTimeout))})},o.prototype.check=function(t){var e=this,n=this.manifest;"string"==typeof t&&(e.newManifestUrl=t,t=void 0);var o=new i(function(n,o){"object"==typeof t?n(t):(pegasus(e.newManifestUrl).then(n,o),setTimeout(function(){o(new Error("new manifest timeout"))},e._checkTimeout))});return new i(function(t,r){i.all([o,e.getBundledManifest(),e.cache.list()]).then(function(o){var i=o[0],a=o[1];if(JSON.stringify(i.files)===e._lastUpdateFiles)return JSON.stringify(i.files)!==JSON.stringify(Manifest.files)&&(console.warn("New manifest available, but an earlier update attempt failed. Will not download."),e.corruptNewManifest=!0,t(null)),void t(!1);if(!i.files)return void r('Downloaded Manifest has no "files" attribute.');var s=o[2],u=e._createFilemap(n.files),c=e._createFilemap(i.files),f=e._createFilemap(a.files);e._toBeDownloaded=[],e._toBeCopied=[],e._toBeDeleted=[];var l=e.cache._fs.isCordova;Object.keys(c).filter(function(t){return!u[t]||u[t].version!==c[t].version||!e.cache.isCached(t)}).forEach(function(t){l&&f[t]&&f[t].version===c[t].version?e._toBeCopied.push(t):e._toBeDownloaded.push(t)}),e._toBeDeleted=s.map(function(t){return t.substr(e.cache.localRoot.length)}).filter(function(t){return!c[t]||e._toBeDownloaded.indexOf(t)>=0||e._toBeCopied.indexOf(t)>=0});var d=e._toBeDeleted.length+e._toBeDownloaded.length;d>0?(e.newManifest=i,e.newManifest.root=e.cache.localInternalURL,t(!0)):t(!1)})})},o.prototype.canDownload=function(){return!!this.newManifest&&!this._updateReady},o.prototype.canUpdate=function(){return this._updateReady},o.prototype.download=function(t){var e=this;return e.canDownload()?(localStorage.removeItem("manifest"),localStorage.setItem("last_update_files",JSON.stringify(this.newManifest.files)),this.manifest.files=Manifest.files={},e.cache.remove(e._toBeDeleted,!0).then(function(){return i.all(e._toBeCopied.map(function(t){return e.cache._fs.download(a+t,e.cache.localRoot+t)}))}).then(function(){return e.allowServerRootFromManifest&&e.newManifest.serverRoot&&(e.cache.serverRoot=e.newManifest.serverRoot),e.cache.add(e._toBeDownloaded),e.cache.download(t)}).then(function(){return e._toBeDeleted=[],e._toBeDownloaded=[],e._updateReady=!0,e.newManifest},function(t){return t&&t.length&&e.cache.remove(t),t})):i.resolve(null)},o.prototype.update=function(t){return this._updateReady?(localStorage.setItem("manifest",JSON.stringify(this.newManifest)),t!==!1&&location.reload(),!0):!1},o.prototype.clear=function(){return localStorage.removeItem("last_update_files"),localStorage.removeItem("manifest"),this.cache.clear()},o.prototype.reset=function(){return this.clear().then(function(){location.reload()},function(){location.reload()})},t.exports=o},function(t,e,n){function o(t){var e=this;if(this._fs=t.fs,!this._fs)throw new Error('Missing required option "fs". Add an instance of cordova-promise-fs.');i=this._fs.Promise,this._mirrorMode="hash"!==t.mode,this._retry=t.retry||[500,1500,8e3],this._cacheBuster=!!t.cacheBuster,this.localRoot=this._fs.normalize(t.localRoot||"data"),this.serverRoot=this._fs.normalize(t.serverRoot||""),this._downloading=[],this._added=[],this._cached={},this.ready=this._fs.ensure(this.localRoot).then(function(t){return e.localInternalURL=a?t.toInternalURL():t.toURL(),e.localUrl=t.toURL(),e.list()})}var r=n(3),i=null,a="undefined"!=typeof cordova;o.prototype.list=function(){var t=this;return new i(function(e){t._fs.list(t.localRoot,"rfe").then(function(n){t._cached={},n=n.map(function(e){var n=t._fs.normalize(e.fullPath);return t._cached[n]={toInternalURL:a?e.toInternalURL():e.toURL(),toURL:e.toURL()},n}),e(n)},function(){e([])})})},o.prototype.add=function(t){t||(t=[]),"string"==typeof t&&(t=[t]);var e=this;return t.forEach(function(t){t=e.toServerURL(t),-1===e._added.indexOf(t)&&e._added.push(t)}),e.isDirty()},o.prototype.remove=function(t,e){t||(t=[]);var n=[];"string"==typeof t&&(t=[t]);var o=this;return t.forEach(function(t){var e=o._added.indexOf(o.toServerURL(t));e>=0&&o._added.splice(e,1);var r=o.toPath(t);n.push(o._fs.remove(r)),delete o._cached[r]}),e?i.all(n):o.isDirty()},o.prototype.getDownloadQueue=function(){var t=this,e=t._added.filter(function(e){return!t.isCached(e)});return e},o.prototype.getAdded=function(){return this._added},o.prototype.isDirty=function(){return this.getDownloadQueue().length>0},o.prototype.download=function(t){var e=this._fs,n=this;return n.abort(),new i(function(o,r){e.ensure(n.localRoot).then(function(){return n.list()}).then(function(){if(!n.isDirty())return void o(n);var i=n.getDownloadQueue(),a=[],s=n._downloading.length,u=n._downloading.length,c=n._downloading.length+i.length;i.forEach(function(i){var f,l=n.toPath(i);"function"==typeof t&&(f=function(e){e.queueIndex=s,e.queueSize=c,e.url=i,e.path=l,e.percentage=s/c,e.loaded>0&&e.total>0&&s!==c&&(e.percentage+=e.loaded/e.total/c),a.indexOf(i)<0&&(a.push(i),s++),t(e)});var d=function(){u++,u===c&&(n._downloading=[],n.list().then(function(){f&&f(new ProgressEvent),n.isDirty()?r(n.getDownloadQueue()):o(n)},r))},h=i;n._cacheBuster&&(h+="?"+Date.now());var p=e.download(h,l,{retry:n._retry},f);p.then(d,d),n._downloading.push(p)})},r)})},o.prototype.abort=function(){this._downloading.forEach(function(t){t.abort()}),this._downloading=[]},o.prototype.isCached=function(t){return t=this.toPath(t),!!this._cached[t]},o.prototype.clear=function(){var t=this;return this._cached={},this._fs.removeDir(this.localRoot).then(function(){return t._fs.ensure(t.localRoot)})},o.prototype.toInternalURL=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toInternalURL:t},o.prototype.get=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toInternalURL:this.toServerURL(t)},o.prototype.toDataURL=function(t){return this._fs.toDataURL(this.toPath(t))},o.prototype.toURL=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toURL:t},o.prototype.toServerURL=function(t){return t=this._fs.normalize(t),t.indexOf("://")<0?this.serverRoot+t:t},o.prototype.toPath=function(t){return this._mirrorMode?(t=t=this._fs.normalize(t||""),len=this.serverRoot.length,t.substr(0,len)!==this.serverRoot?this.localRoot+t:this.localRoot+t.substr(len)):this.localRoot+r(t)+t.substr(t.lastIndexOf("."))},t.exports=o},function(t){function e(t,n,o,r){t.getDirectory(n[0],{create:!0},function(t){n.length>1?e(t,n.slice(1),o,r):o(t)},r)}function n(t){return t=t.substr(0,t.lastIndexOf("/")+1),"/"===t[0]&&(t=t.substr(1)),t}function o(t){return t.substr(t.lastIndexOf("/")+1)}function r(t){return t=t||"","/"===t[0]&&(t=t.substr(1)),t&&t.indexOf(".")<0&&"/"!==t[t.length-1]&&(t+="/"),"./"===t&&(t=""),t}var i=[],a=0;t.exports=function(t){function s(t){return new x(function(e){return e(t)})}function u(t){return new x(function(n,o){return F.then(function(r){t?(t=t.split("/").filter(function(t){return t&&t.length>0&&"."!==t[0]}),e(r.root,t,n,o)):n(r.root)},o)})}function c(t,e){return new x(function(n,o){return t instanceof FileEntry?n(t):(t=r(t),e=e||{},F.then(function(r){r.root.getFile(t,e,n,o)},o))})}function f(t,e){return t=r(t),e=e||{},new x(function(n,o){return F.then(function(r){t&&"/"!==t?r.root.getDirectory(t,e,n,o):n(r.root)},o)})}function l(t,e){e=e||"";var n=e.indexOf("r")>-1,o=e.indexOf("e")>-1,r=e.indexOf("f")>-1,i=e.indexOf("d")>-1;return r&&i&&(r=!1,i=!1),new x(function(e,a){return f(t).then(function(t){var u=t.createReader();u.readEntries(function(t){var u=[s(t)];n&&t.filter(function(t){return t.isDirectory}).forEach(function(t){u.push(l(t.fullPath,"re"))}),x.all(u).then(function(t){var n=[];n=n.concat.apply(n,t),r&&(n=n.filter(function(t){return t.isFile})),i&&(n=n.filter(function(t){return t.isDirectory})),o||(n=n.map(function(t){return t.fullPath})),e(n)},a)},a)},a)})}function d(t){return new x(function(e,n){c(t).then(function(t){e(t)},function(t){1===t.code?e(!1):n(t)})})}function h(t){return u(n(t)).then(function(){return c(t,{create:!0})})}function p(t){return c(t).then(function(t){return t.toURL()})}function w(t,e){return e=e||"readAsText",c(t).then(function(t){return new x(function(n,o){t.file(function(t){var o=new FileReader;o.onloadend=function(){n(this.result)},o[e](t)},o)})})}function v(t){return w(t,"readAsDataURL")}function y(t){return w(t).then(JSON.parse)}function m(t,e,o){return u(n(t)).then(function(){return c(t,{create:!0})}).then(function(t){return new x(function(n,r){t.createWriter(function(t){t.onwriteend=n,t.onerror=r,"string"==typeof e?e=new Blob([e],{type:o||"text/plain"}):e instanceof Blob!=!0&&(e=new Blob([JSON.stringify(e,null,4)],{type:o||"application/json"})),t.write(e)},r)})})}function _(t,e){return u(n(e)).then(function(n){return c(t).then(function(t){return new x(function(r,i){t.moveTo(n,o(e),r,i)})})})}function g(t,e){return u(n(e)).then(function(n){return c(t).then(function(t){return new x(function(r,i){t.copyTo(n,o(e),r,i)})})})}function R(t,e){var n=e?c:d;return new x(function(e,o){n(t).then(function(t){t!==!1?t.remove(e,o):e(1)},o)}).then(function(t){return 1===t?!1:!0})}function b(t){return f(t).then(function(t){return new x(function(e,n){t.removeRecursively(e,n)})})}function S(){for(;i.length>0&&a<t.concurrency;){a++;var e=i.pop(),n=e.shift(),o=e.shift(),r=e.shift(),s=e.shift(),u=e.shift(),c=e.shift(),f=e.shift(),l=e.shift();n._aborted?a--:o?(n.download.call(n,r,s,u,c,f,l),n.onprogress&&n.onprogress(new ProgressEvent)):n.upload.call(n,s,r,u,c,l,f)}}function U(t){return a--,S(),t}function D(e,n,o,r,s){"function"==typeof r&&(s=r,r={}),n=encodeURI(n),C&&(o=O(o)),r=r||{},r.retry&&r.retry.length||(r.retry=t.retry),r.retry=r.retry.concat();var u=new FileTransfer;s=s||r.onprogress,"function"==typeof s&&(u.onprogress=s);var c=new x(function(t,s){var c=function(a){if(0===r.retry.length)s(a);else{i.unshift([u,e,n,o,t,c,r.trustAllHosts||!1,r]);var f=r.retry.shift();f>0?setTimeout(U,f):U()}};r.retry.unshift(0),a++,c()});return c.then(U,U),c.progress=function(t){return u.onprogress=t,c},c.abort=function(){return u._aborted=!0,u.abort(),c},c}function L(t,e,n,o){return D(!0,t,e,n,o)}function M(t,e,n,o){return D(!1,e,t,n,o)}var x=t.Promise||window.Promise;if(!x)throw new Error("No Promise library given in options.Promise");this.options=t=t||{},t.persistent=void 0!==t.persistent?t.persistent:!0,t.storageSize=t.storageSize||20971520,t.concurrency=t.concurrency||3,t.retry=t.retry||[];var B,C="undefined"!=typeof cordova;C?B=new x(function(t,e){document.addEventListener("deviceready",t,!1),setTimeout(function(){e(new Error("deviceready has not fired after 5 seconds."))},5100)}):(B=s(!0),"undefined"!=typeof webkitRequestFileSystem?(window.requestFileSystem=webkitRequestFileSystem,window.FileTransfer=function(){},FileTransfer.prototype.download=function(t,e,n,o){var r=new XMLHttpRequest;return r.open("GET",t),r.responseType="blob",r.onreadystatechange=function(){4==r.readyState&&(200===r.status?m(e,r.response).then(n,o):o(r.status))},r.send(),r},window.ProgressEvent=function(){}):window.requestFileSystem=function(t,e,n,o){o(new Error("requestFileSystem not supported!"))});var F=new x(function(e,n){B.then(function(){var o=t.persistent?1:0;"number"==typeof t.fileSystem&&(o=t.fileSystem),!C&&o>1&&(console.warn('Chrome does not support fileSystem "'+o+'". Falling back on "0" (temporary).'),o=0),window.requestFileSystem(o,t.storageSize,e,n),setTimeout(function(){n(new Error("Could not retrieve FileSystem after 5 seconds."))},5100)},n)});F.then(function(t){window.__fs=t},function(t){console.error("Could not get Cordova FileSystem:",t)});var E,O;return C?(O=function(e){return e=r(e),"cdvfile://localhost/"+(t.persistent?"persistent/":"temporary/")+e},E=function(t){return c(t).then(function(t){return t.toInternalURL()})}):(O=function(e){return e=r(e),"filesystem:"+location.origin+(t.persistent?"/persistent/":"/temporary/")+e},E=function(t){return c(t).then(function(t){return t.toURL()})}),{fs:F,normalize:r,file:c,filename:o,dir:f,dirname:n,create:h,read:w,readJSON:y,write:m,move:_,copy:g,remove:R,removeDir:b,list:l,ensure:u,exists:d,download:L,upload:M,toURL:p,isCordova:C,toInternalURLSync:O,toInternalURL:E,toDataURL:v,deviceready:B,options:t,Promise:x}}},function(t){function e(t,e){var n,o,r,i,a,s,u,c;for(n=3&t.length,o=t.length-n,r=e,a=3432918353,s=461845907,c=0;o>c;)u=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u,r=r<<13|r>>>19,i=5*(65535&r)+((5*(r>>>16)&65535)<<16)&4294967295,r=(65535&i)+27492+(((i>>>16)+58964&65535)<<16);switch(u=0,n){case 3:u^=(255&t.charCodeAt(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:u^=255&t.charCodeAt(c),u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u}return r^=t.length,r^=r>>>16,r=2246822507*(65535&r)+((2246822507*(r>>>16)&65535)<<16)&4294967295,r^=r>>>13,r=3266489909*(65535&r)+((3266489909*(r>>>16)&65535)<<16)&4294967295,r^=r>>>16,r>>>0}t.exports=e}]); | ||
var CordovaAppLoader=function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){function o(t){if(!t)throw new Error("CordovaAppLoader has no options!");if(!t.fs)throw new Error('CordovaAppLoader has no "fs" option (cordova-promise-fs)');if(!t.serverRoot)throw new Error('CordovaAppLoader has no "serverRoot" option.');if(!window.pegasus||!window.Manifest)throw new Error("CordovaAppLoader bootstrap.js is missing.");this.allowServerRootFromManifest=t.allowServerRootFromManifest===!0,i=t.fs.Promise,this.manifest=window.Manifest,this.newManifest=null,this.bundledManifest=null,this._lastUpdateFiles=localStorage.getItem("last_update_files"),t.serverRoot=t.serverRoot||"",t.serverRoot&&"/"!==t.serverRoot[t.serverRoot.length-1]&&(t.serverRoot+="/"),this.newManifestUrl=t.manifestUrl||t.serverRoot+(t.manifest||"manifest.json"),t.mode&&(t.mode="mirror"),this.cache=new r(t),this.corruptNewManifest=!1,this._toBeCopied=[],this._toBeDeleted=[],this._toBeDownloaded=[],this._updateReady=!1,this._checkTimeout=t.checkTimeout||1e4}var r=n(1),i=(n(2),null),a=location.href.replace(location.hash,""),a=a.substr(0,a.lastIndexOf("/")+1);/ip(hone|ad|od)/i.test(navigator.userAgent)&&(a="cdvfile://localhost/bundle/www/"),o.prototype._createFilemap=function(t){var e={},n=this.cache._fs.normalize;return Object.keys(t).forEach(function(o){t[o].filename=n(t[o].filename),e[t[o].filename]=t[o]}),e},o.prototype.copyFromBundle=function(t){var e=a+t;return this.cache._fs.download(e,this.cache.localRoot+t)},o.prototype.getBundledManifest=function(){var t=this,e=document.querySelector("script[manifest]"),n=(e?e.getAttribute("manifest"):null)||"manifest.json";return new i(function(e,o){t.bundledManifest?e(t.bundledManifest):(pegasus(n).then(function(n){t.bundledManifest=n,e(n)},o),setTimeout(function(){o(new Error("bundled manifest timeout"))},t._checkTimeout))})},o.prototype.check=function(t){var e=this,n=this.manifest;"string"==typeof t&&(e.newManifestUrl=t,t=void 0);var o=new i(function(n,o){"object"==typeof t?n(t):(pegasus(e.newManifestUrl).then(n,o),setTimeout(function(){o(new Error("new manifest timeout"))},e._checkTimeout))});return new i(function(t,r){i.all([o,e.getBundledManifest(),e.cache.list()]).then(function(o){var i=o[0],a=o[1];if(JSON.stringify(i.files)===e._lastUpdateFiles)return JSON.stringify(i.files)!==JSON.stringify(Manifest.files)&&(console.warn("New manifest available, but an earlier update attempt failed. Will not download."),e.corruptNewManifest=!0,t(null)),void t(!1);if(!i.files)return void r('Downloaded Manifest has no "files" attribute.');var s=o[2],u=e._createFilemap(n.files),c=e._createFilemap(i.files),f=e._createFilemap(a.files);e._toBeDownloaded=[],e._toBeCopied=[],e._toBeDeleted=[];var l=e.cache._fs.isCordova;Object.keys(c).filter(function(t){return!u[t]||u[t].version!==c[t].version||!e.cache.isCached(t)}).forEach(function(t){l&&f[t]&&f[t].version===c[t].version?e._toBeCopied.push(t):e._toBeDownloaded.push(t)}),e._toBeDeleted=s.map(function(t){return t.substr(e.cache.localRoot.length)}).filter(function(t){return!c[t]||e._toBeDownloaded.indexOf(t)>=0||e._toBeCopied.indexOf(t)>=0});var d=e._toBeDeleted.length+e._toBeDownloaded.length;d>0?(e.newManifest=i,e.newManifest.root=e.cache.localInternalURL,t(!0)):t(!1)})})},o.prototype.canDownload=function(){return!!this.newManifest&&!this._updateReady},o.prototype.canUpdate=function(){return this._updateReady},o.prototype.download=function(t){var e=this;return e.canDownload()?(localStorage.removeItem("manifest"),localStorage.setItem("last_update_files",JSON.stringify(this.newManifest.files)),this.manifest.files=Manifest.files={},e.cache.remove(e._toBeDeleted,!0).then(function(){return i.all(e._toBeCopied.map(function(t){return e.cache._fs.download(a+t,e.cache.localRoot+t)}))}).then(function(){return e.allowServerRootFromManifest&&e.newManifest.serverRoot&&(e.cache.serverRoot=e.newManifest.serverRoot),e.cache.add(e._toBeDownloaded),e.cache.download(t)}).then(function(){return e._toBeDeleted=[],e._toBeDownloaded=[],e._updateReady=!0,e.newManifest},function(t){return t&&t.length&&e.cache.remove(t),t})):i.resolve(null)},o.prototype.update=function(t){return this._updateReady?(localStorage.setItem("manifest",JSON.stringify(this.newManifest)),t!==!1&&location.reload(),!0):!1},o.prototype.clear=function(){return localStorage.removeItem("last_update_files"),localStorage.removeItem("manifest"),this.cache.clear()},o.prototype.reset=function(){return this.clear().then(function(){location.reload()},function(){location.reload()})},t.exports=o},function(t,e,n){function o(t){var e=this;if(this._fs=t.fs,!this._fs)throw new Error('Missing required option "fs". Add an instance of cordova-promise-fs.');i=this._fs.Promise,this._mirrorMode="hash"!==t.mode,this._retry=t.retry||[500,1500,8e3],this._cacheBuster=!!t.cacheBuster,this.localRoot=this._fs.normalize(t.localRoot||"data"),this.serverRoot=this._fs.normalize(t.serverRoot||""),this._downloading=[],this._added=[],this._cached={},this.ready=this._fs.ensure(this.localRoot).then(function(t){return e.localInternalURL=a?t.toInternalURL():t.toURL(),e.localUrl=t.toURL(),e.list()})}var r=n(3),i=null,a="undefined"!=typeof cordova;o.prototype.list=function(){var t=this;return new i(function(e){t._fs.list(t.localRoot,"rfe").then(function(n){t._cached={},n=n.map(function(e){var n=t._fs.normalize(e.fullPath);return t._cached[n]={toInternalURL:a?e.toInternalURL():e.toURL(),toURL:e.toURL()},n}),e(n)},function(){e([])})})},o.prototype.add=function(t){t||(t=[]),"string"==typeof t&&(t=[t]);var e=this;return t.forEach(function(t){t=e.toServerURL(t),-1===e._added.indexOf(t)&&e._added.push(t)}),e.isDirty()},o.prototype.remove=function(t,e){t||(t=[]);var n=[];"string"==typeof t&&(t=[t]);var o=this;return t.forEach(function(t){var e=o._added.indexOf(o.toServerURL(t));e>=0&&o._added.splice(e,1);var r=o.toPath(t);n.push(o._fs.remove(r)),delete o._cached[r]}),e?i.all(n):o.isDirty()},o.prototype.getDownloadQueue=function(){var t=this,e=t._added.filter(function(e){return!t.isCached(e)});return e},o.prototype.getAdded=function(){return this._added},o.prototype.isDirty=function(){return this.getDownloadQueue().length>0},o.prototype.download=function(t){var e=this._fs,n=this;return n.abort(),new i(function(o,r){e.ensure(n.localRoot).then(function(){return n.list()}).then(function(){if(!n.isDirty())return void o(n);var i=n.getDownloadQueue(),a=[],s=n._downloading.length,u=n._downloading.length,c=n._downloading.length+i.length;i.forEach(function(i){var f,l=n.toPath(i);"function"==typeof t&&(f=function(e){e.queueIndex=s,e.queueSize=c,e.url=i,e.path=l,e.percentage=s/c,e.loaded>0&&e.total>0&&s!==c&&(e.percentage+=e.loaded/e.total/c),a.indexOf(i)<0&&(a.push(i),s++),t(e)});var d=function(){u++,u===c&&(n._downloading=[],n.list().then(function(){f&&f(new ProgressEvent),n.isDirty()?r(n.getDownloadQueue()):o(n)},r))},h=i;n._cacheBuster&&(h+="?"+Date.now());var p=e.download(h,l,{retry:n._retry},f);p.then(d,d),n._downloading.push(p)})},r)})},o.prototype.abort=function(){this._downloading.forEach(function(t){t.abort()}),this._downloading=[]},o.prototype.isCached=function(t){return t=this.toPath(t),!!this._cached[t]},o.prototype.clear=function(){var t=this;return this._cached={},this._fs.removeDir(this.localRoot).then(function(){return t._fs.ensure(t.localRoot)})},o.prototype.toInternalURL=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toInternalURL:t},o.prototype.get=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toInternalURL:this.toServerURL(t)},o.prototype.toDataURL=function(t){return this._fs.toDataURL(this.toPath(t))},o.prototype.toURL=function(t){return path=this.toPath(t),this._cached[path]?this._cached[path].toURL:t},o.prototype.toServerURL=function(t){return t=this._fs.normalize(t),t.indexOf("://")<0?this.serverRoot+t:t},o.prototype.toPath=function(t){return this._mirrorMode?(t=t=this._fs.normalize(t||""),len=this.serverRoot.length,t.substr(0,len)!==this.serverRoot?this.localRoot+t:this.localRoot+t.substr(len)):this.localRoot+r(t)+t.substr(t.lastIndexOf("."))},t.exports=o},function(t){function e(t,n,o,r){t.getDirectory(n[0],{create:!0},function(t){n.length>1?e(t,n.slice(1),o,r):o(t)},r)}function n(t){return t=t.substr(0,t.lastIndexOf("/")+1),"/"===t[0]&&(t=t.substr(1)),t}function o(t){return t.substr(t.lastIndexOf("/")+1)}function r(t){return t=t||"","/"===t[0]&&(t=t.substr(1)),t&&t.indexOf(".")<0&&"/"!==t[t.length-1]&&(t+="/"),"./"===t&&(t=""),t}var i=[],a=0;t.exports=function(t){function s(t){return new x(function(e){return e(t)})}function u(t){return new x(function(n,o){return F.then(function(r){t?(t=t.split("/").filter(function(t){return t&&t.length>0&&"."!==t[0]}),e(r.root,t,n,o)):n(r.root)},o)})}function c(t,e){return new x(function(n,o){return"object"==typeof t?n(t):(t=r(t),e=e||{},F.then(function(r){r.root.getFile(t,e,n,o)},o))})}function f(t,e){return t=r(t),e=e||{},new x(function(n,o){return F.then(function(r){t&&"/"!==t?r.root.getDirectory(t,e,n,o):n(r.root)},o)})}function l(t,e){e=e||"";var n=e.indexOf("r")>-1,o=e.indexOf("e")>-1,r=e.indexOf("f")>-1,i=e.indexOf("d")>-1;return r&&i&&(r=!1,i=!1),new x(function(e,a){return f(t).then(function(t){var u=t.createReader();u.readEntries(function(t){var u=[s(t)];n&&t.filter(function(t){return t.isDirectory}).forEach(function(t){u.push(l(t.fullPath,"re"))}),x.all(u).then(function(t){var n=[];n=n.concat.apply(n,t),r&&(n=n.filter(function(t){return t.isFile})),i&&(n=n.filter(function(t){return t.isDirectory})),o||(n=n.map(function(t){return t.fullPath})),e(n)},a)},a)},a)})}function d(t){return new x(function(e,n){c(t).then(function(t){e(t)},function(t){1===t.code?e(!1):n(t)})})}function h(t){return u(n(t)).then(function(){return c(t,{create:!0})})}function p(t){return c(t).then(function(t){return t.toURL()})}function w(t,e){return e=e||"readAsText",c(t).then(function(t){return new x(function(n,o){t.file(function(t){var o=new FileReader;o.onloadend=function(){n(this.result)},o[e](t)},o)})})}function v(t){return w(t,"readAsDataURL")}function y(t){return w(t).then(JSON.parse)}function m(t,e,o){return u(n(t)).then(function(){return c(t,{create:!0})}).then(function(t){return new x(function(n,r){t.createWriter(function(t){t.onwriteend=n,t.onerror=r,"string"==typeof e?e=new Blob([e],{type:o||"text/plain"}):e instanceof Blob!=!0&&(e=new Blob([JSON.stringify(e,null,4)],{type:o||"application/json"})),t.write(e)},r)})})}function _(t,e){return u(n(e)).then(function(n){return c(t).then(function(t){return new x(function(r,i){t.moveTo(n,o(e),r,i)})})})}function g(t,e){return u(n(e)).then(function(n){return c(t).then(function(t){return new x(function(r,i){t.copyTo(n,o(e),r,i)})})})}function R(t,e){var n=e?c:d;return new x(function(e,o){n(t).then(function(t){t!==!1?t.remove(e,o):e(1)},o)}).then(function(t){return 1===t?!1:!0})}function b(t){return f(t).then(function(t){return new x(function(e,n){t.removeRecursively(e,n)})})}function S(){for(;i.length>0&&a<t.concurrency;){a++;var e=i.pop(),n=e.shift(),o=e.shift(),r=e.shift(),s=e.shift(),u=e.shift(),c=e.shift(),f=e.shift(),l=e.shift();n._aborted?a--:o?(n.download.call(n,r,s,u,c,f,l),n.onprogress&&n.onprogress(new ProgressEvent)):n.upload.call(n,s,r,u,c,l,f)}}function U(t){return a--,S(),t}function D(e,n,o,r,s){"function"==typeof r&&(s=r,r={}),n=encodeURI(n),C&&(o=O(o)),r=r||{},r.retry&&r.retry.length||(r.retry=t.retry),r.retry=r.retry.concat();var u=new FileTransfer;s=s||r.onprogress,"function"==typeof s&&(u.onprogress=s);var c=new x(function(t,s){var c=function(a){if(0===r.retry.length)s(a);else{i.unshift([u,e,n,o,t,c,r.trustAllHosts||!1,r]);var f=r.retry.shift();f>0?setTimeout(U,f):U()}};r.retry.unshift(0),a++,c()});return c.then(U,U),c.progress=function(t){return u.onprogress=t,c},c.abort=function(){return u._aborted=!0,u.abort(),c},c}function L(t,e,n,o){return D(!0,t,e,n,o)}function M(t,e,n,o){return D(!1,e,t,n,o)}var x=t.Promise||window.Promise;if(!x)throw new Error("No Promise library given in options.Promise");this.options=t=t||{},t.persistent=void 0!==t.persistent?t.persistent:!0,t.storageSize=t.storageSize||20971520,t.concurrency=t.concurrency||3,t.retry=t.retry||[];var B,C="undefined"!=typeof cordova;C?B=new x(function(t,e){document.addEventListener("deviceready",t,!1),setTimeout(function(){e(new Error("deviceready has not fired after 5 seconds."))},5100)}):(B=s(!0),"undefined"!=typeof webkitRequestFileSystem?(window.requestFileSystem=webkitRequestFileSystem,window.FileTransfer=function(){},FileTransfer.prototype.download=function(t,e,n,o){var r=new XMLHttpRequest;return r.open("GET",t),r.responseType="blob",r.onreadystatechange=function(){4==r.readyState&&(200===r.status?m(e,r.response).then(n,o):o(r.status))},r.send(),r},window.ProgressEvent=function(){},window.FileEntry=function(){}):window.requestFileSystem=function(t,e,n,o){o(new Error("requestFileSystem not supported!"))});var F=new x(function(e,n){B.then(function(){var o=t.persistent?1:0;"number"==typeof t.fileSystem&&(o=t.fileSystem),!C&&o>1&&(console.warn('Chrome does not support fileSystem "'+o+'". Falling back on "0" (temporary).'),o=0),window.requestFileSystem(o,t.storageSize,e,n),setTimeout(function(){n(new Error("Could not retrieve FileSystem after 5 seconds."))},5100)},n)});F.then(function(t){window.__fs=t},function(t){console.error("Could not get Cordova FileSystem:",t)});var E,O;return C?(O=function(e){return e=r(e),"cdvfile://localhost/"+(t.persistent?"persistent/":"temporary/")+e},E=function(t){return c(t).then(function(t){return t.toInternalURL()})}):(O=function(e){return e=r(e),"filesystem:"+location.origin+(t.persistent?"/persistent/":"/temporary/")+e},E=function(t){return c(t).then(function(t){return t.toURL()})}),{fs:F,normalize:r,file:c,filename:o,dir:f,dirname:n,create:h,read:w,readJSON:y,write:m,move:_,copy:g,remove:R,removeDir:b,list:l,ensure:u,exists:d,download:L,upload:M,toURL:p,isCordova:C,toInternalURLSync:O,toInternalURL:E,toDataURL:v,deviceready:B,options:t,Promise:x}}},function(t){function e(t,e){var n,o,r,i,a,s,u,c;for(n=3&t.length,o=t.length-n,r=e,a=3432918353,s=461845907,c=0;o>c;)u=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u,r=r<<13|r>>>19,i=5*(65535&r)+((5*(r>>>16)&65535)<<16)&4294967295,r=(65535&i)+27492+(((i>>>16)+58964&65535)<<16);switch(u=0,n){case 3:u^=(255&t.charCodeAt(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:u^=255&t.charCodeAt(c),u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u}return r^=t.length,r^=r>>>16,r=2246822507*(65535&r)+((2246822507*(r>>>16)&65535)<<16)&4294967295,r^=r>>>13,r=3266489909*(65535&r)+((3266489909*(r>>>16)&65535)<<16)&4294967295,r^=r>>>16,r>>>0}t.exports=e}]); |
@@ -130,2 +130,3 @@ var CordovaPromiseFS = | ||
window.ProgressEvent = function ProgressEvent(){}; | ||
window.FileEntry = function FileEntry(){}; | ||
} else { | ||
@@ -188,3 +189,3 @@ window.requestFileSystem = function(x,y,z,fail){ | ||
return new Promise(function(resolve,reject){ | ||
if(path instanceof FileEntry) { | ||
if(typeof path === 'object') { | ||
return resolve(path); | ||
@@ -191,0 +192,0 @@ } |
@@ -1,1 +0,1 @@ | ||
var CordovaPromiseFS=function(n){function e(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return n[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var t={};return e.m=n,e.c=t,e.p="",e(0)}([function(n){function e(n,t,r,o){n.getDirectory(t[0],{create:!0},function(n){t.length>1?e(n,t.slice(1),r,o):r(n)},o)}function t(n){return n=n.substr(0,n.lastIndexOf("/")+1),"/"===n[0]&&(n=n.substr(1)),n}function r(n){return n.substr(n.lastIndexOf("/")+1)}function o(n){return n=n||"","/"===n[0]&&(n=n.substr(1)),n&&n.indexOf(".")<0&&"/"!==n[n.length-1]&&(n+="/"),"./"===n&&(n=""),n}var i=[],u=0;n.exports=function(n){function f(n){return new O(function(e){return e(n)})}function s(n){return new O(function(t,r){return q.then(function(o){n?(n=n.split("/").filter(function(n){return n&&n.length>0&&"."!==n[0]}),e(o.root,n,t,r)):t(o.root)},r)})}function c(n,e){return new O(function(t,r){return n instanceof FileEntry?t(n):(n=o(n),e=e||{},q.then(function(o){o.root.getFile(n,e,t,r)},r))})}function a(n,e){return n=o(n),e=e||{},new O(function(t,r){return q.then(function(o){n&&"/"!==n?o.root.getDirectory(n,e,t,r):t(o.root)},r)})}function l(n,e){e=e||"";var t=e.indexOf("r")>-1,r=e.indexOf("e")>-1,o=e.indexOf("f")>-1,i=e.indexOf("d")>-1;return o&&i&&(o=!1,i=!1),new O(function(e,u){return a(n).then(function(n){var s=n.createReader();s.readEntries(function(n){var s=[f(n)];t&&n.filter(function(n){return n.isDirectory}).forEach(function(n){s.push(l(n.fullPath,"re"))}),O.all(s).then(function(n){var t=[];t=t.concat.apply(t,n),o&&(t=t.filter(function(n){return n.isFile})),i&&(t=t.filter(function(n){return n.isDirectory})),r||(t=t.map(function(n){return n.fullPath})),e(t)},u)},u)},u)})}function d(n){return new O(function(e,t){c(n).then(function(n){e(n)},function(n){1===n.code?e(!1):t(n)})})}function p(n){return s(t(n)).then(function(){return c(n,{create:!0})})}function y(n){return c(n).then(function(n){return n.toURL()})}function h(n,e){return e=e||"readAsText",c(n).then(function(n){return new O(function(t,r){n.file(function(n){var r=new FileReader;r.onloadend=function(){t(this.result)},r[e](n)},r)})})}function w(n){return h(n,"readAsDataURL")}function v(n){return h(n).then(JSON.parse)}function m(n,e,r){return s(t(n)).then(function(){return c(n,{create:!0})}).then(function(n){return new O(function(t,o){n.createWriter(function(n){n.onwriteend=t,n.onerror=o,"string"==typeof e?e=new Blob([e],{type:r||"text/plain"}):e instanceof Blob!=!0&&(e=new Blob([JSON.stringify(e,null,4)],{type:r||"application/json"})),n.write(e)},o)})})}function g(n,e){return s(t(e)).then(function(t){return c(n).then(function(n){return new O(function(o,i){n.moveTo(t,r(e),o,i)})})})}function S(n,e){return s(t(e)).then(function(t){return c(n).then(function(n){return new O(function(o,i){n.copyTo(t,r(e),o,i)})})})}function b(n,e){var t=e?c:d;return new O(function(e,r){t(n).then(function(n){n!==!1?n.remove(e,r):e(1)},r)}).then(function(n){return 1===n?!1:!0})}function F(n){return a(n).then(function(n){return new O(function(e,t){n.removeRecursively(e,t)})})}function x(){for(;i.length>0&&u<n.concurrency;){u++;var e=i.pop(),t=e.shift(),r=e.shift(),o=e.shift(),f=e.shift(),s=e.shift(),c=e.shift(),a=e.shift(),l=e.shift();t._aborted?u--:r?(t.download.call(t,o,f,s,c,a,l),t.onprogress&&t.onprogress(new ProgressEvent)):t.upload.call(t,f,o,s,c,l,a)}}function R(n){return u--,x(),n}function E(e,t,r,o,f){"function"==typeof o&&(f=o,o={}),t=encodeURI(t),U&&(r=C(r)),o=o||{},o.retry&&o.retry.length||(o.retry=n.retry),o.retry=o.retry.concat();var s=new FileTransfer;f=f||o.onprogress,"function"==typeof f&&(s.onprogress=f);var c=new O(function(n,f){var c=function(u){if(0===o.retry.length)f(u);else{i.unshift([s,e,t,r,n,c,o.trustAllHosts||!1,o]);var a=o.retry.shift();a>0?setTimeout(R,a):R()}};o.retry.unshift(0),u++,c()});return c.then(R,R),c.progress=function(n){return s.onprogress=n,c},c.abort=function(){return s._aborted=!0,s.abort(),c},c}function T(n,e,t,r){return E(!0,n,e,t,r)}function L(n,e,t,r){return E(!1,e,n,t,r)}var O=n.Promise||window.Promise;if(!O)throw new Error("No Promise library given in options.Promise");this.options=n=n||{},n.persistent=void 0!==n.persistent?n.persistent:!0,n.storageSize=n.storageSize||20971520,n.concurrency=n.concurrency||3,n.retry=n.retry||[];var P,U="undefined"!=typeof cordova;U?P=new O(function(n,e){document.addEventListener("deviceready",n,!1),setTimeout(function(){e(new Error("deviceready has not fired after 5 seconds."))},5100)}):(P=f(!0),"undefined"!=typeof webkitRequestFileSystem?(window.requestFileSystem=webkitRequestFileSystem,window.FileTransfer=function(){},FileTransfer.prototype.download=function(n,e,t,r){var o=new XMLHttpRequest;return o.open("GET",n),o.responseType="blob",o.onreadystatechange=function(){4==o.readyState&&(200===o.status?m(e,o.response).then(t,r):r(o.status))},o.send(),o},window.ProgressEvent=function(){}):window.requestFileSystem=function(n,e,t,r){r(new Error("requestFileSystem not supported!"))});var q=new O(function(e,t){P.then(function(){var r=n.persistent?1:0;"number"==typeof n.fileSystem&&(r=n.fileSystem),!U&&r>1&&(console.warn('Chrome does not support fileSystem "'+r+'". Falling back on "0" (temporary).'),r=0),window.requestFileSystem(r,n.storageSize,e,t),setTimeout(function(){t(new Error("Could not retrieve FileSystem after 5 seconds."))},5100)},t)});q.then(function(n){window.__fs=n},function(n){console.error("Could not get Cordova FileSystem:",n)});var D,C;return U?(C=function(e){return e=o(e),"cdvfile://localhost/"+(n.persistent?"persistent/":"temporary/")+e},D=function(n){return c(n).then(function(n){return n.toInternalURL()})}):(C=function(e){return e=o(e),"filesystem:"+location.origin+(n.persistent?"/persistent/":"/temporary/")+e},D=function(n){return c(n).then(function(n){return n.toURL()})}),{fs:q,normalize:o,file:c,filename:r,dir:a,dirname:t,create:p,read:h,readJSON:v,write:m,move:g,copy:S,remove:b,removeDir:F,list:l,ensure:s,exists:d,download:T,upload:L,toURL:y,isCordova:U,toInternalURLSync:C,toInternalURL:D,toDataURL:w,deviceready:P,options:n,Promise:O}}}]); | ||
var CordovaPromiseFS=function(n){function e(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return n[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var t={};return e.m=n,e.c=t,e.p="",e(0)}([function(n){function e(n,t,r,o){n.getDirectory(t[0],{create:!0},function(n){t.length>1?e(n,t.slice(1),r,o):r(n)},o)}function t(n){return n=n.substr(0,n.lastIndexOf("/")+1),"/"===n[0]&&(n=n.substr(1)),n}function r(n){return n.substr(n.lastIndexOf("/")+1)}function o(n){return n=n||"","/"===n[0]&&(n=n.substr(1)),n&&n.indexOf(".")<0&&"/"!==n[n.length-1]&&(n+="/"),"./"===n&&(n=""),n}var i=[],u=0;n.exports=function(n){function f(n){return new O(function(e){return e(n)})}function c(n){return new O(function(t,r){return q.then(function(o){n?(n=n.split("/").filter(function(n){return n&&n.length>0&&"."!==n[0]}),e(o.root,n,t,r)):t(o.root)},r)})}function s(n,e){return new O(function(t,r){return"object"==typeof n?t(n):(n=o(n),e=e||{},q.then(function(o){o.root.getFile(n,e,t,r)},r))})}function a(n,e){return n=o(n),e=e||{},new O(function(t,r){return q.then(function(o){n&&"/"!==n?o.root.getDirectory(n,e,t,r):t(o.root)},r)})}function l(n,e){e=e||"";var t=e.indexOf("r")>-1,r=e.indexOf("e")>-1,o=e.indexOf("f")>-1,i=e.indexOf("d")>-1;return o&&i&&(o=!1,i=!1),new O(function(e,u){return a(n).then(function(n){var c=n.createReader();c.readEntries(function(n){var c=[f(n)];t&&n.filter(function(n){return n.isDirectory}).forEach(function(n){c.push(l(n.fullPath,"re"))}),O.all(c).then(function(n){var t=[];t=t.concat.apply(t,n),o&&(t=t.filter(function(n){return n.isFile})),i&&(t=t.filter(function(n){return n.isDirectory})),r||(t=t.map(function(n){return n.fullPath})),e(t)},u)},u)},u)})}function d(n){return new O(function(e,t){s(n).then(function(n){e(n)},function(n){1===n.code?e(!1):t(n)})})}function p(n){return c(t(n)).then(function(){return s(n,{create:!0})})}function y(n){return s(n).then(function(n){return n.toURL()})}function h(n,e){return e=e||"readAsText",s(n).then(function(n){return new O(function(t,r){n.file(function(n){var r=new FileReader;r.onloadend=function(){t(this.result)},r[e](n)},r)})})}function w(n){return h(n,"readAsDataURL")}function v(n){return h(n).then(JSON.parse)}function m(n,e,r){return c(t(n)).then(function(){return s(n,{create:!0})}).then(function(n){return new O(function(t,o){n.createWriter(function(n){n.onwriteend=t,n.onerror=o,"string"==typeof e?e=new Blob([e],{type:r||"text/plain"}):e instanceof Blob!=!0&&(e=new Blob([JSON.stringify(e,null,4)],{type:r||"application/json"})),n.write(e)},o)})})}function g(n,e){return c(t(e)).then(function(t){return s(n).then(function(n){return new O(function(o,i){n.moveTo(t,r(e),o,i)})})})}function S(n,e){return c(t(e)).then(function(t){return s(n).then(function(n){return new O(function(o,i){n.copyTo(t,r(e),o,i)})})})}function b(n,e){var t=e?s:d;return new O(function(e,r){t(n).then(function(n){n!==!1?n.remove(e,r):e(1)},r)}).then(function(n){return 1===n?!1:!0})}function F(n){return a(n).then(function(n){return new O(function(e,t){n.removeRecursively(e,t)})})}function x(){for(;i.length>0&&u<n.concurrency;){u++;var e=i.pop(),t=e.shift(),r=e.shift(),o=e.shift(),f=e.shift(),c=e.shift(),s=e.shift(),a=e.shift(),l=e.shift();t._aborted?u--:r?(t.download.call(t,o,f,c,s,a,l),t.onprogress&&t.onprogress(new ProgressEvent)):t.upload.call(t,f,o,c,s,l,a)}}function R(n){return u--,x(),n}function E(e,t,r,o,f){"function"==typeof o&&(f=o,o={}),t=encodeURI(t),U&&(r=C(r)),o=o||{},o.retry&&o.retry.length||(o.retry=n.retry),o.retry=o.retry.concat();var c=new FileTransfer;f=f||o.onprogress,"function"==typeof f&&(c.onprogress=f);var s=new O(function(n,f){var s=function(u){if(0===o.retry.length)f(u);else{i.unshift([c,e,t,r,n,s,o.trustAllHosts||!1,o]);var a=o.retry.shift();a>0?setTimeout(R,a):R()}};o.retry.unshift(0),u++,s()});return s.then(R,R),s.progress=function(n){return c.onprogress=n,s},s.abort=function(){return c._aborted=!0,c.abort(),s},s}function T(n,e,t,r){return E(!0,n,e,t,r)}function L(n,e,t,r){return E(!1,e,n,t,r)}var O=n.Promise||window.Promise;if(!O)throw new Error("No Promise library given in options.Promise");this.options=n=n||{},n.persistent=void 0!==n.persistent?n.persistent:!0,n.storageSize=n.storageSize||20971520,n.concurrency=n.concurrency||3,n.retry=n.retry||[];var P,U="undefined"!=typeof cordova;U?P=new O(function(n,e){document.addEventListener("deviceready",n,!1),setTimeout(function(){e(new Error("deviceready has not fired after 5 seconds."))},5100)}):(P=f(!0),"undefined"!=typeof webkitRequestFileSystem?(window.requestFileSystem=webkitRequestFileSystem,window.FileTransfer=function(){},FileTransfer.prototype.download=function(n,e,t,r){var o=new XMLHttpRequest;return o.open("GET",n),o.responseType="blob",o.onreadystatechange=function(){4==o.readyState&&(200===o.status?m(e,o.response).then(t,r):r(o.status))},o.send(),o},window.ProgressEvent=function(){},window.FileEntry=function(){}):window.requestFileSystem=function(n,e,t,r){r(new Error("requestFileSystem not supported!"))});var q=new O(function(e,t){P.then(function(){var r=n.persistent?1:0;"number"==typeof n.fileSystem&&(r=n.fileSystem),!U&&r>1&&(console.warn('Chrome does not support fileSystem "'+r+'". Falling back on "0" (temporary).'),r=0),window.requestFileSystem(r,n.storageSize,e,t),setTimeout(function(){t(new Error("Could not retrieve FileSystem after 5 seconds."))},5100)},t)});q.then(function(n){window.__fs=n},function(n){console.error("Could not get Cordova FileSystem:",n)});var D,C;return U?(C=function(e){return e=o(e),"cdvfile://localhost/"+(n.persistent?"persistent/":"temporary/")+e},D=function(n){return s(n).then(function(n){return n.toInternalURL()})}):(C=function(e){return e=o(e),"filesystem:"+location.origin+(n.persistent?"/persistent/":"/temporary/")+e},D=function(n){return s(n).then(function(n){return n.toURL()})}),{fs:q,normalize:o,file:s,filename:r,dir:a,dirname:t,create:p,read:h,readJSON:v,write:m,move:g,copy:S,remove:b,removeDir:F,list:l,ensure:c,exists:d,download:T,upload:L,toURL:y,isCordova:U,toInternalURLSync:C,toInternalURL:D,toDataURL:w,deviceready:P,options:n,Promise:O}}}]); |
@@ -5,3 +5,4 @@ var CordovaFileCache = require('cordova-file-cache'); | ||
var BUNDLE_ROOT = location.href.substr(0,location.href.lastIndexOf('/')+1); | ||
var BUNDLE_ROOT = location.href.replace(location.hash,''); | ||
var BUNDLE_ROOT = BUNDLE_ROOT.substr(0,BUNDLE_ROOT.lastIndexOf('/')+1); | ||
if(/ip(hone|ad|od)/i.test(navigator.userAgent)){ | ||
@@ -8,0 +9,0 @@ BUNDLE_ROOT = 'cdvfile://localhost/bundle/www/'; |
{ | ||
"name": "cordova-app-loader", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"description": "Cordova App Loader - remote update your cordova app", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -386,2 +386,6 @@ cordova-app-loader | ||
### 0.13.0 (9/1/2014) | ||
* Fix [issue 15](https://github.com/markmarijnissen/cordova-app-loader/issues/15): Copied files contain index.html on Android when location.href contains `#/` while updating. | ||
### 0.12.0 (21/12/2014) | ||
@@ -388,0 +392,0 @@ |
@@ -61,3 +61,4 @@ /******/ (function(modules) { // webpackBootstrap | ||
var BUNDLE_ROOT = location.href.substr(0,location.href.lastIndexOf('/')+1); | ||
var BUNDLE_ROOT = location.href.replace(location.hash,''); | ||
var BUNDLE_ROOT = BUNDLE_ROOT.substr(0,BUNDLE_ROOT.lastIndexOf('/')+1); | ||
if(/ip(hone|ad|od)/i.test(navigator.userAgent)){ | ||
@@ -649,2 +650,3 @@ BUNDLE_ROOT = 'cdvfile://localhost/bundle/www/'; | ||
window.ProgressEvent = function ProgressEvent(){}; | ||
window.FileEntry = function FileEntry(){}; | ||
} else { | ||
@@ -707,3 +709,3 @@ window.requestFileSystem = function(x,y,z,fail){ | ||
return new Promise(function(resolve,reject){ | ||
if(path instanceof FileEntry) { | ||
if(typeof path === 'object') { | ||
return resolve(path); | ||
@@ -710,0 +712,0 @@ } |
@@ -52,3 +52,4 @@ var CordovaAppLoader = | ||
var BUNDLE_ROOT = location.href.substr(0,location.href.lastIndexOf('/')+1); | ||
var BUNDLE_ROOT = location.href.replace(location.hash,''); | ||
var BUNDLE_ROOT = BUNDLE_ROOT.substr(0,BUNDLE_ROOT.lastIndexOf('/')+1); | ||
if(/ip(hone|ad|od)/i.test(navigator.userAgent)){ | ||
@@ -640,2 +641,3 @@ BUNDLE_ROOT = 'cdvfile://localhost/bundle/www/'; | ||
window.ProgressEvent = function ProgressEvent(){}; | ||
window.FileEntry = function FileEntry(){}; | ||
} else { | ||
@@ -698,3 +700,3 @@ window.requestFileSystem = function(x,y,z,fail){ | ||
return new Promise(function(resolve,reject){ | ||
if(path instanceof FileEntry) { | ||
if(typeof path === 'object') { | ||
return resolve(path); | ||
@@ -701,0 +703,0 @@ } |
@@ -130,2 +130,3 @@ var CordovaPromiseFS = | ||
window.ProgressEvent = function ProgressEvent(){}; | ||
window.FileEntry = function FileEntry(){}; | ||
} else { | ||
@@ -188,3 +189,3 @@ window.requestFileSystem = function(x,y,z,fail){ | ||
return new Promise(function(resolve,reject){ | ||
if(path instanceof FileEntry) { | ||
if(typeof path === 'object') { | ||
return resolve(path); | ||
@@ -191,0 +192,0 @@ } |
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
1686944
37817
470