1 <script type="text/javascript">
3 function startSearch() {
4 updateSidebar("Search Results", "<p class='search_results_entry'>Searching...<\/p>");
6 $("search_field").style.display = "none";
7 $("search_active").style.display = "inline";
10 function endSearch() {
11 $("search_field").style.display = "inline";
12 $("search_active").style.display = "none";
15 function describeLocation() {
16 var position = getPosition();
18 <%= remote_function(:loading => "startSearch()",
19 :complete => "endSearch()",
20 :url => { :controller => :geocoder, :action => :description },
21 :with => "'lat=' + position.lat + '&lon=' + position.lon") %>
24 <% if params[:query] %>
25 <%= remote_function(:loading => "startSearch()",
26 :complete => "endSearch()",
27 :url => { :controller => :geocoder, :action => :search, :query => h(params[:query]) }) %>
32 <% content_for "optionals" do %>
33 <div class="optionalbox">
34 <span class="oboxheader"><%= t 'site.search.search' %></span>
35 <span class="whereami"><a href="javascript:describeLocation()"><%= t 'site.search.where_am_i' %></a></span>
36 <div class="search_form">
37 <div id="search_field">
38 <% form_remote_tag(:loading => "startSearch()",
39 :complete => "endSearch()",
40 :url => { :controller => :geocoder, :action => :search }) do %>
41 <%= text_field_tag :query, h(params[:query]) %>
42 <%= submit_tag t('site.search.submit_text') %>
45 <p id="search_active"><%= t 'site.search.searching' %></p>
47 <p class="search_help">
48 <%= t 'site.search.search_help' %>