]> mj.ucw.cz Git - gallery.git/blobdiff - gal2/UCW/Gallery/Web/HighSlide.pm
Gallery2: Further HighSlide hackery
[gallery.git] / gal2 / UCW / Gallery / Web / HighSlide.pm
index fc9650b2661732a731582ee74ed01fb49d369423..c6bedbf62e70e969f53488dd64c9ec80c2838b95 100644 (file)
@@ -35,13 +35,13 @@ sub theme_head_extras($) {
 <link rel=stylesheet href='$tdir/style.css' type='text/css' media=all>
 <script type="text/javascript" src="$hsdir/highslide-with-gallery.js"></script>
 <script type="text/javascript" src="$hsdir/highslide.config.js" charset="utf-8"></script>
+<script type="text/javascript">
+hs.graphicsDir = '$hsdir/graphics/';
+</script>
 <link rel="stylesheet" type="text/css" href="$hsdir/highslide.css">
 <!--[if lt IE 7]>
 <link rel="stylesheet" type="text/css" href="$hsdir/highslide-ie6.css">
 <![endif]-->
-<style type="text/css">
-.brum { border: 1px solid green; }
-</style>
 AMEN
 }
 
@@ -60,13 +60,13 @@ sub show_links($$$$) {
 
 sub show_pre_thumbs($) {
        my ($self) = @_;
-       print "<div class='highslide-gallery'>\n\n";
+       print "\n<div class='highslide-gallery'><ul>\n";
        $self->{hs_thumb_counter} = 0;
 }
 
 sub show_post_thumbs($) {
        my ($self) = @_;
-       print "</div>\n\n";
+       print "</ul></div>\n\n";
 }
 
 sub show_thumb($) {
@@ -79,17 +79,12 @@ sub show_thumb($) {
        my $tw = $tm->{w};
        my $th = $tm->{h};
        my $thumb = $self->get('ThumbUrlPrefix') . "$tf/$photo_id.jpg";
-       my $ml = int(($box_w - $tw)/2);
-       my $mr = $box_w - $tw - $ml;
-       my $mt = int(($box_h - $th)/2);
-       my $mb = $box_h - $th - $mt;
        # HighSlide requires title either for all images, or for none
        my $tit = " title=\"$annot\"";
        my $aid = $self->{hs_thumb_counter}++ ? "" : " id=thumb1";
-       print "<span style='border: 1px solid green; padding: ${mt}px ${mr}px ${mb}px ${ml}px'>\n";
-       print "<a$aid href='$click_url' class=highslide onclick='return hs.expand(this)'>";
+       my $photo_url = $self->get('PhotoUrlPrefix') . "$photo_id.jpg";
+       print "<li><a$aid href='$click_url' class=highslide onclick='return hs.expand(this, { src: \"$photo_url\" })'>";
        print "<img src='$thumb' width=$tw height=$th alt='Photo'$tit></a>\n";
-       print "</span>\n";
 }
 
 sub attach($$) {