appcache-nanny
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -74,3 +74,6 @@ // appCacheNanny | ||
setupCallbacks.push(appCacheNanny.check); | ||
setup(); | ||
if (! setupPending) { | ||
setup(); | ||
setupPending = true; | ||
} | ||
return true; | ||
@@ -97,6 +100,10 @@ } | ||
var setupDone = false; | ||
var setupPending = false; | ||
appCacheNanny.start = function start(options) { | ||
if (! setupDone) { | ||
setupCallbacks.push(appCacheNanny.start); | ||
setup(); | ||
if (! setupPending) { | ||
setup(); | ||
setupPending = true; | ||
} | ||
return true; | ||
@@ -108,2 +115,3 @@ } | ||
intervalPointer = setInterval(appCacheNanny.check, checkInterval); | ||
isCheckingForUpdatesFlag = true; | ||
trigger('start'); | ||
@@ -117,2 +125,3 @@ }; | ||
clearInterval(intervalPointer); | ||
isCheckingForUpdatesFlag = false; | ||
trigger('stop'); | ||
@@ -122,2 +131,9 @@ }; | ||
// | ||
// returns true if the nanny is checking periodically for updates | ||
// | ||
appCacheNanny.isCheckingForUpdates = function isCheckingForUpdates() { | ||
return isCheckingForUpdatesFlag; | ||
}; | ||
// | ||
// returns true if an update has been fully received, otherwise false | ||
@@ -141,2 +157,5 @@ // | ||
// flag whether the nanny is checking for updates in the background | ||
var isCheckingForUpdatesFlag = false; | ||
// flag if there was an error updating the appCache, usually meaning | ||
@@ -178,2 +197,3 @@ // it couldn't connect, a.k.a. you're offline. | ||
subscribeToEvents(); | ||
setupPending = false; | ||
setupDone = true; | ||
@@ -180,0 +200,0 @@ setupCallbacks.forEach(function(callback) { |
{ | ||
"name": "appcache-nanny", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ "Gregor Martynus <gregor@martynus.net>" |
{ | ||
"name": "appcache-nanny", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Teaches the applicationCache douchebag some manners!", | ||
@@ -5,0 +5,0 @@ "main": "appcache-nanny.js", |
@@ -149,2 +149,10 @@ The appCache Nanny | ||
TODOs / IDEAs | ||
------------- | ||
* on obsolete, remove the iframe, load it again to check if a new *.appcache path | ||
has been set. If yes, update and trigger `updateready` event, otherwise trigger | ||
`obsolete` event | ||
Fine Print | ||
@@ -151,0 +159,0 @@ ---------- |
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
2020562
26574
164
37