mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 10:00:08 +00:00
more tweaking to sort...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
f1b71c69d8
commit
5bf57405df
@ -2474,7 +2474,7 @@ module.System = {
|
|||||||
<div>
|
<div>
|
||||||
<b>Nested pages:</b><br>
|
<b>Nested pages:</b><br>
|
||||||
<div style="padding-left: 30px">
|
<div style="padding-left: 30px">
|
||||||
<macro src="./*" join="<br>" else="@slot(nested)">
|
<macro src="./*:$ARGS" join="<br>" else="@slot(nested)">
|
||||||
<a href="#@source(s ./path)">@source(./title)</a>
|
<a href="#@source(s ./path)">@source(./title)</a>
|
||||||
</macro>
|
</macro>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -897,6 +897,12 @@ module.BaseStore = {
|
|||||||
// actual existing pages, while in non-strict mode the pattern will
|
// actual existing pages, while in non-strict mode the pattern will
|
||||||
// match all sub-paths.
|
// match all sub-paths.
|
||||||
//
|
//
|
||||||
|
// Handled path arguments:
|
||||||
|
// all
|
||||||
|
// sort=<methods>
|
||||||
|
// sortnewlast (default)
|
||||||
|
// sortnewfirst
|
||||||
|
//
|
||||||
__match_args__: {
|
__match_args__: {
|
||||||
//
|
//
|
||||||
// <tag-name>: function(value, args){
|
// <tag-name>: function(value, args){
|
||||||
@ -974,6 +980,11 @@ module.BaseStore = {
|
|||||||
|
|
||||||
var all = args.all
|
var all = args.all
|
||||||
var sort = args.sort
|
var sort = args.sort
|
||||||
|
var newlast =
|
||||||
|
args.sortnewlast
|
||||||
|
?? !(args.sortnewfirst
|
||||||
|
// default is sortnewlast...
|
||||||
|
?? false)
|
||||||
var test = await this.__match_args(args)
|
var test = await this.__match_args(args)
|
||||||
args = pwpath.joinArgs('', args)
|
args = pwpath.joinArgs('', args)
|
||||||
|
|
||||||
@ -1034,7 +1045,10 @@ module.BaseStore = {
|
|||||||
that
|
that
|
||||||
.sort(this, ...sort.split(/\s*[,\s]+/g))
|
.sort(this, ...sort.split(/\s*[,\s]+/g))
|
||||||
:this
|
:this
|
||||||
.sortAs(order) })
|
.sortAs(order,
|
||||||
|
newlast ?
|
||||||
|
'head'
|
||||||
|
: 'tail') })
|
||||||
.map(function(p){
|
.map(function(p){
|
||||||
return p+args })}
|
return p+args })}
|
||||||
// direct search...
|
// direct search...
|
||||||
|
|||||||
@ -37,9 +37,6 @@
|
|||||||
* -
|
* -
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* XXX sort: for saved order, how do we handle items not in the metadata?
|
|
||||||
* ...there are three ways to handle this, put them first, last or
|
|
||||||
* add an option with a reasonable default...
|
|
||||||
* XXX sort: revise how we store order...
|
* XXX sort: revise how we store order...
|
||||||
* .metadata.order = [ .. ]
|
* .metadata.order = [ .. ]
|
||||||
* .metadata.order_<name> = [ .. ]
|
* .metadata.order_<name> = [ .. ]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user