Fix minor code standards issues
[busui.git] / include / common-template.inc.php
blob:a/include/common-template.inc.php -> blob:b/include/common-template.inc.php
--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -52,35 +52,24 @@
 <title>' . $pageTitle . ' - Canberra Bus Timetable</title>
         <meta name="google-site-verification" content="-53T5Qn4TB_de1NyfR_ZZkEVdUNcNFSaYKSFkWKx-sY" />
 <link rel="dns-prefetch" href="//code.jquery.com">
-<link rel="dns-prefetch" href="//ajax.googleapis.com">
-	<link rel="stylesheet"  href="' . $basePath . 'css/jquery-ui-1.8.12.custom.css" />';
+<link rel="dns-prefetch" href="//ajax.googleapis.com">';
     $jqmVersion = "1.0.1";
-    if (isDebugServer()) {
-        $jqmcss = $basePath . "css/jquery.mobile-$jqmVersion.css";
-        $jqjs = $basePath . "js/jquery-1.6.4.min.js";
-        $jqmjs = $basePath . "js/jquery.mobile-$jqmVersion.js";
-
-        $jqmcss = $basePath . "css/jquery.mobile-b90eab4935.css";
-        $jqmjs = $basePath . "js/jquery.mobile-b90eab4935.js";
-    } else {
-        $jqmcss = "//code.jquery.com/mobile/$jqmVersion/jquery.mobile-$jqmVersion.min.css";
-        $jqjs = "//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js";
-        $jqmjs = "//code.jquery.com/mobile/$jqmVersion/jquery.mobile-$jqmVersion.min.js";
-    }
-    echo '<link rel="stylesheet"  href="' . $jqmcss . '" />
-	<script src="' . $jqjs . '"></script>
-		 <script>$(document).bind("mobileinit", function(){
+    echo '
+	<script src="'.$basePath.'js/yepnope/yepnope.1.5.3-min.js"></script>
+		 <script>
+                 yepnope([{
+  load: "//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js",
+  complete: function () {
+    
+     $(document).bind("mobileinit", function(){
   $.mobile.ajaxEnabled = false;
-});
-</script> 
-	<script src="' . $jqmjs . '"></script>
-
-<script src="' . $basePath . 'js/jquery.ui.core.min.js"></script>
-<script src="' . $basePath . 'js/jquery.ui.position.min.js"></script>
-<script src="' . $basePath . 'js/jquery.ui.widget.min.js"></script>
-  <script src="' . $basePath . 'js/jquery.ui.autocomplete.min.js"></script>
-  <script>
-	$(function() {
+}); }
+  
+}, {
+  load: ["//code.jquery.com/mobile/' . $jqmVersion . '/jquery.mobile-' . $jqmVersion . '.min.css","//code.jquery.com/mobile/' . $jqmVersion . '/jquery.mobile-' . $jqmVersion . '.min.js"] 
+  }, {
+  load: ["' . $basePath . 'css/jquery-ui-1.8.12.custom.css","' . $basePath . 'js/jquery.ui.core.min.js","' . $basePath . 'js/jquery.ui.position.min.js","' . $basePath . 'js/jquery.ui.widget.min.js","' . $basePath . 'js/jquery.ui.autocomplete.min.js"],
+  complete: function() {
 		$( "#geolocate" ).autocomplete({
 			source: "lib/autocomplete.php",
 			minLength: 2
@@ -93,8 +82,13 @@
 			source: "lib/autocomplete.php",
 			minLength: 2
 		});
-	});
-	</script>';
+	}
+  
+  
+}]);
+                
+</script> 
+	';
     echo '<style type="text/css">';
     if (strstr($_SERVER['HTTP_USER_AGENT'], 'Android'))
         echo '.ui-shadow,.ui-btn-up-a,.ui-btn-hover-a,.ui-btn-down-a,.ui-body-b,.ui-btn-up-b,.ui-btn-hover-b,
@@ -176,10 +170,10 @@
             $overrides = getServiceOverride();
             if (isset($overrides['service_id'])) {
                 if ($overrides['service_id'] == "noservice") {
-                    echo '<div id="servicewarning">Buses are <strong>not running today</strong> due to industrial action/public holiday. See <a 
+                    echo '<div class="servicewarning">Buses are <strong>not running today</strong> due to industrial action/public holiday. See <a 
 href="http://www.action.act.gov.au">http://www.action.act.gov.au</a> for details.</div>';
                 } else {
-                    echo '<div id="servicewarning">Buses are running on an altered timetable today due to industrial action/public holiday. See <a href="http://www.action.act.gov.au">http://www.action.act.gov.au</a> for details.</div>';
+                    echo '<div class="servicewarning">Buses are running on an altered timetable today due to industrial action/public holiday. See <a href="http://www.action.act.gov.au">http://www.action.act.gov.au</a> for details.</div>';
                 }
             }
             $serviceAlerts = Array();
@@ -204,7 +198,7 @@
             }
             if (isset($serviceAlerts['entity']) && sizeof($serviceAlerts['entity']) > 0) {
                 foreach ($serviceAlerts['entity'] as $entity) {
-                    echo "<div id='servicewarning'><b>{$entity['alert']['header_text']['translation'][0]['text']}</b>&nbsp;<small>"
+                    echo "<div class='servicewarning'><b>{$entity['alert']['header_text']['translation'][0]['text']}</b>&nbsp;<small>"
                     . date("F jS Y, g:i a", $entity['alert']['active_period'][0]['start']) . " to "
                     . date("F jS Y, g:i a", $entity['alert']['active_period'][0]['end']) . "</small>
                             <br>Warning: {$entity['alert']['description_text']['translation'][0]['text']}