diff --git a/pwiki/store/base.js b/pwiki/store/base.js index 3a8682e..fe209aa 100755 --- a/pwiki/store/base.js +++ b/pwiki/store/base.js @@ -140,6 +140,11 @@ module.BaseStore = { // XXX revise naming... next: undefined, + // XXX HIDE name?? + hide_paths: [ + 'System', + ], + // NOTE: .data is not part of the spec and can be implementation-specific, // only .____(..) use it internally... (XXX check this) __data: undefined, @@ -319,6 +324,7 @@ module.BaseStore = { // match all sub-paths. // match: async function(path, strict=false){ + var that = this // pattern match * / ** if(path.includes('*') || path.includes('**')){ @@ -352,7 +358,13 @@ module.BaseStore = { // skip metadata paths... if(p.includes('*')){ return res } - if(pwpath.basename(p)[0] == '.' + if((pwpath.basename(p)[0] == '.' + // XXX CACHE this??? + || (that.hide_paths + && that.hide_paths + .reduce(function(res, h){ + return res === true + || p.startsWith(h) }, false))) && !all){ return res } var m = p.match(pattern) diff --git a/pwiki2.html b/pwiki2.html index 83b34dc..ba60d99 100755 --- a/pwiki2.html +++ b/pwiki2.html @@ -224,7 +224,9 @@ require(['./browser'], function(browser){ // when the hash is actually changed... for(var lnk of this.dom.querySelectorAll(`a[href="${location.hash}"]`)){ lnk.addEventListener('click', function(evt){ - that.refresh() }) } }) + startSpinner() + setTimeout(function(){ + that.refresh() }, 0) }) } }) // wait for stuff to finish... browser.setup.then(function(){ diff --git a/pwiki2.js b/pwiki2.js index 1cc155a..ec109aa 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -1,6 +1,8 @@ /********************************************************************** * * +* XXX changing the URL does not start the spinner... +* XXX HIDE revise .hide_paths... * XXX Q: can we access fs from a pwa??? * XXX start writing docs in pwiki * - WYSIWYG markdown editor/viewer (ASAP) @@ -20,6 +22,17 @@ * ...likely no... * ...would depend on where we iterate pages and on whether * we can/should reach that spot from within the parser... +* XXX page access mothods (.get(..) / .__get__(..) via path + args) +* - path -- DONE +* - tags -- +* - search -- +* Syntax: +* /path/to/*:tags=a,b,c:search=some text +* +--------+ . . . . . . . . . . . . . . . . path +* +--------+ . . . . . . . . . . . tags +* +--------------+ . . search +* order is not relevant here... +* each of the methods narrows down the previous' results * XXX FEATURE tags and accompanying API... * - add tags to page -- macro/filter * - .text -> .tags (cached on .update(..))