From: Vincent Vanwaelscappel Date: Fri, 15 Nov 2013 11:14:09 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d26b4184a9985e11a47197ad09b5bf8e95ee9451;p=fluidbook-html5.git --- diff --git a/js/libs/cube/util.js b/js/libs/cube/util.js index 3aa9be9d..da0d2cc5 100644 --- a/js/libs/cube/util.js +++ b/js/libs/cube/util.js @@ -13,10 +13,14 @@ function arrayRemove(array, element) { return array; } -function json_parse(str) { +function json_parse(str, info) { + try { return JSON.parse(str); } catch (err) { + if (info != undefined) { + fb('::::' + info); + } fb(err); fb(str); } diff --git a/js/libs/fluidbook/fluidbook.touch.js b/js/libs/fluidbook/fluidbook.touch.js index b9b17c17..77bde02f 100644 --- a/js/libs/fluidbook/fluidbook.touch.js +++ b/js/libs/fluidbook/fluidbook.touch.js @@ -219,7 +219,7 @@ FluidbookTouch.prototype = { this.fluidbook.viewport.maxScale = 1; this.fluidbook.viewport.userScalable = false; } else { - this.fluidbook.viewport.maxScale = 8; + this.fluidbook.viewport.maxScale = 4; this.fluidbook.viewport.userScalable = true; } this.fluidbook.viewport.updateViewport(); diff --git a/js/main.js b/js/main.js index 1dda0266..dd001469 100644 --- a/js/main.js +++ b/js/main.js @@ -89,7 +89,12 @@ try { } - var collection = JSON.parse(window.localStorage.getItem('collection')); + var collection; + try { + collection = json_parse(window.localStorage.getItem('collection')) + } catch (err) { + + } if (collection.res != undefined && collection.res) { resolution = collection.res; } @@ -104,8 +109,8 @@ try { if (navigator.onLine && manifest && !OFFLINEAPP) { var readyToLoad = false; var finishedLoading = false; - gal = new GameAssetLoader(JSON.parse(manifest), fsprefix); - gal = new GameAssetLoader(JSON.parse(manifest), fsprefix); + gal = new GameAssetLoader(json_parse(manifest), fsprefix); + gal.init(function() { startAfterLoading = true; init(); @@ -272,7 +277,7 @@ try { window.location = getPublicationURL(id); } else { var topmanifest = window.sessionStorage.getItem('topmanifest'); - window.gallocale = new GameAssetLoader(JSON.parse(topmanifest), window.sessionStorage.getItem('galfsprefix')); + window.gallocale = new GameAssetLoader(json_parse(topmanifest,'topmanifest'), window.sessionStorage.getItem('galfsprefix')); window.gallocale.init(function() { window.gallocale.downloadAndCall('p_' + id, function() { window.location = getPublicationURL(id);