diff options
Diffstat (limited to 'radicale_infcloud/web/cache_handler.js')
-rw-r--r-- | radicale_infcloud/web/cache_handler.js | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/radicale_infcloud/web/cache_handler.js b/radicale_infcloud/web/cache_handler.js index e21fb63..a285d09 100644 --- a/radicale_infcloud/web/cache_handler.js +++ b/radicale_infcloud/web/cache_handler.js @@ -43,37 +43,41 @@ window.applicationCache.addEventListener('updateready', function(){ // Check if a new cache is available on page load. window.addEventListener('load', function(e) { - window.applicationCache.addEventListener('cached', function(e) + // Suppress useless warning/errors about applicationCache not existing. + if(window.applicationCache) { - if(!isUserLogged) - window.location.reload(); - else - $('#cacheDialog').css('display','block'); - }, false); + window.applicationCache.addEventListener('cached', function(e) + { + if(!isUserLogged) + window.location.reload(); + else + $('#cacheDialog').css('display','block'); + }, false); - window.applicationCache.addEventListener('updateready', function(e) - { - if(!isUserLogged) - window.location.reload(); - else - $('#cacheDialog').css('display','block'); - }, false); + window.applicationCache.addEventListener('updateready', function(e) + { + if(!isUserLogged) + window.location.reload(); + else + $('#cacheDialog').css('display','block'); + }, false); - window.applicationCache.addEventListener('obsolete', function(e) - { - if(!isUserLogged) - window.location.reload(); - else - $('#cacheDialog').css('display','block'); - }, false); + window.applicationCache.addEventListener('obsolete', function(e) + { + if(!isUserLogged) + window.location.reload(); + else + $('#cacheDialog').css('display','block'); + }, false); - window.applicationCache.addEventListener('noupdate', function(e) - { - if(!isUserLogged) + window.applicationCache.addEventListener('noupdate', function(e) { - clearInterval(globalCacheUpdateInterval); - globalCacheUpdateInterval=setInterval(function(){window.applicationCache.update();}, 300000); - //$('#LoginPage .window').css('display', 'inline-block'); - } - }, false); + if(!isUserLogged) + { + clearInterval(globalCacheUpdateInterval); + globalCacheUpdateInterval=setInterval(function(){window.applicationCache.update();}, 300000); + //$('#LoginPage .window').css('display', 'inline-block'); + } + }, false); + }; }, false); |