From 0a77873455478eaf38f221ebd46d60b2c3746840 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 14 Nov 2014 22:17:17 +0300 Subject: [PATCH] started work with real data... Signed-off-by: Alex A. Naanou --- ui (gen4)/testing.js | 11 ++++++ ui (gen4)/viewer.js | 88 ++++++++++++++++++++++++-------------------- 2 files changed, 59 insertions(+), 40 deletions(-) diff --git a/ui (gen4)/testing.js b/ui (gen4)/testing.js index b09a3908..1aa20a91 100755 --- a/ui (gen4)/testing.js +++ b/ui (gen4)/testing.js @@ -4,6 +4,11 @@ * **********************************************************************/ +if(typeof(process) != 'undefined'){ + var glob = require('glob') +} + + //var DEBUG = DEBUG != null ? DEBUG : true // define(function(require){ var module = {} @@ -89,6 +94,12 @@ module.setupActions = function(viewer){ } +window.load2014 = function(){ + return glob('l:/media/img/my/2014/*jpg') + .on('end', function(l){ window.a.loadURLs(l) }) +} + + /********************************************************************** * vim:set ts=4 sw=4 : */ diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index a6e42ca3..49a8a583 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -584,6 +584,8 @@ actions.Actions(Client, { } else { this.ribbons.clear() + // XXX + this.ribbons.images = this.images } this.reload() @@ -639,30 +641,33 @@ actions.Actions(Client, { .centerImage(gid) .centerRibbon(gid) - // align other ribbons... - var ribbon = data.getRibbon(gid) - for(var r in data.ribbons){ - // skip the current ribbon... - if(r == ribbon){ - continue - } - - // XXX skip off-screen ribbons... - - // center... - // XXX is there a 'last' special case here??? - var t = data.getImage(gid, r) - if(t == null){ - var f = data.getImage('first', r) - // nothing found -- empty ribbon? - if(f == null){ + var that = this + //setTimeout(function(){ + // align other ribbons... + var ribbon = data.getRibbon(gid) + for(var r in data.ribbons){ + // skip the current ribbon... + if(r == ribbon){ continue } - this.centerImage(f, 'before') - } else { - this.centerImage(t, 'after') + + // XXX skip off-screen ribbons... + + // center... + // XXX is there a 'last' special case here??? + var t = data.getImage(gid, r) + if(t == null){ + var f = data.getImage('first', r) + // nothing found -- empty ribbon? + if(f == null){ + continue + } + that.centerImage(f, 'before') + } else { + that.centerImage(t, 'after') + } } - } + //}, 0) }], // XXX these should also affect up/down navigation... // ...navigate by proximity (closest to center) rather than by @@ -682,26 +687,29 @@ actions.Actions(Client, { .centerRibbon(gid) .centerImage(gid) - // align other ribbons... - var ribbon = data.getRibbon(gid) - for(var r in data.ribbons){ - // skip the current ribbon... - if(r == ribbon){ - continue + var that = this + //setTimeout(function(){ + // align other ribbons... + var ribbon = data.getRibbon(gid) + for(var r in data.ribbons){ + // skip the current ribbon... + if(r == ribbon){ + continue + } + + // XXX skip off-screen ribbons... + + // XXX see if we need to do some loading... + + // center... + var f = data.getImage('first', r) + // nothing found -- empty ribbon? + if(f == null){ + continue + } + that.centerImage(f, 'before') } - - // XXX skip off-screen ribbons... - - // XXX see if we need to do some loading... - - // center... - var f = data.getImage('first', r) - // nothing found -- empty ribbon? - if(f == null){ - continue - } - this.centerImage(f, 'before') - } + //}, 0) }], // NOTE: this will align only a single image...