IE compatibility
authorEugene Crosser <crosser@average.org>
Wed, 3 Sep 2008 18:30:41 +0000 (18:30 +0000)
committerEugene Crosser <crosser@average.org>
Wed, 3 Sep 2008 18:30:41 +0000 (18:30 +0000)
todo item

README
include/controls.js
include/gallery.js
include/show.js
include/showwin.js
mkgallery.pl

diff --git a/README b/README
index a433efb9485448a307e66f0d38755802b8acf32e..354dfd5ca29a3f158d934bfbf01167fb8d182e3d 100644 (file)
--- a/README
+++ b/README
@@ -71,6 +71,7 @@ Homepage:
 http://www.average.org/mkgallery/
 
 TODO:
+- implement header and footer insertion
 - make index.html depend of .title and directory timestamps
 - rebuild htmls in .html when directory timestamp chnges (images added)
 - make links in the rss file relative
index dd30e393a7509f35dc31dd7451be565d7a502413..ba0d89aae9d441d52add4cb9f1aeee09bcb0bcea 100644 (file)
@@ -27,7 +27,7 @@ var Controls = new Class({
                return {
                        onClick: $empty,
                        zIndex: 9,
-                       buttonClass: 'controlButton',
+                       buttonClass: 'controlButton'
                }
        },
 
@@ -37,9 +37,9 @@ var Controls = new Class({
                this.container = new Element('div').addClass(name).
                setProperties({
                        id: name,
-                       name: name,
+                       name: name
                }).setStyles({
-                       zIndex: this.options.zIndex,
+                       zIndex: this.options.zIndex
                }).addEvent('click', function(){
                        this.options.onClick()
                }.bind(this)).injectInside(this.parent);
@@ -49,7 +49,7 @@ var Controls = new Class({
                        sub.addClass(this.options.buttonClass).setProperties({
                                id: el,
                                name: el,
-                               title: el,
+                               title: el
                        }).addEvent('click', function(){
                                this[el]();
                        }.bind(this)).injectInside(this.container);
@@ -57,13 +57,13 @@ var Controls = new Class({
                },this);
                this.posbox = new Element('span').
                addClass('controlPosition').setProperties({
-                       id: 'controlPosition',
+                       id: 'controlPosition'
                }).injectInside(this.commbox);
                this.refbox = new Element('a', {
                        href: 'javascript: void(1);',
-                       html: 'title',
+                       html: 'title'
                }).addClass('controlRef').setProperties({
-                       id: 'controlRef',
+                       id: 'controlRef'
                }).injectInside(this.commbox);
        },
 
@@ -132,7 +132,7 @@ var Controls = new Class({
                        this.stopbox.setStyle('display', 'none');
                        this.playbox.setStyle('display', 'block');
                }
-       },
+       }
 });
 
 Controls.implement(new Options);
index fa37bbf7925fb12e10b86ab050477aade5c294bd..39d8d846b4aa9ed7759c98195daada2942311c85 100644 (file)
@@ -42,7 +42,7 @@ function init_gallery() {
                rimgs[rel] = i;
                vimgs[i] = [rel, el.title, []];
                el.getElements('a').each(function(ael,j){
-                       dim = /(\d+)[^\d](\d+)/.exec(ael.text);
+                       dim = /(\d+)[^\d](\d+)/.exec(ael.rel);
                        w = dim[1];
                        h = dim[2];
                        vimgs[i][2][j]=[w,h,ael.href];
@@ -72,12 +72,12 @@ function init_gallery() {
                openFromLink: false,
                movieWidth: 640,
                movieHeight: 480,
-               descClassName: 'infoBoxDesc',
+               descClassName: 'infoBoxDesc'
        };
        ibox = new multiBox('infoBox', iboxparams);
 
        var winparms = {
-               tohide: 'indexContainer',
+               tohide: 'indexContainer'
        };
        var showwin = new showWindow('slideshowContainer',winparms);
 
@@ -88,7 +88,7 @@ function init_gallery() {
 
        var showparms = {
                cbStart: function(){ showwin.show(); },
-               cbExit: function(){ showwin.hide(); },
+               cbExit: function(){ showwin.hide(); }
        };
        var show = new Show(vimgs,showwin,ctl,showparms);
 
index c333249931cf168e53d31d43dad839eef4b2603f..fdce267134ed1d277c017a40876f49d2e4a9e571 100644 (file)
@@ -43,7 +43,7 @@ var Show = new Class({
                        cbExit: function(){ alert('show exit undefined'); },
                        percentage: 98,
                        delay: 5000,
-                       fxduration: 200,
+                       fxduration: 200
                }
        },
 
@@ -58,7 +58,7 @@ var Show = new Class({
                this.cache = {
                        prev: {},
                        curr: {},
-                       next: {},
+                       next: {}
                };
 /*
  *  thescripts.com/forum/thread170365.html
@@ -84,7 +84,7 @@ var Show = new Class({
                        zIndex: 4,
                        display: 'none',
                        width: this.coords.width,
-                       height: this.coords.height,
+                       height: this.coords.height
                });
                this.container.grab(this.loadingdiv);
 
@@ -171,7 +171,7 @@ var Show = new Class({
                var newcache = {
                        prev: (id > 0)?this.prepare(id-1):{},
                        curr: this.prepare(id),
-                       next: (id < (this.vimgs.length-1))?this.prepare(id+1):{},
+                       next: (id < (this.vimgs.length-1))?this.prepare(id+1):{}
                };
                delete this.cache;
                this.cache = newcache;
@@ -211,7 +211,7 @@ var Show = new Class({
                                id: id,
                                vi: vi,
                                ready: false,
-                               url: this.vimgs[id][2][vi][2],
+                               url: this.vimgs[id][2][vi][2]
                        };
                        cachel.img = this.bgload(cachel);
                }
@@ -224,7 +224,7 @@ var Show = new Class({
                return new Asset.image(this.vimgs[cachel.id][2][cachel.vi][2],{
                        id: this.vimgs[cachel.id][0],
                        title: this.vimgs[cachel.id][1],
-                       onload: this.loadcomplete.bind(this,[cachel]),
+                       onload: this.loadcomplete.bind(this,[cachel])
                });
        },
 
@@ -247,7 +247,7 @@ var Show = new Class({
                setStyles(this.calcsize(cachel)).
                setStyles({
                        zIndex: 3,
-                       opacity: 0,
+                       opacity: 0
                });
                this.ondisplay.replaces(this.prevdisplay).
                setProperty('alt', 'Previous Image').
@@ -260,7 +260,7 @@ var Show = new Class({
 
        effect: function(){
                this.fx = new Fx.Tween(this.ondisplay, {
-                       duration: this.options.fxduration,
+                       duration: this.options.fxduration
                });
                this.fx.addEvent('complete',this.displaycomplete.bind(this));
                this.fx.start('opacity', 0, 1);
@@ -284,6 +284,15 @@ var Show = new Class({
        },
 
        calcsize: function(cachel){
+               if (! cachel.id) {
+                       return {
+                               position: 'absolute',
+                               top: 0+'px',
+                               left: 0+'px',
+                               width: this.coords.width,
+                               height: this.coords.height
+                       };
+               }
                var factor = 1;
                var candidate;
                candidate = this.target.width /
@@ -304,7 +313,7 @@ var Show = new Class({
                        top: t+'px',
                        left: l+'px',
                        width: w,
-                       height: h,
+                       height: h
                };
        },
 
@@ -312,7 +321,7 @@ var Show = new Class({
                this.loadingdiv.setStyles({
                        display: 'block',
                        width: this.coords.width,
-                       height: this.coords.height,
+                       height: this.coords.height
                });
        },
 
@@ -334,13 +343,14 @@ var Show = new Class({
                        width: Math.round(this.coords.width *
                                                this.options.percentage / 100),
                        height: Math.round(this.coords.height *
-                                               this.options.percentage / 100),
+                                               this.options.percentage / 100)
                };
                /* alert('coords: '+this.coords.width+'x'+this.coords.height+
                     ', target: '+this.target.width+'x'+this.target.height); */
-       },
+       }
 
 });
+
 Show.implement(new Options);
 Show.implement(new Events);
 
index d0451601407adc46f8ab04bd07b3055972d8f8e1..dfd3714f8ec668a14cf74e7fa029c9ef236050af 100644 (file)
@@ -19,7 +19,7 @@ var showWindow = new Class({
                        zIndex: 2,
                        container: document.body,
                        tohide: '',
-                       onClick: $empty,
+                       onClick: $empty
                }
        },
 
@@ -32,7 +32,7 @@ var showWindow = new Class({
                this.container = new Element('div').addClass(name).
                setProperties({
                        id: name,
-                       name: name,
+                       name: name
                }).setStyles({
                        position: 'absolute',
                        left: '0px',
@@ -70,7 +70,7 @@ var showWindow = new Class({
                return {
                        width: this.w,
                        height: this.h,
-                       top: this.s,
+                       top: this.s
                };
        },
 
@@ -80,7 +80,7 @@ var showWindow = new Class({
                                'display'
                        );
                        this.options.tohide.setStyles({
-                               display: 'none',
+                               display: 'none'
                        });
                }
                this.bodystyles = document.body.getStyles(
@@ -89,7 +89,7 @@ var showWindow = new Class({
                document.body.setStyles({
                        overflow: 'hidden',
                        'overflow-x': 'hidden',
-                       'overflow-y': 'hidden',
+                       'overflow-y': 'hidden'
                });
                this.position();
                this.container.setStyle('display', 'block');
@@ -105,7 +105,8 @@ var showWindow = new Class({
 
        grab: function(obj){
                return this.container.grab(obj);
-       },
-})
+       }
+});
+
 showWindow.implement(new Options);
 
index 4166ae6ce2b1c0aa55cf01663f63b989037a8b79..fffb0301c6ca5bd2f21e4205ebdf6a3635fe46a7 100755 (executable)
@@ -690,10 +690,12 @@ sub img_entry {
                my $h=$self->{$sz}->{'dim'}->[1];
                print $IND "  ",a({-href=>$src,
                        -class=>"conceal",
+                       -rel=>$w."x".$h,
                        -title=>"Reduced to ".$w."x".$h},
                        $w."x".$h)," \n";
        }
        print $IND "  ",a({-href=>$name,
+                               -rel=>$w."x".$h,
                                -title=>'Original'},$w."x".$h),
                "\n",end_div,"\n",
                end_td,end_Tr,end_table,"\n";