X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/01eed9b96c47365c1e6517df6d21f5d8b9286f29..b4a9d7537785f1b44ea4db42bed69127fbe323ae:/app/assets/javascripts/leaflet.share.js diff --git a/app/assets/javascripts/leaflet.share.js b/app/assets/javascripts/leaflet.share.js index c096a92fc..325b168b2 100644 --- a/app/assets/javascripts/leaflet.share.js +++ b/app/assets/javascripts/leaflet.share.js @@ -1,23 +1,24 @@ L.OSM.share = function (options) { - var control = L.OSM.sidebarPane(options, "share", "javascripts.share.title", "javascripts.share.title"), - marker = L.marker([0, 0], { draggable: true }), - locationFilter = new L.LocationFilter({ - enableButton: false, - adjustButton: false - }); + const control = L.OSM.sidebarPane(options, "share", "javascripts.share.title", "javascripts.share.title"), + marker = L.marker([0, 0], { draggable: true }), + locationFilter = new L.LocationFilter({ + enableButton: false, + adjustButton: false + }); control.onAddPane = function (map, button, $ui) { // Link / Embed + $("#content").addClass("overlay-right-sidebar"); - var $linkSection = $("
") - .attr("class", "section share-link") + const $linkSection = $("
") + .attr("class", "share-link p-3 border-bottom border-secondary-subtle") .appendTo($ui); $("

") .text(I18n.t("javascripts.share.link")) .appendTo($linkSection); - var $form = $("
") + let $form = $("") .appendTo($linkSection); $("
") @@ -46,11 +47,14 @@ L.OSM.share = function (options) { .text(I18n.t("javascripts.share.short_link"))) .append($("") .attr("for", "embed_html") + .attr("id", "embed_link") + .attr("data-bs-title", I18n.t("javascripts.site.embed_html_disabled")) .attr("href", "#") .text(I18n.t("javascripts.share.embed"))) .on("click", "a", function (e) { e.preventDefault(); - var id = "#" + $(this).attr("for"); + if (!$(this).hasClass("btn-primary")) return; + const id = "#" + $(this).attr("for"); $(this).siblings("a") .removeClass("active"); $(this).addClass("active"); @@ -95,13 +99,13 @@ L.OSM.share = function (options) { .on("click", select)) .append( $("

") - .attr("class", "text-muted") + .attr("class", "text-body-secondary") .text(I18n.t("javascripts.share.paste_html"))); // Geo URI - var $geoUriSection = $("

") - .attr("class", "section share-geo-uri") + const $geoUriSection = $("
") + .attr("class", "share-geo-uri p-3 border-bottom border-secondary-subtle") .appendTo($ui); $("

") @@ -115,8 +119,8 @@ L.OSM.share = function (options) { // Image - var $imageSection = $("
") - .attr("class", "section share-image") + const $imageSection = $("
") + .attr("class", "share-image p-3") .appendTo($ui); $("

") @@ -125,8 +129,13 @@ L.OSM.share = function (options) { $("
") .attr("id", "export-warning") - .attr("class", "text-muted") - .text(I18n.t("javascripts.share.only_standard_layer")) + .attr("class", "text-body-secondary") + .text(I18n.t("javascripts.share.only_layers_exported_as_image")) + .append( + $("