pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rename patch files fullscreen slide show use subdirectory so symlink to /usr/pkg/share/fgallery/view can be supported



Module Name:	pkgsrc-wip
Committed By:	ast <ast%NetBSD.org@localhost>
Pushed By:	ast
Date:		Sat Oct 29 22:52:33 2016 +0200
Changeset:	5515a3e4e4f05a8f9553b0c6d2e5e4114c0de845

Added Files:
	fgallery/patches/patch-fgallery
	fgallery/patches/patch-view_index.css
	fgallery/patches/patch-view_index.html
	fgallery/patches/patch-view_index.js
Removed Files:
	fgallery/patches/patch-aa
	fgallery/patches/patch-ab
	fgallery/patches/patch-ac
	fgallery/patches/patch-ad

Log Message:
rename patch files
fullscreen slide show
use subdirectory so symlink to /usr/pkg/share/fgallery/view can be supported

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=5515a3e4e4f05a8f9553b0c6d2e5e4114c0de845

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 fgallery/patches/patch-aa              | 124 ----------------
 fgallery/patches/patch-ab              |  14 --
 fgallery/patches/patch-ac              |  15 --
 fgallery/patches/patch-ad              |  68 ---------
 fgallery/patches/patch-fgallery        | 194 +++++++++++++++++++++++++
 fgallery/patches/patch-view_index.css  |  23 +++
 fgallery/patches/patch-view_index.html |  28 ++++
 fgallery/patches/patch-view_index.js   | 257 +++++++++++++++++++++++++++++++++
 8 files changed, 502 insertions(+), 221 deletions(-)

diffs:
diff --git a/fgallery/patches/patch-aa b/fgallery/patches/patch-aa
deleted file mode 100644
index 3b66057..0000000
--- a/fgallery/patches/patch-aa
+++ /dev/null
@@ -1,124 +0,0 @@
-$NetBSD$
-
-Use a "cmd_exists" for tests of existence of commands in given environment
-Use oct instead of 0### and don't return undef explicitely (Perl::Critic)
-
---- fgallery.orig      2014-09-05 16:33:54.000000000 +0200
-+++ fgallery   2015-10-02 11:10:05.000000000 +0200
-@@ -21,7 +21,6 @@
- use File::Find qw{find};
- use File::Path qw{make_path remove_tree};
- use File::Spec::Functions qw{rel2abs};
--use FindBin qw{$RealBin};
- use Getopt::Long qw{:config bundling};
- use IO::Handle;
- use Image::ExifTool qw{ImageInfo};
-@@ -38,7 +37,7 @@
- our $ENCODING = encoding::_get_locale_encoding() || 'UTF-8';
- 
- # defaults
--my $mode = 0644;
-+my $mode = oct(644);
- my $slim = 0;
- my $ofile = 0;
- my $orient = 1;
-@@ -73,6 +72,14 @@
- }
- 
- 
-+# see if our environment has a given command installed
-+sub cmd_exists
-+{
-+  my ($c) = @_;
-+  return qx{/bin/sh -c "command -v $c"};
-+}
-+
-+
- sub sys
- {
-   my @cmd = @_;
-@@ -263,7 +270,7 @@
- sub cap_from_str
- {
-   my ($title, $desc) = split("\n", shift, 2);
--  return undef if(!$title && !$desc);
-+  return unless $title || $desc;
-   my $ret = [cap_clean_title($title), ($desc? cap_clean_desc($desc): '')];
-   return $ret;
- }
-@@ -399,49 +406,27 @@
- }
- 
- # check tools
--if(system("identify -version >/dev/null 2>&1")
--|| system("convert -version >/dev/null 2>&1")) {
--  fatal("cannot run \"identify\" or \"convert\" (check if ImageMagick is installed)");
--}
--if(system("7za -h >/dev/null 2>&1"))
--{
-+fatal 'Missing identify or convert executable (from ImageMagick)'
-+  unless cmd_exists('identify') || cmd_exists('convert');
-+unless(cmd_exists('7za')) {
-   $p7zip = 0;
--  if(system("zip -h >/dev/null 2>&1")) {
--    fatal("cannot run \"zip\" (check if 7za or zip is installed)");
--  }
--}
--if(system("jpegoptim -V >/dev/null 2>&1")) {
--  $jpegoptim = 0;
--}
--if(system("pngcrush -h >/dev/null 2>&1")) {
--  $pngoptim = 0;
-+  cmd_exists('zip') || fatal('Missing 7z or zip command');
- }
--if($facedet && system("facedetect -h >/dev/null 2>&1")) {
--  fatal("cannot run \"facedetect\" (see https://www.thregr.org/~wavexx/software/facedetect/)");
--}
--
--my $tificccmd;
--if($sRGB)
--{
--  if(!system("tificc >/dev/null 2>&1")) {
--    $tificccmd = "tificc";
--  } elsif(!system("tificc2 >/dev/null 2>&1")) {
--    $tificccmd = "tificc2";
--  } else {
--    fatal("cannot run \"tificc\" or \"tificc2\" (check if liblcms2-utils is installed)");
--  }
--}
--
-+$jpegoptim = 0 unless cmd_exists('jpegoptim');
-+$pngoptim = 0 unless cmd_exists('pngcrush');
-+fatal 'Missing facedetect (see http://www.thregr.org/~wavexx/hacks/facedetect/'
-+  if $facedet && !cmd_exists('facedetect');
-+fatal 'Missing tificc executable (from lcms2 library)'
-+  if $sRGB && !cmd_exists('tificc');
-+my $tificccmd = 'tificc';
- my $exiftrancmd;
--if($orient)
-+while($orient)
- {
--  if(!system("exiftran -h >/dev/null 2>&1")) {
--    $exiftrancmd = "exiftran -aip";
--  } elsif(!system("exifautotran >/dev/null 2>&1")) {
--    $exiftrancmd = "exifautotran";
--  } else {
--    fatal("cannot execute exiftran or exifautotran for lossless JPEG autorotation");
--  }
-+  $exiftrancmd = "exiftran -aip" if cmd_exists('exiftran');
-+  last if $exiftrancmd;
-+  $exiftrancmd = "exifautotran" if cmd_exists('exifautotran');
-+  fatal 'Missing exiftran or exifautotran executable for JPEG autorotation'
-+    unless $exiftrancmd;
- }
- 
- # list available files
-@@ -496,7 +481,7 @@
- 
-   my $props = ImageInfo($file, {PrintConv => 0, Sort => 'File'});
-   unless(defined($props) && isin($props->{FileType}, @filetypes)) {
--    return undef;
-+    return;
-   }
- 
-   # sanitize file name
diff --git a/fgallery/patches/patch-ab b/fgallery/patches/patch-ab
deleted file mode 100644
index ca06b7a..0000000
--- a/fgallery/patches/patch-ab
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD$
-
-Make the (optional) download/date text slightly less conspicuous
-
---- view/index.css.orig	2015-10-28 14:11:00.000000000 +0100
-+++ view/index.css	2015-10-28 14:11:35.000000000 +0100
-@@ -105,6 +105,7 @@
-   background: #111; /* IE<9 */
-   background: rgba(0, 0, 0, 0.7);
-   font-family: sans-serif;
-+  font-size: 60%;
-   padding: 0.5em;
- }
- 
diff --git a/fgallery/patches/patch-ac b/fgallery/patches/patch-ac
deleted file mode 100644
index 8858310..0000000
--- a/fgallery/patches/patch-ac
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Make the (optional) download/date area slightly less intrusive
-
---- view/index.js.orig  2015-10-28 14:10:55.000000000 +0100
-+++ view/index.js       2015-10-28 14:14:47.000000000 +0100
-@@ -461,7 +461,7 @@
-     el.inject(ehdr);
-   }
-   if(imgs.data[eidx].date)
--    ehdr.adopt(new Element('span', { 'html': '<b>Date</b>: ' + imgs.data[eidx].date }));
-+    ehdr.adopt(new Element('span', { 'html': imgs.data[eidx].date }));
-   ehdr.setStyle('display', (ehdr.children.length? 'block': 'none'));
- }
- 
diff --git a/fgallery/patches/patch-ad b/fgallery/patches/patch-ad
deleted file mode 100644
index 3432118..0000000
--- a/fgallery/patches/patch-ad
+++ /dev/null
@@ -1,68 +0,0 @@
-$NetBSD$
-
-Slideshow on/off: click (tap) on center image (or type 's' with keyboard)
-
---- view/index.js.orig  2016-09-22 18:14:00.000000000 +0200
-+++ view/index.js       2016-10-09 18:48:23.000000000 +0200
-@@ -66,6 +66,7 @@
- var clayout;	// current layout
- var csr;	// current scaling ratio
- var sdir;	// scrolling direction
-+var slideshow;	// slideshow status
- 
- function resize()
- {
-@@ -429,6 +430,24 @@
-   showHdr();
- }
- 
-+function toggleSlideshow()
-+{
-+  if(slideshow == 'on')
-+  {
-+    idle.removeEvent('idle', next);
-+    showHdr();
-+    showNav();
-+    idle.addEvent('idle', hideHdr);
-+    slideshow = 'off';
-+  } else {
-+    idle.removeEvent('idle', hideHdr);
-+    hideNav();
-+    hideHdr();
-+    idle.addEvent('idle', next);
-+    slideshow = 'on';
-+  }
-+}
-+
- function setupHeader()
- {
-   ehdr.empty();
-@@ -549,7 +568,8 @@
- 
-   tthr = resetTimeout(tthr);
-   idle.start();
--  showHdr();
-+  if(slideshow != 'on')
-+    showHdr();
-   centerThumb(d);
- 
-   // prefetch next image
-@@ -775,6 +795,7 @@
-   eright.addEvent('click', next);
-   window.addEvent('resize', onResize);
-   window.addEvent('hashchange', change);
-+  window.addEvent('click', toggleSlideshow);
- 
-   window.addEvent('keydown', function(ev)
-   {
-@@ -792,6 +813,10 @@
-     {
-       toggleCap();
-     }
-+    else if(ev.key == 's')
-+    {
-+      toggleSlideshow();
-+    }
-   });
- 
-   econt.addEvent('mousewheel', function(ev)
diff --git a/fgallery/patches/patch-fgallery b/fgallery/patches/patch-fgallery
new file mode 100644
index 0000000..ffde831
--- /dev/null
+++ b/fgallery/patches/patch-fgallery
@@ -0,0 +1,194 @@
+$NetBSD$
+
+Use a "cmd_exists" for tests of existence of commands in given environment
+Use oct instead of 0### and don't return undef explicitely (Perl::Critic)
+Adaptions for keeping all fgallery files in view subdirectory
+Pretty print json for easier customization
+
+--- fgallery.orig	2016-05-25 09:53:19.000000000 +0000
++++ fgallery
+@@ -20,25 +20,20 @@ use Fcntl;
+ use File::Basename qw{fileparse};
+ use File::Find qw{find};
+ use File::Path qw{make_path remove_tree};
+-use File::Spec::Functions qw{rel2abs};
+-use FindBin qw{$RealBin};
++use File::Spec::Functions qw{rel2abs canonpath catfile};
+ use Getopt::Long qw{:config bundling};
+ use IO::Handle;
+ use Image::ExifTool qw{ImageInfo};
+ use Time::Piece;
+ 
+-# We require either Cpanel::JSON::XS or JSON::PP (JSON::XS does not support ithreads)
+-my $JSON_cls = eval { require Cpanel::JSON::XS; "Cpanel::JSON::XS"; } //
+-	       eval { require JSON::PP; "JSON::PP"; } //
+-	       fatal("either Cpanel::JSON::XS or JSON::PP is required");
+-$JSON_cls->import(qw{encode_json});
++use JSON::PP;
+ 
+ # constants
+ our $VERSION = "1.8.2";
+ our $ENCODING = encoding::_get_locale_encoding() || 'UTF-8';
+ 
+ # defaults
+-my $mode = 0644;
++my $mode = oct(644);
+ my $slim = 0;
+ my $ofile = 0;
+ my $orient = 1;
+@@ -73,6 +68,14 @@ sub fatal
+ }
+ 
+ 
++# see if our environment has a given command installed
++sub cmd_exists
++{
++  my ($c) = @_;
++  return qx{/bin/sh -c "command -v $c"};
++}
++
++
+ sub sys
+ {
+   my @cmd = @_;
+@@ -87,13 +90,13 @@ sub sys
+   }
+ 
+   local $/ = undef;
+-  my $out = <$fd>;
++  my $output = <$fd>;
+ 
+   unless(close($fd)) {
+     fatal("command \"@cmd\" failed");
+   }
+ 
+-  return split("\n", $out);
++  return split("\n", $output);
+ }
+ 
+ 
+@@ -263,7 +266,7 @@ sub cap_clean_desc
+ sub cap_from_str
+ {
+   my ($title, $desc) = split("\n", shift, 2);
+-  return undef if(!$title && !$desc);
++  return unless $title || $desc;
+   my $ret = [cap_clean_title($title), ($desc? cap_clean_desc($desc): '')];
+   return $ret;
+ }
+@@ -383,8 +386,16 @@ my $out = $ARGV[1];
+ my $name = (@ARGV < 3? undef: decode($ARGV[2]));
+ 
+ # check paths
+-my $absDir = rel2abs($dir) . '/';
+-my $absOut = rel2abs($out) . '/';
++my $absDir = canonpath(rel2abs($dir));
++my $absOut = canonpath(rel2abs($out));
++
++sub is_fgallery_dir
++{
++    return unless -d catfile($out, 'view');
++    return unless -e catfile($out, 'index.html');
++    return unless -e catfile($out, 'data.json');
++    return 1;
++}
+ 
+ if(!-d $dir) {
+   fatal("input directory \"$dir\" does not exist");
+@@ -393,55 +404,34 @@ if(!-d $dir) {
+ } elsif(substr($absOut, 0, length($absDir)) eq $absDir) {
+   fatal("output directory is a sub-directory of input, refusing to scan");
+ } elsif(!-d $out) {
+-  sys('cp', '-L', '-R', "$RealBin/view", $out);
+-} elsif(!-f "$out/index.html") {
+-  fatal("output directory already exists, but doesn't look like a template copy");
++  mkdir($out);
++  sys('cp', '-L', '-R', '%%REALBIN%%/view', $out);
++} elsif(!is_fgallery_dir) {
++  fatal("output directory exists, but doesn't look like a fgallery template");
+ }
+ 
+ # check tools
+-if(system("identify -version >/dev/null 2>&1")
+-|| system("convert -version >/dev/null 2>&1")) {
+-  fatal("cannot run \"identify\" or \"convert\" (check if ImageMagick is installed)");
+-}
+-if(system("7za -h >/dev/null 2>&1"))
+-{
++fatal 'Missing identify or convert executable (from ImageMagick)'
++  unless cmd_exists('identify') || cmd_exists('convert');
++unless(cmd_exists('7za')) {
+   $p7zip = 0;
+-  if(system("zip -h >/dev/null 2>&1")) {
+-    fatal("cannot run \"zip\" (check if 7za or zip is installed)");
+-  }
+-}
+-if(system("jpegoptim -V >/dev/null 2>&1")) {
+-  $jpegoptim = 0;
++  cmd_exists('zip') || fatal('Missing 7z or zip command');
+ }
+-if(system("pngcrush -h >/dev/null 2>&1")) {
+-  $pngoptim = 0;
+-}
+-if($facedet && system("facedetect -h >/dev/null 2>&1")) {
+-  fatal("cannot run \"facedetect\" (see https://www.thregr.org/~wavexx/software/facedetect/)");
+-}
+-
+-my $tificccmd;
+-if($sRGB)
+-{
+-  if(!system("tificc >/dev/null 2>&1")) {
+-    $tificccmd = "tificc";
+-  } elsif(!system("tificc2 >/dev/null 2>&1")) {
+-    $tificccmd = "tificc2";
+-  } else {
+-    fatal("cannot run \"tificc\" or \"tificc2\" (check if liblcms2-utils is installed)");
+-  }
+-}
+-
++$jpegoptim = 0 unless cmd_exists('jpegoptim');
++$pngoptim = 0 unless cmd_exists('pngcrush');
++fatal 'Missing facedetect (see http://www.thregr.org/~wavexx/hacks/facedetect/'
++  if $facedet && !cmd_exists('facedetect');
++fatal 'Missing tificc executable (from lcms2 library)'
++  if $sRGB && !cmd_exists('tificc');
++my $tificccmd = 'tificc';
+ my $exiftrancmd;
+-if($orient)
++while($orient)
+ {
+-  if(!system("exiftran -h >/dev/null 2>&1")) {
+-    $exiftrancmd = "exiftran -aip";
+-  } elsif(!system("exifautotran >/dev/null 2>&1")) {
+-    $exiftrancmd = "exifautotran";
+-  } else {
+-    fatal("cannot execute exiftran or exifautotran for lossless JPEG autorotation");
+-  }
++  $exiftrancmd = "exiftran -aip" if cmd_exists('exiftran');
++  last if $exiftrancmd;
++  $exiftrancmd = "exifautotran" if cmd_exists('exifautotran');
++  fatal 'Missing exiftran or exifautotran executable for JPEG autorotation'
++    unless $exiftrancmd;
+ }
+ 
+ # list available files
+@@ -496,7 +486,7 @@ sub analyze_file
+ 
+   my $props = ImageInfo($file, {PrintConv => 0, Sort => 'File'});
+   unless(defined($props) && isin($props->{FileType}, @filetypes)) {
+-    return undef;
++    return;
+   }
+ 
+   # sanitize file name
+@@ -851,7 +841,9 @@ my $fd;
+ unless(open($fd, ">:raw", "$out/data.json")) {
+   fatal("cannot write data file: $!");
+ }
+-print($fd encode_json(\%json));
++print($fd JSON::PP->new->ascii->pretty->canonical->allow_blessed->encode(\%json));
+ close($fd);
+ 
++chdir($out) && symlink(catfile('view', 'index.html'), 'index.html');
++
+ print("completed\n");
diff --git a/fgallery/patches/patch-view_index.css b/fgallery/patches/patch-view_index.css
new file mode 100644
index 0000000..d6bb711
--- /dev/null
+++ b/fgallery/patches/patch-view_index.css
@@ -0,0 +1,23 @@
+$NetBSD$
+
+Force fullscreen on IOS > 1.1 where minimal-ui fails
+Make the (optional) download/date text slightly less conspicuous
+
+--- view/index.css.orig	2016-01-11 19:17:15.000000000 +0000
++++ view/index.css
+@@ -5,6 +5,7 @@ html, body
+   padding: 0;
+   margin: 0;
+   border: 0;
++  height: 100.1% /* IOS>7.1 meta viewport minimal-ui to hide menu + bars */
+ }
+ 
+ img
+@@ -110,6 +111,7 @@ img
+   background: #111; /* IE<9 */
+   background: rgba(0, 0, 0, 0.7);
+   font-family: sans-serif;
++  font-size: 80%;
+   padding: 0.5em;
+ }
+ 
diff --git a/fgallery/patches/patch-view_index.html b/fgallery/patches/patch-view_index.html
new file mode 100644
index 0000000..b7f5ed9
--- /dev/null
+++ b/fgallery/patches/patch-view_index.html
@@ -0,0 +1,28 @@
+$NetBSD$
+
+Move all fgallery files into view subdirectory so we can symlink it on
+webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
+
+--- view/index.html.orig	2016-01-06 19:45:03.000000000 +0000
++++ view/index.html
+@@ -2,13 +2,13 @@
+ <html>
+   <head>
+     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+-    <meta name="viewport" content="width=device-width,initial-scale=1" />
+-    <script src="mootools-core-1.4.js" type="text/javascript"></script>
+-    <script src="mootools-more-1.4.js" type="text/javascript"></script>
+-    <script src="mootools-idle.js" type="text/javascript"></script>
+-    <script src="mootools-mooswipe.js" type="text/javascript"></script>
+-    <script src="index.js" type="text/javascript"></script>
+-    <link href="index.css" rel="stylesheet" type="text/css"/>
++    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,minimal-ui" />
++    <script src="view/mootools-core-1.4.js" type="text/javascript"></script>
++    <script src="view/mootools-more-1.4.js" type="text/javascript"></script>
++    <script src="view/mootools-idle.js" type="text/javascript"></script>
++    <script src="view/mootools-mooswipe.js" type="text/javascript"></script>
++    <script src="view/index.js" type="text/javascript"></script>
++    <link href="view/index.css" rel="stylesheet" type="text/css"/>
+   </head>
+   <body>
+     <noscript>
diff --git a/fgallery/patches/patch-view_index.js b/fgallery/patches/patch-view_index.js
new file mode 100644
index 0000000..e9bf6eb
--- /dev/null
+++ b/fgallery/patches/patch-view_index.js
@@ -0,0 +1,257 @@
+$NetBSD$
+
+Slideshow on/off: click (tap) on center image (or type 's' with keyboard)
+Remove forward and back buttons so slideshow works better
+
+Move all fgallery files into view subdirectory so we can symlink it on
+webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
+
+--- view/index.js.orig	2016-04-25 19:57:44.000000000 +0000
++++ view/index.js
+@@ -52,8 +52,6 @@ var elist;	// thumbnail list
+ var fscr;	// thumbnail list scroll fx
+ var econt;	// picture container
+ var ebuff;	// picture buffer
+-var eleft;	// go left
+-var eright;	// go right
+ var oimg;	// old image
+ var eimg;	// new image
+ var cthumb;	// current thumbnail
+@@ -66,6 +64,7 @@ var idle;	// idle timer
+ var clayout;	// current layout
+ var csr;	// current scaling ratio
+ var sdir;	// scrolling direction
++var slideshow;	// slideshow status
+ 
+ function resize()
+ {
+@@ -100,7 +99,7 @@ function resize()
+   {
+     econt.setStyles(
+     {
+-      'width': epos.x,
++      'width': (slideshow == 'on'? msize.x: epos.x),
+       'height': msize.y
+     });
+   }
+@@ -109,7 +108,7 @@ function resize()
+     econt.setStyles(
+     {
+       'width': msize.x,
+-      'height': epos.y
++      'height': (slideshow == 'on'? msize.y: epos.y)
+     });
+   }
+ 
+@@ -244,12 +243,12 @@ function resizeMainImg(img)
+ {
+   var contSize = econt.getSize();
+   var listSize = elist.getSize();
+-  var thumbWidth = (clayout == 'horizontal'? listSize.x: listSize.y);
++  var thumbWidth = (slideshow == 'on'? 0: clayout == 'horizontal'? listSize.x: listSize.y);
+   var data = imgs.data[img.idx].img;
+   var width = data[1][0];
+   var height = data[1][1];
+   var imgrt = width / height;
+-  var pad = padding * 2;
++  var pad = (slideshow == 'on'? 0: padding * 2);
+ 
+   if(imgrt > (contSize.x / contSize.y))
+   {
+@@ -425,8 +424,31 @@ function toggleCap()
+ 
+   // update indicator
+   var img = document.id('togglecap', ehdr);
+-  img.src = 'cap-' + capst + '.png';
++  img.src = 'view/cap-' + capst + '.png';
+   showHdr();
++
++  //resume slideshow (as click stopped it)
++  toggleSlideshow();
++}
++
++function toggleSlideshow()
++{
++  if(slideshow == 'on')
++  {
++    idle.removeEvent('idle', next);
++    showHdr();
++    idle.addEvent('idle', hideHdr);
++    elist.setStyle('display', 'block');
++    slideshow = 'off';
++  }
++  else
++  {
++    hideHdr();
++    idle.addEvent('idle', next);
++    elist.setStyle('display', 'none');
++    slideshow = 'on';
++  }
++  resize();
+ }
+ 
+ function setupHeader()
+@@ -435,33 +457,33 @@ function setupHeader()
+   if(imgs.index)
+   {
+     var el = new Element('a', { 'title': 'Back to index', 'href': imgs.index });
+-    el.set('html', '<img src=\"back.png\"/>');
++    el.set('html', '<img src="view/back.png"/>');
+     ehdr.adopt(el);
+   }
+   if(imgs.data[eidx].file)
+   {
+     var file = imgs.data[eidx].file[0];
+     var el = new Element('a', { 'title': 'Download image', 'href': file });
+-    el.set('html', '<img src=\"eye.png\"/>');
++    el.set('html', '<img src="view/eye.png"/>');
+     ehdr.adopt(el);
+   }
+   if(imgs.download)
+   {
+     var el = new Element('a', { 'title': 'Download album', 'href': imgs.download });
+-    el.set('html', '<img src=\"download.png\"/>');
++    el.set('html', '<img src="view/download.png"/>');
+     ehdr.adopt(el);
+   }
+   if(imgs.captions)
+   {
+-    var el = new Element('a', { 'title': 'Toggle captions (shortcut: c)' });
++    var el = new Element('a', { 'title': 'Toggle captions' });
+     el.setStyle('cursor', 'pointer');
+     el.addEvent('click', toggleCap);
+-    var img = new Element('img', { 'id': 'togglecap', 'src': 'cap-' + capst + '.png' });
++    var img = new Element('img', { 'id': 'togglecap', 'src': 'view/cap-' + capst + '.png' });
+     img.inject(el);
+     el.inject(ehdr);
+   }
+   if(imgs.data[eidx].date)
+-    ehdr.adopt(new Element('span', { 'html': '<b>Date</b>: ' + imgs.data[eidx].date }));
++    ehdr.adopt(new Element('span', { 'title': 'EXIF timestamp', 'html': imgs.data[eidx].date }));
+   ehdr.setStyle('display', (ehdr.children.length? 'block': 'none'));
+ }
+ 
+@@ -549,7 +571,8 @@ function onMainReady()
+ 
+   tthr = resetTimeout(tthr);
+   idle.start();
+-  showHdr();
++  if(slideshow != 'on')
++    showHdr();
+   centerThumb(d);
+ 
+   // prefetch next image
+@@ -563,7 +586,7 @@ function onMainReady()
+ function showThrobber()
+ {
+   var img = new Element('img', { id: 'throbber' });
+-  img.src = "throbber.gif";
++  img.src = "view/throbber.gif";
+   ehdr.empty();
+   img.inject(ehdr);
+   ehdr.setStyle('display', 'block');
+@@ -574,31 +597,19 @@ function showThrobber()
+ function hideHdr()
+ {
+   if(idle.started)
++  {
+     ehdr.tween('opacity', 0);
+-}
+-
+-function hideNav()
+-{
+-  emain.addClass('no-cursor');
+-  eleft.tween('opacity', 0);
+-  eright.tween('opacity', 0);
++    emain.addClass('no-cursor');
++  }
+ }
+ 
+ function showHdr()
+ {
++  emain.removeClass('no-cursor');
+   ehdr.get('tween').cancel();
+   ehdr.fade('show');
+ }
+ 
+-function showNav()
+-{
+-  emain.removeClass('no-cursor');
+-  eleft.get('tween').cancel();
+-  eleft.fade('show');
+-  eright.get('tween').cancel();
+-  eright.fade('show');
+-}
+-
+ function flash()
+ {
+   eflash.setStyle('display', 'block');
+@@ -722,16 +733,6 @@ function initGallery(data)
+   ecap = new Element('div', { id: 'caption' });
+   ecap.inject(econt);
+ 
+-  eleft = new Element('a', { id: 'left' });
+-  eleft.adopt((new Element('div')).adopt(new Element('img', { 'src': 'left.png' })));
+-  eleft.set('tween', { link: 'ignore' })
+-  eleft.inject(econt);
+-
+-  eright = new Element('a', { id: 'right' });
+-  eright.adopt((new Element('div')).adopt(new Element('img', { 'src': 'right.png' })));
+-  eright.set('tween', { link: 'ignore' })
+-  eright.inject(econt);
+-
+   ehdr = new Element('div', { id: 'header' });
+   ehdr.set('tween', { link: 'ignore' })
+   ehdr.inject(econt);
+@@ -771,10 +772,9 @@ function initGallery(data)
+ 
+   // events and navigation shortcuts
+   elist.addEvent('scroll', onScroll);
+-  eleft.addEvent('click', prev);
+-  eright.addEvent('click', next);
+   window.addEvent('resize', onResize);
+   window.addEvent('hashchange', change);
++  econt.addEvent('click', toggleSlideshow);
+ 
+   window.addEvent('keydown', function(ev)
+   {
+@@ -788,10 +788,6 @@ function initGallery(data)
+       ev.stop();
+       next();
+     }
+-    else if(ev.key == 'c')
+-    {
+-      toggleCap();
+-    }
+   });
+ 
+   econt.addEvent('mousewheel', function(ev)
+@@ -819,8 +815,7 @@ function initGallery(data)
+     timeout: hidedelay,
+     events: ['mousemove', 'mousedown', 'mousewheel']
+   }).start();
+-  idleTmp.addEvent('idle', hideNav);
+-  idleTmp.addEvent('active', function() { showNav(); showHdr(); });
++  idleTmp.addEvent('active', showHdr);
+ 
+   // general idle callback
+   idle = new IdleTimer(window, { timeout: hidedelay }).start();
+@@ -871,12 +866,12 @@ function init()
+   }).get();
+ 
+   // preload some resources
+-  Asset.images(['throbber.gif',
+-		'left.png', 'right.png',
+-		'eye.png', 'download.png', 'back.png',
+-		'cap-normal.png', 'cap-always.png', 'cap-never.png',
+-		'cut-left.png', 'cut-right.png',
+-		'cut-top.png', 'cut-mov.png']);
++  Asset.images(['view/throbber.gif',
++		'view/left.png', 'view/right.png',
++		'view/eye.png', 'view/download.png', 'view/back.png',
++		'view/cap-normal.png', 'view/cap-always.png', 'view/cap-never.png',
++		'view/cut-left.png', 'view/cut-right.png',
++		'view/cut-top.png', 'view/cut-mov.png']);
+ }
+ 
+ window.addEvent('domready', init);


Home | Main Index | Thread Index | Old Index