X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e96a64ca9c2ea068dd9167e074ee26c8d28744b4..71e7208a0aceccf47edce739803130096999da5d:/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 7efe12e0c..c518eb4e9 100644 --- a/app/assets/javascripts/leaflet.share.js +++ b/app/assets/javascripts/leaflet.share.js @@ -1,68 +1,400 @@ L.OSM.share = function (options) { - var control = L.control(options); + var control = L.OSM.sidebarPane(options), + marker = L.marker([0, 0], { draggable: true }), + locationFilter = new L.LocationFilter({ + enableButton: false, + adjustButton: false + }); control.onAdd = function (map) { - var $container = $('
') - .attr('class', 'control-share'); - - $('') - .attr('class', 'control-button') - .attr('href', '#') - .attr('title', 'Share') - .html('') - .on('click', toggle) + var $container = $("
") + .attr("class", "control-share"); + + var button = this.makeButton("share", "javascripts.share.title", toggle) .appendTo($container); - var $ui = $('
') - .attr('class', 'share-ui'); + var $ui = this.makeUI("share-ui", "javascripts.share.title", toggle); - $('
') - .appendTo($ui) - .append( - $('

') - .text(I18n.t('javascripts.share.title'))); + // Link / Embed - var $share_link = $('
') + var $linkSection = $("
") + .attr("class", "section share-link") .appendTo($ui); - var $title = $('

') - .text(I18n.t('javascripts.share.link')) - .appendTo($share_link); - - var $short_url_input = $('') - .attr('id', 'short_url') - .attr('type', 'checkbox') - .prop('checked', 'checked') - .appendTo($share_link) - .bind('change', function() { - options.short = $(this).prop('checked'); - update(); + $("

") + .text(I18n.t("javascripts.share.link")) + .appendTo($linkSection); + + var $form = $("
") + .appendTo($linkSection); + + $("
") + .attr("class", "form-check mb-3") + .appendTo($form) + .append( + $("