mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
started porting sort methods...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8177a807bd
commit
02dfeb1285
@ -524,6 +524,22 @@ actions.Actions({
|
||||
//
|
||||
// NOTE: the cmp function is called in the actions context.
|
||||
__sort_modes__: {
|
||||
'name-leading-sequence': function(a, b){
|
||||
a = this.images.getImageNameLeadingSeq(a)
|
||||
a = typeof(a) == typeof('str') ? 0 : a
|
||||
b = this.images.getImageNameLeadingSeq(b)
|
||||
b = typeof(b) == typeof('str') ? 0 : b
|
||||
|
||||
return a - b
|
||||
},
|
||||
'name-sequence': function(a, b){
|
||||
a = this.images.getImageNameSeq(a)
|
||||
a = typeof(a) == typeof('str') ? 0 : a
|
||||
b = this.images.getImageNameSeq(b)
|
||||
b = typeof(b) == typeof('str') ? 0 : b
|
||||
|
||||
return a - b
|
||||
},
|
||||
},
|
||||
// XXX this also requires images...
|
||||
// XXX cache order???
|
||||
|
||||
@ -170,6 +170,8 @@ module.ViewerActions = actions.Actions({
|
||||
'sort-modes': {
|
||||
'Sort by date': 'metadata.createDate birthtime',
|
||||
'Sort by name': 'name path',
|
||||
'Sort by name (XP-style)': 'name-leading-sequence name path',
|
||||
'Sort by file sequence number': 'name-leading-sequence name path',
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user