appcache-nanny
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -59,7 +59,10 @@ // appCacheNanny | ||
var DEFAULT_MANIFEST_LOADER_PATH = '/appcache-loader.html'; | ||
var DEFAULT_CHECK_INTERVAL = 30000; | ||
var appCacheNanny = new Events(); | ||
var DEFAULT_MANIFEST_LOADER_PATH = '/appcache-loader.html'; | ||
var nannyOptions = { | ||
loaderPath: DEFAULT_MANIFEST_LOADER_PATH | ||
loaderPath: DEFAULT_MANIFEST_LOADER_PATH, | ||
checkInterval: DEFAULT_CHECK_INTERVAL, | ||
offlineCheckInterval: DEFAULT_CHECK_INTERVAL | ||
}; | ||
@@ -108,2 +111,4 @@ | ||
appCacheNanny.start = function start(options) { | ||
if (options) appCacheNanny.set(options); | ||
if (! setupDone) { | ||
@@ -117,3 +122,2 @@ setupCallbacks.push(appCacheNanny.start); | ||
} | ||
if (options && options.checkInterval) checkInterval = options.checkInterval; | ||
@@ -180,7 +184,6 @@ clearInterval(intervalPointer); | ||
// default check interval in ms | ||
var checkInterval = 30000; | ||
// optional: shorter interval when offline | ||
var checkOfflineInterval; | ||
// this is the internal state of checkInterval. | ||
// It usually differs between online / offline state | ||
var checkInterval = DEFAULT_CHECK_INTERVAL; | ||
@@ -330,3 +333,4 @@ // flag if there is a pending update, being applied after next page reload | ||
// reset check interval | ||
appCacheNanny.start(checkInterval); | ||
checkInterval = appCacheNanny.get('checkInterval'); | ||
appCacheNanny.start(); | ||
@@ -352,3 +356,4 @@ trigger('online'); | ||
// check with offline interval | ||
appCacheNanny.start(checkOfflineInterval || checkInterval); | ||
checkInterval = appCacheNanny.get('offlineCheckInterval'); | ||
appCacheNanny.start(); | ||
@@ -355,0 +360,0 @@ trigger('offline'); |
{ | ||
"name": "appcache-nanny", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ "Gregor Martynus <gregor@martynus.net>" |
{ | ||
"name": "appcache-nanny", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Teaches the applicationCache douchebag some manners!", | ||
@@ -5,0 +5,0 @@ "main": "appcache-nanny.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2021832
26608