]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 15 Nov 2013 11:14:09 +0000 (11:14 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 15 Nov 2013 11:14:09 +0000 (11:14 +0000)
js/libs/cube/util.js
js/libs/fluidbook/fluidbook.touch.js
js/main.js

index 3aa9be9df44c6007866308388f079ae4b3bb5155..da0d2cc5400491c8c4f1edb336c2f2dc9f4f07ac 100644 (file)
@@ -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);
        }
index b9b17c17c8ebf9e4cd4b9ff64c6917154244dd4c..77bde02fd648d105c21a5723d710c975250362fd 100644 (file)
@@ -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();
index 1dda0266682019cc106bd2ad9ccf42417007d6e9..dd00146933913e26a3403551f93e0005dbc1c3c2 100644 (file)
@@ -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);