From 02dfeb128524ffabf8f4ccec5960a6a408b17b10 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 22 Apr 2016 12:56:19 +0300 Subject: [PATCH] started porting sort methods... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/base.js | 16 ++++++++++++++++ ui (gen4)/features/ui.js | 2 ++ 2 files changed, 18 insertions(+) diff --git a/ui (gen4)/features/base.js b/ui (gen4)/features/base.js index c566682a..abaf2773 100755 --- a/ui (gen4)/features/base.js +++ b/ui (gen4)/features/base.js @@ -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??? diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index f2dd2d5d..9c5e124a 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -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', }, },