From: Eugene Crosser Date: Mon, 1 Sep 2008 22:43:22 +0000 (+0000) Subject: make html xhtml 1.0 compliant X-Git-Tag: 2.00~20 X-Git-Url: http://www.average.org/gitweb/?p=mkgallery.git;a=commitdiff_plain;h=2442719e0866f7733d1b171307d1a39ffdb8b8cf make html xhtml 1.0 compliant streamline styles --- diff --git a/include/gallery.css b/include/gallery.css index fa3ad84..e278b30 100644 --- a/include/gallery.css +++ b/include/gallery.css @@ -5,7 +5,7 @@ http://www.average.org/mkgallery/ */ -.slideimage img { +img.thumbnail { clear:both; border-style: inset; border-color: gray; @@ -13,7 +13,7 @@ margin: 0.2ex; } -.slideshowContainer img { +img.mainformat { clear:both; border-style: none; margin: 0px; diff --git a/include/gallery.js b/include/gallery.js index a870a03..fa37bbf 100644 --- a/include/gallery.js +++ b/include/gallery.js @@ -38,8 +38,9 @@ function init_gallery() { /* Populate images list */ $$('div.varimages').each(function(el,i){ - rimgs[el.id] = i; - vimgs[i] = [el.id, el.title, []]; + var rel=el.get('id'); + rimgs[rel] = i; + vimgs[i] = [rel, el.title, []]; el.getElements('a').each(function(ael,j){ dim = /(\d+)[^\d](\d+)/.exec(ael.text); w = dim[1]; @@ -117,11 +118,11 @@ function init_gallery() { $$('a.showStart').each(function(el){ el.addEvent('click', - show.start.bind(show,[rimgs[el.get('id')],1])); + show.start.bind(show,[rimgs[el.get('rel')],1])); }); $$('a.showImage').each(function(el){ el.addEvent('click', - show.start.bind(show,[rimgs[el.get('id')],0])); + show.start.bind(show,[rimgs[el.get('rel')],0])); }); /* Determine if we need to go directly into show mode */ diff --git a/include/show.js b/include/show.js index f7f555e..5016928 100644 --- a/include/show.js +++ b/include/show.js @@ -72,12 +72,11 @@ var Show = new Class({ this.updatecoords(); this.prevdisplay = new Element('img'). + set('class', 'mainformat'). setProperty('alt', 'Current Image'). setStyle('opacity', 0). injectInside(this.container.container); - this.ondisplay = new Element('img'). - setProperty('alt', 'Current Image'). - setStyle('opacity', 0). + this.ondisplay = this.prevdisplay.clone(). injectInside(this.container.container); this.loadingdiv = new Element('div'). addClass('loading').setStyles({ diff --git a/mkgallery.pl b/mkgallery.pl index b5a82c8..4166ae6 100755 --- a/mkgallery.pl +++ b/mkgallery.pl @@ -510,6 +510,7 @@ sub makeaux { end_table,"\n", center(table({-class=>'picframe'}, Tr(td(img({-src=>$imgsrc, + -class=>'standalone', -alt=>$title}))))),"\n", end_html,"\n"; close($F); @@ -538,6 +539,7 @@ sub makeaux { h1($title),"\n", table({-class=>'ipage'}, Tr(td(img({-src=>$imgsrc, + -class=>'thumbnail', -alt=>$title})), td($self->infotable))), a({-href=>'../index.html',-class=>'conceal'}, @@ -649,7 +651,7 @@ sub startimglist { my $slideref = sprintf(".html/%s-slide.html",$first); print $IND h2("Images ", - a({-href=>$slideref,-class=>'showStart',-id=>$first}, + a({-href=>$slideref,-class=>'showStart',-rel=>'i'.$first}, '> slideshow')),"\n"; } @@ -668,18 +670,20 @@ sub img_entry { print $IND a({-name=>$name}),"\n", start_table({-class=>'slide'}),start_Tr,start_td,"\n", - div({-class=>'slidetitle',-id=>$name}, + div({-class=>'slidetitle'}, "\n ",a({-href=>".html/$name-info.html", -title=>'Image Info: '.$name, -class=>'infoBox'}, $title),"\n"),"\n", - div({-class=>'slideimage',-id=>$name}, + div({-class=>'slideimage'}, "\n ",a({-href=>".html/$name-static.html", -title=>$title, -class=>'showImage', - -id=>$name}, - img({-src=>$thumb,-alt=>$title})),"\n"),"\n", - start_div({-class=>'varimages',-id=>$name,-title=>$title}),"\n"; + -rel=>'i'.$name}, + img({-src=>$thumb, + -class=>'thumbnail', + -alt=>$title})),"\n"),"\n", + start_div({-class=>'varimages',-id=>'i'.$name,-title=>$title}),"\n"; foreach my $sz(@sizes) { my $src=$self->{$sz}->{'url'}; my $w=$self->{$sz}->{'dim'}->[0];