From 26f9b2170828eb663efa23be3627ec77c3c25a6f Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 23 Jun 2014 14:21:09 +0000 Subject: [PATCH] --- js/libs/gal/gal.js | 12 +++++++++++- js/main.js | 5 +++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/js/libs/gal/gal.js b/js/libs/gal/gal.js index 2bb040c2..311ef4ab 100644 --- a/js/libs/gal/gal.js +++ b/js/libs/gal/gal.js @@ -118,7 +118,9 @@ // Fetch full url and store it locally. - that.adapter.saveAsset(key, url, cb, cb); + that.adapter.saveAsset(key, url, cb, function() { + + }); })(0); } @@ -234,6 +236,14 @@ return this.adapter.root.toURL(); }; + GAL.prototype.getRootNativeURL = function() { + try { + return this.adapter.root.toNativeURL(); + } catch (err) { + return this.getRootURL(); + } + }; + GAL.prototype.initAdapter = function(callback) { if (null == this.adapter) { this.initAdapter_(callback); diff --git a/js/main.js b/js/main.js index 342abbb7..eda9baf9 100644 --- a/js/main.js +++ b/js/main.js @@ -46,7 +46,7 @@ try { }, false); } - if (DATAS.phonegap) { + if (DATAS && DATAS.phonegap) { loadPhonegap(); } else { init(); @@ -127,7 +127,6 @@ try { } var collection; - console.error(window.localStorage.getItem('collection')); try { collection = json_parse(window.localStorage.getItem('collection')); } catch (err) { @@ -147,6 +146,8 @@ try { } if (navigator.onLine && manifest && !OFFLINEAPP) { + fb('init online'); + var readyToLoad = false; var finishedLoading = false; gal = new GameAssetLoader(json_parse(manifest, 'manifest'), fsprefix); -- 2.39.5