Merge branch 'master' into tooltips-enable-disable

This commit is contained in:
Anton Khorev 2022-09-23 12:43:31 +03:00
commit 9657b92fad
44 changed files with 1758 additions and 705 deletions

View file

@ -75,7 +75,7 @@ window.onload = function () {
L.Control.OSMReportAProblem = L.Control.Attribution.extend({
options: {
position: 'bottomright',
prefix: '<a href="http://www.openstreetmap.org/fixthemap?lat={x}&lon={y}&zoom={z}" target="_blank">'+I18n.t('javascripts.embed.report_problem')+'</a>'
prefix: '<a href="https://www.openstreetmap.org/fixthemap?lat={x}&lon={y}&zoom={z}" target="_blank">'+I18n.t('javascripts.embed.report_problem')+'</a>'
},
onAdd: function (map) {

View file

@ -50,18 +50,16 @@ OSM.initializeBrowse = function (map) {
$("#browse_status").html(
$("<div>").append(
$("<div class='d-flex'>").append(
$("<div class='flex-grow-1 text-break'>").append(
$("<h2>")
.text(I18n.t("browse.start_rjs.load_data"))),
$("<h2 class='flex-grow-1 text-break'>")
.text(I18n.t("browse.start_rjs.load_data")),
$("<div>").append(
$("<button type='button' class='btn-close mt-1'>")
$("<button type='button' class='btn-close'>")
.click(cancel))),
$("<div>").append(
$("<p class='alert alert-warning'></p>")
.text(I18n.t("browse.start_rjs.feature_warning", { num_features: count, max_features: limit })),
$("<input type='submit' class='btn btn-primary'>")
.val(I18n.t("browse.start_rjs.load_data"))
.click(add))));
$("<p class='alert alert-warning'>")
.text(I18n.t("browse.start_rjs.feature_warning", { num_features: count, max_features: limit })),
$("<input type='submit' class='btn btn-primary'>")
.val(I18n.t("browse.start_rjs.load_data"))
.click(add)));
}
var dataLoader;

View file

@ -265,15 +265,14 @@ OSM.Directions = function (map) {
}
var turnByTurnTable = $("<table class='mb-3'>");
var directionsCloseButton = $("<button type='button' class='btn-close mt-1'>");
var directionsCloseButton = $("<button type='button' class='btn-close'>");
$("#sidebar_content")
.empty()
.append(
$("<div class='d-flex'>").append(
$("<div class='flex-grow-1 text-break'>").append(
$("<h2>")
.text(I18n.t("javascripts.directions.directions"))),
$("<h2 class='flex-grow-1 text-break'>")
.text(I18n.t("javascripts.directions.directions")),
$("<div>").append(directionsCloseButton)),
distanceText,
turnByTurnTable

View file

@ -48,6 +48,9 @@ OSM.History = function (map) {
if (window.location.pathname === "/history") {
data.bbox = map.getBounds().wrap().toBBoxString();
var feedLink = $("link[type=\"application/atom+xml\"]"),
feedHref = feedLink.attr("href").split("?")[0];
feedLink.attr("href", feedHref + "?bbox=" + data.bbox);
}
$.ajax({
@ -59,11 +62,6 @@ OSM.History = function (map) {
updateMap();
}
});
var feedLink = $("link[type=\"application/atom+xml\"]"),
feedHref = feedLink.attr("href").split("?")[0];
feedLink.attr("href", feedHref + "?bbox=" + data.bbox);
}
function loadMore(e) {

View file

@ -300,12 +300,17 @@ L.OSM.Map = L.Map.extend({
},
setSidebarOverlaid: function (overlaid) {
var sidebarWidth = 350;
if (overlaid && !$("#content").hasClass("overlay-sidebar")) {
$("#content").addClass("overlay-sidebar");
this.invalidateSize({ pan: false })
.panBy([-350, 0], { animate: false });
this.invalidateSize({ pan: false });
if ($("html").attr("dir") !== "rtl") {
this.panBy([-sidebarWidth, 0], { animate: false });
}
} else if (!overlaid && $("#content").hasClass("overlay-sidebar")) {
this.panBy([350, 0], { animate: false });
if ($("html").attr("dir") !== "rtl") {
this.panBy([sidebarWidth, 0], { animate: false });
}
$("#content").removeClass("overlay-sidebar");
this.invalidateSize({ pan: false });
}

View file

@ -92,8 +92,7 @@ L.OSM.share = function (options) {
.append(
$("<p>")
.attr("class", "text-muted")
.text(I18n.t("javascripts.share.paste_html"))
.appendTo($linkSection));
.text(I18n.t("javascripts.share.paste_html")));
// Geo URI

View file

@ -22,11 +22,10 @@ L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
$("<div class='sidebar_heading d-flex'>")
.appendTo($ui)
.append($("<div class='flex-grow-1 text-break'>")
.append($("<h4>")
.text(I18n.t(paneTitle))))
.append($("<h4 class='flex-grow-1 text-break'>")
.text(I18n.t(paneTitle)))
.append($("<div>")
.append($("<button type='button' class='btn-close mt-1'>")
.append($("<button type='button' class='btn-close'>")
.attr("aria-label", I18n.t("javascripts.close"))
.bind("click", toggle)));

View file

@ -17,6 +17,8 @@ L.OSM.sidebar = function (selector) {
};
control.togglePane = function (pane, button) {
var paneWidth = 250;
current
.hide()
.trigger("hide");
@ -25,12 +27,18 @@ L.OSM.sidebar = function (selector) {
.removeClass("active");
if (current === pane) {
if ($("html").attr("dir") === "rtl") {
map.panBy([-paneWidth, 0], { animate: false });
}
$(sidebar).hide();
current = currentButton = $();
} else {
$(sidebar).show();
current = pane;
currentButton = button || $();
if ($("html").attr("dir") === "rtl") {
map.panBy([paneWidth, 0], { animate: false });
}
}
map.invalidateSize({ pan: false, animate: false });

View file

@ -242,6 +242,95 @@ body.compact-nav {
}
}
body.small-nav {
#menu-icon {
display: inline-block !important;
}
nav.primary,
nav.secondary {
float: none !important;
position: relative;
display: block;
clear: both;
}
header {
height: auto;
min-height: $headerHeight;
background: #fff;
&.closed nav {
display: none;
}
.search_forms {
display: block;
}
}
#sidebar .search_forms,
#edit_tab,
#export_tab {
display: none;
}
nav.primary {
padding: 0;
ul, li {
border: none;
border-radius: 0;
width: 100%;
}
ul {
border-top: 1px solid #eee;
li {
border-bottom: 1px solid #eee;
border-right: none;
> a {
border-radius: 0;
width: 100%;
text-align: center;
font-size: 15px;
}
}
}
.btn-group {
width: 100%;
padding: 10px;
}
}
nav.secondary {
.user-menu {
width: 100%;
}
}
#compact-secondary-nav {
display: none;
}
.compact-hide {
display: inline-block;
}
.overlay-sidebar #sidebar .welcome.visible {
display: none;
}
.overlay-sidebar #sidebar #banner {
display: none;
}
.leaflet-top.leaflet-right {
top: 10px !important;
}
}
/* Utility for styling notification numbers */
.count-number {
@ -421,21 +510,35 @@ body.compact-nav {
border-bottom: 1px solid $grey;
padding: 10px 20px;
}
}
}
a.close-button {
float: right;
padding:5px;
font-size:20px;
line-height:10px;
color:#222;
border:1px solid $grey;
@include media-breakpoint-down(md) {
body.map-layout {
#sidebar, #map {
position: relative;
overflow-x: hidden;
width: 100%;
height: 50%;
}
.tooltip {
opacity: 1;
border: 1px solid $grey;
.tooltip-arrow {
border-top-color: $grey;
#map-ui {
z-index: 9999;
width: 100%;
height: 50%;
overflow-y: scroll;
}
.overlay-sidebar {
#sidebar {
position: absolute;
width: 350px;
height: auto;
overflow: hidden;
}
#map, #map-ui {
height: 100%;
}
}
}
@ -1025,7 +1128,7 @@ tr.turn:hover {
min-width: 200px;
p {
padding: 0 0 5px 0;
margin-top: 0 0 0 60px;
margin: 0 0 0 60px;
font-size: 12px;
}
}
@ -1138,16 +1241,6 @@ tr.turn:hover {
display: inline !important;
}
/* Rules for the oauth settings page */
.oauth_clients .buttons .oauth-edit {
border-radius: 2px 0 0 2px;
}
.oauth_clients .buttons .oauth-delete {
border-radius: 0 2px 2px 0;
}
/* Rules for the oauth authorization page */
.oauth-authorize ul {
@ -1309,7 +1402,7 @@ abbr.geo {
border-bottom: none;
}
/* General styles for action lists / subnavs / pager navs */
/* General styles for action lists / subnavs */
nav.secondary-actions {
@ -1322,10 +1415,6 @@ nav.secondary-actions {
margin-bottom: 0;
margin-left: -1px;
padding: 0;
&.pager {
display: inline-block;
margin-right: 60px;
}
> li {
flex-basis: auto;
list-style: none;
@ -1342,60 +1431,6 @@ div.secondary-actions {
text-align: center;
}
.buttons {
min-width: 200px;
input[type="submit"],
input[type="button"],
input[type="reset"],
.button,
.button_to {
box-sizing: border-box;
float: left;
border-radius: 0;
margin:0;
min-width: 75px;
max-width: 180px;
border-right:1px solid white;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
input:first-child,
.button:first-child,
.button_to:first-child {
border-radius:2px 0 0 2px;
}
input:last-child,
.button:last-child,
.button_to:last-child {
border-radius:0 2px 2px 0;
border-right-width: 0;
}
input:only-child,
.button:only-child,
.button_to:only-child,
*[value="Hide"] + input:last-child,
*[value="Hide"] + .button:last-child,
*[value="Hide"] + .button_to:last-child {
border-radius:2px;
border-right-width: 0;
}
/* if a 3-button set has a hidden middle button */
*[value="Hide"] + input:nth-child(3),
*[value="Hide"] + .button:nth-child(3),
*[value="Hide"] + .button_to:nth-child(3) {
border-radius:0 2px 2px 0;
border-right-width: 0;
}
/* if a 3-button set starts with a hidden button */
*[value="Hide"] + input:nth-child(2):not(:last-child),
*[value="Hide"] + .button:nth-child(2):not(:last-child),
*[value="Hide"] + .button_to:nth-child(2):not(:last-child) {
border-radius:2px 0 0 2px;
border-right-width: 1px;
}
}
/* Create a single-line dl */
dl.dl-inline {
@ -1472,15 +1507,6 @@ dl.dl-inline {
display: block;
}
.icon-list {
padding-bottom: 20px;
div {
margin-bottom: 10px;
p {
padding-top: 10px;
}
}
}
.sprite.small {
width: 50px;
height: 50px;
@ -1527,10 +1553,6 @@ dl.dl-inline {
.site-about #content {
background-color: $lightgrey;
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
.content-inner {
max-width: 760px;
@ -1568,8 +1590,6 @@ dl.dl-inline {
.icon {
width: 30px;
height: 30px;
margin-right: 10px;
vertical-align: middle;
background: 40px 40px image-url('about/sprite.png') no-repeat;
&.local {
@ -1600,9 +1620,3 @@ dl.dl-inline {
}
@import 'browse';
@media only screen and (max-width:960px) {
.header-illustration.new-user-arm {
display: none;
}
}

View file

@ -1,4 +1,3 @@
/*
*= require ltr/common
*= require ltr/small
*/

View file

@ -1,4 +1,3 @@
/*
*= require rtl/common
*= require rtl/small
*/

View file

@ -1,122 +0,0 @@
@import "parameters";
/* Styles specific to a small screen, such as iPhone, Android, etc... */
body.small-nav {
#menu-icon {
display: inline-block !important;
}
nav.primary,
nav.secondary {
float: none !important;
position: relative;
display: block;
clear: both;
}
header {
height: auto;
min-height: $headerHeight;
background: #fff;
&.closed nav {
display: none;
}
.search_forms {
display: block;
}
}
#sidebar .search_forms,
#edit_tab,
#export_tab {
display: none;
}
nav.primary {
padding: 0;
ul, li {
border: none;
border-radius: 0;
width: 100%;
}
ul {
border-top: 1px solid #eee;
li {
border-bottom: 1px solid #eee;
border-right: none;
> a {
border-radius: 0;
width: 100%;
text-align: center;
font-size: 15px;
}
}
}
.btn-group {
width: 100%;
padding: 10px;
}
}
nav.secondary {
.user-menu {
width: 100%;
}
}
#compact-secondary-nav {
display: none;
}
.compact-hide {
display: inline-block;
}
.overlay-sidebar #sidebar .welcome.visible {
display: none;
}
.overlay-sidebar #sidebar #banner {
display: none;
}
.leaflet-top.leaflet-right {
top: 10px !important;
}
}
@media (max-width: 767.98px) {
body.map-layout {
#sidebar, #map {
position: relative;
overflow-x: hidden;
width: 100%;
height: 50%;
}
.overlay-sidebar {
#sidebar {
position: absolute;
width: 350px;
height: auto;
overflow: hidden;
}
#map {
height: 100%;
}
}
#map-ui {
z-index: 9999;
width: 100%;
overflow-y: scroll;
}
}
}