From: Tom Hughes Date: Wed, 1 Dec 2010 09:25:27 +0000 (+0000) Subject: Replace JOSM editing option with generic Remote Control option X-Git-Tag: live~6863^2~10 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/aa4a8fdc816af0172acf23e13960dec5378643d8 Replace JOSM editing option with generic Remote Control option --- diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 301d4a966..73f38f78c 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -34,7 +34,7 @@ class SiteController < ApplicationController def edit editor = params[:editor] || @user.preferred_editor || DEFAULT_EDITOR - if editor == "josm" + if editor == "remote" render :action => :index else # Decide on a lat lon to initialise potlatch with. Various ways of doing this diff --git a/app/views/site/index.html.erb b/app/views/site/index.html.erb index 9d883daf9..7b1d874e7 100644 --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@ -270,7 +270,7 @@ end resizeMap(); } - function josmEditHandler(event) { + function remoteEditHandler(event) { var extent = getMapExtent(); var loaded = false; @@ -278,20 +278,20 @@ end $("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') %>"); + if (!loaded) alert("<%= t('site.index.remote_failed') %>"); }, 1000); event.stop(); } function installEditHandler() { - $("josmanchor").observe("click", josmEditHandler); + $("remoteanchor").observe("click", remoteEditHandler); - <% if preferred_editor == "josm" %> - $("editanchor").observe("click", josmEditHandler); + <% if preferred_editor == "remote" %> + $("editanchor").observe("click", remoteEditHandler); <% if params[:action] == "edit" %> - josmEditHandler(); + remoteEditHandler(); <% end %> <% end %> } diff --git a/config/locales/en.yml b/config/locales/en.yml index 36ba2db72..74ac8e75d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -87,9 +87,9 @@ en: potlatch2: name: "Potlatch 2" description: "Potlatch 2 (in-browser editor)" - josm: - name: "JOSM" - description: "JOSM (via remote-control plugin)" + remote: + name: "Remote Control" + description: "Remote Control (JOSM or Merkaartor)" browse: changeset: title: "Changeset" @@ -1238,7 +1238,7 @@ en: 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" + remote_failed: "Editing failed - make sure JOSM or Merkaartor is loaded and the remote control option 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}}." diff --git a/lib/editors.rb b/lib/editors.rb index efd10aef9..ed1de5999 100644 --- a/lib/editors.rb +++ b/lib/editors.rb @@ -1,3 +1,3 @@ module Editors - ALL_EDITORS = [ "potlatch", "potlatch2", "josm" ] + ALL_EDITORS = [ "potlatch", "potlatch2", "remote" ] end