started porting sort methods...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-04-22 12:56:19 +03:00
parent 8177a807bd
commit 02dfeb1285
2 changed files with 18 additions and 0 deletions

View File

@ -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???

View File

@ -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',
},
},