From f539b5c6d2c198967e76a2e086d8226a2a42402c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 30 Sep 2013 07:41:45 +0000 Subject: [PATCH] --- js/libs/gal/gal.filesystem.js | 5 +++++ js/main.js | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/js/libs/gal/gal.filesystem.js b/js/libs/gal/gal.filesystem.js index f7229884..47e1fa50 100644 --- a/js/libs/gal/gal.filesystem.js +++ b/js/libs/gal/gal.filesystem.js @@ -164,6 +164,8 @@ that.regenerate(callback); }; + console.log('fs init'); + // Callback when the filesystem API has granted quota var quotaCallback = function(grantedBytes) { var persistent = LocalFileSystem.PERSISTENT; @@ -252,10 +254,13 @@ // And then recreate it var fs = this.fs; + console.log('regenerate'); + createDir_(fs.root, ROOT_DIR.split('/'), function(res) { // Create a directory for the root of the GAL fs.root.getDirectory(ROOT_DIR, {create: true}, function(dirEntry) { that.root = dirEntry; + console.log('root created'); callback(); }, onError); }); diff --git a/js/main.js b/js/main.js index 7af3663d..c67cae5b 100644 --- a/js/main.js +++ b/js/main.js @@ -82,13 +82,16 @@ function onDeviceReady() { } console.log('cordova ready'); + console.log(fsprefix); + console.log(manifest); if (navigator.onLine && manifest) { var readyToLoad = false; var finishedLoading = false; gal = new GameAssetLoader(JSON.parse(manifest), fsprefix); - + console.log(gal); gal.init(function() { + console.log('gal inited'); startAfterLoading = true; init(); }); @@ -116,8 +119,17 @@ function onDeviceReady() { if (info.bundleName == 'extras') { window.localStorage.setItem('offline.' + DATAS.id, '1'); } - fluidbook.loader.retryErrorImages(); + try { + if (fluidbook && fluidbook.loader) { + fluidbook.loader.retryErrorImages(); + } + } catch (err) { + + } + + }); + console.log('gal waiting...'); } else { init(); } @@ -162,6 +174,8 @@ function init() { return; } + console.log('fluidbook inited'); + INITED = true; fluidbook = new Fluidbook(DATAS); -- 2.39.5