Improve alert messages when database is offline.
[rails.git] / app / views / site / _search.rhtml
index aa9294236e10e65a1b298127363ae1aad26c15f3..84f44f0f44f9231c8c159b8fd265082f4608b639 100644 (file)
@@ -12,6 +12,7 @@
 <script type="text/javascript">
 <!--
   function startSearch() {
+    $("search_results_content").innerHTML = "<p class='search_results_entry'>Searching...</p>";
     $("search_field").style.display = "none";
     $("search_active").style.display = "inline";
   }
     <%= onclose %>
   }
 
+  function describeLocation() {
+    var position = getPosition();
+
+    <%= remote_function(:loading => "startSearch()",
+                        :complete => "endSearch()",
+                        :url => { :controller => :geocoder, :action => :description },
+                        :with => "'lat=' + position.lat + '&lon=' + position.lon") %>
+  }
+
   <% if params[:query] %>
   <%= remote_function(:loading => "startSearch()",
                       :complete => "endSearch()",
@@ -42,6 +52,7 @@
 <% content_for "optionals" do %>
   <div class="optionalbox">
     <span class="oboxheader">Search</span>
+    <span class="whereami"><a href="javascript:describeLocation()">Where am I?</a></span>
     <div class="search_form">
     <span id="search_field">
     <% form_remote_tag(:loading => "startSearch()",
@@ -55,7 +66,7 @@
     <p class="search_help">
       examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ',
       or 'post offices near L√ľnen'
-      <a href="http://wiki.openstreetmap.org/index.php/Search_Help">more examples...</a>
+      <a href="http://wiki.openstreetmap.org/index.php/Search">more examples...</a>
     </p>
   </div>
 <% end %>