patched fotoswipe to use searchParams instead of the wrong and stupid hash

This commit is contained in:
2025-08-18 23:04:58 +02:00
parent b4badfbd15
commit b249ae9d46
7 changed files with 3852 additions and 219 deletions

View File

@@ -35,8 +35,7 @@
transition: opacity 0.2s;
-webkit-box-shadow: none;
box-shadow: none; }
.pswp__button:focus,
.pswp__button:hover {
.pswp__button:focus, .pswp__button:hover {
opacity: 1; }
.pswp__button:active {
outline: none;
@@ -272,14 +271,13 @@ a.pswp__share--download:hover {
color: #BBB; }
.pswp__caption__center {
text-align: center;
text-align: left;
max-width: 420px;
margin: 0 auto;
font-size: 13px;
padding: 10px;
line-height: 20px;
color: #CCC;
font-weight: bold; }
color: #CCC; }
.pswp__caption--empty {
display: none; }
@@ -481,4 +479,4 @@ a.pswp__share--download:hover {
display: none !important; }
.pswp--minimal--dark .pswp__top-bar {
background: none; }
background: none; }

View File

@@ -1,131 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="264"
height="88"
viewBox="0 0 264 88"
version="1.1"
id="svg12"
sodipodi:docname="default-skin.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs12" />
<sodipodi:namedview
id="namedview12"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="true"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
showborder="true"
borderlayer="true"
inkscape:zoom="3.0855569"
inkscape:cx="95.606729"
inkscape:cy="65.142212"
inkscape:window-width="1896"
inkscape:window-height="1016"
inkscape:window-x="1932"
inkscape:window-y="52"
inkscape:window-maximized="1"
inkscape:current-layer="g11" />
<title
id="title1">default-skin 2</title>
<g
fill="none"
fill-rule="evenodd"
id="g12">
<g
id="g11">
<g
fill="#fff"
id="g1">
<path
d="M13 29v-5h2v3h3v2h-5zM13 15h5v2h-3v3h-2v-5zM31 15v5h-2v-3h-3v-2h5zM31 29h-5v-2h3v-3h2v5z"
id="path1" />
</g>
<g
fill="#fff"
id="g2">
<path
d="M62 24v5h-2v-3h-3v-2h5zM62 20h-5v-2h3v-3h2v5zM70 20v-5h2v3h3v2h-5zM70 24h5v2h-3v3h-2v-5z"
id="path2" />
</g>
<path
d="M20.586 66l-5.656-5.656 1.414-1.414L22 64.586l5.656-5.656 1.414 1.414L23.414 66l5.656 5.656-1.414 1.414L22 67.414l-5.656 5.656-1.414-1.414L20.586 66z"
fill="#fff"
id="path3" />
<path
d="M111.785 65.03L110 63.5l3-3.5h-10v-2h10l-3-3.5 1.785-1.468L117 59l-5.215 6.03z"
fill="#fff"
id="path4" />
<path
d="M152.215 65.03L154 63.5l-3-3.5h10v-2h-10l3-3.5-1.785-1.468L147 59l5.215 6.03z"
fill="#fff"
id="path5" />
<g
id="g6">
<path
id="Rectangle-11"
fill="#fff"
d="M160.957 28.543l-3.25-3.25-1.413 1.414 3.25 3.25z" />
<path
d="M152.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z"
id="Oval-1"
stroke="#fff"
stroke-width="1.5" />
<path
fill="#fff"
d="M150 21h5v1h-5z"
id="path6" />
</g>
<g
id="g10">
<path
d="M116.957 28.543l-1.414 1.414-3.25-3.25 1.414-1.414 3.25 3.25z"
fill="#fff"
id="path7" />
<path
d="M108.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z"
stroke="#fff"
stroke-width="1.5"
id="path8" />
<path
fill="#fff"
d="M106 21h5v1h-5z"
id="path9" />
<path
fill="#fff"
d="M109.043 19.008l-.085 5-1-.017.085-5z"
id="path10" />
</g>
<g
id="g14">
<path
id="Shape"
style="fill:#ffffff"
d="M 63.708984 57.572266 L 63.708984 66.917969 L 62.773438 66.917969 L 59.173828 66.917969 L 65.089844 72.916016 L 71.173828 66.917969 L 67.40625 66.917969 L 66.640625 66.917969 L 66.640625 57.572266 L 63.708984 57.572266 z " />
<path
id="rect13"
style="fill:#ffffff;stroke:#ffffff;stroke-width:0.649;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
d="m 56.24391,72.078606 v 3.51729 h 17.859837 v -3.51729 h -1.210961 v 2.324677 H 57.456705 v -2.324677 z" />
</g>
</g>
</g>
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:title>default-skin 2</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
</svg>
<svg width="264" height="88" viewBox="0 0 264 88" xmlns="http://www.w3.org/2000/svg"><title>default-skin 2</title><g fill="none" fill-rule="evenodd"><g><path d="M67.002 59.5v3.768c-6.307.84-9.184 5.75-10.002 9.732 2.22-2.83 5.564-5.098 10.002-5.098V71.5L73 65.585 67.002 59.5z" id="Shape" fill="#fff"/><g fill="#fff"><path d="M13 29v-5h2v3h3v2h-5zM13 15h5v2h-3v3h-2v-5zM31 15v5h-2v-3h-3v-2h5zM31 29h-5v-2h3v-3h2v5z" id="Shape"/></g><g fill="#fff"><path d="M62 24v5h-2v-3h-3v-2h5zM62 20h-5v-2h3v-3h2v5zM70 20v-5h2v3h3v2h-5zM70 24h5v2h-3v3h-2v-5z"/></g><path d="M20.586 66l-5.656-5.656 1.414-1.414L22 64.586l5.656-5.656 1.414 1.414L23.414 66l5.656 5.656-1.414 1.414L22 67.414l-5.656 5.656-1.414-1.414L20.586 66z" fill="#fff"/><path d="M111.785 65.03L110 63.5l3-3.5h-10v-2h10l-3-3.5 1.785-1.468L117 59l-5.215 6.03z" fill="#fff"/><path d="M152.215 65.03L154 63.5l-3-3.5h10v-2h-10l3-3.5-1.785-1.468L147 59l5.215 6.03z" fill="#fff"/><g><path id="Rectangle-11" fill="#fff" d="M160.957 28.543l-3.25-3.25-1.413 1.414 3.25 3.25z"/><path d="M152.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" id="Oval-1" stroke="#fff" stroke-width="1.5"/><path fill="#fff" d="M150 21h5v1h-5z"/></g><g><path d="M116.957 28.543l-1.414 1.414-3.25-3.25 1.414-1.414 3.25 3.25z" fill="#fff"/><path d="M108.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" stroke="#fff" stroke-width="1.5"/><path fill="#fff" d="M106 21h5v1h-5z"/><path fill="#fff" d="M109.043 19.008l-.085 5-1-.017.085-5z"/></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because one or more lines are too long

View File

@@ -15,21 +15,14 @@
touch-action: none;
z-index: 1500;
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
/* create separate layer, to avoid paint on window.onscroll in webkit/blink */
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
outline: none;
}
.pswp * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.pswp img {
max-width: none;
}
outline: none; }
.pswp * {
-webkit-box-sizing: border-box;
box-sizing: border-box; }
.pswp img {
max-width: none; }
/* style is added when JS option showHideOpacity is set to true */
.pswp--animate_opacity {
@@ -38,33 +31,28 @@
will-change: opacity;
/* for open/close transition */
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
}
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp--open {
display: block;
}
display: block; }
.pswp--zoom-allowed .pswp__img {
/* autoprefixer: off */
cursor: -webkit-zoom-in;
cursor: -moz-zoom-in;
cursor: zoom-in;
}
cursor: zoom-in; }
.pswp--zoomed-in .pswp__img {
/* autoprefixer: off */
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
cursor: grab; }
.pswp--dragging .pswp__img {
/* autoprefixer: off */
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
cursor: grabbing; }
/*
Background is added as a separate element.
@@ -78,10 +66,10 @@
height: 100%;
background: #000;
opacity: 0;
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
will-change: opacity;
}
will-change: opacity; }
.pswp__scroll-wrap {
position: absolute;
@@ -89,8 +77,7 @@
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
overflow: hidden; }
.pswp__container,
.pswp__zoom-wrap {
@@ -100,8 +87,7 @@
left: 0;
right: 0;
top: 0;
bottom: 0;
}
bottom: 0; }
/* Prevent selection and tap highlights */
.pswp__container,
@@ -109,10 +95,9 @@
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
}
-webkit-touch-callout: none; }
.pswp__zoom-wrap {
position: absolute;
@@ -122,27 +107,22 @@
transform-origin: left top;
/* for open/close transition */
-webkit-transition: -webkit-transform 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1);
}
transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp__bg {
will-change: opacity;
/* for open/close transition */
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
}
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp--animated-in .pswp__bg,
.pswp--animated-in .pswp__zoom-wrap {
-webkit-transition: none;
transition: none;
}
transition: none; }
.pswp__container,
.pswp__zoom-wrap {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
-webkit-backface-visibility: hidden; }
.pswp__item {
position: absolute;
@@ -150,40 +130,34 @@
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
}
overflow: hidden; }
.pswp__img {
position: absolute;
width: auto;
height: auto;
top: 0;
left: 0;
}
left: 0; }
/*
stretched thumbnail or div placeholder element (see below)
style is added to avoid flickering in webkit/blink when layers overlap
*/
.pswp__img--placeholder {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
-webkit-backface-visibility: hidden; }
/*
div element that matches size of large image
large image loads on top of it
*/
.pswp__img--placeholder--blank {
background: #222;
}
background: #222; }
.pswp--ie .pswp__img {
width: 100% !important;
height: auto !important;
left: 0;
top: 0;
}
top: 0; }
/*
Error message appears when image is not loaded
@@ -198,10 +172,8 @@
font-size: 14px;
line-height: 16px;
margin-top: -8px;
color: #CCC;
}
color: #CCC; }
.pswp__error-msg a {
color: #CCC;
text-decoration: underline;
}
text-decoration: underline; }

3788
files/pswp/photoswipe.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -71,6 +71,11 @@ class PhotoGallery {
const content = document.documentElement.innerHTML;
const title = document.title;
const folders = document.querySelector(".folders");
let path = window.location.origin + window.location.pathname;
if (path.startsWith("null")) {
path = window.location.protocol + "//" + path.substring(4);
}
if (folders) folders.style.display = "";
document.getElementById("recursive").checked = false;
document
@@ -79,7 +84,7 @@ class PhotoGallery {
window.history.replaceState(
{ html: content, pageTitle: title },
"",
window.location.origin + window.location.pathname
path
);
this.requestMetadata();
}
@@ -94,22 +99,15 @@ class PhotoGallery {
if (!isChecked) {
if (folders) folders.style.display = "";
loc.searchParams.delete("recursive");
window.history.replaceState(
{ html: content, pageTitle: title },
"",
loc
);
window.history.replaceState({ html: content, pageTitle: title }, "", loc);
this.requestMetadata();
return;
}
if (folders) folders.style.display = "none";
loc.searchParams.append("recursive", true)
window.history.replaceState(
{ html: content, pageTitle: title },
"",
loc
);
loc.searchParams.delete("recursive");
loc.searchParams.append("recursive", true);
window.history.replaceState({ html: content, pageTitle: title }, "", loc);
const visited = new Set();
const existingItems = new Set();
@@ -184,19 +182,20 @@ class PhotoGallery {
} else {
this.filter();
}
const pid = searchParams.get("pid");
if (pid != null) {
this.openSwipe(parseInt(pid));
}
})
.catch(() => {});
}
filter() {
const searchParams = new URLSearchParams(window.location.search);
this.shown = [];
const path = decodeURIComponent(
window.location.origin + window.location.pathname.replace("index.html", "")
let path = decodeURIComponent(
window.location.origin +
window.location.pathname.replace("index.html", "")
);
if (path.startsWith("null")) {
path = window.location.protocol + "//" + path.substring(4);
}
const selectedTags = [];
document
@@ -237,6 +236,11 @@ class PhotoGallery {
}
this.updateImageList();
window.location.hash = urltags;
const pid = searchParams.get("pid") - 1;
if (pid != -1) {
this.openSwipe(pid);
}
}
updateImageList() {