Hibajavítások
escapeHtml, color parsing, képnéző betöltés/megjelenítés
This commit is contained in:
parent
5a46f394f0
commit
402f21e5c6
18
approve.php
18
approve.php
@ -176,6 +176,16 @@ if ($logged_in) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// html-be biztonságosan beilleszthető string gyártása
|
||||||
|
// https://stackoverflow.com/a/6234804
|
||||||
|
function escapeHtml(unsafe) {
|
||||||
|
return unsafe
|
||||||
|
.replace(/&/g, "&")
|
||||||
|
.replace(/</g, "<")
|
||||||
|
.replace(/>/g, ">")
|
||||||
|
.replace(/"/g, """)
|
||||||
|
.replace(/'/g, "'");
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
const MAX_TABLE_ROWS = 10;
|
const MAX_TABLE_ROWS = 10;
|
||||||
@ -224,10 +234,10 @@ if ($logged_in) {
|
|||||||
<img src="ARTWORKS/thumbnails/${image_data["Image_FileName"]}" style="vertical-align: top" />
|
<img src="ARTWORKS/thumbnails/${image_data["Image_FileName"]}" style="vertical-align: top" />
|
||||||
<section style="display: inline-block; margin-left: 1em;">
|
<section style="display: inline-block; margin-left: 1em;">
|
||||||
<section style="display: block">
|
<section style="display: block">
|
||||||
<span class="label">Alkotó:</span><span class="fill-in-content" style="margin-right: 0.5em;"><input type="text" class="f-author-c" name="f_author" value="${image_data["Author"]}">,</span>
|
<span class="label">Alkotó:</span><span class="fill-in-content" style="margin-right: 0.5em;"><input type="text" class="f-author-c" name="f_author" value="${escapeHtml(image_data["Author"])}">,</span>
|
||||||
<span class="label">Csoport:</span><input type="text" class="f-author-group-c" name="f_author_group" value="${image_data["AuthorGroup"]}"></span><br />
|
<span class="label">Csoport:</span><input type="text" class="f-author-group-c" name="f_author_group" value="${escapeHtml(image_data["AuthorGroup"])}"></span><br />
|
||||||
<span class="label">Cím:</span><span class="fill-in-content"><input type="text" class="f-title-c" name="f_title" value="${image_data["Title"]}"></span><br />
|
<span class="label">Cím:</span><span class="fill-in-content"><input type="text" class="f-title-c" name="f_title" value="${escapeHtml(image_data["Title"])}"></span><br />
|
||||||
<span class="label">Leírás:</span><span class="fill-in-content"><textarea placeholder="(nincs)" class="f-desc-c" style="vertical-align: baseline;" name="f_details">${image_data["Description"]}</textarea></span><br />
|
<span class="label">Leírás:</span><span class="fill-in-content"><textarea placeholder="(nincs)" class="f-desc-c" style="vertical-align: baseline;" name="f_details">${escapeHtml(image_data["Description"])}</textarea></span><br />
|
||||||
<span class="label">Feltöltés ideje:</span><span class="fill-in-content">${image_data["TS"]}</span><br />
|
<span class="label">Feltöltés ideje:</span><span class="fill-in-content">${image_data["TS"]}</span><br />
|
||||||
</section>
|
</section>
|
||||||
<section style="display: block; margin-top: 1em;">
|
<section style="display: block; margin-top: 1em;">
|
||||||
|
@ -55,7 +55,7 @@ class Color {
|
|||||||
this.g = Number(components[1]);
|
this.g = Number(components[1]);
|
||||||
this.b = Number(components[2]);
|
this.b = Number(components[2]);
|
||||||
|
|
||||||
if (components.length <= 4) {
|
if (components.length >= 4) {
|
||||||
this.a = Number(components[3]);
|
this.a = Number(components[3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -564,7 +564,7 @@ function init_viewer() {
|
|||||||
|
|
||||||
// betöltéskor a felirat megjelenítése
|
// betöltéskor a felirat megjelenítése
|
||||||
img.addEventListener("load", (e) => {
|
img.addEventListener("load", (e) => {
|
||||||
img.style.opacity = "1";
|
img.classList.remove("loading");
|
||||||
place_artcaptions();
|
place_artcaptions();
|
||||||
show(caption_sect);
|
show(caption_sect);
|
||||||
hide("viewerloadanim");
|
hide("viewerloadanim");
|
||||||
@ -679,7 +679,7 @@ var group_logo_repository = "https://mkkozi.hu/user/plugins/mkk-groups/logos";
|
|||||||
// képnézegető megynitása
|
// képnézegető megynitása
|
||||||
function open_viewer(details) {
|
function open_viewer(details) {
|
||||||
let img = o("viewerimg");
|
let img = o("viewerimg");
|
||||||
img.style.opacity = "0";
|
img.classList.add("loading");
|
||||||
img.style.left = img.style.top = "0px";
|
img.style.left = img.style.top = "0px";
|
||||||
img.src = "ARTWORKS/published/" + details.Image_FileName;
|
img.src = "ARTWORKS/published/" + details.Image_FileName;
|
||||||
|
|
||||||
@ -719,6 +719,10 @@ function close_viewer() {
|
|||||||
hide("viewersect");
|
hide("viewersect");
|
||||||
hide("artcaptions");
|
hide("artcaptions");
|
||||||
|
|
||||||
|
// kép eltávolítása
|
||||||
|
let img = o("viewerimg");
|
||||||
|
img.src = "";
|
||||||
|
|
||||||
viewer_open = false;
|
viewer_open = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
7
phw.css
7
phw.css
@ -267,7 +267,12 @@ img.viewer {
|
|||||||
z-index: 3000;
|
z-index: 3000;
|
||||||
cursor: grab;
|
cursor: grab;
|
||||||
|
|
||||||
transition: opacity, transform 0.3s ease;
|
transition: opacity 0.3s, transform 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
img.viewer.loading {
|
||||||
|
transition: opacity 0s;
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 600px) {
|
@media only screen and (max-width: 600px) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user