add fullscreen for route_mgmt

This commit is contained in:
Zhora Shalyapin 2025-03-10 10:11:55 +00:00
parent af84552e32
commit 0408afd554

524
main.js
View File

@ -4,7 +4,7 @@
// @version 2024-11-18 // @version 2024-11-18
// @desc try to take over the world! // @desc try to take over the world!
// @author You // @author You
// @match https://rst.runcity.org/*/cp_mgmt* // @match https://rst.runcity.org/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=runcity.org // @icon https://www.google.com/s2/favicons?sz=64&domain=runcity.org
// @grant none // @grant none
// @require https://code.jquery.com/jquery-3.7.1.min.js // @require https://code.jquery.com/jquery-3.7.1.min.js
@ -758,10 +758,12 @@
function addFullscreenButton() { function addFullscreenButton() {
$(async () => { $(async () => {
while (L.Control.Fullscreen === undefined) { if (document.querySelector("#map") !== null) {
await sleep(500) while (L.Control.Fullscreen === undefined) {
await sleep(500)
}
map.addControl(new L.Control.Fullscreen())
} }
map.addControl(new L.Control.Fullscreen())
}) })
} }
@ -776,325 +778,325 @@
#content-wrapper { #content-wrapper {
display: flex; display: flex;
gap: 20px; gap: 20px;
}
#props { #props {
width: unset !important; width: unset !important;
} }
#content-wrapper form { form {
width: 50%; width: 50%;
} }
#content-wrapper #map-wrapper { #map-wrapper {
width: 50%; width: 50%;
} }
#content-wrapper #map { #map {
width: unset !important; width: unset !important;
} }
#new { #new {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
}
#new > :not(:first-child) { & > :not(:first-child) {
padding-top: 5px; padding-top: 5px;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
} }
#new > :not(:last-child) { & > :not(:last-child) {
padding-bottom: 5px; padding-bottom: 5px;
} }
#cps_main { .map-icon {
width: 150px; width: 15px;
} height: 15px;
}
#new .map-icon { .copy-button {
width: 15px; all: unset;
height: 15px; cursor: pointer;
} }
#new .copy-button { .copy-button img {
all: unset; width: 15px;
cursor: pointer; heigth: 15px;
} }
#new .copy-button img { input[type=radio], input[type=checkbox] {
width: 15px; margin: 0;
heigth: 15px; }
}
input[type=submit] { input[type="file"] {
width: fit-content; display: none;
} }
.desc-icon-container { div > input[type="checkbox"] {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.desc-icon { input#cp_number {
width: 15px; width: 3em;
height: 15px; }
cursor: help;
}
button, input[type=submit] { select#cps_main {
cursor: pointer; width: 6em;
} }
#new input[type=radio], input[type=checkbox] { input:is(#lat, #lng) {
margin: 0; width: 5.5em;
} }
#new input[type="file"] { input[name="cp[name_int]"] {
display: none; width: 34em;
} }
}
#new div > input[type="checkbox"] { #cps_main {
display: flex; width: 150px;
align-items: center; }
}
.buttons-row__content-wrapper { input[type=submit] {
display: flex; width: fit-content;
justify-content: center; }
gap: 10px;
font-weight: normal;
}
#new input#cp_number { .desc-icon-container {
width: 3em; display: flex;
} align-items: center;
}
#new select#cps_main { .desc-icon {
width: 6em; width: 15px;
} height: 15px;
cursor: help;
}
#new input:is(#lat, #lng) { button, input[type=submit] {
width: 5.5em; cursor: pointer;
} }
#new input[name="cp[name_int]"] { .buttons-row__content-wrapper {
width: 34em; display: flex;
} justify-content: center;
gap: 10px;
font-weight: normal;
}
.custom-file-upload { .custom-file-upload {
display: block; display: block;
width: fit-content; width: fit-content;
border: 1px solid black; border: 1px solid black;
padding: 5px 14px; padding: 5px 14px;
border-radius: 5px; border-radius: 5px;
box-shadow: 0 1px 3px #ddd; box-shadow: 0 1px 3px #ddd;
background: linear-gradient(white, #ddd); background: linear-gradient(white, #ddd);
} }
.buttons > * > * { .buttons > * > * {
display: flex; display: flex;
gap: 10px; gap: 10px;
} }
.always-prettify-container { .always-prettify-container {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 5px; gap: 5px;
} }
.header > * { .header > * {
display: flex; display: flex;
gap: 5px; gap: 5px;
} }
:is(.header, .options) input { :is(.header, .options) input {
width: unset; width: unset;
} }
.header { .header {
display: flex; display: flex;
gap: 30px; gap: 30px;
align-items: start; align-items: start;
} }
.options { .options {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 10px; gap: 10px;
} }
.options > * { .options > * {
display: flex; display: flex;
gap: 5px; gap: 5px;
align-items: center; align-items: center;
} }
.legend-container { .legend-container {
display: flex; display: flex;
} }
.legend-container > :not(:last-child) { .legend-container > :not(:last-child) {
padding-right: 15px; padding-right: 15px;
border-right: 1px solid #ddd; border-right: 1px solid #ddd;
} }
.legend-container > :not(:first-child) { .legend-container > :not(:first-child) {
padding-left: 15px; padding-left: 15px;
} }
.legend-container > * { .legend-container > * {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: 0 1 48%; flex: 0 1 48%;
gap: 5px; gap: 5px;
} }
.legend-container__desc-header { .legend-container__desc-header {
display: flex; display: flex;
gap: 10px; gap: 10px;
align-items: center; align-items: center;
justify-content: end; justify-content: end;
} }
.legend-desc { .legend-desc {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 5px; gap: 5px;
} }
.collapsed, .hidden { .collapsed, .hidden {
display: none; display: none;
} }
.collapse-button::after { .collapse-button::after {
content: "Свернуть" content: "Свернуть"
} }
.collapsed + * > .collapse-button::after { .collapsed + * > .collapse-button::after {
content: "Развернуть" content: "Развернуть"
} }
:is(.comment, .legend-desc) > * { :is(.comment, .legend-desc) > * {
display: flex; display: flex;
gap: 5px; gap: 5px;
} }
:is(.comment, .legend-desc) label { :is(.comment, .legend-desc) label {
display: block; display: block;
width: 10em; width: 10em;
} }
:is(.comment, .legend-desc) > * > :nth-child(2) { :is(.comment, .legend-desc) > * > :nth-child(2) {
flex: 1 1 auto; flex: 1 1 auto;
} }
textarea { textarea {
width: 100%; width: 100%;
} }
.files-container input[type=radio] { .files-container input[type=radio] {
display: none; display: none;
} }
.file-list-container { .file-list-container {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 10px; gap: 10px;
margin-top: 5px; margin-top: 5px;
} }
.file-container { .file-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 5px; gap: 5px;
} }
.file-container img.preview { .file-container img.preview {
width: 120px; width: 120px;
} }
.file-container img.preview-small { .file-container img.preview-small {
width: 60px; width: 60px;
} }
.file-container img:is(.preview, .preview-small) { .file-container img:is(.preview, .preview-small) {
cursor: zoom-in; cursor: zoom-in;
} }
dialog .preview, dialog .preview,
.swiper { .swiper {
max-width: 1000px; max-width: 1000px;
width: 100%; width: 100%;
max-height: 500px; max-height: 500px;
height: 100%; height: 100%;
} }
.swiper-button-next, .swiper-button-next,
.swiper-button-prev { .swiper-button-prev {
user-select: none; user-select: none;
-webkit-user-select: none; -webkit-user-select: none;
} }
.swiper-wrapper { .swiper-wrapper {
align-items: center; align-items: center;
} }
.swiper-wrapper > .swiper-slide { .swiper-wrapper > .swiper-slide {
width: 100%; width: 100%;
max-height: 500px; max-height: 500px;
height: 100%; height: 100%;
} }
.swiper-slide img { .swiper-slide img {
width: 100%; width: 100%;
max-height: 500px; max-height: 500px;
height: 100%; height: 100%;
object-fit: contain; object-fit: contain;
object-position: center; object-position: center;
} }
.swiper-download-link { .swiper-download-link {
display: block; display: block;
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
background: white; background: white;
padding: 5px 10px; padding: 5px 10px;
margin: 5px; margin: 5px;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 7.5px; border-radius: 7.5px;
} }
button.button-delete { button.button-delete {
padding: 0; padding: 0;
border: 0; border: 0;
margin: 0; margin: 0;
background: none; background: none;
font-size: 18px; font-size: 18px;
} }
.admin-files-container { .admin-files-container {
display: flex; display: flex;
} }
.admin-files-container > :not(:last-child) { .admin-files-container > :not(:last-child) {
padding-right: 10px; padding-right: 10px;
border-right: 1px solid #ddd; border-right: 1px solid #ddd;
} }
.admin-files-container > :not(:first-child) { .admin-files-container > :not(:first-child) {
padding-left: 10px; padding-left: 10px;
} }
dialog img.preview { dialog img.preview {
width: auto; width: auto;
} }
.file-buttons-container { .file-buttons-container {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 5px; gap: 5px;
}
} }
` `