]> www.average.org Git - mkgallery.git/commitdiff
customizable header and footer
authorEugene Crosser <crosser@average.org>
Thu, 4 Sep 2008 14:37:03 +0000 (14:37 +0000)
committerEugene Crosser <crosser@average.org>
Thu, 4 Sep 2008 14:37:03 +0000 (14:37 +0000)
include/custom.css [new file with mode: 0644]
include/footer.pl [new file with mode: 0644]
include/gallery.css
include/header.pl [new file with mode: 0644]
mkgallery.pl

diff --git a/include/custom.css b/include/custom.css
new file mode 100644 (file)
index 0000000..ba080db
--- /dev/null
@@ -0,0 +1,18 @@
+h1.title {
+       text-align: center;
+}
+
+hr.footer {
+       width: 80%;
+}
+
+div.linkup {
+       position: absolute;
+       top: 0px;
+       right: 0px;
+}
+
+div.genby {
+       font-size: small;
+       text-align: right;
+}
diff --git a/include/footer.pl b/include/footer.pl
new file mode 100644 (file)
index 0000000..7fa6b8c
--- /dev/null
@@ -0,0 +1 @@
+"<div class=\"genby\">generated by $_{-version}</div>";
index e278b305edcacf6ae70401c718d5f1805ec944d5..e1ec8243a15c48c258527805c566e32a2fda5b3f 100644 (file)
@@ -5,6 +5,14 @@
        http://www.average.org/mkgallery/
 */
 
        http://www.average.org/mkgallery/
 */
 
+h2.ititle {
+       text-align: center;
+}
+
+h2.atitle {
+       text-align: center;
+}
+
 img.thumbnail {
  clear:both;
  border-style: inset;
 img.thumbnail {
  clear:both;
  border-style: inset;
diff --git a/include/header.pl b/include/header.pl
new file mode 100644 (file)
index 0000000..e1f9c96
--- /dev/null
@@ -0,0 +1,2 @@
+"<h1 class=\"title\">$_{-title}</h1>".
+($_{-depth}?"<div class=\"linkup\"><a href=\"../index.html\">UP</a></div>":"")
index fffb0301c6ca5bd2f21e4205ebdf6a3635fe46a7..ad32e66407aee4a62726e952edb6c8928151cd55 100755 (executable)
@@ -105,6 +105,7 @@ sub new {
                $self = {
                                -parent=>$parent,
                                -root=>$parent->{-root},
                $self = {
                                -parent=>$parent,
                                -root=>$parent->{-root},
+                               -depth=>$parent->{-depth}+1,
                                -base=>$name,
                                -fullpath=>$fullpath,
                                -inc=>'../'.$parent->{-inc},
                                -base=>$name,
                                -fullpath=>$fullpath,
                                -inc=>'../'.$parent->{-inc},
@@ -114,6 +115,7 @@ sub new {
                $class = $this;
                my $root=shift;
                $self = {
                $class = $this;
                my $root=shift;
                $self = {
+                               -depth=>0,
                                -root=>$root,
                                -fullpath=>$root,
                                -inc=>getinc($root),
                                -root=>$root,
                                -fullpath=>$root,
                                -inc=>getinc($root),
@@ -575,7 +577,10 @@ sub startindex {
        print $IND start_html(-title => $title,
                        -encoding=>"utf-8",
                        -head=>$rsslink,
        print $IND start_html(-title => $title,
                        -encoding=>"utf-8",
                        -head=>$rsslink,
-                       -style=>{-src=>$inc."gallery.css"},
+                       -style=>[
+                               {-src=>$inc."gallery.css"},
+                               {-src=>$inc."custom.css"},
+                       ],
                        -script=>[
                                {-src=>$inc."mootools.js"},
                                {-src=>$inc."overlay.js"},
                        -script=>[
                                {-src=>$inc."mootools.js"},
                                {-src=>$inc."overlay.js"},
@@ -589,19 +594,48 @@ sub startindex {
                comment("Created by ".$version),"\n",
                start_div({-class => 'indexContainer',
                                -id => 'indexContainer'}),
                comment("Created by ".$version),"\n",
                start_div({-class => 'indexContainer',
                                -id => 'indexContainer'}),
-               a({-href=>"../index.html"},"UP"),"\n",
-               start_center,"\n",
-               h1($title),"\n",
                "\n";
                "\n";
+       my $EVL;
+       if (open($EVL,$inc.'header.pl')) {
+               my $prm;
+               while (<$EVL>) {
+                       $prm .= $_;
+               }
+               close($EVL);
+               %_ = (
+                       -version        => $version,
+                       -depth          => $self->{-depth},
+                       -title          => $title,
+                       -breadcrumbs    => "breadcrumbs unimplemented",
+               );
+               print $IND eval $prm,"\n";
+       } else {
+               print $IND a({-href=>"../index.html"},"UP"),"\n",
+                       h1({-class=>'title'},$title),"\n",
+       }
 }
 
 sub endindex {
        my $self = shift;
        my $IND = $self->{-IND};
 
 }
 
 sub endindex {
        my $self = shift;
        my $IND = $self->{-IND};
 
-       print $IND end_center,end_div,
-       # "\n",'<script type="text/javascript">init_gallery();</script>',"\n",
-       end_html,"\n";
+       print $IND end_div;
+       my $EVL;
+       if (open($EVL,$self->{-inc}.'footer.pl')) {
+               my $prm;
+               while (<$EVL>) {
+                       $prm .= $_;
+               }
+               close($EVL);
+               %_ = (
+                       -version        => $version,
+                       -depth          => $self->{-depth},
+                       -title          => $self->{-title},
+                       -breadcrumbs    => "breadcrumbs unimplemented",
+               );
+               print $IND eval $prm,"\n";
+       }
+       print $IND end_html,"\n";
 
        close($IND) if ($IND);
        undef $self->{-IND};
 
        close($IND) if ($IND);
        undef $self->{-IND};
@@ -623,7 +657,7 @@ sub startsublist {
        my $self = shift;
        my $IND = $self->{-IND};
 
        my $self = shift;
        my $IND = $self->{-IND};
 
-       print $IND h2("Albums"),"\n",start_table,"\n";
+       print $IND h2({-class=>"atitle"},"Albums"),"\n",start_table,"\n";
 }
 
 sub sub_entry {
 }
 
 sub sub_entry {
@@ -650,7 +684,7 @@ sub startimglist {
        my $first = $self->{-firstimg}->{-base};
        my $slideref = sprintf(".html/%s-slide.html",$first);
 
        my $first = $self->{-firstimg}->{-base};
        my $slideref = sprintf(".html/%s-slide.html",$first);
 
-       print $IND h2("Images ",
+       print $IND h2({-class=>"ititle"},"Images ",
                a({-href=>$slideref,-class=>'showStart',-rel=>'i'.$first},
                        '&gt; slideshow')),"\n";
 }
                a({-href=>$slideref,-class=>'showStart',-rel=>'i'.$first},
                        '&gt; slideshow')),"\n";
 }