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 = unproj(map.getExtent());
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 <div class="search_container">
47 <div id="search_field">
48 <%= form_tag "#", :id => "search_form" do %>
49 <%= submit_tag t('site.search.submit_text') %>
50 <%= text_field_tag :query, h(params[:query]), :tabindex => "1", :placeholder => t('site.search.search') %>
54 <p class='search_help deemphasize'>
55 <%= raw(t 'site.search.search_help') %>
56 <span class="whereami"><a href="javascript:describeLocation()" title="<%= t 'site.search.where_am_i_title' %>"><%= t 'site.search.where_am_i' %></a></span>