v.1.0.4: Support for upcoming imagegrid

pull/1335/head
Grischa Brockhaus 2022-12-14 18:58:00 +01:00
parent d1d3c73d25
commit 98dd4b537c
2 changed files with 2 additions and 4 deletions

View File

@ -2,8 +2,6 @@ MODULE=fancybox
cd .. cd ..
# read actual version from module.json
# old releases not needed anymore # old releases not needed anymore
mkdir -p $MODULE/dist mkdir -p $MODULE/dist
rm $MODULE/dist/* rm $MODULE/dist/*

View File

@ -2,7 +2,7 @@
/** /**
* Name: Fancybox * Name: Fancybox
* Description: Open media attachments of posts into a fancybox overlay. * Description: Open media attachments of posts into a fancybox overlay.
* Version: 1.03 * Version: 1.04
* Author: Grischa Brockhaus <grischa@brockha.us> * Author: Grischa Brockhaus <grischa@brockha.us>
*/ */
@ -47,7 +47,7 @@ function fancybox_render(App $a, array &$b){
// Local content images attached: // Local content images attached:
$text = preg_replace_callback( $text = preg_replace_callback(
'#<div class="body-attach">.*?</div>#s', '#<div class="(body-attach|imagegrid-column)">.*?</div>#s',
function ($matches) use ($gallery) { function ($matches) use ($gallery) {
return str_replace('<a href', '<a data-fancybox="' . $gallery . '" href', $matches[0]); return str_replace('<a href', '<a data-fancybox="' . $gallery . '" href', $matches[0]);
}, },