X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/be878df0978d5b51f7fbb72fca16f74c5708c818..a419f8890a66e584501b831aba9d1fdcbc6894bc:/app/assets/javascripts/osm.js.erb diff --git a/app/assets/javascripts/osm.js.erb b/app/assets/javascripts/osm.js.erb index 3e2e7c866..3290b5e2c 100644 --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@ -3,8 +3,8 @@ //= require qs/dist/qs OSM = { -<% if defined?(PIWIK) %> - PIWIK: <%= PIWIK.to_json %>, +<% if defined?(Settings.matomo) %> + MATOMO: <%= Settings.matomo.to_json %>, <% end %> MAX_REQUEST_AREA: <%= Settings.max_request_area.to_json %>, @@ -37,7 +37,8 @@ OSM = { SEARCHING: <%= image_path("searching.gif").to_json %>, apiUrl: function (object) { - var url = "/api/" + OSM.API_VERSION + "/" + object.type + "/" + object.id; + var apiType = object.type === "note" ? "notes" : object.type; + var url = "/api/" + OSM.API_VERSION + "/" + apiType + "/" + object.id; if (object.type === "way" || object.type === "relation") { url += "/full"; @@ -85,6 +86,8 @@ OSM = { mapParams.object = {type: 'way', id: parseInt(params.way)}; } else if (params.relation) { mapParams.object = {type: 'relation', id: parseInt(params.relation)}; + } else if (params.note) { + mapParams.object = {type: 'note', id: parseInt(params.note)}; } var hash = OSM.parseHash(location.hash);