diff --git a/ui (gen4)/ribbons.js b/ui (gen4)/ribbons.js index bdb31234..1d9c95dc 100755 --- a/ui (gen4)/ribbons.js +++ b/ui (gen4)/ribbons.js @@ -373,8 +373,14 @@ module.RibbonsPrototype = { // // NOTE: if a previous shadow if the same image exists this will recycle // the existing shadow and cancel it's removal. + // ...this is useful for when a second consecutive action with + // the same image is issued before the previous has time to + // complete, recycling the shadow will enable a single flowing + // animation for such series of commands. + // Example: several fast consecutive horizontal shifts will result + // in a single shadow "flowing" through the ribbon. + // NOTE: multiple shadows of different images are supported... // - // XXX make this work for multiple targets... // XXX should we also have a ribbon shadow??? makeShadow: function(target, animate, delay){ delay = delay || 200 diff --git a/ui (gen4)/ui.js b/ui (gen4)/ui.js index 3bd590c7..1655a7be 100755 --- a/ui (gen4)/ui.js +++ b/ui (gen4)/ui.js @@ -128,6 +128,8 @@ module.GLOBAL_KEYBOARD = { }, ctrl: function(){ a.nextScreen() }, }, + '(': function(){ a.prevImageInOrder() }, + ')': function(){ a.nextImageInOrder() }, Up: { default: function(){ a.prevRibbon() }, shift: function(){ a.shiftImageUp() }, diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index c207add2..dd212d50 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -127,8 +127,8 @@ actions.Actions({ // basic navigation... // focusImage: ['Focus image', - function(img){ - this.data.focusImage(img) + function(img, list){ + this.data.focusImage(img, list) }], focusRibbon: ['Focus Ribbon', function(target){ @@ -152,7 +152,7 @@ actions.Actions({ this.focusImage(t, r) }], - setBaseRibbon: ['', + setBaseRibbon: ['Set base ribbon', function(target){ this.data.setBase(target) }], // shorthands for .focusImage(..) and .focusRibbon(..)... @@ -174,6 +174,19 @@ actions.Actions({ this.focusImage('next') }], + prevImageInOrder: ['Focus previous image in order', + function(){ + // keep track of traverse direction... + this.direction = 'left' + this.focusImage('prev', this.data.order) + }], + nextImageInOrder: ['Focus next image in order', + function(){ + // keep track of traverse direction... + this.direction = 'right' + this.focusImage('next', this.data.order) + }], + firstRibbon: ['Focus previous ribbon', function(){ this.focusRibbon('fisrt') }], lastRibbon: ['Focus next ribbon', @@ -359,58 +372,61 @@ actions.Actions(Client, { focusImage: [ // XXX skip invisible ribbons (???) // XXX load data chunks... - function(target){ + function(target, list){ var ribbons = this.ribbons var data = this.data - if(data != null){ - var gid = data.getImage(target) - gid = gid == null ? data.getImage('current') : gid - - // XXX see if we need to load a new data set... - // XXX - - target = ribbons.focusImage(gid) - - } else { + if(data == null){ target = ribbons.focusImage(target) var gid = ribbons.getElemGID(target) } - // align current ribbon... - ribbons - .centerRibbon(target) - .centerImage(target) + return function(){ + if(data != null){ + // use the data for all the heavy lifting... + // NOTE: this will prevent sync errors... + var gid = data.getImage() + target = ribbons.focusImage(gid) - // align other ribbons... - if(data != null){ - 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... // XXX + } - // 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){ + // align current ribbon... + ribbons + .centerRibbon(target) + .centerImage(target) + + // align other ribbons... + if(data != null){ + var ribbon = data.getRibbon(gid) + for(var r in data.ribbons){ + // skip the current ribbon... + if(r == ribbon){ continue } - ribbons.centerImage(data.getImage('first', r), 'before') - } else { - ribbons.centerImage(t, 'after') + + // XXX skip off-screen ribbons... + // XXX + + // 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 + } + ribbons.centerImage(data.getImage('first', r), 'before') + } else { + ribbons.centerImage(t, 'after') + } } } } }], - setBaseRibbon: ['', + setBaseRibbon: [ function(target){ var r = this.data.getRibbon(target) r = r == null ? this.ribbons.getRibbon(target) : r