Revision: 1814
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1814&view=rev
Author:   cimorrison
Date:     2011-04-12 13:50:08 +0000 (Tue, 12 Apr 2011)

Log Message:
-----------
- Tidied up the code
- Changed the way IE6 conditional comments are used in the last revision to 
avoid HTML validation errors

Modified Paths:
--------------
    mrbs/trunk/web/Themes/default/header.inc

Modified: mrbs/trunk/web/Themes/default/header.inc
===================================================================
--- mrbs/trunk/web/Themes/default/header.inc    2011-04-12 13:38:38 UTC (rev 
1813)
+++ mrbs/trunk/web/Themes/default/header.inc    2011-04-12 13:50:08 UTC (rev 
1814)
@@ -43,7 +43,7 @@
     // because the browser doesn't render the autocomplete box properly - it
     // gets hidden behind other elements.   Although there are fixes for this,
     // it's not worth it ...
-    $js .= "if ($('#iegt6').length > 0)\n";
+    $js .= "if ($('#ielte6').length == 0)\n";
     $js .= "{\n";
     $js .= "  $('#$id').autocomplete({\n";
     $js .= "    source: [$names_string],\n";
@@ -778,26 +778,7 @@
 ?>
 
 $(document).ready(function() {
-  <?php
-  if ($page == 'report')
-  {
-    // Make the area match input on the report page into an auto-complete input
-    $sql = "SELECT area_name FROM $tbl_area ORDER BY area_name";
-    echo generate_autocomplete('areamatch', $sql);
 
-    // Make the room match input on the report page into an auto-complete input
-    // (We need DISTINCT because it's possible to have two rooms of the same 
name
-    // in different areas)
-    $sql = "SELECT DISTINCT room_name FROM $tbl_room ORDER BY room_name";
-    echo generate_autocomplete('roommatch', $sql);
-  }
-  ?>
-});
-
-
-// actions to be taken on page load
-function init()
-{
   <?php // ALL PAGES ?>
   // if there's a logon box, set the username input field in focus
   var logonForm = document.getElementById('logon');
@@ -931,6 +912,20 @@
     <?php
   }
 
+  // REPORT.PHP
+  if ($page == 'report')
+  {
+    // Make the area match input on the report page into an auto-complete input
+    $sql = "SELECT area_name FROM $tbl_area ORDER BY area_name";
+    echo generate_autocomplete('areamatch', $sql);
+
+    // Make the room match input on the report page into an auto-complete input
+    // (We need DISTINCT because it's possible to have two rooms of the same 
name
+    // in different areas)
+    $sql = "SELECT DISTINCT room_name FROM $tbl_room ORDER BY room_name";
+    echo generate_autocomplete('roommatch', $sql);
+  }
+
   // SEARCH.PHP
   // put the search string field in focus
   if ($page == 'search')
@@ -944,16 +939,17 @@
   <?php
   }
   ?>
-}
 
+});
 
+
 //]]>
     </script>
   </head>
   <?php
   // Put the filename in as a class to aid styling.   
   // (Use a class rather than id to avoid specificity problems)
-  echo "<body class=\"".htmlspecialchars($page)."\" onLoad =\"init()\">\n";
+  echo "<body class=\"".htmlspecialchars($page)."\">\n";
   ?>
 
 
@@ -963,9 +959,9 @@
     // Add in some markers so that the JavaScript can work out
     // which browser we're using
     ?>
-    <![if gt IE 6]>
-    <span id="iegt6"></span>
-    <![endif]>
+    <!--[if lte IE 6 ]>
+    <span id="ielte6"></span>
+    <![endif]-->
 
 <?php // show a warning if this is using a low version of php
   if (substr(phpversion(), 0, 1) == 3)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to