]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 25 Jul 2013 14:02:47 +0000 (14:02 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 25 Jul 2013 14:02:47 +0000 (14:02 +0000)
js/libs/fluidbook/fluidbook.cache.js
js/main.js
style/fluidbook.css

index 52c2de15a4e32a51aa7c1fedc5e4e2cc2c6f0929..7482ddbf9e0965f10f500acba7e756244236dce1 100644 (file)
@@ -1,10 +1,10 @@
 function FluidbookCache(options) {
        this._cache = {};
        this.options = options;
-       this._prefix ='fluidbook.' + this.options.id + '.';
+       this._prefix = 'fluidbook.' + this.options.id + '.';
        this._support = false;
        this._date = this.options.cacheDate;
-       this._support=Modernizr.localstorage;
+       this._support = Modernizr.localstorage;
        this.init();
 
 }
@@ -17,14 +17,19 @@ FluidbookCache.prototype = {
        },
        clear: function() {
                if (this._support) {
-                       localStorage.clear();
+                       for (var i = localStorage.length - 1; i >= 0; i--) {
+                               var key = localStorage.key(i);
+                               if (key.indexOf(this._prefix) == 0) {
+                                       localStorage.removeItem(key);
+                               }
+                       }
                } else {
                        this._cache = {};
                }
        },
        isset: function(key) {
                if (this._support) {
-                       var res= localStorage.getItem(this._prefix + key) != null;
+                       var res = localStorage.getItem(this._prefix + key) != null;
                        return res;
                } else {
                        return this._cache[key] != null;
index d1a958f1c42bb4a79a7cfeb16c7367b31231d1c7..2fc3d45af2e7253af1a84e249c4b2690299bf5da 100644 (file)
@@ -7,7 +7,7 @@ var maskHashChange = false;
 var jsLibraries = [];
 var longpresstime = undefined;
 var startAfterLoading = false;
-var gal=null;
+var gal = null;
 
 $(function() {
        $_GET = parseGet();
@@ -51,7 +51,7 @@ function onAppResume() {
 
 function onDeviceReady() {
        var manifest = window.sessionStorage.getItem('manifest.' + DATAS.id);
-       if (manifest) {
+       if (navigator.onLine && manifest) {
                gal = new GameAssetLoader(JSON.parse(manifest));
                gal.init(function() {
                        startAfterLoading = true;
@@ -66,6 +66,10 @@ function onDeviceReady() {
                        if (info.bundleName === 'content_4') {
                                fluidbook.changeAddress();
                        }
+                       if (info.bundleName === 'extras') {
+                               console.log('put offline flag');
+                               window.localStorage.setItem('offline.' + DATAS.id, '1');
+                       }
                        fluidbook.loader.retryErrorImages();
                });
        } else {
index f677cd1b46fd4b74de03f68d96348f35257d60cf..5dabe07b32ec1ba88c872ce3205efc750d9c6fbb 100644 (file)
@@ -981,7 +981,6 @@ ul.chapters a.level-1 .right{
 \r
 ul.chapters a.level0,ul.chapters a.level1,ul.chapters a.level2,ul.chapters a.level3{\r
        border-top: 1px solid rgba(255,255,255,0.3);\r
-\r
 }\r
 \r
 ul.chapters a.level0{\r
@@ -1165,7 +1164,6 @@ ul.chapters a>nav{
 }\r
 \r
 .doublePage._3d .right{\r
-\r
        -webkit-transform:  rotate3d(0,1,0,0deg);\r
        -o-transform:  rotate3d(0,1,0,0deg);\r
        -ms-transform:  rotate3d(0,1,0,0deg);\r
@@ -1174,7 +1172,6 @@ ul.chapters a>nav{
 }\r
 \r
 .doublePage._3d .left{\r
-\r
        -webkit-transform:  rotate3d(0,1,0,180deg);\r
        -o-transform:  rotate3d(0,1,0,180deg);\r
        -ms-transform:  rotate3d(0,1,0,180deg);\r
@@ -1183,7 +1180,6 @@ ul.chapters a>nav{
 }\r
 \r
 .doublePage._3d.nextstart{\r
-\r
        -webkit-transform:  rotate3d(0,1,0,360deg);\r
        -o-transform:  rotate3d(0,1,0,360deg);\r
        -ms-transform:  rotate3d(0,1,0,360deg);\r
@@ -1241,7 +1237,6 @@ a.button{
        background-position: 100% 50%;\r
 }\r
 \r
-\r
 #fontsLoader{\r
        position:absolute;\r
        bottom:0px;\r
@@ -1264,8 +1259,6 @@ a.button{
        position:absolute;\r
 }\r
 \r
-\r
-\r
 @media all and (orientation: portrait) {  \r
        #ol{display:none;}\r
        @-ms-viewport { width: 640px; }\r
@@ -1282,7 +1275,6 @@ a.button{
     src: url('fonts/slkscr-webfont.ttf') format('truetype');\r
     font-weight: normal;\r
     font-style: normal;\r
-\r
 }\r
 \r
 @font-face {\r