]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'osmlab/map-ui'
authorTom Hughes <tom@compton.nu>
Tue, 6 Aug 2013 08:05:59 +0000 (09:05 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 6 Aug 2013 08:05:59 +0000 (09:05 +0100)
app/assets/javascripts/application.js
app/assets/javascripts/index.js
app/views/browse/_map.html.erb
app/views/site/index.html.erb
test/functional/oauth_controller_test.rb

index fc7cdb51c548e829702714e9e119cfccd6ba01ec..225ddaf44503ee78aaa2ec81455121df795c6e36 100644 (file)
@@ -44,12 +44,21 @@ function remoteEditHandler(bbox, select) {
       };
 
   if (select) query.select = select;
-  $("#linkloader")
+
+  var iframe = $('<iframe>')
+    .hide()
+    .appendTo('body')
     .attr("src", "http://127.0.0.1:8111/load_and_zoom?" + querystring.stringify(query))
-    .load(function() { loaded = true; });
+    .on('load', function() {
+      $(this).remove();
+      loaded = true;
+    });
 
   setTimeout(function () {
-    if (!loaded) alert(I18n.t('site.index.remote_failed'));
+    if (!loaded) {
+      alert(I18n.t('site.index.remote_failed'));
+      iframe.remove();
+    }
   }, 1000);
 
   return false;
index 4724351ce614ab6bc03545880863d7afb62ba862..bae80cac5069480ff60a9fe3ab4cf3e857a77ac8 100644 (file)
@@ -185,7 +185,7 @@ function setPositionLink(map) {
       }
 
       if (data.type && data.id) {
-        map.addObject(data, { zoom: true, style: { opacity: 0.2, fill: false } });
+        map.addObject(data, { zoom: false, style: { opacity: 0.2, fill: false } });
       }
 
       map.markerLayer.clearLayers();
index ed3cc0faf169b829b828caab84b00ad67a1bce1d..9b82753fb237fe3febc990f695e51403d9282b17 100644 (file)
@@ -1,6 +1,3 @@
-<iframe id="linkloader" style="display: none">
-</iframe>
-
 <div id="browse_map" class='clearfix content_map'>
   <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible? %>
 
index 721fd18edc988154efc7c9a6ea658d72369a112e..73e1382d301231490a690437ae48d30c6cdcdf14 100644 (file)
@@ -19,9 +19,6 @@
 <div id="map" tabindex="2">
 </div>
 
-<iframe id="linkloader" style="display: none">
-</iframe>
-
 <div id="attribution">
   <table width="100%">
     <tr>
index b34416be6feff29ea581590aafc89ae57562a13f..d0ac28d0a99e109ed1957235c9d89e915c019928 100644 (file)
@@ -5,27 +5,27 @@ class OauthControllerTest < ActionController::TestCase
   # test all routes which lead to this controller
   def test_routes
     assert_routing(
-      { :path => "/oauth/revoke" },
+      { :path => "/oauth/revoke", :method => :post },
       { :controller => "oauth", :action => "revoke" }
     )
     assert_routing(
-      { :path => "/oauth/authorize" },
+      { :path => "/oauth/authorize", :method => :post },
       { :controller => "oauth", :action => "authorize" }
     )
     assert_routing(
-      { :path => "/oauth/token" },
+      { :path => "/oauth/token", :method => :get },
       { :controller => "oauth", :action => "token" }
     )
     assert_routing(
-      { :path => "/oauth/request_token" },
+      { :path => "/oauth/request_token", :method => :get },
       { :controller => "oauth", :action => "request_token" }
     )
     assert_routing(
-      { :path => "/oauth/access_token" },
+      { :path => "/oauth/access_token", :method => :get },
       { :controller => "oauth", :action => "access_token" }
     )
     assert_routing(
-      { :path => "/oauth/test_request" },
+      { :path => "/oauth/test_request", :method => :get },
       { :controller => "oauth", :action => "test_request" }
     )
   end