aboutsummaryrefslogtreecommitdiffstats
path: root/phonegap
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
commit7c3278bc571ed3129cab6f755fecf7f8c2bcfc5a (patch)
tree767becca337e598d5337c42b606e586af4703c68 /phonegap
parent2fa8a96f261aaccfa0a8ad32e1f379f487c58dc1 (diff)
basic connection checking functionality
Diffstat (limited to 'phonegap')
-rw-r--r--phonegap/www/js/mobile.js10
-rw-r--r--phonegap/www/no_connection.html78
2 files changed, 88 insertions, 0 deletions
diff --git a/phonegap/www/js/mobile.js b/phonegap/www/js/mobile.js
index 3a15c4c1a..b23be32b8 100644
--- a/phonegap/www/js/mobile.js
+++ b/phonegap/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);
diff --git a/phonegap/www/no_connection.html b/phonegap/www/no_connection.html
new file mode 100644
index 000000000..b7557d11e
--- /dev/null
+++ b/phonegap/www/no_connection.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title></title>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
+ <meta charset="utf-8">
+
+ <link rel="stylesheet" href="css/base.css">
+ <link rel="stylesheet" href="css/mobile.css">
+ <script type="text/javascript" src="js/json2.js"></script>
+ <script type="text/javascript" src="js/config.js"></script>
+ <script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script>
+ <script type="text/javascript" src="js/jquery-1.7.0.min.js"></script>
+ <script src="js/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script>
+
+ <script type="text/javascript" src="js/geo.min.js"></script>
+ <script type="text/javascript" src="js/fixmystreet.js"></script>
+ <script type="text/javascript" src="js/mobile.js"></script>
+
+ <script type="text/javascript">
+ validation_strings = {
+ update: 'Please enter a message',
+ title: 'Please enter a subject',
+ detail: 'Please enter some details',
+ name: {
+ required: 'Please enter your name',
+ validName: 'Please enter your full name, councils need this information – if you do not wish your name to be shown on the site, untick the box below'
+ },
+ category: 'Please choose a category',
+ rznvy: {
+ required: 'Please enter your email',
+ email: 'Please enter a valid email'
+ },
+ email: {
+ required: 'Please enter your email',
+ email: 'Please enter a valid email'
+ }
+ };
+ </script>
+ </head>
+ <body id="container" class="frontpage fullwidthpage mobile-header" ontouchmove="touchmove(event);">
+
+ <div class="wrapper">
+ <div class="table-cell">
+ <header id="site-header" role="banner">
+ <div class="container">
+ <a href="/" id="site-logo">FixMyStreet</a>
+ </div>
+ </header>
+
+ <div class="container">
+ <div class="content" role="main">
+ <div class="tablewrapper">
+ <h2>No Internet connection</h2>
+
+ <p>
+ There is no connection to the internet available which means
+ you can't report a problem at the moment. Please try again when
+ you have a connection.
+ </p>
+ </div>
+ </div><!-- .content role=main -->
+ </div><!-- .container -->
+ </div><!-- .table-cell -->
+
+ <div class="mobile-info">
+ <a href="about.html">i</a>
+ </div>
+
+ <div class="big-green-banner mobile-map-banner mobile-nav-banner">
+ <a href="index.html">Home</a>
+ No connection
+ </div>
+ </div> <!-- .wrapper -->
+ </body>
+</html>
+</html>