summaryrefslogtreecommitdiff
path: root/lib/App
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-02-27 18:09:36 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-02-27 18:09:36 +0100
commit48c650ef4122a31e7ef707b889a9806b90a58937 (patch)
tree1d336d14e770f4de5d669af653817793d0e856b4 /lib/App
parentea2b05009684580d5db574fd361a0577d51cf271 (diff)
Add (crude) option to disable lightbox
Diffstat (limited to 'lib/App')
-rwxr-xr-xlib/App/Dthumb.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm
index f26848f..ed1ed72 100755
--- a/lib/App/Dthumb.pm
+++ b/lib/App/Dthumb.pm
@@ -23,6 +23,7 @@ sub new {
$conf->{size} //= 200;
$conf->{spacing} //= 1.1;
$conf->{quality} //= 75;
+ $conf->{lightbox} = !$conf->{'no-lightbox'};
$conf->{names} = !$conf->{'no-names'};
$ref->{config} = $conf;
@@ -104,14 +105,17 @@ sub create_files {
mkdir($thumbdir);
}
- if (not -d $datadir) {
- mkdir($datadir);
- }
+ if ($self->{config}->{lightbox}) {
+
+ if (not -d $datadir) {
+ mkdir($datadir);
+ }
- for my $file (qw(lightbox.js overlay.png loading.gif close.gif)) {
- open(my $fh, '>', "${datadir}/${file}");
- print {$fh} $self->{data}->get($file);
- close($fh);
+ for my $file (qw(lightbox.js overlay.png loading.gif close.gif)) {
+ open(my $fh, '>', "${datadir}/${file}");
+ print {$fh} $self->{data}->get($file);
+ close($fh);
+ }
}
}