From 63b75fe5fc6b57668d305290e41eb326186a8e7d Mon Sep 17 00:00:00 2001 From: azett Date: Wed, 29 Jun 2022 20:54:29 +0200 Subject: [PATCH 1/4] fixes #122 --- .../res/photoswipe-4.1.1/photoswipe.css | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css b/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css index b1f7109..26d9e3f 100644 --- a/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css +++ b/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css @@ -186,37 +186,41 @@ background: transparent url(../img/play.png) no-repeat scroll 16px 14px !importa background-image: url(../img/stop.png) !important; } +div.photoswipe { +} div.photoswipe figure { + display:inline-block; + margin:.5em 1em 0 0; +} +div.photoswipe figure img { + margin: 0 !important; +} +div.photoswipe figcaption { text-align:center; } + div.photoswipe figure.floatleft { float:left; margin:0 1em 1em 0; } +div.photoswipe figure.floatleft img.floatleft { + float:none; +} div.photoswipe figure.floatright { float:right; margin:0 0 1em 1em; } - +div.photoswipe figure.floatright img.floatright { + float:none; +} .img-gallery div.photoswipe figure { display:inline-block; width:140px; vertical-align: top; + text-align:center; margin:.5em 1em 0 0; } -div.photoswipe figure figcaption { - width:200px; -} -.img-gallery div.photoswipe figure figcaption { - width:140px; -} -div.photoswipe figure.nofloat figcaption { - width:inherit; -} -div.photoswipe figure img { - margin: 0 0 .5em 0; -} button.pswp__button--share { display:none; @@ -229,14 +233,5 @@ div.img-gallery div.photoswipe display: inline; } -/* -Fixes FP standard behaviour: If no float attribute is given, the image will get float attribute "center" -*/ -figure.nofloat, -figure.nofloat figcaption, -figure.nofloat img.center { - display:inline-block; - text-align:left !important; -} .pswp__img { margin: 0px !important; } \ No newline at end of file From 97fdec44ff799204813de569c50b5f45b6329276 Mon Sep 17 00:00:00 2001 From: azett Date: Thu, 30 Jun 2022 20:26:01 +0200 Subject: [PATCH 2/4] Fixed gallery output, also fixes #127 --- .../photoswipe/photoswipefunctions.class.php | 24 ++++++++++++------- .../res/photoswipe-4.1.1/photoswipe.css | 9 ++++--- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/fp-plugins/photoswipe/photoswipefunctions.class.php b/fp-plugins/photoswipe/photoswipefunctions.class.php index 5bd4410..ab9fc6f 100644 --- a/fp-plugins/photoswipe/photoswipefunctions.class.php +++ b/fp-plugins/photoswipe/photoswipefunctions.class.php @@ -58,10 +58,10 @@ class PhotoSwipeFunctions { // for usage in HTML attributes, we need to remove quotes and HTML tags from the title $titleForAttributes = isset($attr ['title']) ? htmlentities(strip_tags($attr ['title'])) : ''; - // image may float, according the the given float attribute - $float = ' class="thumbnail nofloat" '; + // image may float, according the the given float attribute - if not given, use "nofloat" class + $floatClasses = 'thumbnail nofloat'; if (isset($attr ['float'])) { - $float = ' class="thumbnail float' . $attr ['float'] . '"'; + $floatClasses = 'float' . $attr ['float']; } // to get the HTML code for preview image, we use the Flatpress standard function do_bbcode_img() @@ -78,28 +78,34 @@ class PhotoSwipeFunctions { $previewHtml .= ' itemprop="thumbnail" title="' . $titleForAttributes . '">'; // PhotoSwipe needs to know the dimensions of the image - so we read them - $imgsize = getimagesize($imgPathRel); + $imgsize = @getimagesize($imgPathRel); + $datasizeAttr = ($imgsize === false) ? '' : 'data-size="' . $imgsize [0] . 'x' . $imgsize [1] . '" '; + + // set max width of the figure according to the width attribute + $styleAttr = isset($attr ['width']) ? ' style="width:' . $attr ['width'] . 'px" ' : ''; // now lets assemble the whole HTML code - including the overlay HTML, if not inserted into the DOM before $imgHtml = self::getPhotoSwipeOverlay() . // - '
-
' . // + '
' . // '' . // $previewHtml . // '' . // - '
' . $title . '
' . // + '' . $title . '' . // '
' . // '
'; diff --git a/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css b/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css index 26d9e3f..d2df090 100644 --- a/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css +++ b/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css @@ -199,23 +199,22 @@ div.photoswipe figcaption { text-align:center; } -div.photoswipe figure.floatleft { +div.floatleft { float:left; margin:0 1em 1em 0; } -div.photoswipe figure.floatleft img.floatleft { +div.floatleft img.floatleft { float:none; } -div.photoswipe figure.floatright { +div.floatright { float:right; margin:0 0 1em 1em; } -div.photoswipe figure.floatright img.floatright { +div.floatright img.floatright { float:none; } .img-gallery div.photoswipe figure { display:inline-block; - width:140px; vertical-align: top; text-align:center; margin:.5em 1em 0 0; From e656213fe49fe5791378fe04cab496c9348a00f9 Mon Sep 17 00:00:00 2001 From: azett Date: Thu, 30 Jun 2022 20:27:46 +0200 Subject: [PATCH 3/4] Set Leggero v2 as default style of the Leggero Theme --- fp-interface/themes/leggero/theme.conf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fp-interface/themes/leggero/theme.conf.php b/fp-interface/themes/leggero/theme.conf.php index 6e2af6d..4c5bc5b 100755 --- a/fp-interface/themes/leggero/theme.conf.php +++ b/fp-interface/themes/leggero/theme.conf.php @@ -17,7 +17,7 @@ $theme ['version'] = 0.705; $theme ['style_def'] = 'style.css'; $theme ['style_admin'] = 'admin.css'; -$theme ['default_style'] = 'leggero'; +$theme ['default_style'] = 'leggero-v2'; // Other theme settings From f30fc6204a6bc7643d7952b1df98a3aa7b462dea Mon Sep 17 00:00:00 2001 From: azett Date: Fri, 1 Jul 2022 18:47:05 +0200 Subject: [PATCH 4/4] fixes #129: captions not centered --- fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css b/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css index d2df090..af2a638 100644 --- a/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css +++ b/fp-plugins/photoswipe/res/photoswipe-4.1.1/photoswipe.css @@ -233,4 +233,10 @@ div.img-gallery div.photoswipe } -.pswp__img { margin: 0px !important; } \ No newline at end of file +.pswp__img { margin: 0px !important; } + +.pswp__caption__center { + text-align: center; + margin: 0 auto; + max-width:90%; +} \ No newline at end of file