pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
wip/fgallery-1.8.2nb4: support no JavaScript
Module Name: pkgsrc-wip
Committed By: ast <ast%NetBSD.org@localhost>
Pushed By: ast
Date: Tue Nov 1 19:24:13 2016 +0100
Changeset: 84c70b4e61650bd1a1fa470425d7e4506ec8a210
Modified Files:
fgallery/Makefile
fgallery/distinfo
fgallery/files/overview.css
fgallery/files/overview.html
fgallery/patches/patch-fgallery
fgallery/patches/patch-view_index.html
fgallery/patches/patch-view_index.js
Added Files:
fgallery/files/noscript.css
Log Message:
wip/fgallery-1.8.2nb4: support no JavaScript
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=84c70b4e61650bd1a1fa470425d7e4506ec8a210
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
fgallery/Makefile | 5 +-
fgallery/distinfo | 6 +-
fgallery/files/noscript.css | 64 +++++++++++++++++++
fgallery/files/overview.css | 1 -
fgallery/files/overview.html | 10 ++-
fgallery/patches/patch-fgallery | 112 ++++++++++++++++++++++++++-------
fgallery/patches/patch-view_index.html | 23 ++++---
fgallery/patches/patch-view_index.js | 81 ++++++++++++++++--------
8 files changed, 230 insertions(+), 72 deletions(-)
diffs:
diff --git a/fgallery/Makefile b/fgallery/Makefile
index a3ab804..778ec2c 100644
--- a/fgallery/Makefile
+++ b/fgallery/Makefile
@@ -3,7 +3,7 @@
PORTVERSION= 1.8.2
PKGBASE= fgallery
DISTNAME= ${PKGBASE}-${PORTVERSION}
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= www
MASTER_SITES= http://www.thregr.org/~wavexx/software/fgallery/releases/
@@ -67,7 +67,8 @@ FG_VIEWFILES= back.png \
OV_FILES= overview.css \
overview.html \
overview.js \
- overview.png
+ overview.png \
+ noscript.css
INSTALLATION_DIRS= bin ${FG_SHAREDIR} ${FG_VIEWDIR}
diff --git a/fgallery/distinfo b/fgallery/distinfo
index 36c93be..e696463 100644
--- a/fgallery/distinfo
+++ b/fgallery/distinfo
@@ -4,7 +4,7 @@ SHA1 (fgallery-1.8.2.zip) = a4164160f9e7d70fe1b135f11e175e8a470a94f2
RMD160 (fgallery-1.8.2.zip) = 959854b675a813379e78d8e66022dd2f56e30561
SHA512 (fgallery-1.8.2.zip) = 1e782b86c74b7cafbb61e46f346b2e42dab9cc3133cf8cedef827f916b5eb29316d86a52020305b56a42fa9d6555423b9d5a175dac4446a0f7f5d538beb9311f
Size (fgallery-1.8.2.zip) = 158562 bytes
-SHA1 (patch-fgallery) = 32d9833729a63d7f3b33632073dd937ded3524f7
+SHA1 (patch-fgallery) = f0536a948a24849cc3b4821aa3b0e6c7fe4dc3b1
SHA1 (patch-view_index.css) = 562587d10dc72d8a22a9577cba9cc63fa9473c86
-SHA1 (patch-view_index.html) = 1e62672675b873d547eb11a1f48bf4af582869c6
-SHA1 (patch-view_index.js) = 4a49c8734a3b736f887b62dc493bed461a41c238
+SHA1 (patch-view_index.html) = 6ea26e75ee14d5d6825ebab6e647f37853ed1382
+SHA1 (patch-view_index.js) = 18f650bac04a6bf5c4c362dfed64affd81818878
diff --git a/fgallery/files/noscript.css b/fgallery/files/noscript.css
new file mode 100644
index 0000000..8d03d5e
--- /dev/null
+++ b/fgallery/files/noscript.css
@@ -0,0 +1,64 @@
+/* noscript environment, based on https://css-tricks.com/seamless-responsive-photo-grid/ */
+html, body
+{
+ overflow: hidden; /* IE<9 */
+ padding: 0;
+ margin: 0;
+ border: 0;
+ height: 100.1% /* IOS>7.1 meta viewport minimal-ui to hide menu + bars */
+}
+
+body
+{
+ overflow: scroll;
+ background-color: #eee;
+}
+
+#photos {
+ /* Prevent vertical gaps */
+ line-height: 0;
+ -webkit-column-count: 8;
+ -webkit-column-gap: 0px;
+ -moz-column-count: 8;
+ -moz-column-gap: 0px;
+ column-count: 8;
+ column-gap: 0px;
+}
+
+#photos img {
+ /* Just in case there are inline attributes */
+ width: 100% !important;
+ height: auto !important;
+}
+
+@media (max-width: 1200px) {
+ #photos {
+ -moz-column-count: 7;
+ -webkit-column-count: 7;
+ column-count: 7;
+ }
+}
+
+@media (max-width: 1000px) {
+ #photos {
+ -moz-column-count: 6;
+ -webkit-column-count: 6;
+ column-count: 6;
+ }
+}
+
+@media (max-width: 800px) {
+ #photos {
+ -moz-column-count: 5;
+ -webkit-column-count: 5;
+ column-count: 5;
+ }
+}
+
+@media (max-width: 400px) {
+ #photos {
+ -moz-column-count: 3;
+ -webkit-column-count: 3;
+ column-count: 3;
+ }
+}
diff --git a/fgallery/files/overview.css b/fgallery/files/overview.css
index c4eff14..05732fa 100644
--- a/fgallery/files/overview.css
+++ b/fgallery/files/overview.css
@@ -1,4 +1,3 @@
-/* General reset of index.css */
html, body
{
overflow: hidden; /* IE<9 */
diff --git a/fgallery/files/overview.html b/fgallery/files/overview.html
index 8360df7..39ae999 100755
--- a/fgallery/files/overview.html
+++ b/fgallery/files/overview.html
@@ -3,14 +3,12 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimal-ui" />
+ <noscript>
+ <meta http-equiv="refresh" content="0;url=noscript.html" />
+ </noscript>
<script src="mootools-core-1.4.js" type="text/javascript"></script>
<script src="overview.js" type="text/javascript"></script>
<link href="overview.css" rel="stylesheet" type="text/css" />
</head>
- <body>
- <noscript>
- <h2>Please enable JavaScript</h2>
- </noscript>
- <div id="overview"></div>
- </body>
+ <body><div id="overview"></div></body>
</html>
diff --git a/fgallery/patches/patch-fgallery b/fgallery/patches/patch-fgallery
index 4b9cce1..a80ab9a 100644
--- a/fgallery/patches/patch-fgallery
+++ b/fgallery/patches/patch-fgallery
@@ -133,7 +133,7 @@ Pretty print json for easier customization
my $ret = [cap_clean_title($title), ($desc? cap_clean_desc($desc): '')];
return $ret;
}
-@@ -322,32 +333,35 @@ sub parse_cap
+@@ -322,32 +333,84 @@ sub parse_cap
sub print_version
{
@@ -142,6 +142,55 @@ Pretty print json for easier customization
exit(0);
}
++sub init_noscript
++{
++ my ($d) = @_;
++ fatal("init_noscript: $d not a directory")
++ unless $d && -d $d;
++ my $fd;
++ my $f = "$d/noscript.html";
++ unless(open($fd, ">:raw", $f)) {
++ fatal("init_noscript: cannot write file '$f': $!");
++ }
++ chmod($mode, $f);
++ select $fd;
++ print join "\n",
++ '<!DOCTYPE html>',
++ '<html>',
++ '<head>',
++ ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',
++ ' <meta name="viewport" '
++ . 'content="width=device-width,initial-scale=1,'
++ . 'minimum-scale=1,minimal-ui" />',
++ ' <link href="view/noscript.css" rel="stylesheet" type="text/css" />',
++ '</head>',
++ '<body>',
++ ' <section id="photos">',
++ '';
++}
++
++sub print_noscript
++# <a href="imgs/DSC00712.jpg"><img src="thumbs/DSC00712.jpg" alt="c1 c2"></a>
++{
++ my ($f, $t, $c) = @_;
++ return unless @_ == 3 && $f && $t;
++ $c = [] unless $c && ref $c eq 'ARRAY';
++ my $x = '';
++ for (@$c) {
++ $x .= ' ' if $c =~ /\S$/o;
++ $x .= $_ if defined $_ && /\S/o;
++ }
++ my $a = '';
++ $a = sprintf ' alt="%s"', $x if $x && $x =~ /\S/o;
++ printf ' <a href="%s"><img src="%s"%s></a>' . "\n", $f, $t, $a;
++}
++
++sub finish_noscript
++{
++ print join "\n", ' </section>', '</body>', '</html>', '';
++ select STDOUT;
++}
++
sub print_help
{
print(STDERR qq{Usage: $0 [options] input-dir output-dir [album name]
@@ -189,7 +238,7 @@ Pretty print json for easier customization
});
exit(shift);
}
-@@ -363,17 +377,21 @@ my ($ret, @ARGS) = GetOptions(
+@@ -363,17 +426,21 @@ my ($ret, @ARGS) = GetOptions(
'i' => sub { $ofile = 1; },
'j=i' => sub { $workers = parse_int($_[0], $_[1], 1, undef); },
'o' => sub { $orient = 0; },
@@ -212,7 +261,7 @@ Pretty print json for easier customization
if(@ARGV < 2 || @ARGV > 3 || !$ret) {
print_help(2);
-@@ -383,8 +401,16 @@ my $out = $ARGV[1];
+@@ -383,8 +450,16 @@ my $out = $ARGV[1];
my $name = (@ARGV < 3? undef: decode($ARGV[2]));
# check paths
@@ -231,7 +280,7 @@ Pretty print json for easier customization
if(!-d $dir) {
fatal("input directory \"$dir\" does not exist");
-@@ -393,55 +419,37 @@ if(!-d $dir) {
+@@ -393,55 +468,37 @@ 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) {
@@ -264,7 +313,8 @@ Pretty print json for easier customization
-}
-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;
-}
@@ -282,8 +332,7 @@ Pretty print json for easier customization
- } else {
- fatal("cannot run \"tificc\" or \"tificc2\" (check if liblcms2-utils is installed)");
- }
-+ cmd_exists('zip') || fatal('Missing 7z or zip command');
- }
+-}
-
+$jpegoptim = 0 unless cmd_exists('jpegoptim');
+$pngoptim = 0 unless cmd_exists('pngcrush');
@@ -311,7 +360,7 @@ Pretty print json for easier customization
}
# list available files
-@@ -475,6 +483,7 @@ my @backsize = (int($minthumb[0] * 4), i
+@@ -475,6 +532,7 @@ my @backsize = (int($minthumb[0] * 4), i
for my $path("$out/thumbs", "$out/blurs", "$out/imgs", "$out/files")
{
remove_tree($path);
@@ -319,7 +368,7 @@ Pretty print json for easier customization
make_path($path);
}
-@@ -496,7 +505,7 @@ sub analyze_file
+@@ -496,7 +554,7 @@ sub analyze_file
my $props = ImageInfo($file, {PrintConv => 0, Sort => 'File'});
unless(defined($props) && isin($props->{FileType}, @filetypes)) {
@@ -328,7 +377,7 @@ Pretty print json for easier customization
}
# sanitize file name
-@@ -535,9 +544,9 @@ sub analyze_file
+@@ -535,9 +593,9 @@ sub analyze_file
{
if($props->{'Comment'})
{
@@ -341,7 +390,7 @@ Pretty print json for easier customization
}
}
elsif($m eq "txt")
-@@ -545,16 +554,16 @@ sub analyze_file
+@@ -545,16 +603,16 @@ sub analyze_file
my $txt = "$dir$base.txt";
if(-f $txt)
{
@@ -362,7 +411,7 @@ Pretty print json for easier customization
}
}
elsif($m eq "xmp")
-@@ -562,8 +571,8 @@ sub analyze_file
+@@ -562,8 +620,8 @@ sub analyze_file
my $xmp = ImageInfo("$file.xmp", {PrintConv => 0, Sort => 'File'});
if(defined($xmp) && ($xmp->{'Title'} || $xmp->{'Description'}))
{
@@ -373,7 +422,7 @@ Pretty print json for easier customization
}
}
}
-@@ -635,22 +644,24 @@ sub process_img
+@@ -635,22 +693,24 @@ sub process_img
# copy source file
sys('cp', '-L', $file, $fout);
@@ -410,7 +459,7 @@ Pretty print json for easier customization
}
# final file mode
-@@ -658,11 +669,12 @@ sub process_img
+@@ -658,11 +718,12 @@ sub process_img
sys('touch', '-r', $file, $fout);
# intermediate sRGB colorspace conversion
@@ -426,7 +475,7 @@ Pretty print json for easier customization
sys($tificccmd, '-t0', $ftmp, "$ftmp.tmp");
rename("$ftmp.tmp", $ftmp);
}
-@@ -674,13 +686,13 @@ sub process_img
+@@ -674,13 +735,13 @@ sub process_img
# generate main image
my @sfile = ($props{ImageWidth}, $props{ImageHeight});
@@ -447,7 +496,7 @@ Pretty print json for easier customization
# face/center detection
my @center = (0.5, 0.5);
-@@ -701,7 +713,7 @@ sub process_img
+@@ -701,7 +762,7 @@ sub process_img
$thumbrt = $minthumb[1] / $sfile[1];
}
my @sthumb = (max(int($sfile[0] * $thumbrt + 0.5), $minthumb[0]),
@@ -456,7 +505,7 @@ Pretty print json for easier customization
my @mthumb = (min($maxthumb[0], $sthumb[0]), min($maxthumb[1], $sthumb[1]));
# cropping window
-@@ -710,7 +722,7 @@ sub process_img
+@@ -710,7 +771,7 @@ sub process_img
my $dy = $sthumb[1] - $mthumb[1];
my $cy = clamp(0, $dy, int($center[1] * $sthumb[1] - $sthumb[1] / 2 + $dy / 2));
@@ -465,7 +514,7 @@ Pretty print json for easier customization
'-gamma', '0.454545',
'-resize', "$sthumb[0]x$sthumb[1]!",
'-gravity', 'NorthWest',
-@@ -720,17 +732,17 @@ sub process_img
+@@ -720,17 +781,17 @@ sub process_img
'-quality', $imgq, "$out/$fthumb");
# blur
@@ -486,7 +535,7 @@ Pretty print json for easier customization
# do not store duplicate information
my @tdata = ($fthumb, [map { int } @mthumb]);
-@@ -747,7 +759,9 @@ sub process_img
+@@ -747,7 +808,9 @@ sub process_img
}
# remove temporary files
@@ -497,7 +546,7 @@ Pretty print json for easier customization
return \%fdata;
}
-@@ -807,7 +821,7 @@ if(!$ofile || $slim)
+@@ -807,7 +870,7 @@ if(!$ofile || $slim)
my $omp = ($ox * $oy / 1e6);
if($mp >= $omp && $mp > $amp && abs($x / $y) >= $panort) {
@@ -506,7 +555,7 @@ Pretty print json for easier customization
}
}
-@@ -828,7 +842,7 @@ $json{version} = $VERSION;
+@@ -828,9 +891,11 @@ $json{version} = $VERSION;
$json{name} = $name if($name);
$json{download} = $fdownload if($fdownload);
$json{index} = $indexUrl if($indexUrl);
@@ -514,10 +563,25 @@ Pretty print json for easier customization
+$json{blur} = \@backsize if $do_blur;
$json{thumb} = { min => \@minthumb, max => \@maxthumb };
++# prepare data.json and print out noscript.html file
++init_noscript($out);
foreach my $fdata(@adata)
-@@ -851,7 +865,13 @@ my $fd;
- unless(open($fd, ">:raw", "$out/data.json")) {
- fatal("cannot write data file: $!");
+ {
+ my %data;
+@@ -845,13 +910,22 @@ foreach my $fdata(@adata)
+ }
+ }
+ push(@{$json{data}}, \%data);
++ print_noscript($data{img}->[0], $data{thumb}->[0], $data{caption});
+ }
++finish_noscript();
+
+ my $fd;
+-unless(open($fd, ">:raw", "$out/data.json")) {
+- fatal("cannot write data file: $!");
++my $dj = "$out/data.json";
++unless(open($fd, ">:raw", $dj)) {
++ fatal("cannot write file '$dj': $!");
}
-print($fd encode_json(\%json));
+print($fd JSON::PP->new->ascii->pretty->canonical->allow_blessed->encode(\%json));
diff --git a/fgallery/patches/patch-view_index.html b/fgallery/patches/patch-view_index.html
index 341a0b0..4100c26 100644
--- a/fgallery/patches/patch-view_index.html
+++ b/fgallery/patches/patch-view_index.html
@@ -5,7 +5,7 @@ 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,17 +2,17 @@
+@@ -2,18 +2,16 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -16,18 +16,21 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
- <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"/>
+- </head>
+- <body>
+ <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,minimal-ui" />
+ <noscript>
+- <h2>Frak! JavaScript required :'(</h2>
++ <meta http-equiv="refresh" content="0;url=noscript.html" />
+ </noscript>
+- <div id="gallery"></div>
+- </body>
+ <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>
-- <h2>Frak! JavaScript required :'(</h2>
-+ <h2>Please enable JavaScript</h2>
- </noscript>
- <div id="gallery"></div>
- </body>
++ <link href="view/index.css" rel="stylesheet" type="text/css" />
++ </head>
++ <body><div id="gallery"></div></body>
+ </html>
diff --git a/fgallery/patches/patch-view_index.js b/fgallery/patches/patch-view_index.js
index 909aaee..2b1bf01 100644
--- a/fgallery/patches/patch-view_index.js
+++ b/fgallery/patches/patch-view_index.js
@@ -8,7 +8,21 @@ 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
+@@ -5,9 +5,10 @@
+
+ var datafile = 'data.json';
+ var padding = 22;
+-var duration = 500;
+-var thrdelay = 1500;
+-var hidedelay = 3000;
++var duration = 500; // for scrolling
++var thrdelay = 1500; // throbber delay
++var hidedelay = 3000; // header and caption hiding delay
++var slidedelay = 5000; // slide show delay
+ var prefetch = 1;
+ var minupscale = 640 * 480;
+ var thumbrt = 16/9 - 5/3;
+@@ -52,8 +53,6 @@ var elist; // thumbnail list
var fscr; // thumbnail list scroll fx
var econt; // picture container
var ebuff; // picture buffer
@@ -17,7 +31,13 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
var oimg; // old image
var eimg; // new image
var cthumb; // current thumbnail
-@@ -66,6 +64,7 @@ var idle; // idle timer
+@@ -62,10 +61,12 @@ var eidx; // current index
+ var tthr; // throbber timeout
+ var imgs; // image list
+ var first; // first image
+-var idle; // idle timer
++var idle; // general idle timer
++var idleMouse; // idle mouse timer
var clayout; // current layout
var csr; // current scaling ratio
var sdir; // scrolling direction
@@ -25,7 +45,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
function resize()
{
-@@ -100,7 +99,7 @@ function resize()
+@@ -100,7 +101,7 @@ function resize()
{
econt.setStyles(
{
@@ -34,7 +54,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
'height': msize.y
});
}
-@@ -109,7 +108,7 @@ function resize()
+@@ -109,7 +110,7 @@ function resize()
econt.setStyles(
{
'width': msize.x,
@@ -43,7 +63,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
});
}
-@@ -244,12 +243,12 @@ function resizeMainImg(img)
+@@ -244,12 +245,12 @@ function resizeMainImg(img)
{
var contSize = econt.getSize();
var listSize = elist.getSize();
@@ -58,7 +78,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
if(imgrt > (contSize.x / contSize.y))
{
-@@ -388,17 +387,20 @@ function hideCap(nodelay)
+@@ -388,17 +389,20 @@ function hideCap(nodelay)
function showCap(nodelay)
{
if(capst == 'never') return;
@@ -82,7 +102,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
var words = cap[0].split(' ').length + cap[1].split(' ').length;
var delay = Math.max(capdelay, rdwdelay * words);
captm = hideCap.delay(delay);
-@@ -408,7 +410,6 @@ function showCap(nodelay)
+@@ -408,7 +412,6 @@ function showCap(nodelay)
function toggleCap()
{
if(!imgs.captions) return;
@@ -90,7 +110,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
// switch mode
if(capst == 'normal')
capst = 'never';
-@@ -416,53 +417,76 @@ function toggleCap()
+@@ -416,53 +419,75 @@ function toggleCap()
capst = 'always';
else
capst = 'normal';
@@ -114,14 +134,13 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
+ {
+ idle.removeEvent('idle', next);
+ showHdr();
-+ idle.addEvent('idle', hideHdr);
+ elist.setStyle('display', 'block');
+ slideshow = 'off';
+ }
+ else
+ {
-+ hideHdr();
+ idle.addEvent('idle', next);
++ hideHdr();
+ elist.setStyle('display', 'none');
+ slideshow = 'on';
+ }
@@ -179,7 +198,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
}
function onMainReady()
-@@ -544,26 +568,31 @@ function onMainReady()
+@@ -544,26 +569,31 @@ function onMainReady()
fx.start('opacity', 1);
var rp = Math.floor(Math.random() * 100);
@@ -216,21 +235,20 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
ehdr.empty();
img.inject(ehdr);
ehdr.setStyle('display', 'block');
-@@ -574,31 +603,19 @@ function showThrobber()
+@@ -573,32 +603,17 @@ function showThrobber()
+
function hideHdr()
{
- if(idle.started)
-+ {
- ehdr.tween('opacity', 0);
+- if(idle.started)
+- ehdr.tween('opacity', 0);
-}
-
-function hideNav()
-{
-- emain.addClass('no-cursor');
++ ehdr.tween('opacity', 0);
+ emain.addClass('no-cursor');
- eleft.tween('opacity', 0);
- eright.tween('opacity', 0);
-+ emain.addClass('no-cursor');
-+ }
}
function showHdr()
@@ -252,7 +270,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
function flash()
{
eflash.setStyle('display', 'block');
-@@ -637,7 +654,7 @@ function load(i)
+@@ -637,7 +652,7 @@ function load(i)
if(i == eidx) return;
var data = imgs.data[i];
@@ -261,7 +279,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
{
onComplete: function() { if(i == eidx) onMainReady(); }
});
-@@ -722,16 +739,6 @@ function initGallery(data)
+@@ -722,16 +737,6 @@ function initGallery(data)
ecap = new Element('div', { id: 'caption' });
ecap.inject(econt);
@@ -278,7 +296,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
ehdr = new Element('div', { id: 'header' });
ehdr.set('tween', { link: 'ignore' })
ehdr.inject(econt);
-@@ -771,10 +778,9 @@ function initGallery(data)
+@@ -771,10 +776,9 @@ function initGallery(data)
// events and navigation shortcuts
elist.addEvent('scroll', onScroll);
@@ -290,7 +308,7 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
window.addEvent('keydown', function(ev)
{
-@@ -788,10 +794,6 @@ function initGallery(data)
+@@ -788,10 +792,6 @@ function initGallery(data)
ev.stop();
next();
}
@@ -301,17 +319,28 @@ webserver to /usr/pkg/share/fgallery/view in DocumentRoot hierarchies
});
econt.addEvent('mousewheel', function(ev)
-@@ -819,8 +821,7 @@ function initGallery(data)
+@@ -815,16 +815,15 @@ function initGallery(data)
+ });
+
+ // setup an idle callback for mouse movement only
+- var idleTmp = new IdleTimer(window, {
++ idleMouse = new IdleTimer(window, {
timeout: hidedelay,
events: ['mousemove', 'mousedown', 'mousewheel']
}).start();
- idleTmp.addEvent('idle', hideNav);
- idleTmp.addEvent('active', function() { showNav(); showHdr(); });
-+ idleTmp.addEvent('active', showHdr);
++ idleMouse.addEvent('active', showHdr);
++ idleMouse.addEvent('idle', hideHdr);
// general idle callback
- idle = new IdleTimer(window, { timeout: hidedelay }).start();
-@@ -871,12 +872,11 @@ function init()
+- idle = new IdleTimer(window, { timeout: hidedelay }).start();
+- idle.addEvent('idle', hideHdr);
++ idle = new IdleTimer(window, { timeout: slidedelay }).start();
+
+ // prepare first image
+ sdir = 1;
+@@ -871,12 +870,11 @@ function init()
}).get();
// preload some resources
Home |
Main Index |
Thread Index |
Old Index