1 <script type="text/javascript">
3 function startSearch() {
4 updateSidebar("<%= t 'site.sidebar.search_results' %>", "");
7 function describeLocation() {
8 var position = getPosition();
10 <%= remote_function(:loading => "startSearch()",
11 :url => { :controller => :geocoder, :action => :description },
12 :with => "'lat=' + position.lat + '&lon=' + position.lon") %>
15 <% if params[:query] %>
16 <%= remote_function(:loading => "startSearch()",
17 :url => { :controller => :geocoder, :action => :search, :query => h(params[:query]) }) %>
22 <% content_for "optionals" do %>
23 <div class="optionalbox">
24 <span class="oboxheader"><%= t 'site.search.search' %></span>
25 <span class="whereami"><a href="javascript:describeLocation()"><%= t 'site.search.where_am_i' %></a></span>
26 <div class="search_form">
27 <div id="search_field">
28 <% form_remote_tag(:loading => "startSearch()",
29 :complete => "endSearch()",
30 :url => { :controller => :geocoder, :action => :search }) do %>
31 <%= text_field_tag :query, h(params[:query]) %>
32 <%= submit_tag t('site.search.submit_text') %>
36 <p class="search_help">
37 <%= t 'site.search.search_help' %>