some sorting issues resolved, preparing for manual sort/order...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-10-11 04:50:45 +03:00
parent 1ac4bbcc9d
commit 01e58c8630
3 changed files with 29 additions and 11 deletions

View File

@ -2,7 +2,7 @@
XXX Genereal template description...
</p>
<macro name="show-source" src="./*">
<macro name="show-source" src="./**" sort="path">
<hr>
<h2>
<a href="#@source(./path)/_edit">@source(./path)</a>
@ -12,6 +12,8 @@ XXX Genereal template description...
</p>
</macro>
<macro name="show-source" src="Templates"/>
<macro name="show-source" src="System/style"/>
<!-- @filter(-wikiword) -->

View File

@ -1,5 +1,5 @@
@include(style/_css)
@include(./style/_css)
<div>
<a href="#pages" class="pages-list-button button">&#x2630;</a>

View File

@ -120,6 +120,7 @@ module.BaseData = {
'System/raw': function(){ return { text: this.get('..').raw() } },
'System/html': function(){ return { text: this.get('..').html() } },
// list all path elements on a level, including empty path sections...
// XXX update these to the new format -- must return an object...
// XXX move this to Wiki.children + rename...
// XXX
@ -143,6 +144,10 @@ module.BaseData = {
// list links to this page...
// XXX this is done, though we cant use this until we solve .html(..)
// macro recursion issues...
// XXX cache the result + need a strategy to drop parts of cache when
// irrelevant -- when path/text changes...
// XXX might be a good idea to move this to the store, at least the
// management, part...
'System/links': function(){
return 'NoImplemented'
var that = this
@ -154,14 +159,22 @@ module.BaseData = {
.forEach(function(p){
var pa = that.acquire(p)
that.get(p).links().forEach(function(l){
var la = that.acquire(l)
if(l == p || la == p || la == pa){
res.push([l, p])
}
})
that.get(p)
// XXX this will render the page which might not be
// the best idea in some cases...
.links()
.forEach(function(l){
var la = that.acquire(l)
if(l == p || la == p || la == pa){
res.push([l, p])
}
})
})
// cache the result...
// XXX
this.attr('rev-links', res)
return res
//.map(function(e){ return '['+ e[0] +'] <i>from page: ['+ e[1] +']</i>' })
.map(function(e){ return '['+ e[1] +'] <i>-&gt; ['+ e[0] +']</i>' })
@ -242,10 +255,14 @@ module.pWikiData = {
: method == 'Path' ? p
: method == 'title' ? path2list(p).pop().toLowerCase()
: method == 'Title' ? path2list(p).pop()
// special case...
: method == 'checked' ? (data[p][method] ? 1 : 0)
// XXX experimental...
//: method == 'order' ? order.indexOf(p)
// attr...
: data[method]
: data[p][method]
})
.concat([i, p])
})
@ -1311,7 +1328,7 @@ var pWikiPeerJSSync = pWikiFeatures.Feature({
//---------------------------------------------------------------------
// XXX should this extend pWiki or encapsulate???
// XXX should this extend pWiki or encapsulate (current)???
var pWikiUIActions = actions.Actions({
config: {
'special-paths': {
@ -1546,7 +1563,6 @@ var pWikiUI = pWikiFeatures.Feature({
var pWikiClient =
module.pWikiClient = object.makeConstructor('pWikiClient',
actions.mix(
// XXX not sure if we need this here...
actions.MetaActions,
pWikiUIActions))