-# recurse into subdirectories BEFORE opening index file
-
- &iteratedir($D,$start,$dir,sub {
- my ($start,$dir,$base)=@_;
- my $ndir = $dir;
- $ndir .= "/" if ($ndir);
- $ndir .= $base;
- return unless ( -d $start."/".$ndir );
- &processdir($start,$ndir);
- });
-
-# fill in title
-
- my $title=&gettitle($dn,$dir);
-
-# get include prefix
-
- my $inc=&getinclude($dn);
-
-# generate directory index unless suppressed
-
- if ( -e $dn."/.noindex" ) {
- open(STDOUT,">/dev/null");
- } else {
- open(STDOUT,">".$dn."/index.html");
+sub makeaux {
+ my $self = shift;
+ my $name = $self->{-base};
+ my $dn = $self->{-parent}->{-fullpath};
+ my $pref = $self->{-previmg}->{-base};
+ my $nref = $self->{-nextimg}->{-base};
+ my $inc = $self->{-inc};
+ my $title = $self->{-info}->{'Comment'};
+ $title = $name unless ($title);
+
+ print "slide: \"$title\": \"$pref\"->\"$name\"->\"$nref\"\n" if ($debug);
+
+ # slideshow
+ for my $refresh('static', 'slide') {
+ my $fn = sprintf("%s/.html/%s-%s.html",$dn,$name,$refresh);
+ if (isnewer($self->{-fullpath},$fn)) {
+ my $imgsrc = '../'.$self->{$sizes[1]}->{'url'};
+ my $fwdref;
+ my $bakref;
+ if ($nref) {
+ $fwdref = sprintf("%s-%s.html",$nref,$refresh);
+ } else {
+ $fwdref = '../index.html';
+ }
+ if ($pref) {
+ $bakref = sprintf("%s-%s.html",$pref,$refresh);
+ } else {
+ $bakref = '../index.html';
+ }
+ my $toggleref;
+ my $toggletext;
+ if ($refresh eq 'slide') {
+ $toggleref=sprintf("%s-static.html",$name);
+ $toggletext = 'Stop!';
+ } else {
+ $toggleref=sprintf("%s-slide.html",$name);
+ $toggletext = 'Play->';
+ }
+ my $F;
+ unless (open($F,'>'.$fn)) {
+ warn "cannot open \"$fn\": $!";
+ next;
+ }
+ binmode($F, ":utf8");
+ if ($refresh eq 'slide') {
+ print $F start_html(
+ -encoding=>"utf-8",
+ -title=>$title,
+ -bgcolor=>"#808080",
+ -head=>meta({-http_equiv=>'Refresh',
+ -content=>"3; url=$fwdref"}),
+ -style=>{-src=>$inc."gallery.css"},
+ ),"\n",
+ comment("Created by ".$version),"\n";
+
+ } else {
+ print $F start_html(-title=>$title,
+ -encoding=>"utf-8",
+ -bgcolor=>"#808080",
+ -style=>{-src=>$inc."gallery.css"},
+ ),"\n",
+ comment("Created by ".$version),"\n";
+ }
+ print $F start_table({-class=>'navi'}),start_Tr,"\n",
+ td(a({-href=>"../index.html"},"Index")),"\n",
+ td(a({-href=>$bakref},"<<Prev")),"\n",
+ td(a({-href=>$toggleref},$toggletext)),"\n",
+ td(a({-href=>$fwdref},"Next>>")),"\n",
+ td({-class=>'title'},$title),"\n",
+ end_Tr,
+ end_table,"\n",
+ center(table({-class=>'picframe'},
+ Tr(td(img({-src=>$imgsrc}))))),"\n",
+ end_html,"\n";
+ close($F);
+ }