]> git.openstreetmap.org Git - rails.git/commitdiff
Warn if we fail to contact JOSM
authorTom Hughes <tom@compton.nu>
Mon, 15 Nov 2010 09:34:09 +0000 (09:34 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 29 Nov 2010 12:20:22 +0000 (12:20 +0000)
app/views/site/index.html.erb
config/locales/en.yml

index bc7ca3394594fb89ff3cf519199cf7edd3898795..843d0d2debbe3e76e10e401f7b24a62709f5cea8 100644 (file)
@@ -272,9 +272,15 @@ end
 
   function josmEditHandler() {
     var extent = getMapExtent();
 
   function josmEditHandler() {
     var extent = getMapExtent();
+    var loaded = false;
 
 
+    $("linkloader").onload = function () { loaded = true; };
     $("linkloader").src = "http://127.0.0.1:8111/load_and_zoom?left=" + extent.left + "&top=" + extent.top + "&right=" + extent.right + "&bottom=" + extent.bottom;
 
     $("linkloader").src = "http://127.0.0.1:8111/load_and_zoom?left=" + extent.left + "&top=" + extent.top + "&right=" + extent.right + "&bottom=" + extent.bottom;
 
+    setTimeout(function () {
+      if (!loaded) alert("<%= t('site.index.josm_failed') %>");
+    }, 1000);
+
     return false;
   }
 
     return false;
   }
 
index 2b2694a113ecbd5d7991452566bf98557dba9822..a717e839d690b0a7e57d5a731b1837dc3bfd7ea8 100644 (file)
@@ -1227,6 +1227,7 @@ en:
         license_url: "http://creativecommons.org/licenses/by-sa/2.0/"
         project_name: "OpenStreetMap project"
         project_url: "http://openstreetmap.org"
         license_url: "http://creativecommons.org/licenses/by-sa/2.0/"
         project_name: "OpenStreetMap project"
         project_url: "http://openstreetmap.org"
+      josm_failed: "Editing failed - make sure JOSM is loaded and the remote control plugin is enabled"
     edit:
       not_public: "You have not set your edits to be public."
       not_public_description: "You can no longer edit the map unless you do so. You can set your edits as public from your {{user_page}}."
     edit:
       not_public: "You have not set your edits to be public."
       not_public_description: "You can no longer edit the map unless you do so. You can set your edits as public from your {{user_page}}."