diff --git a/ui/crop.js b/ui/crop.js index 81717bd7..05b332dc 100755 --- a/ui/crop.js +++ b/ui/crop.js @@ -314,6 +314,10 @@ function filterImagesDialog(){ 'no' ]} cfg['sep2'] = '---' + cfg['Ribbon'] = {select: [ + 'all', + 'current only' + ]} cfg['Keep ribbons'] = false formDialog(null, @@ -386,6 +390,11 @@ function filterImagesDialog(){ } else { gids = getUnmarked(gids) } + + } else if(/^Ribbon/.test(field) && res[field].trim() != 'all'){ + if(res[field] == 'current only'){ + gids = getRibbonGIDs(gids) + } } } diff --git a/ui/data.js b/ui/data.js index da909abd..b646bcd9 100755 --- a/ui/data.js +++ b/ui/data.js @@ -709,12 +709,22 @@ function getGIDRibbonIndex(gid, data){ // - number - ribbon index // - gid // - image +// - list - return only images in ribbon +// +// XXX we should be able to pass both a ribbon number and a list of +// gids to filter... function getRibbonGIDs(a, no_clone, data){ data = data == null ? DATA : data if(typeof(a) == typeof(123)){ - return data.ribbons[a].slice() + var res = data.ribbons[a] + } else { + var res = data.ribbons[getGIDRibbonIndex(a.constructor.name != 'Array' ? a : null, data)] + } + if(a.constructor.name = 'Array'){ + res = res.filter(function(e){ + return a.indexOf(e) >= 0 + }) } - var res = data.ribbons[getGIDRibbonIndex(a, data)] if(no_clone){ return res } diff --git a/ui/files.js b/ui/files.js index 766b7654..0956588b 100755 --- a/ui/files.js +++ b/ui/files.js @@ -436,8 +436,9 @@ function loadFileImages(path, no_load_diffs){ // // NOTE: if an explicit name is given then this will not remove anything. // NOTE: this will use CONFIG.cache_dir as the location if no name is given. -function saveFileImages(name){ - var remove_diffs = (name == null) +function saveFileImages(name, remove_diffs){ + //remove_diffs = remove_diffs == null ? (name == null) : remove_diffs + remove_diffs = remove_diffs == null ? false : remove_diffs name = name == null ? normalizePath(CONFIG.cache_dir_var +'/'+ Date.timeStamp()) : name if(window.dumpJSON == null){ diff --git a/ui/tags.js b/ui/tags.js index 336f4548..42fd7ce5 100755 --- a/ui/tags.js +++ b/ui/tags.js @@ -155,7 +155,7 @@ function removeTag(tags, gid, tagset, images){ }) // clear the tags... - if(updated && img.tags.length == 0){ + if(updated && img.tags != null && img.tags.length == 0){ delete img.tags } diff --git a/ui/ui.js b/ui/ui.js index bcf04e32..873349ce 100755 --- a/ui/ui.js +++ b/ui/ui.js @@ -1262,6 +1262,11 @@ function showImageInfo(){ 'Position (ribbon): '+ (DATA.ribbons[r].indexOf(gid)+1) + '/'+ DATA.ribbons[r].length +''+ 'Position (global): '+ (order+1) +'/'+ DATA.order.length +''+ + 'Sorted: '+ + //(((DATA.order.length-tagSelectAND('unsorted', DATA.order).length)/DATA.order.length)*100+'').split('.')[0] + + //(((DATA.order.length-tagSelectAND('unsorted').length)/DATA.order.length)*100+'').split('.')[0] + + (((DATA.order.length-TAGS['unsorted'].length)/DATA.order.length)*100+'').split('.')[0] + + '%'+ // editable fields... '
'+