basic work on display modes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-01-15 05:37:06 +03:00
parent 8dacec8a26
commit 369578f285
2 changed files with 20 additions and 12 deletions

View File

@ -219,6 +219,7 @@ var MetadataUIActions = actions.Actions({
], ],
}, },
// XXX should we replace 'mode' with nested set of metadata???
showMetadata: ['Image/Show metadata', showMetadata: ['Image/Show metadata',
function(image, mode){ function(image, mode){
image = this.data.getImage(image) image = this.data.getImage(image)
@ -242,13 +243,17 @@ var MetadataUIActions = actions.Actions({
.capitalize() .capitalize()
// skip metadata stuff in short mode... // skip metadata stuff in short mode...
if(mode == 'short' if(mode != 'full'
&& field_order.indexOf(n) == -1){ && field_order.indexOf(n) == -1){
return if(mode == 'short'){
return
} else if(mode == 'disabled') {
n = '- ' + n
}
} }
fields.push([ n + ': ', fields.push([ n + ': ', metadata[k] ])
metadata[k] ])
}) })
// sort fields... // sort fields...
@ -260,11 +265,6 @@ var MetadataUIActions = actions.Actions({
return a - b return a - b
}) })
// XXX replace field names with pretty names...
// XXX do two types of fields:
// - base
// - other (browse.Browse + sub-directory???)
var o = overlay.Overlay(this.ribbons.viewer, var o = overlay.Overlay(this.ribbons.viewer,
browse.makeList( browse.makeList(
null, null,

View File

@ -2098,11 +2098,19 @@ ListPrototype.options = {
var n = k var n = k
// XXX make this support list args as well... // XXX make this support list args as well...
if(pattern && typeof(k) == typeof('str')){ if(pattern){
var n = k.replace(pattern, '') var t = typeof(n) == typeof('str') ? n : n[0]
if(n != k){
var tt = t.replace(pattern, '')
if(t != tt){
disable = true disable = true
if(typeof(k) == typeof('str')){
n = tt
} else {
n[0] = tt
}
if(that.options.skipDisabledItems){ if(that.options.skipDisabledItems){
return return
} }