1 <script type="text/javascript">
3 function describeLocation() {
4 var args = getArgs($("#viewanchor").attr("href"));
6 $("#sidebar_title").html("<%= t 'site.sidebar.search_results' %>");
7 $("#sidebar_content").load("<%= url_for :controller => :geocoder, :action => :description %>", {
14 function doSearch(query) {
15 $("#sidebar_title").html("<%= t 'site.sidebar.search_results' %>");
17 <% if params[:action] == 'index' -%>
18 var extent = getMapExtent();
20 $("#sidebar_content").load("<%= url_for :controller => :geocoder, :action => :search %>", {
21 query: $("#query").val(),
23 minlat: extent.bottom,
28 $("#sidebar_content").load("<%= url_for :controller => :geocoder, :action => :search %>", {
29 query: $("#query").val()
34 $(document).ready(function () {
35 $("#search_form").submit(function (event) {
36 doSearch($("#query").val());
44 <% content_for :optionals do %>
45 <div class="optionalbox">
46 <span class="whereami"><a href="javascript:describeLocation()" title="<%= t 'site.search.where_am_i_title' %>"><%= t 'site.search.where_am_i' %></a></span>
47 <h1><%= t 'site.search.search' %></h1>
48 <div class="search_container">
49 <div id="search_field">
50 <%= form_tag "#", :id => "search_form" do %>
51 <%= text_field_tag :query, h(params[:query]), :tabindex => "1" %>
52 <%= submit_tag t('site.search.submit_text') %>
56 <p class="search_help">
57 <%= raw(t 'site.search.search_help') %>