aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-06-06 12:38:51 +0100
committerStruan Donald <struan@exo.org.uk>2012-06-06 12:40:35 +0100
commitab49f95e4bc8848eb4f004d2a43320ecddee0c40 (patch)
treea4813c6c7753d83e3e6a30281a9a8167339f59d7 /www/js
parentf558425eda4165c945c887f35af385573cf90df8 (diff)
basic connection checking functionality
Diffstat (limited to 'www/js')
-rw-r--r--www/js/mobile.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/www/js/mobile.js b/www/js/mobile.js
index 3a15c4c..b23be32 100644
--- a/www/js/mobile.js
+++ b/www/js/mobile.js
@@ -428,3 +428,13 @@ $(function(){
signed_in();
});
+function onDeviceReady() {
+ var location = document.location + '';
+ if ( location.indexOf('no_connection.html') < 0 && (
+ navigator.network.connection.type == Connection.NONE ||
+ navigator.network.connection.type == Connection.UNKNOWN ) ) {
+ document.location = 'no_connection.html';
+ }
+}
+
+document.addEventListener("deviceready", onDeviceReady, false);