X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/33897d30b32b1323d8d4a3053b2a8a13cea5e5d5..edda4af515cfb0bd4de1ed0650b47e124bfad6ed:/app/assets/javascripts/leaflet.share.js?ds=inline diff --git a/app/assets/javascripts/leaflet.share.js b/app/assets/javascripts/leaflet.share.js index d43f99b1d..40ba020e6 100644 --- a/app/assets/javascripts/leaflet.share.js +++ b/app/assets/javascripts/leaflet.share.js @@ -1,60 +1,464 @@ -L.Control.Share = L.Control.extend({ - options: { - position: 'topright', - title: 'Share', - url: function(map) { - return ''; - } - }, +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 + }); - onAdd: function (map) { - var className = 'control-share', - container = L.DomUtil.create('div', className); + control.onAddPane = function (map, button, $ui) { + // Link / Embed + $("#content").addClass("overlay-right-sidebar"); - var link = L.DomUtil.create('a', 'control-button', container); - link.innerHTML = ""; - link.href = '#'; - link.title = this.options.title; + var $linkSection = $("
") + .attr("class", "share-link p-3 border-bottom border-secondary-subtle") + .appendTo($ui); - this._uiPane = this.options.uiPane; + $("

") + .text(I18n.t("javascripts.share.link")) + .appendTo($linkSection); - this._map = map; + var $form = $("
") + .appendTo($linkSection); - var h2 = L.DomUtil.create('h2', '', this._uiPane); - h2.innerHTML = I18n.t('javascripts.share.title'); + $("
") + .attr("class", "form-check mb-3") + .appendTo($form) + .append($("