diff options
-rwxr-xr-x | lib/App/Dthumb.pm | 20 | ||||
-rw-r--r-- | lib/App/Dthumb/Data.pm | 76 |
2 files changed, 94 insertions, 2 deletions
diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm index 2425800..0ec0ce3 100755 --- a/lib/App/Dthumb.pm +++ b/lib/App/Dthumb.pm @@ -37,6 +37,7 @@ sub new { $ref->{config}->{file_index} = 'index.xhtml'; $ref->{config}->{file_lightbox} = 'lightbox.js'; $ref->{config}->{dir_thumbs} = '.thumbs'; + $ref->{config}->{dir_data} = '.dthumb'; return bless($ref, $obj); } @@ -84,15 +85,32 @@ sub read_directories { sub create_files { my ($self) = @_; my $thumbdir = $self->{config}->{dir_thumbs}; + my $datadir = $self->{config}->{dir_data}; my $fh; if (not -d $thumbdir) { mkdir($thumbdir); } - open($fh, '>', 'lightbox.js'); + if (not -d $datadir) { + mkdir($datadir); + } + + open($fh, '>', "${datadir}/lightbox.js"); print {$fh} $self->{data}->lightbox(); close($fh); + + open($fh, '>', "${datadir}/overlay.png"); + print {$fh} $self->{data}->overlay_png(); + close($fh); + + open($fh, '>', "${datadir}/loading.gif"); + print {$fh} $self->{data}->loading_gif(); + close($fh); + + open($fh, '>', "${datadir}/close.gif"); + print {$fh} $self->{data}->close_gif(); + close($fh); } sub delete_old_thumbnails { diff --git a/lib/App/Dthumb/Data.pm b/lib/App/Dthumb/Data.pm index 85ab1d2..69877d5 100644 --- a/lib/App/Dthumb/Data.pm +++ b/lib/App/Dthumb/Data.pm @@ -5,6 +5,7 @@ use warnings; use base 'Exporter'; use Data::Section -setup; +use MIME::Base64 qw(decode_base64); our @EXPORT_OK = (); @@ -29,6 +30,21 @@ sub lightbox { return ${$self->section_data('lightbox.js')}; } +sub overlay_png { + my ($self) = @_; + return decode_base64(${$self->section_data('overlay.png')}); +} + +sub loading_gif { + my ($self) = @_; + return decode_base64(${$self->section_data('loading.gif')}); +} + +sub close_gif { + my ($self) = @_; + return decode_base64(${$self->section_data('close.gif')}); +} + 1; __DATA__ @@ -41,7 +57,7 @@ ______[ html_and_css ]______ <head> <title>dthumb</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> - <script type="text/javascript" src="lightbox.js"></script> + <script type="text/javascript" src=".dthumb/lightbox.js"></script> <style type="text/css"> #lightbox { @@ -93,6 +109,64 @@ ______[ html_end ]______ </body> </html> +______[ overlay.png ]______ + +iVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAABGdBTUEAAK/INwWK6QAAABl0RVh0 +U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAACpSURBVHja7NEBDQAACMOwg39PWMMGCZ2E +tZJMdKq2AIqgQBEUKIICRVAEBYqgQBEUKIIiKFAEBYqgQBEUQYEiKFAEBYqgCAoUQYEiKFAERVCg +CAoUQYEiKIICRVCgCAoUQREUKIICRVCgCIqgQBEUKIICRVAEBYqgQBEUKIIiKFAEBYqgQBEUQYEi +KFAEBYqgQLEAiqBAERQoggJFUAQFiqBAEZTHrQADAOi7AYkbZwBkAAAAAElFTkSuQmCC + +______[ loading.gif ]______ + +R0lGODlhfgAWANUiAFJSUi4uLjAwMElJSVBQUE9PT0xMTEhISCwsLDU1NUFBQUtLSy8vL0VFRUZG +RlNTU2pqZy8vLDs7N1paWj09PVNTTkJCPjExMTIyMjY2Njg4ODQ0NDk5OW5ubjo6OkBAQC0tLTMz +M////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQF +AAAiACwAAAAAfgAWAAAG/8CQcEgsGo/IpHLJbDqfx450Sq1ar9isdsvter/Th7DzKZvP6LR6zW67 +3/C43Dz+gBB4kH7P7/v/gIGCg4SFhn94CCBkdQgUDQ0OB5MKegqTmAeVIBhGGHqdRZ+cnqClpKKm +qahEo6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bY +LDbD7XKtSoN4LNaYz2ZwssBusznwOFyNJNjvdo9+r6cfAYCBgHx8fiKCgoR7hoiBin1+jYBycoZ4 +eGhohm5uXl6GZGRTU4ZaWkJEQ0Z+TE5NCkEAIfkEBQAAIgAsXgAEABwADgAABnxATGhIxIiOyORR +cWg6Gg3KZkqdKq+igXZweDYy4DAYqzQsztynZs1ek5OFuDnNqdvrbyRhXzA3PYCBgHlHAHsEBQtc +goKEIgCGiIoHjIGOkHyTlYOEkZJcd3eOh30LTW1tjnGlaWJijmZoXQ1VVY5baVBCRENGhExOUBRB +ACH5BAUAACIALAQABAB6AA4AAAavQEqj4TgYFaKkcslsOp/QqHRKFWFC2Cxm+jgMi4PwoEoum8/T +jXqtnk684IXcgK7b79GMfq93H+IGBYJ4hIV1GoiJiH5GC4EEkIaSk1IclpeWjAMLBZAEAJShokke +paalmpyQAKCjroanp6mdn62vt3axprOetri/ZbqoUhUWjY+RwMpVmJh+gIIFy9NSiop+RAebc9Td +Tnx82NliY97mSWxsfkLZR+fnV1lYW1JdQQA7 + +______[ close.gif ]______ + +R0lGODlhFAAUAJEDAJeXl0BAQO7u7vr69SH5BAEAAAMALAAAAAAUABQAAAI+nI+py+0PYxO02puu +trmCcAUA1VHBWZ2gUJqoWrUuHCMbXR+aiuZG+OqxbCkhrfUJjYa6zUbmJEGdiygHUQAAOw== + ______[ lightbox.js ]______ /* |