From: Vincent Vanwaelscappel Date: Thu, 25 Jul 2013 14:02:47 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5739b8c5173d265f6daa452a2061a2dec7eb1dd9;p=fluidbook-html5.git --- diff --git a/js/libs/fluidbook/fluidbook.cache.js b/js/libs/fluidbook/fluidbook.cache.js index 52c2de15..7482ddbf 100644 --- a/js/libs/fluidbook/fluidbook.cache.js +++ b/js/libs/fluidbook/fluidbook.cache.js @@ -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; diff --git a/js/main.js b/js/main.js index d1a958f1..2fc3d45a 100644 --- a/js/main.js +++ b/js/main.js @@ -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 { diff --git a/style/fluidbook.css b/style/fluidbook.css index f677cd1b..5dabe07b 100644 --- a/style/fluidbook.css +++ b/style/fluidbook.css @@ -981,7 +981,6 @@ ul.chapters a.level-1 .right{ ul.chapters a.level0,ul.chapters a.level1,ul.chapters a.level2,ul.chapters a.level3{ border-top: 1px solid rgba(255,255,255,0.3); - } ul.chapters a.level0{ @@ -1165,7 +1164,6 @@ ul.chapters a>nav{ } .doublePage._3d .right{ - -webkit-transform: rotate3d(0,1,0,0deg); -o-transform: rotate3d(0,1,0,0deg); -ms-transform: rotate3d(0,1,0,0deg); @@ -1174,7 +1172,6 @@ ul.chapters a>nav{ } .doublePage._3d .left{ - -webkit-transform: rotate3d(0,1,0,180deg); -o-transform: rotate3d(0,1,0,180deg); -ms-transform: rotate3d(0,1,0,180deg); @@ -1183,7 +1180,6 @@ ul.chapters a>nav{ } .doublePage._3d.nextstart{ - -webkit-transform: rotate3d(0,1,0,360deg); -o-transform: rotate3d(0,1,0,360deg); -ms-transform: rotate3d(0,1,0,360deg); @@ -1241,7 +1237,6 @@ a.button{ background-position: 100% 50%; } - #fontsLoader{ position:absolute; bottom:0px; @@ -1264,8 +1259,6 @@ a.button{ position:absolute; } - - @media all and (orientation: portrait) { #ol{display:none;} @-ms-viewport { width: 640px; } @@ -1282,7 +1275,6 @@ a.button{ src: url('fonts/slkscr-webfont.ttf') format('truetype'); font-weight: normal; font-style: normal; - } @font-face {