From 01e58c86308876b344c50c69da23bbfe87fe0ce1 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 11 Oct 2016 04:50:45 +0300 Subject: [PATCH] some sorting issues resolved, preparing for manual sort/order... Signed-off-by: Alex A. Naanou --- bootstrap/Templates.html | 4 +++- bootstrap/Templates/_view.html | 2 +- pwiki.js | 34 +++++++++++++++++++++++++--------- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/bootstrap/Templates.html b/bootstrap/Templates.html index f5ed3b9..69cf1c9 100644 --- a/bootstrap/Templates.html +++ b/bootstrap/Templates.html @@ -2,7 +2,7 @@ XXX Genereal template description...

- +

@source(./path) @@ -12,6 +12,8 @@ XXX Genereal template description...

+ + diff --git a/bootstrap/Templates/_view.html b/bootstrap/Templates/_view.html index 6f49c0c..b1eaed5 100644 --- a/bootstrap/Templates/_view.html +++ b/bootstrap/Templates/_view.html @@ -1,5 +1,5 @@ -@include(style/_css) +@include(./style/_css)
diff --git a/pwiki.js b/pwiki.js index b42cfdf..93f9538 100755 --- a/pwiki.js +++ b/pwiki.js @@ -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] +'] from page: ['+ e[1] +']' }) .map(function(e){ return '['+ e[1] +'] -> ['+ e[0] +']' }) @@ -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))