From: Vincent Vanwaelscappel Date: Wed, 13 Nov 2013 14:27:08 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9bda10b5e2e765497823229a2402683213c696de;p=fluidbook-html5.git --- diff --git a/js/libs/fluidbook/fluidbook.loader.js b/js/libs/fluidbook/fluidbook.loader.js index a758d0fe..ae32a596 100644 --- a/js/libs/fluidbook/fluidbook.loader.js +++ b/js/libs/fluidbook/fluidbook.loader.js @@ -210,7 +210,7 @@ FluidbookLoader.prototype = { callback(); } else { var $this = this; - if (window.gal != undefined && !OFLINEAPP) { + if (window.gal != undefined && !OFFLINEAPP) { window.gal.downloadAndCall('content_' + page, function() { $this.__loadBackground(page, callback); }, 250); diff --git a/js/main.js b/js/main.js index 3fdefc89..26db6241 100644 --- a/js/main.js +++ b/js/main.js @@ -102,6 +102,7 @@ try { var readyToLoad = false; var finishedLoading = false; gal = new GameAssetLoader(JSON.parse(manifest), fsprefix); + gal = new GameAssetLoader(JSON.parse(manifest), fsprefix); gal.init(function() { startAfterLoading = true; init(); @@ -263,21 +264,13 @@ try { window.localStorage.setItem('locale', locale); if (OFFLINEAPP) { - /** - * - * @todo - */ + window.location = getPublicationURL(id); } else { var topmanifest = window.sessionStorage.getItem('topmanifest'); window.gallocale = new GameAssetLoader(JSON.parse(topmanifest), window.sessionStorage.getItem('galfsprefix')); window.gallocale.init(function() { window.gallocale.downloadAndCall('p_' + id, function() { - var url = window.home; - var replace = "/" + fluidbook.datas.id + "/"; - var replaceby = "/" + id + "/"; - url = url.replace(replace, replaceby); - var c = window.localStorage.getItem('collection'); - window.location = url; + window.location = getPublicationURL(id); }); }); } @@ -483,3 +476,10 @@ function closePopin() { }; })(); +function getPublicationURL(id) { + var url = window.home; + var replace = "/" + fluidbook.datas.id + "/"; + var replaceby = "/" + id + "/"; + url = url.replace(replace, replaceby); + return url; +} \ No newline at end of file