From: Vincent Vanwaelscappel Date: Mon, 23 Jun 2014 14:41:28 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d53d94b836e9498f72755142ada0c1068674dd8d;p=fluidbook-html5.git --- diff --git a/js/main.js b/js/main.js index 252bec15..33d26f20 100644 --- a/js/main.js +++ b/js/main.js @@ -79,14 +79,13 @@ try { function cordovaLoaded() { setTimeout(function() { onDeviceReady(); - }, 5000); + }, 2500); } function onDeviceOffline() { if (OFFLINEAPP) { return; } - if (FINISHLOADING) { return; } @@ -109,23 +108,24 @@ try { return; } + fb('device ready'); + DEVICE_READY = true; document.addEventListener("offline", onDeviceOffline, false); - var manifest = window.localStorage.getItem('manifest.' + DATAS.id); var fsprefix = window.sessionStorage.getItem('galfsprefix'); PLATFORM = DATAS.phonegap; - if (DATAS.phonegap == 'ios') { + if (PLATFORM == 'ios') { window.ExternalFileUtil = { openWith: function(path, uti, success, fail, offset) { return cordova.exec(success, fail, "ExternalFileUtil", "openWith", [path, uti, offset.left, offset.top]); } }; - } else if (DATAS.phonegap == 'android') { + } else if (PLATFORM == 'android') { } @@ -133,7 +133,7 @@ try { try { collection = json_parse(window.localStorage.getItem('collection')); } catch (err) { - + fb('error parsing collection'); } if (collection.res != undefined && collection.res) { @@ -176,7 +176,7 @@ try { FINISHLOADING = true; window.localStorage.setItem('offline.' + DATAS.id, '1'); } - }) + }); $(window).on('GALBundleLoaded', function(e, info) { if (info.bundleName == 'content_4') {