]> git.openstreetmap.org Git - rails.git/commitdiff
Add manual fallback for "Start Mapping" button
authorJohn Firebaugh <john.firebaugh@gmail.com>
Wed, 7 Aug 2013 23:14:15 +0000 (16:14 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Mon, 12 Aug 2013 20:34:45 +0000 (13:34 -0700)
app/assets/javascripts/index.js
app/assets/javascripts/welcome.js
config/locales/en.yml

index e46ca6d9d09d4483ace3474e5ca5299434e01465..2a704f72464f8d697fe02f8b91bd592855b3ac46 100644 (file)
@@ -158,6 +158,20 @@ $(document).ready(function () {
     remoteEditHandler(map.getBounds());
   }
 
+  if (OSM.params().edit_help) {
+    $('#editanchor')
+      .removeAttr('title')
+      .tooltip({
+        placement: 'bottom',
+        title: I18n.t('javascripts.edit_help')
+      })
+      .tooltip('show');
+
+    $('body').one('click', function() {
+      $('#editanchor').tooltip('hide');
+    });
+  }
+
   initializeSearch(map);
   initializeExport(map);
   initializeBrowse(map, params);
index 60648383adc10efa3979950848b5ef47c834be2c..56c454ac4aeaa731d63b064f56db39f6a1c7315b 100644 (file)
@@ -25,12 +25,6 @@ $(document).ready(function() {
       });
     }
 
-    function geoError() {
-      $('.start-mapping')
-        .removeClass('loading')
-        .addClass('error');
-    }
-
     $('.start-mapping').on('click', function(e) {
       e.preventDefault();
 
@@ -39,9 +33,15 @@ $(document).ready(function() {
 
       // handle firefox's weird implementation
       // https://bugzilla.mozilla.org/show_bug.cgi?id=675533
-      window.setTimeout(geoError, 4000);
+      window.setTimeout(manualEdit, 4000);
 
-      navigator.geolocation.getCurrentPosition(geoSuccess, geoError);
+      navigator.geolocation.getCurrentPosition(geoSuccess, manualEdit);
     });
+  } else {
+    manualEdit();
+  }
+
+  function manualEdit() {
+    window.location = '/?edit_help=1'
   }
 });
index 5a1cd3a51c3f50bf9b9e16421c9cda1dac95ad7c..f3f4ac8dcf24085246eef5baff772f9f3ab7a4f4 100644 (file)
@@ -2144,6 +2144,7 @@ en:
         reactivate: Reactivate
         comment_and_resolve: Comment & Resolve
         comment: Comment
+    edit_help: Move the map and zoom in on a location you want to edit, then click here.
   redaction:
     edit:
       description: "Description"