]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 23 Jun 2014 16:07:45 +0000 (16:07 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 23 Jun 2014 16:07:45 +0000 (16:07 +0000)
js/libs/cube/util.js
js/main.js

index da9692c4ed48eb9a7a250e947561fb2c91190743..9d81383577eca85b497c35328f46b96e079aca2a 100644 (file)
@@ -14,14 +14,13 @@ function arrayRemove(array, element) {
 }
 
 function json_parse(str, info) {
-
        try {
                return JSON.parse(str);
        } catch (err) {
                if (info != undefined) {
-                       
+
                }
-               fb(err);
+               console.error('Error parsing json :: ' + err + ' :: ' + str);
        }
 }
 
index e13705012119b9c453c6dff9ab6320eaab321162..d58817606addb81c7bc875f1bcfc6873a0d24b84 100644 (file)
@@ -109,7 +109,7 @@ try {
                        return;
                }
 
-               console.log('device ready');
+               console.log('device ready !');
 
                DEVICE_READY = true;
 
@@ -146,9 +146,16 @@ try {
                }
 
                if (DATAS.phonegap && !manifest && !OFFLINEAPP) {
+                       console.log('set manifest from manifest pub');
+
                        manifest = collection.manifestPub[DATAS.id];
+
+               } else {
+                       console.log('manifest set in local storage');
                }
 
+               console.log(manifest.bundles[0].name + ' :: ' + manifest.bundles[0].contents[0]);
+
                if (navigator.onLine && manifest && !OFFLINEAPP) {
                        console.log('init online');
 
@@ -156,10 +163,7 @@ try {
                        var finishedLoading = false;
                        gal = new GameAssetLoader(json_parse(manifest, 'manifest'), fsprefix);
 
-                       gal.init(function() {
-                               startAfterLoading = true;
-                               init();
-                       });
+                       gal.init(galLoaded);
 
                        gal.onLoaded(function(info) {
                                $(window).trigger('GALBundleLoaded', [info]);
@@ -180,6 +184,8 @@ try {
                        });
 
                        $(window).on('GALBundleLoaded', function(e, info) {
+                               console.log('Loaded :: ' + info.bundleName);
+
                                if (info.bundleName == 'content_4') {
                                        fluidbook.changeAddress();
                                }
@@ -235,6 +241,11 @@ try {
                document.getElementsByTagName("head")[0].appendChild(script);
        }
 
+       function galLoaded() {
+               startAfterLoading = true;
+               init();
+       }
+
        function init() {
                if (INITED == true) {
                        return;