Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions serendipity_event_lightbox/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
3.1.0:
* Improve page loading times by using minified photoswipe files and
defer loading them

3.0.0:
* Add PhotoSwipe as (new default) lightbox option, for a nicer
looking lightbox that allows swiping through galleries (thanks to
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions serendipity_event_lightbox/photoswipe/photoswipe.esm.min.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions serendipity_event_lightbox/serendipity_event_lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function introspect(&$propbag)
$propbag->add('name', PLUGIN_EVENT_LIGHTBOX_NAME);
$propbag->add('description', PLUGIN_EVENT_LIGHTBOX_DESC);
$propbag->add('author', 'Thomas Nesges, Andy Hopkins, Lokesh Dhakar, Cody Lindley, Stephan Manske, Grischa Brockhaus, Ian, Jeremy Glastetter');
$propbag->add('version', '3.0.0');
$propbag->add('version', '3.1.0');
$propbag->add('requirements', array(
'serendipity' => '2.0',
'php' => '5.3.0'
Expand Down Expand Up @@ -169,7 +169,7 @@ function event_hook($event, &$bag, &$eventData, $addData = null)

if ($type == 'photoswipe') {
if (isset($headcss) && $headcss) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/photoswipe/photoswipe.css" />' . "\n";
echo ' <link rel="stylesheet" href="' . $pluginDir . '/photoswipe/photoswipe.css" media="print" onload="this.media=\'all\'">' . "\n";
echo ' <style type="text/css">
.pswp { --pswp-icon-color: #fff; }
/* NEW: Prevent stretching, add corners, and force high-res visibility */
Expand Down Expand Up @@ -200,9 +200,9 @@ function event_hook($event, &$bag, &$eventData, $addData = null)
} else {
echo '
<script type="module">
import PhotoSwipeLightbox from "' . $pluginDir . '/photoswipe/photoswipe-lightbox.esm.js";
import PhotoSwipe from "' . $pluginDir . '/photoswipe/photoswipe.esm.js";
import PhotoSwipeLightbox from "' . $pluginDir . '/photoswipe/photoswipe-lightbox.esm.min.js";

document.addEventListener("DOMContentLoaded", () => {
const lightbox = new PhotoSwipeLightbox({';
switch ($navigate) {
case 'page':
Expand All @@ -221,7 +221,7 @@ function event_hook($event, &$bag, &$eventData, $addData = null)
echo $init_js;
}
echo '
pswpModule: PhotoSwipe,
pswpModule: () => import("' . $pluginDir . '/photoswipe/photoswipe.esm.min.js"),
// NEW: Extra bottom padding to keep image clear of the caption bar
padding: { top: 20, bottom: 100, left: 20, right: 20 }
});
Expand Down Expand Up @@ -272,6 +272,7 @@ function event_hook($event, &$bag, &$eventData, $addData = null)
});
});
lightbox.init();
});
</script>' . "\n";
}
}
Expand Down