+ 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
+ });
+
+ control.onAddPane = function (map, button, $ui) {
+ // Link / Embed
+
+ var $linkSection = $("<div>")
+ .attr("class", "section share-link")
+ .appendTo($ui);
+
+ $("<h4>")
+ .text(I18n.t("javascripts.share.link"))
+ .appendTo($linkSection);
+
+ var $form = $("<form>")
+ .appendTo($linkSection);
+
+ $("<div>")
+ .attr("class", "form-check mb-3")
+ .appendTo($form)
+ .append($("<label>")
+ .attr("for", "link_marker")
+ .attr("class", "form-check-label")
+ .text(I18n.t("javascripts.share.include_marker")))
+ .append($("<input>")
+ .attr("id", "link_marker")
+ .attr("type", "checkbox")
+ .attr("class", "form-check-input")
+ .bind("change", toggleMarker));
+
+ $("<div class='btn-group btn-group-sm mb-2'>")
+ .appendTo($form)
+ .append($("<a class='btn btn-primary'>")
+ .addClass("active")
+ .attr("for", "long_input")
+ .attr("id", "long_link")
+ .text(I18n.t("javascripts.share.long_link")))
+ .append($("<a class='btn btn-primary'>")
+ .attr("for", "short_input")
+ .attr("id", "short_link")
+ .text(I18n.t("javascripts.share.short_link")))
+ .append($("<a class='btn btn-primary'>")
+ .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();
+ if (!$(this).hasClass("btn-primary")) return;
+ var id = "#" + $(this).attr("for");
+ $(this).siblings("a")
+ .removeClass("active");
+ $(this).addClass("active");
+ $linkSection.find(".share-tab")
+ .hide();
+ $linkSection.find(".share-tab:has(" + id + ")")
+ .show()
+ .find("input, textarea")
+ .select();
+ });
+
+ $("<div>")
+ .attr("class", "share-tab")
+ .appendTo($form)
+ .append($("<input>")
+ .attr("id", "long_input")
+ .attr("type", "text")
+ .attr("class", "form-control form-control-sm font-monospace")
+ .attr("readonly", true)
+ .on("click", select));
+
+ $("<div>")
+ .attr("class", "share-tab")
+ .hide()
+ .appendTo($form)
+ .append($("<input>")
+ .attr("id", "short_input")
+ .attr("type", "text")
+ .attr("class", "form-control form-control-sm font-monospace")
+ .attr("readonly", true)
+ .on("click", select));
+
+ $("<div>")
+ .attr("class", "share-tab")
+ .hide()
+ .appendTo($form)