From f41d77a022016b9faa6dcc6dc2331b7fbbed35d8 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 16 Nov 2018 01:39:29 +0300 Subject: [PATCH] added 'loaded' mode to image index status indicator... Signed-off-by: Alex A. Naanou --- ui (gen4)/css/layout.less | 4 ++++ ui (gen4)/features/ui-status.js | 38 ++++++++++++++++++--------------- ui (gen4)/imagegrid/data.js | 4 +++- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/ui (gen4)/css/layout.less b/ui (gen4)/css/layout.less index c0d0acaf..cd652d65 100755 --- a/ui (gen4)/css/layout.less +++ b/ui (gen4)/css/layout.less @@ -1482,12 +1482,16 @@ stretching in width... */ .overlay-info .index .position.editable { cursor: text; } +.overlay-info .index.loaded:after, .overlay-info .index.global:after { content: "G"; opacity: 0.7; font-size: small; } +.overlay-info .index.loaded:after { + content: "L"; +} /* .overlay-info .index.global:hover:after { content: "Global"; diff --git a/ui (gen4)/features/ui-status.js b/ui (gen4)/features/ui-status.js index 4fbbe764..f1bff3c4 100755 --- a/ui (gen4)/features/ui-status.js +++ b/ui (gen4)/features/ui-status.js @@ -142,6 +142,16 @@ var StatusBarActions = actions.Actions({ // make an element... if(typeof(item) == typeof('str')){ var type = item + var go = function(i){ + i = i >= 1 ? i-1 + : i == null ? 'current' + : i + that.focusImage(i, + item.hasClass('global') ? + 'global' + : item.hasClass('loaded') ? + 'loaded' + : undefined) } item = $('') .addClass(type) .append(!(this.config['status-bar-index'] || {})['editable'] ? @@ -164,27 +174,15 @@ var StatusBarActions = actions.Actions({ }) // select image when done... .on('edit-commit', function(_, text){ - var i = parseInt(text) - i = i >= 1 ? i-1 - : i == null ? 'current' - : i - that.focusImage(i, - item.hasClass('global') ? 'global' : undefined) - }) + go(parseInt(text)) }) // update image position... // XXX this appears to be run in the node context... .keyup(function(){ // XXX KeyboardEvent does not appear to have this... //event.stopPropagation() - if((that.config['status-bar-index'] || {})['live-update-on-edit']){ - var i = parseInt($(this).text()) - i = i >= 1 ? i-1 - : i == null ? 'current' - : i - that.focusImage(i, - item.hasClass('global') ? 'global' : undefined) - } + (that.config['status-bar-index'] || {})['live-update-on-edit'] + && go(parseInt($(this).text())) }) .focus(function(){ $(this).selectText() @@ -214,6 +212,11 @@ var StatusBarActions = actions.Actions({ var i = this.data ? this.data.getImageOrder(gid) : -1 var l = this.data ? this.data.length : 0 + // loaded/crop index... + } else if(cls == 'loaded'){ + var i = this.data ? this.data.getImageOrder('loaded', gid) : -1 + var l = this.data ? this.data.getImages('loaded').len : 0 + // ribbon index... } else { var i = this.data ? this.data.getImageOrder('ribbon', gid) : -1 @@ -698,8 +701,9 @@ var StatusBarActions = actions.Actions({ }], toggleStatusBarIndexMode: ['Interface/Status bar index mode', toggler.CSSClassToggler( - function(){ return this.dom.find('.global-info .index') }, - ['normal', 'global'], + function(){ + return this.dom.find('.global-info .index') }, + ['normal', 'loaded', 'global'], function(state){ this.toggleStatusBar('?') == 'none' && this.toggleStatusBar() diff --git a/ui (gen4)/imagegrid/data.js b/ui (gen4)/imagegrid/data.js index 39fdca52..d05cf78a 100755 --- a/ui (gen4)/imagegrid/data.js +++ b/ui (gen4)/imagegrid/data.js @@ -898,7 +898,7 @@ var DataPrototype = { : offset > 0 ? 'after' : mode offset = Math.abs(offset) - } else if(mode == 'global'){ + } else if(mode == 'global' || mode == 'loaded'){ list = mode mode = 'before' } else if(mode == 'next'){ @@ -926,6 +926,8 @@ var DataPrototype = { || this.getRibbon(this.getImage(target, 'after', this.getImages()))] : list == 'global' ? this.order + : list == 'loaded' ? + this.getImages('loaded') : list instanceof Array ? this.makeSparseImages(list) : this.ribbons[this.getRibbon(list)]