diff options
author | Daniel Friesel <derf@finalrewind.org> | 2014-11-02 10:56:59 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2014-11-02 10:56:59 +0100 |
commit | f031a3971aa32839917afb8c6b4ac2878f70b545 (patch) | |
tree | 4402fd929013f205199a3692ac4348cfe2aff180 /lib/App/Dthumb.pm | |
parent | 5807e449b47dead99b180c461d8d43b0b2444801 (diff) |
re-add shadowbox support
note that the shadowbox source cannot be redistributed due to its license.
Diffstat (limited to 'lib/App/Dthumb.pm')
-rwxr-xr-x | lib/App/Dthumb.pm | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm index a287f32..1b26b13 100755 --- a/lib/App/Dthumb.pm +++ b/lib/App/Dthumb.pm @@ -29,8 +29,13 @@ sub new { $conf{dir_thumbs} = "$conf{dir_images}/.thumbs"; # helpers to directly pass GetOptions results - $conf{lightbox} //= ( $conf{'no-lightbox'} ? 0 : 1 ); - $conf{names} //= ( $conf{'no-names'} ? 0 : 1 ); + $conf{lightbox} //= ( + ( + $conf{'no-lightbox'} + or $conf{shadowbox} + ) ? 0 : 1 + ); + $conf{names} //= ( $conf{'no-names'} ? 0 : 1 ); $ref->{config} = \%conf; @@ -43,8 +48,12 @@ sub new { ); if ( $conf{lightbox} ) { - $ref->{data} - ->set_vars( lightbox => $ref->{data}->get('html_lightbox.dthumb'), ); + $ref->{data}->set_vars( + lightbox => $ref->{data}->get('lightbox/html_load.dthumb'), ); + } + elsif ( $conf{shadowbox} ) { + $ref->{data}->set_vars( + lightbox => $ref->{data}->get('shadowbox/html_load.dthumb'), ); } $ref->{html} = $ref->{data}->get('html_start.dthumb'); @@ -94,14 +103,15 @@ sub create_files { my $datadir = $self->{config}->{dir_data}; my @files; - if ( not -d $thumbdir ) { - mkdir($thumbdir); - } - if ( not -d $datadir ) { - mkdir($datadir); + for my $dir ( $thumbdir, $datadir, "${datadir}/lightbox", + "${datadir}/shadowbox" ) + { + if ( not -d $dir ) { + mkdir($dir); + } } - if ( $self->{config}->{lightbox} ) { + if ( $self->{config}->{lightbox} or $self->{config}->{shadowbox} ) { @files = $self->{data}->list_archived(); } else { |