From 8ca781ac75e7b4627a2c2ccdf7aee84c4771b759 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 7 Aug 2013 16:14:15 -0700 Subject: [PATCH] Add manual fallback for "Start Mapping" button --- app/assets/javascripts/index.js | 14 ++++++++++++++ app/assets/javascripts/welcome.js | 16 ++++++++-------- config/locales/en.yml | 1 + 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index e46ca6d9d..2a704f724 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -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); diff --git a/app/assets/javascripts/welcome.js b/app/assets/javascripts/welcome.js index 60648383a..56c454ac4 100644 --- a/app/assets/javascripts/welcome.js +++ b/app/assets/javascripts/welcome.js @@ -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' } }); diff --git a/config/locales/en.yml b/config/locales/en.yml index 5a1cd3a51..f3f4ac8dc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" -- 2.43.2