]> git.openstreetmap.org Git - rails.git/commitdiff
Extract browse.js static asset
authorJohn Firebaugh <john.firebaugh@gmail.com>
Sun, 26 Aug 2012 02:27:10 +0000 (19:27 -0700)
committerTom Hughes <tom@compton.nu>
Mon, 27 Aug 2012 19:23:24 +0000 (20:23 +0100)
app/assets/javascripts/browse.js [moved from app/views/browse/start.js.erb with 99% similarity]
app/assets/javascripts/site.js
app/controllers/browse_controller.rb
app/views/browse/_map.html.erb
app/views/changeset/_map.html.erb
app/views/diary_entry/edit.html.erb
app/views/site/index.html.erb
app/views/user/_map.html.erb

similarity index 99%
rename from app/views/browse/start.js.erb
rename to app/assets/javascripts/browse.js
index 6478794da30d039cb3d46cae156a0ed02134d1e1..fef09aada9ddaf9f1ba36c6b5f1ca6f96b8263e0 100644 (file)
@@ -542,5 +542,3 @@ function clearStatus() {
   $("#browse_status").html("");
   $("#browse_status").hide();
 }
-
-startBrowse("<%=j render :partial => "sidebar" %>");
index 978e84e3d24f564141cf78dee37118e562ba0b7a..df56b95bc2bd007c0694a4043f4547aabaa041d9 100644 (file)
@@ -2,8 +2,10 @@
 //= require jquery_ujs
 //= require jquery.autogrowtextarea
 //= require jquery.timers
+//= require openlayers
 //= require i18n/translations
 //= require globals
+//= require browse
 //= require export
 
 /*
index 2a7e2c5f70ed74c09ee1c0abef9c127461bffd65..e3f20c803c4443837aaad3f698f21f8e4a13b740 100644 (file)
@@ -7,6 +7,7 @@ class BrowseController < ApplicationController
   around_filter :web_timeout, :except => [:start]
 
   def start 
+    render :partial => "sidebar"
   end
   
   def relation
index b8077e6824fcab470bc6016b1a1a66e4bd71fada..340e26132bf8e94e7fc6803beab960a271f5535b 100644 (file)
@@ -1,4 +1,3 @@
-<%= javascript_include_tag 'openlayers.js' %>
 <%= javascript_include_tag 'map.js' %>
 
 <iframe id="linkloader" style="display: none">
index 3357057b17e0b91c033b05ef65f5b0781de1de7f..e055047a915b71cdeeab6ea9cd8308cdeec16c68 100644 (file)
@@ -1,4 +1,3 @@
-<%= javascript_include_tag 'openlayers.js' %>
 <%= javascript_include_tag 'map.js' %>
 
 <div id="changeset_list_map">
index 54ed0cc70ec94ec49d644d6fbc5632980b432973..fc34842ad4ad34491d921f17aab5dfda5167b2e6 100644 (file)
@@ -49,7 +49,6 @@
   <% zoom = '12' %>
 <% end %>
 
-<%= javascript_include_tag 'openlayers.js' %>
 <%= javascript_include_tag 'map.js' %>
 
 <script type="text/javascript">
index 5eb8ae228c3a3b4b53b743d4a3df22bc0279a8de..9b4405feb23dd776b669fe575548c42730fffab3 100644 (file)
@@ -6,7 +6,7 @@
 
 <% unless STATUS == :api_offline or STATUS == :database_offline -%>
   <% content_for :editmenu do -%>
-    <li><%= link_to t("browse.start_rjs.data_layer_name"), "#", :id => "show_data" %></li>
+    <li><%= link_to t("browse.start_rjs.data_layer_name"), { :controller => :browse, :action => :start }, :id => "show_data" %></li>
   <% end -%>
 <% end -%>
 
@@ -125,7 +125,6 @@ else
 end
 %>
 
-<%= javascript_include_tag 'openlayers.js' %>
 <%= javascript_include_tag 'map.js' %>
 
 <%= render :partial => 'resize' %>
@@ -192,8 +191,11 @@ end
   }
 
   $(document).ready(function () {
-    $("#show_data").click(function () {
-      $.ajax({ url: "<%= url_for :controller => :browse, :action => :start %>" });
+    $("#show_data").click(function (e) {
+      $.ajax({ url: $(this).attr('href'), success: function (sidebarHtml) {
+        startBrowse(sidebarHtml);
+      }});
+      e.preventDefault();
     });
 
     $("body").on("click", "a.set_position", function () {
index a142e99b9b288ddb36192613f3ee034e6c73b52e..94d1411a05f8063b83365796ebd47252f1b34b76 100644 (file)
@@ -13,7 +13,6 @@ else
 end
 %>
 
-<%= javascript_include_tag 'openlayers.js' %>
 <%= javascript_include_tag 'map.js' %>
 
 <script type="text/javascript">