aboutsummaryrefslogtreecommitdiff
path: root/radicale_infcloud/web/cache_handler.js
diff options
context:
space:
mode:
Diffstat (limited to 'radicale_infcloud/web/cache_handler.js')
-rw-r--r--radicale_infcloud/web/cache_handler.js63
1 files changed, 33 insertions, 30 deletions
diff --git a/radicale_infcloud/web/cache_handler.js b/radicale_infcloud/web/cache_handler.js
index e21fb63..4926b20 100644
--- a/radicale_infcloud/web/cache_handler.js
+++ b/radicale_infcloud/web/cache_handler.js
@@ -43,37 +43,40 @@ 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)
- {
- if(!isUserLogged)
- window.location.reload();
- else
- $('#cacheDialog').css('display','block');
- }, false);
+ if(window.applicationCache)
+ {
+ 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)
- {
- clearInterval(globalCacheUpdateInterval);
- globalCacheUpdateInterval=setInterval(function(){window.applicationCache.update();}, 300000);
- //$('#LoginPage .window').css('display', 'inline-block');
- }
- }, false);
+ window.applicationCache.addEventListener('noupdate', function(e)
+ {
+ if(!isUserLogged)
+ {
+ clearInterval(globalCacheUpdateInterval);
+ globalCacheUpdateInterval=setInterval(function(){window.applicationCache.update();}, 300000);
+ //$('#LoginPage .window').css('display', 'inline-block');
+ }
+ }, false);
+ };
}, false);
bgstack15