Add a more robust bugfix for lightboxes in WebKit browsers

- Add a more robust CSS bugfix to fixchrome.css
- Add a switch to only emit fixchrome.css in s9y < 2.1

References s9y/Serendipity#388
This commit is contained in:
Matthias Mees 2016-02-04 18:02:19 +01:00
parent cfe0394cbe
commit b6b0ccb4b6
3 changed files with 19 additions and 16 deletions

View file

@ -1,3 +1,9 @@
2.3.0:
* add a more robust bugfix for WebKit browsers
* only emit fixchrome.css in s9y < 2.1; starting with 2.1, the
required styles will be part of style_fallback.css
------------------------------------------------------------------------
2.2.0:
* lightbox2-jquery update v.2.8.2
* magnific-popup update v.1.0.1

View file

@ -1,13 +1,4 @@
/* on Safari and Chrome */
@media screen and (-webkit-min-device-pixel-ratio:0)
{
/* allows floated images to display in lightbox without need to disable the float */
.serendipity_image_link:before {
content: '';
display: inline-block;
}
/* same for centered images */
.serendipity_image_center {
display: block;
}
/* Fix for Safari and Chrome */
.serendipity_image_link {
display: block;
}

View file

@ -28,7 +28,7 @@ class serendipity_event_lightbox extends serendipity_event {
$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');
$propbag->add('version', '2.2.0');
$propbag->add('version', '2.3.0');
$propbag->add('requirements', array(
'serendipity' => '1.6',
'php' => '5.3.0'
@ -196,7 +196,9 @@ class serendipity_event_lightbox extends serendipity_event {
// ColorBox code (https://github.com/jackmoore/colorbox) - init with :visible to ensure to not show hidden elements via hideafter function in imageselectorplus ranges
if ($type == 'colorbox') {
if ($headcss) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/fixchrome.css" />' . "\n";
if (version_compare($serendipity['version'], '2.0.99', '<')) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/fixchrome.css" />' . "\n";
}
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/colorbox/colorboxScreens.css" />' . "\n";
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/colorbox/colorbox.css" />' . "\n";
} else {
@ -223,7 +225,9 @@ class serendipity_event_lightbox extends serendipity_event {
// Magnific-Popup code (https://github.com/dimsemenov/Magnific-Popup) - init with :visible to ensure to not show hidden elements via hideafter function in imageselectorplus ranges
elseif ($type == 'magnific') {
if ($headcss) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/fixchrome.css" />' . "\n";
if (version_compare($serendipity['version'], '2.0.99', '<')) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/fixchrome.css" />' . "\n";
}
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/magnific-popup/magnific-popup.css" />' . "\n";
} else {
if (!class_exists('serendipity_event_jquery') && !$serendipity['capabilities']['jquery']) {
@ -236,7 +240,9 @@ class serendipity_event_lightbox extends serendipity_event {
// PrettyPhoto code - http://www.no-margin-for-errors.com/projects/prettyPhoto/ - init with :visible to ensure to not show hidden elements via hideafter function in imageselectorplus ranges
elseif ($type == 'prettyPhoto') {
if ($headcss) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/fixchrome.css" />' . "\n";
if (version_compare($serendipity['version'], '2.0.99', '<')) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/fixchrome.css" />' . "\n";
}
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/prettyphoto/css/prettyPhoto.css" />' . "\n";
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/prettyphoto/css/prettyPhotoScreens.css" />' . "\n";
} else {