Page 1 of 1

Shadowbox with Lightbox 2.0 plugin

Posted: Tue Oct 28, 2014 10:04 pm
by Dergln
Hi,

since we got ourselves an updated lightbox plugin I took the time to check for compatibility with shadowbox.

"Why another ABC123...box ?"
jquery Lightbox doesn't support videos.
Also it seems to add another layer on top of the image so users can't "Save as", which is a showstopper for me. (might be configurable via an option, didn't find anything via Google though)

Inline changes are bold, you'll get the position of the bigger block once you looked at the code in serendipity_event_lightbox.php.
$propbag->add('select_values', array('colorbox' => 'ColorBox', 'lightbox2jq' => 'Lightbox 2 jQuery', 'magnific' => 'Magnific-Popup', 'prettyPhoto' => 'prettyPhoto', 'shadowbox' => 'shadowbox'));
if ($type == 'lightbox2jq' || $type == 'shadowbox') {
// shadowbox code - http://www.shadowbox-js.com/usage.html - http://www.shadowbox-js.com/options.html
elseif ($type == 'shadowbox') {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/shadowbox/shadowbox.css" />' . "\n";
if (!class_exists('serendipity_event_jquery') && !$serendipity['capabilities']['jquery']) {
echo ' <script type="text/javascript" src="' . $pluginDir . '/jquery-1.11.1.min.js" charset="utf-8"></script>' . "\n";
}
echo ' <script type="text/javascript" src="' . $pluginDir . '/shadowbox/shadowbox.js" charset="utf-8"></script>' . "\n";
echo ' <script type="text/javascript" charset="utf-8">Shadowbox.init({autoplayMovies: "false", continuous: true, counterType: "skip", handleOversize: "resize", overlayOpacity: "0.66"});</script>' . "\n";
}
if ($type == 'lightbox2jq' || $type == 'shadowbox') {
###
if ($type == 'lightbox2jq' || $type == 'shadowbox') {
is working because shadowbox has a compatibility check which makes it work just fine with "rel=lightbox" as it would with "rel=shadowbox".

Greetings
Oliver

PS: "Why didn't you simply do this via git ?"
The shadowbox license says I am not allowed to redistribute the code.

Re: Shadowbox with Lightbox 2.0 plugin

Posted: Tue Oct 28, 2014 10:06 pm
by Dergln
PPS: Stumbled upon an interesting site !
> http://planetozh.com/projects/lightbox-clones/

Re: Shadowbox with Lightbox 2.0 plugin

Posted: Wed Oct 29, 2014 10:47 am
by Timbalu
Dergln wrote:"Why another ABC123...box ?"
jquery Lightbox doesn't support videos.
But the others do! Actually there is no need to use another lightbox for this.
Colorbox http://www.jacklmoore.com/colorbox/example2/
Magnfic http://codepen.io/collection/nLcqo
PrettyPhoto http://www.no-margin-for-errors.com/pro ... box-clone/ (scroll down to demos, when site is available again)

About the Serendipity lightbox plugin. Please note: It is designed for image links only, as the regex to convert entry image links on the fly checks for jpe?g|gif|png only. To support other content in the lightbox would need to set the rel, link to the scripts and init them manually for specific items.
Dergln wrote:Also it seems to add another layer on top of the image so users can't "Save as", which is a showstopper for me. (might be configurable via an option, didn't find anything via Google though)
Lightbox2 does not
Colorbox does allow
PrettyPhoto does not
MagnficPopup does allow

I for myself think this is good, as you can chose if you want to use a lightbox with direct image download access allowed or not. Actually there is no real way to forbid downloads at all, since everybody knowing a little more definitely knows how to get around restrictions like that. But it keeps a bunch of direct copy users away.
I think even for lightbox2 you could (easily) find a tweak somewhere to allow this again.

Re: Shadowbox with Lightbox 2.0 plugin

Posted: Wed Oct 29, 2014 2:41 pm
by yellowled
Timbalu wrote:Actually there is no real way to forbid downloads at all, since everybody knowing a little more definitely knows how to get around restrictions like that.
Right, there is no way to “protect” images on the web. The “disable right click” option usually works with JS, so if the user has JS disabled … etc.

If somebody wants to get your images on the web, they will get them. The best thing you can do to protect your rights to images is to include water marks, I guess.

YL

Re: Shadowbox with Lightbox 2.0 plugin

Posted: Wed Oct 29, 2014 8:03 pm
by Dergln
Timbalu wrote:Actually there is no need to use another lightbox for this.
There doesn't seem to be a video-capable, save-allowing box that works and looks good except shadowbox, so I don't see an alternative for my taste.

(Your taste may differ.)

Re: Shadowbox with Lightbox 2.0 plugin

Posted: Wed Oct 29, 2014 8:08 pm
by yellowled
Dergln wrote:There doesn't seem to be a video-capable, save-allowing box that works and looks good except shadowbox, so I don't see an alternative for my taste.
As far as I understand it (IANAL), there is no license for Shadowbox which would even allow us to bundle it with the lightbox plugin for s9y since the s9y license explicitly allows commercial use.

YL

Re: Shadowbox with Lightbox 2.0 plugin

Posted: Wed Oct 29, 2014 8:16 pm
by Dergln
yellowled wrote:As far as I understand it (IANAL)
I see it like you.

That's why I explicitly stated:
PS: "Why didn't you simply do this via git ?"
The shadowbox license says I am not allowed to redistribute the code.
Since I already own a license I can basically do whatever I please to with shadowbox anyway ;)

And if someone would like to add it to his s9y installation, he should be able to with my post.