summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/index.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-12-11 05:37:34 -0600
committerJules Laplace <jules@okfoc.us>2015-12-11 05:37:34 -0600
commitaa5a9b7c7cd52a69f8dd1d0cdc15475e113e6da0 (patch)
treececfdb0893eb9e936fe605478b3f8195dc7ef987 /StoneIsland/platforms/android/assets/www/js/index.js
parent4178c44c48aa401f7780bec3f89430c83d50fe30 (diff)
remembered a couple things, push 0.3.4
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/index.js')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/index.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/index.js b/StoneIsland/platforms/android/assets/www/js/index.js
index 468c0d7e..73af443a 100755
--- a/StoneIsland/platforms/android/assets/www/js/index.js
+++ b/StoneIsland/platforms/android/assets/www/js/index.js
@@ -64,6 +64,8 @@ var app = (function(){
app.ready = function(){
if (window.cordova) {
+ document.addEventListener('pause', app.paused, false)
+ document.addEventListener('resume', app.resumed, false)
cordova.plugins.Keyboard.disableScroll(true)
geo.fetch()
}
@@ -74,12 +76,24 @@ var app = (function(){
// app.router.launch()
// }
// else {
- app.account.connect( app.router.launch.bind(app.router) )
+ push.init()
+ app.account.connect( app.router.launch.bind(app.router) )
// }
$("body").removeClass("loading")
}
+ var refresh_time = +Date.now()
+ app.paused = function(){}
+ app.resumed = function(){
+ geo.fetch()
+ var now = +Date.now()
+ if (now - refresh_time > 60 * 60 * 1000) {
+ refresh_time = now
+ app.blog.refresh()
+ }
+ }
+
return app
})()