From a2c1aa6167a7a0fca23cb183578d407c17f08f50 Mon Sep 17 00:00:00 2001 From: Andy Gup Date: Fri, 6 Jun 2014 12:10:40 -0600 Subject: [PATCH] moved script block to bottom --- samples/appcache-features.html | 339 +++++++++++++++++---------------- 1 file changed, 170 insertions(+), 169 deletions(-) diff --git a/samples/appcache-features.html b/samples/appcache-features.html index 4711e9c..01a886e 100644 --- a/samples/appcache-features.html +++ b/samples/appcache-features.html @@ -135,9 +135,22 @@ } - - + function goOnline(){ - -
- -
- -
Pending edits: 0
-
-
-
-
+ offlineFeaturesManager.goOnline(function(success,error){ + if(error === undefined){ + btnOnlineOffline.innerHTML = "Go Offline"; + imgOfflineIndicator.src = bluePinPath; + imgOfflineIndicator.offlineColor = "blue"; + console.log("Online."); + } + else{ + alert("There was a problem syncing offline edits: " + JSON.stringify(error)); + } + }); + } + + function goOffline(){ + btnOnlineOffline.innerHTML = "Go Online"; + imgOfflineIndicator.src = redPinPath; + imgOfflineIndicator.offlineColor = "red"; + offlineFeaturesManager.goOffline(); + + } + + function goOnlineOffline(){ + if(offlineFeaturesManager.getOnlineStatus() == offlineFeaturesManager.ONLINE){ + goOffline(); + } + else{ + goOnline(); + } + } + + function cacheEventHandler(evt){ + console.log("CACHE EVENT: " + JSON.stringify(evt)); + } + + function cacheErrorHandler(evt){ + console.log("CACHE ERROR: " + JSON.stringify(evt)); + } + } +); + + \ No newline at end of file