forked from bensochar/Web-2.0-Touch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixes, renaming php -> html for better off-line support
- Loading branch information
unknown
authored and
unknown
committed
Sep 27, 2011
1 parent
55238af
commit 3481fb0
Showing
33 changed files
with
245 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Convenience array of status values | ||
var cacheStatusValues = []; | ||
cacheStatusValues[0] = 'uncached'; | ||
cacheStatusValues[1] = 'idle'; | ||
cacheStatusValues[2] = 'checking'; | ||
cacheStatusValues[3] = 'downloading'; | ||
cacheStatusValues[4] = 'updateready'; | ||
cacheStatusValues[5] = 'obsolete'; | ||
|
||
// Listeners for all possible events | ||
var cache = window.applicationCache; | ||
cache.addEventListener('cached', logEvent, false); | ||
cache.addEventListener('checking', logEvent, false); | ||
cache.addEventListener('downloading', logEvent, false); | ||
cache.addEventListener('error', logEvent, false); | ||
cache.addEventListener('noupdate', logEvent, false); | ||
cache.addEventListener('obsolete', logEvent, false); | ||
cache.addEventListener('progress', logEvent, false); | ||
cache.addEventListener('updateready', logEvent, false); | ||
|
||
// Log every event to the console | ||
function logEvent(e) { | ||
var online, status, type, message; | ||
online = (navigator.onLine) ? 'yes' : 'no'; | ||
status = cacheStatusValues[cache.status]; | ||
type = e.type; | ||
message = 'online: ' + online; | ||
message+= ', event: ' + type; | ||
message+= ', status: ' + status; | ||
if (type == 'error' && navigator.onLine) { | ||
message+= ' (prolly a syntax error in manifest)'; | ||
} | ||
console.log(message); | ||
} | ||
|
||
// Swap in newly downloaded files when update is ready | ||
window.applicationCache.addEventListener( | ||
'updateready', | ||
function(){ | ||
alert('cache ready'); | ||
window.applicationCache.swapCache(); | ||
console.log('swap cache has been called'); | ||
}, | ||
false | ||
); | ||
|
||
// Check for manifest changes every 10 seconds | ||
setInterval(function(){cache.update()}, 15000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.