Skip to content

Commit

Permalink
Merge branch 'release/v2.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
iMattPro committed Feb 7, 2020
2 parents 65fe22b + a09560c commit eeee99c
Show file tree
Hide file tree
Showing 19 changed files with 179 additions and 116 deletions.
34 changes: 16 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
language: php
dist: trusty
dist: xenial

matrix:
include:
- php: 5.5
- php: 7.1
env: DB=none;NOTESTS=1
- php: 5.4
env: DB=mysqli #myisam
- php: 5.4
env: DB=mysql
- php: 5.4
- php: 7.1
env: DB=mariadb
- php: 5.4
- php: 7.1
env: DB=postgres
- php: 5.4
- php: 7.1
env: DB=sqlite3
- php: 5.5
env: DB=mysqli
- php: 5.6
env: DB=mysqli
- php: 7.0
env: DB=mysqli
- php: 7.1
env: DB=mysqli
env: DB=mysqli # MyISAM
- php: 7.2
env: DB=mysqli
- php: 7.3
env: DB=mysqli
- php: 7.4snapshot
env: DB=mysqli
- php: nightly
env: DB=mysqli
allow_failures:
Expand All @@ -38,7 +32,7 @@ env:
- SNIFF="1" # Should we run code sniffer on your code?
- IMAGE_ICC="1" # Should we run icc profile sniffer on your images?
- EPV="1" # Should we run EPV (Extension Pre Validator) on your code?
- PHPBB_BRANCH="3.2.x"
- PHPBB_BRANCH="3.3.x"

branches:
only:
Expand All @@ -47,8 +41,12 @@ branches:
- /^develop-.*$/
- /^\d+(\.\d+)?\.x$/

services:
- postgresql
- mysql

install:
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
- travis/prepare-phpbb.sh $PHPBB_BRANCH
- cd ../../phpBB3
- travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Changelog

### 2.0.2 - 2020-01-16

- Updated Lightbox2 library to 2.11.1
- jQuery v3 / phpBB v3.3 compatibility fixes
- Eliminated visible image resizing by setting max-width/height in CSS now instead of JavaScript
- Resized user signature images will no longer be included in Lightbox gallery mode
- Added Slovenian translation

### 2.0.1 - 2019-05-24

- Updated Lightbox2 library to 2.11.0
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "phpbb-extension",
"description": "Lightbox for phpBB can resize posted images to a maximum set height/width and display them full-screen in an elegant Lightbox overlay effect.",
"homepage": "https://github.com/VSEphpbb/lightbox",
"version": "2.0.1",
"version": "2.0.2",
"keywords": ["phpbb", "extension", "lightbox", "image", "resizer"],
"license": "GPL-2.0-only",
"authors": [
Expand Down
27 changes: 1 addition & 26 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function add_lightbox_acp_config($event)
'lightbox_max_width' => array('lang' => 'LIGHTBOX_MAX_WIDTH', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $this->language->lang('PIXEL') . '<br />' . $l_append),
'lightbox_max_height' => array('lang' => 'LIGHTBOX_MAX_HEIGHT', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $this->language->lang('PIXEL') . '<br />' . $l_append),
'lightbox_all_images' => array('lang' => 'LIGHTBOX_ALL_IMAGES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'lightbox_gallery' => array('lang' => 'LIGHTBOX_GALLERY', 'validate' => 'int', 'type' => 'select', 'function' => array($this, 'select_gallery_mode'), 'explain' => true),
'lightbox_gallery' => array('lang' => 'LIGHTBOX_GALLERY', 'validate' => 'int', 'type' => 'select', 'function' => 'build_select', 'params' => array(array(0 => 'DISABLED', 1 => 'LIGHTBOX_GALLERY_ALL', 2 => 'LIGHTBOX_GALLERY_POSTS'), '{CONFIG_VALUE}'), 'explain' => true),
'lightbox_signatures' => array('lang' => 'LIGHTBOX_SIGNATURES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'lightbox_img_titles' => array('lang' => 'LIGHTBOX_IMG_TITLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
);
Expand All @@ -114,31 +114,6 @@ public function add_lightbox_acp_config($event)
}
}

/**
* Create options for the gallery mode select setting
*
* @param int $selected The current value of the config setting
* @param string $cfg_key The name of the config key
* @return string The HTML option tags
* @access public
*/
public function select_gallery_mode($selected, $cfg_key = '')
{
$options = '';
$opt_ary = array(
0 => 'DISABLED',
1 => 'LIGHTBOX_GALLERY_ALL',
2 => 'LIGHTBOX_GALLERY_POSTS',
);

foreach ($opt_ary as $opt_key => $opt_value)
{
$options .= '<option value="' . $opt_key . '"' . ($selected == $opt_key ? ' selected="selected"' : '') . '>' . $this->language->lang($opt_value) . '</option>';
}

return $options;
}

/**
* Find lowest value that is not 0
* Accepts variable number of comparable parameters
Expand Down
4 changes: 2 additions & 2 deletions language/ar/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
*
* Lightbox extension for the phpBB Forum Software package.
* [Arabic] Translated By : Bassel Taha Alhitary - www.alhitary.net
* [Arabic] Translated By : Bassel Taha Alhitary <https://www.alhitary.net>
*
* @copyright (c) 2015 Matt Friedman
* @license GNU General Public License, version 2 (GPL-2.0)
Expand All @@ -23,5 +23,5 @@
}

$lang = array_merge($lang, array(
'LIGHTBOX_GALLERY_LABEL' => 'Image %1 of %2',
'LIGHTBOX_GALLERY_LABEL' => 'الصورة %1 من %2',
));
24 changes: 12 additions & 12 deletions language/ar/lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
*
* Lightbox extension for the phpBB Forum Software package.
* [Arabic] Translated By : Bassel Taha Alhitary - www.alhitary.net
* [Arabic] Translated By : Bassel Taha Alhitary <https://www.alhitary.net>
*
* @copyright (c) 2015 Matt Friedman
* @license GNU General Public License, version 2 (GPL-2.0)
Expand All @@ -23,20 +23,20 @@
}

$lang = array_merge($lang, array(
'LIGHTBOX_SETTINGS' => 'إعدادات تصغير الصور',
'LIGHTBOX_MAX_WIDTH' => 'الحد الأقصى لعرض الصورة بالبكسل ',
'LIGHTBOX_SETTINGS' => 'إعدادات تصغير الصور Lightbox',
'LIGHTBOX_MAX_WIDTH' => 'الحد الأقصى لعرض الصورة',
'LIGHTBOX_MAX_WIDTH_EXPLAIN' => 'سيتم تصغير الصور التي تتجاوز هذه القيمة ويمكن تكبيرها بإستخدام تقنية النافذة المضيئة Lightbox. القيمة صفر يعني تعطيل هذا الخيار.',
'LIGHTBOX_MAX_WIDTH_APPEND' => 'التوصية تعتمد على إعدادات الصورة المُرفقة : %spx',
'LIGHTBOX_MAX_HEIGHT' => 'Maximum image height',
'LIGHTBOX_MAX_HEIGHT_EXPLAIN' => 'Images that exceed this height will be resized and can be enlarged using the Lightbox effect. Set this value to 0 to disable Lightbox image resizing by height.',
'LIGHTBOX_ALL_IMAGES' => 'Include all images in Lightbox effect',
'LIGHTBOX_ALL_IMAGES_EXPLAIN' => 'With this setting enabled, all posted images can be opened in the Lightbox effect even if they are not being resized.',
'LIGHTBOX_GALLERY' => 'السماح بالتنقل بين الصور ',
'LIGHTBOX_MAX_HEIGHT' => 'الحد الأقصى لارتفاع الصورة',
'LIGHTBOX_MAX_HEIGHT_EXPLAIN' => 'سيتم تصغير الصور التي تتجاوز هذه القيمة ويمكن تكبيرها بإستخدام تقنية النافذة المضيئة Lightbox. القيمة صفر تعني تعطيل هذا الخيار.',
'LIGHTBOX_ALL_IMAGES' => 'التطبيق على جميع الصور ',
'LIGHTBOX_ALL_IMAGES_EXPLAIN' => 'عند اختيارك “نعم”, سيكون بالامكان فتح جميع صور المشاركات بواسطة تقنية النافذة المضيئة Lightbox حتى إذا لم يتم تصغير حجمها.',
'LIGHTBOX_GALLERY' => 'السماح بالتنقل بين الصور',
'LIGHTBOX_GALLERY_EXPLAIN' => 'السماح بسهولة التنقل بين جميع الصور المُصغرة في الصفحة بإستخدام تقنية النافذة المضيئة.',
'LIGHTBOX_GALLERY_ALL' => 'All resized images on page',
'LIGHTBOX_GALLERY_POSTS' => 'All resized images per post',
'LIGHTBOX_SIGNATURES' => 'تصغير صور التواقيع ',
'LIGHTBOX_GALLERY_ALL' => 'جميع الصور المُصغرة في الصفحة',
'LIGHTBOX_GALLERY_POSTS' => 'جميع الصور المُصغرة بكل مشاركة',
'LIGHTBOX_SIGNATURES' => 'تصغير صور التواقيع',
'LIGHTBOX_SIGNATURES_EXPLAIN' => 'السماح بتصغير الصور الموجودة في تواقيع الأعضاء.',
'LIGHTBOX_IMG_TITLES' => 'إظهار أسماء الصور ',
'LIGHTBOX_IMG_TITLES' => 'إظهار أسماء الصور',
'LIGHTBOX_IMG_TITLES_EXPLAIN' => 'سيتم عرض أسماء الصور كعنوان في خانة التفاصيل للصورة.',
));
2 changes: 1 addition & 1 deletion language/fr/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
}

$lang = array_merge($lang, array(
'LIGHTBOX_GALLERY_LABEL' => 'Image %1 de %2',
'LIGHTBOX_GALLERY_LABEL' => 'Image %1 sur %2',
));
27 changes: 27 additions & 0 deletions language/sl/common.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
*
* Lightbox extension for the phpBB Forum Software package.
* [Slovenian]
*
* @copyright (c) 2015 Matt Friedman
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = array();
}

$lang = array_merge($lang, array(
'LIGHTBOX_GALLERY_LABEL' => 'Slika %1 od %2',
));
42 changes: 42 additions & 0 deletions language/sl/lightbox.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
*
* Lightbox extension for the phpBB Forum Software package.
* [Slovenian]
*
* @copyright (c) 2015 Matt Friedman
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = array();
}

$lang = array_merge($lang, array(
'LIGHTBOX_SETTINGS' => 'Lightbox spreminjanje velikosti slike',
'LIGHTBOX_MAX_WIDTH' => 'Največja širina slike',
'LIGHTBOX_MAX_WIDTH_EXPLAIN' => 'Slike, ki presegajo to širino, bodo spremenjene velikosti in jih je mogoče povečati z učinkom Lightbox. To vrednost nastavite na 0, če želite onemogočiti spreminjanje velikosti slike Lightbox po širini.',
'LIGHTBOX_MAX_WIDTH_APPEND' => 'Priporočilo, ki temelji na nastavitvah priloge slike: %spx',
'LIGHTBOX_MAX_HEIGHT' => 'Največja višina slike',
'LIGHTBOX_MAX_HEIGHT_EXPLAIN' => 'Slike, ki presegajo to višino, bodo spremenjene velikosti in jih lahko povečate z učinkom Lightbox. To vrednost nastavite na 0, če želite onemogočiti spreminjanje velikosti slike Lightbox po višini.',
'LIGHTBOX_ALL_IMAGES' => 'V učinek Lightbox vključi vse slike',
'LIGHTBOX_ALL_IMAGES_EXPLAIN' => 'Če je omogočena ta nastavitev, se lahko vse objavljene slike odprejo v učinku Lightbox, tudi če jih ne spremenite v velikost.',
'LIGHTBOX_GALLERY' => 'Način galerije',
'LIGHTBOX_GALLERY_EXPLAIN' => 'Omogoča enostavno navigacijo med spremenjenimi slikami z učinkom Lightbox.',
'LIGHTBOX_GALLERY_ALL' => 'Vse spremenjene slike na strani',
'LIGHTBOX_GALLERY_POSTS' => 'se spremenjene slike na objavo',
'LIGHTBOX_SIGNATURES' => 'Spremeni velikost slik v podpisu',
'LIGHTBOX_SIGNATURES_EXPLAIN' => 'Slikam v podpisu dovoli spremembo velikosti.',
'LIGHTBOX_IMG_TITLES' => 'Prikaži imena slikovnih datotek',
'LIGHTBOX_IMG_TITLES_EXPLAIN' => 'Imena slik bodo prikazana kot napis v učinku Lightbox.',
));
6 changes: 1 addition & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
verbose="true"
bootstrap="../../../../tests/bootstrap.php"
>
Expand All @@ -18,14 +17,11 @@
<exclude>./tests/functional</exclude>
</testsuite>
<testsuite name="Extension Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">./tests/functional/</directory>
<directory suffix="_test.php">./tests/functional/</directory>
</testsuite>
</testsuites>

<filter>
<blacklist>
<directory>./tests/</directory>
</blacklist>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./</directory>
<exclude>
Expand Down
11 changes: 11 additions & 0 deletions styles/all/template/event/overall_header_stylesheets_after.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% if LIGHTBOX_RESIZE_HEIGHT || LIGHTBOX_RESIZE_WIDTH %}
<style>
@media (min-width: 900px) {
{% if S_LIGHTBOX_SIGNATURES %}.signature img.postimage,{% endif %}
.content img.postimage {
{{ LIGHTBOX_RESIZE_HEIGHT ? 'max-height: ' ~ LIGHTBOX_RESIZE_HEIGHT ~ 'px !important;' : '' }}
{{ LIGHTBOX_RESIZE_WIDTH ? 'max-width: ' ~ LIGHTBOX_RESIZE_WIDTH ~ 'px !important;' : '' }}
}
}
</style>
{% endif %}
19 changes: 7 additions & 12 deletions styles/all/template/js/resizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
borderRadius: '6px',
transition: 'border-color 0.1s ease-out',
cursor: 'pointer'
}).hover(function() {
}).on('mouseenter', function() {
$(this).css('border-color', '#4ae');
}, function() {
}).on('mouseleave', function() {
$(this).css('border-color', 'transparent');
});
});
Expand All @@ -38,21 +38,16 @@
}

function lightboxResizer(elements) {
if (isMobile() || (!resizeWideImages() && !resizeTallImages() && !vseLightbox.lightboxAll)) {
return;
}
var $targetImage = elements.find('.postimage'),
galleryName = 'post-gallery';
if (!vseLightbox.lightboxSig) {
$targetImage = $targetImage.not(function() {
return $(this).closest('.signature').length > 0;
});
}
if (!isMobile() && (resizeWideImages() || resizeTallImages())) {
$targetImage.css({
'max-width': (resizeWideImages() ? vseLightbox.resizeWidth + 'px' : 'none'),
'max-height': (resizeTallImages() ? vseLightbox.resizeHeight + 'px' : 'none')
});
} else if (!vseLightbox.lightboxAll || isMobile()) {
return;
}
// enclosing the following in a setTimeout seems to solve issues with
// images not being ready and causing $(this).width() to return 0.
setTimeout(function() {
Expand Down Expand Up @@ -89,14 +84,14 @@
var url = $(this).attr('src');
return $('<a/>').attr({
href: url,
'data-lightbox': galleryName + img.index,
'data-lightbox': (vseLightbox.lightboxSig && $(this).closest('.signature').length > 0) ? $targetImage.index(this) : galleryName + img.index,
'data-title': (vseLightbox.imageTitles) ? ((url.indexOf(vseLightbox.downloadFile) !== -1) ? $(this).attr('alt') : url.split('/').pop()) : ''
});
}).borderHover();
}
}).each(function() {
if (this.complete) {
$(this).load();
$(this).trigger('load');
}
});
}, 0);
Expand Down
1 change: 1 addition & 0 deletions styles/all/template/lightbox/css/lightbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ body.lb-disable-scrolling {
text-align: center;
line-height: 0;
font-weight: normal;
outline: none;
}

.lightbox .lb-image {
Expand Down
2 changes: 1 addition & 1 deletion styles/all/template/lightbox/css/lightbox.min.css

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

Loading

0 comments on commit eeee99c

Please sign in to comment.