diff --git a/pwiki/store/base.js b/pwiki/store/base.js index 05aa876..114400b 100755 --- a/pwiki/store/base.js +++ b/pwiki/store/base.js @@ -710,6 +710,8 @@ module.BaseStore = { // | // // + // NOTE: to reverse search order prepend '-' to method name, e.g. cahnge + // 'path' to '-path', etc. // NOTE: all path based values are sync, not requireing a .gat(..) // and thus faster than sorting via arbitrary ... // NOTE: this performs a natural sort, i.e. numbers in strings are @@ -729,12 +731,10 @@ module.BaseStore = { pwpath.basename(p)) }, depth: function(p){ return pwpath.split(p).length }, - // XXX this only accounts for the first number... number: function(p){ - return parseInt(p.split(/[^\d]+/) - .filter(function(e){ - return e != '' }) - .shift()) }, + return p + .split(/[^\d]+/g) + .join(' ') }, }, sort: function(paths, ...by){ var that = this