]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 Sep 2013 13:00:55 +0000 (13:00 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 Sep 2013 13:00:55 +0000 (13:00 +0000)
js/libs/fluidbook/newjavascript.js [deleted file]
js/libs/gal/gal.filesystem.js
js/main.js

diff --git a/js/libs/fluidbook/newjavascript.js b/js/libs/fluidbook/newjavascript.js
deleted file mode 100644 (file)
index 9facedf..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* 
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
-
index 2685572c32723123e2b0389b548cdb1f66d10c90..fb3bab1641585d29eb60af847b1aca2a6dc0bd49 100644 (file)
                // requestFileSystem and storageInfo shims
                var requestFileSystem = window.requestFileSystem ||
                                window.webkitRequestFileSystem;
+
                var storageInfo = window.storageInfo || window.webkitStorageInfo;
 
                var quota = opt_quota || DEFAULT_QUOTA;
                        // Save grantedBytes in the adapter
                        that.grantedBytes = grantedBytes;
                        // Once quota is grantedBytes, initialize a filesystem
+
                        requestFileSystem(persistent, 0, onInitFs, onError);
                };
 
-               if (storageInfo != undefined) {
-                       // Get quota
-                       storageInfo.requestQuota(window.PERSISTENT, quota,
-                                       quotaCallback, onError);
-               } else {
-                       quotaCallback(0);
-               }
+
+               quotaCallback(0);
+
 
        };
 
index f5d96e84c401cc4dd2b2cd390414e26c059317a3..617ad6bb9c4e39daaf47121824eadf9ba57662a6 100644 (file)
@@ -37,7 +37,6 @@ $(function() {
        }
 
        if (DATAS.phonegap) {
-               console.log('need to load cordova before launching app');
                loadPhonegap();
        } else {
                init();
@@ -45,19 +44,19 @@ $(function() {
 });
 
 function loadPhonegap() {
+
        var cordova = 'data/cordova.js';
-       if (Modernizr.localStorage) {
-               var cordovaStorage = window.localStorage.getItem('cordova');
-               if (cordovaStorage) {
-                       cordova = window.localStorage.getItem('cordova');
-               }
+       var cordovaStorage = window.localStorage.getItem('cordova');
+       if (cordovaStorage) {
+               cordova = window.localStorage.getItem('cordova');
        }
 
+       document.addEventListener('deviceready', onDeviceReady, false);
+       document.addEventListener("resume", onAppResume, false);
+
        loadJSLibrary(
                        cordova
                        , function() {
-               document.addEventListener('deviceready', onDeviceReady, false);
-               document.addEventListener("resume", onAppResume, false);
        });
 }
 
@@ -71,8 +70,9 @@ function onAppResume() {
 function onDeviceReady() {
        var manifest = window.sessionStorage.getItem('manifest.' + DATAS.id);
        var fsprefix = window.sessionStorage.getItem('galfsprefix');
+
        if (navigator.onLine && manifest) {
-               gal = new GameAssetLoader(fsprefix, JSON.parse(manifest));
+               gal = new GameAssetLoader(JSON.parse(manifest), fsprefix);
                gal.init(function() {
                        startAfterLoading = true;
                        init();
@@ -87,7 +87,6 @@ function onDeviceReady() {
                                fluidbook.changeAddress();
                        }
                        if (info.bundleName === 'extras') {
-                               console.log('put offline flag');
                                window.localStorage.setItem('offline.' + DATAS.id, '1');
                        }
                        fluidbook.loader.retryErrorImages();
@@ -98,14 +97,9 @@ function onDeviceReady() {
 }
 
 function loadJSLibrary(url, callback) {
-       if (!fluidbook.support.hasNetwork()) {
-               return;
-       }
-
        if (jsLibraries.indexOf(url) > -1) {
                if (callback != undefined) {
                        callback();
-
                }
                return;
        }
@@ -140,6 +134,7 @@ function init() {
        if (INITED == true) {
                return;
        }
+
        INITED = true;
 
        fluidbook = new Fluidbook(DATAS);