From d7c0a397220f9f171f4fc677b96ea1f6655e7e02 Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Mon, 9 Jun 2008 21:09:55 +0000 Subject: [PATCH] work in progress on moving it to phatfusion lightbox --- include/gallery.js | 9 +++++---- mkgallery.pl | 47 +++++++++++++++++++++++++++++++++++++--------- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/include/gallery.js b/include/gallery.js index bf217f3..a9d5299 100644 --- a/include/gallery.js +++ b/include/gallery.js @@ -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'; } + diff --git a/mkgallery.pl b/mkgallery.pl index 4334ef8..70c0089 100755 --- a/mkgallery.pl +++ b/mkgallery.pl @@ -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"; } -- 2.39.2