]> git.openstreetmap.org Git - rails.git/commitdiff
Use configured server protocol for shared URLs
authorTom Hughes <tom@compton.nu>
Mon, 5 Feb 2018 21:03:45 +0000 (21:03 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 5 Feb 2018 21:03:45 +0000 (21:03 +0000)
Closes #939

app/assets/javascripts/leaflet.share.js
app/assets/javascripts/osm.js.erb

index 7cfd50c8e23e09eb7fcc550ca159797e92a797d3..044c767cf30485e3c41cb7c2b28fcb7596514307 100644 (file)
@@ -346,7 +346,7 @@ L.OSM.share = function (options) {
 
       $('#embed_html').val(
         '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="' +
-          escapeHTML('http://' + OSM.SERVER_URL + '/export/embed.html?' + $.param(params)) +
+          escapeHTML(OSM.SERVER_PROTOCOL + '://' + OSM.SERVER_URL + '/export/embed.html?' + $.param(params)) +
           '" style="border: 1px solid black"></iframe><br/>' +
           '<small><a href="' + escapeHTML(map.getUrl(marker)) + '">' +
           escapeHTML(I18n.t('javascripts.share.view_larger_map')) + '</a></small>');
index 971f80be3354136f7fb90cb260253e5780c968f6..a671175108f3ab2b464489e808004eb8131eead7 100644 (file)
@@ -6,6 +6,7 @@ OSM = {
 <% end %>
 
   MAX_REQUEST_AREA:        <%= MAX_REQUEST_AREA.to_json %>,
+  SERVER_PROTOCOL:         <%= SERVER_PROTOCOL.to_json %>,
   SERVER_URL:              <%= SERVER_URL.to_json %>,
   API_VERSION:             <%= API_VERSION.to_json %>,
   STATUS:                  <%= STATUS.to_json %>,