work in progress on moving it to phatfusion lightbox
authorEugene Crosser <crosser@average.org>
Mon, 9 Jun 2008 21:09:55 +0000 (21:09 +0000)
committerEugene Crosser <crosser@average.org>
Mon, 9 Jun 2008 21:09:55 +0000 (21:09 +0000)
include/gallery.js
mkgallery.pl

index bf217f378663e45576594c7bdde135584cd896a7..a9d52999ae40cfb32fac05e17c386aff405abec4 100644 (file)
@@ -3,11 +3,11 @@ function showIbox(iboxid) {
  var bwidth = 400;
  var bheight = 300;
 
- var arrayPageSize = getPageSize();
- var arrayPageScroll = getPageScroll();
+ var wwidth = window.getWidth();
+ var wheight = window.getHeight();
 
- ibox.style.top = arrayPageScroll[1] + ((arrayPageSize[3] - bheight) / 2) + 'px';
- ibox.style.left = ((arrayPageSize[0] - bwidth) / 2) + "px";
+ ibox.style.top = window.getScrollTop() + ((wheight - bheight) / 2) + 'px';
+ ibox.style.left = ((wwidth - bwidth) / 2) + "px";
  ibox.style.width = bwidth + "px";
  ibox.style.height = bheight + "px";
  // alert('wwidth='+wwidth+'; bwidth='+bwidth+'; wheight='+wheight+'; bheight='+bheight);
@@ -20,3 +20,4 @@ function HideIbox(iboxid) {
  ibox.zIndex = '1000';
  ibox.style.display = 'none';
 }
+
index 4334ef8afb3e95313fb5e977981fa353d7230194..70c00892396c19b89f6ee2f26889f9756f5b27de 100755 (executable)
@@ -564,10 +564,30 @@ sub startindex {
                        -encoding=>"utf-8",
                        -head=>$rsslink,
                        -style=>{-src=>[$inc."gallery.css",
-                                       $inc."lightbox.css"]},
-                       -script=>[{-code=>"var incPrefix='$inc';"},
+                                       $inc."lightbox.css"],
+                               -code=>"\
+.lbLoading {background: #fff url(".$inc."loading.gif) no-repeat center;}
+#lbPrevLink {background: transparent url(".$inc.
+                                       "prevlabel.gif) no-repeat 0% 15%;}
+#lbPrevLink:hover {background: transparent url(".$inc.
+                                       "prevlabel.gif) no-repeat 0% 15%;}
+#lbNextLink {background: transparent url(".$inc.
+                                       "nextlabel.gif) no-repeat 0% 15%;}
+#lbNextLink:hover {background: transparent url(".$inc.
+                                       "nextlabel.gif) no-repeat 0% 15%;}
+#lbCloseLink {background: transparent url(".$inc.
+                                       "closelabel.gif) no-repeat center;}
+.lightboxDesc {display: block;}"},
+                       -script=>[
+                               {-src=>$inc."mootools.js"},
                                {-src=>$inc."gallery.js"},
-                               {-src=>$inc."lightbox.js"}]),
+                               {-src=>$inc."lightbox.js"},
+                               {-code=>"\
+var incPrefix='$inc';
+window.addEvent('domready',function(){
+ Lightbox.init({descriptions: '.lightboxDesc', showControls: true});
+});"}
+                       ]),
                a({-href=>"../index.html"},"UP"),"\n",
                start_center,"\n",
                h1($title),"\n",
@@ -655,14 +675,23 @@ sub img_entry {
                $self->infotable,
                end_div,"\n";
 
-       print $IND table({-class=>'slide'},Tr(td(
-               a({-href=>".html/$name-info.html",-title=>'Image Info',
-                       -onClick=>"return showIbox('$name');"},$title),
-               br,
-               a({-href=>$medium,-rel=>"lightbox",-title=>$title},
+       print $IND a({-name=>$name}),
+               table({-class=>'slide'},Tr(td(
+               div({-class=>"lightboxDesc $name"},
+                       a({-href=>".html/$name-info.html",-title=>'Image Info',
+                               -onClick=>"return showIbox('$name');"},
+                               $title)),
+               a({-href=>".html/$name-static.html",-title=>$title,
+                       -id=>$name,
+                       -OnClick=>"Lightbox.show('$medium','$title');return false;"},
                        img({-src=>$thumb})),
                br,
-               a({-href=>$name,-title=>'Original Image'},"($w x $h)"),
+               div({-style=>"display: none;"},
+                       a({-href=>$thumb,-rel=>"lightbox[thm]",
+                                       -title=>'Thumb'},"Thm"),
+                       a({-href=>$medium,-rel=>"lightbox[sml]",
+                                       -title=>'Small'},"Sml")),
+               a({-href=>$name,-title=>'Original'},"($w x $h)"),
                br))),"\n";
 }