mirror of
https://github.com/flynx/pWiki.git
synced 2025-11-03 20:40:10 +00:00
added .hide_pages list...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
eda30ab087
commit
b29248bf49
@ -140,6 +140,11 @@ module.BaseStore = {
|
|||||||
// XXX revise naming...
|
// XXX revise naming...
|
||||||
next: undefined,
|
next: undefined,
|
||||||
|
|
||||||
|
// XXX HIDE name??
|
||||||
|
hide_paths: [
|
||||||
|
'System',
|
||||||
|
],
|
||||||
|
|
||||||
// NOTE: .data is not part of the spec and can be implementation-specific,
|
// NOTE: .data is not part of the spec and can be implementation-specific,
|
||||||
// only .__<name>__(..) use it internally... (XXX check this)
|
// only .__<name>__(..) use it internally... (XXX check this)
|
||||||
__data: undefined,
|
__data: undefined,
|
||||||
@ -319,6 +324,7 @@ module.BaseStore = {
|
|||||||
// match all sub-paths.
|
// match all sub-paths.
|
||||||
//
|
//
|
||||||
match: async function(path, strict=false){
|
match: async function(path, strict=false){
|
||||||
|
var that = this
|
||||||
// pattern match * / **
|
// pattern match * / **
|
||||||
if(path.includes('*')
|
if(path.includes('*')
|
||||||
|| path.includes('**')){
|
|| path.includes('**')){
|
||||||
@ -352,7 +358,13 @@ module.BaseStore = {
|
|||||||
// skip metadata paths...
|
// skip metadata paths...
|
||||||
if(p.includes('*')){
|
if(p.includes('*')){
|
||||||
return res }
|
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){
|
&& !all){
|
||||||
return res }
|
return res }
|
||||||
var m = p.match(pattern)
|
var m = p.match(pattern)
|
||||||
|
|||||||
@ -224,7 +224,9 @@ require(['./browser'], function(browser){
|
|||||||
// when the hash is actually changed...
|
// when the hash is actually changed...
|
||||||
for(var lnk of this.dom.querySelectorAll(`a[href="${location.hash}"]`)){
|
for(var lnk of this.dom.querySelectorAll(`a[href="${location.hash}"]`)){
|
||||||
lnk.addEventListener('click', function(evt){
|
lnk.addEventListener('click', function(evt){
|
||||||
that.refresh() }) } })
|
startSpinner()
|
||||||
|
setTimeout(function(){
|
||||||
|
that.refresh() }, 0) }) } })
|
||||||
|
|
||||||
// wait for stuff to finish...
|
// wait for stuff to finish...
|
||||||
browser.setup.then(function(){
|
browser.setup.then(function(){
|
||||||
|
|||||||
13
pwiki2.js
13
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 Q: can we access fs from a pwa???
|
||||||
* XXX start writing docs in pwiki
|
* XXX start writing docs in pwiki
|
||||||
* - WYSIWYG markdown editor/viewer (ASAP)
|
* - WYSIWYG markdown editor/viewer (ASAP)
|
||||||
@ -20,6 +22,17 @@
|
|||||||
* ...likely no...
|
* ...likely no...
|
||||||
* ...would depend on where we iterate pages and on whether
|
* ...would depend on where we iterate pages and on whether
|
||||||
* we can/should reach that spot from within the parser...
|
* 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...
|
* XXX FEATURE tags and accompanying API...
|
||||||
* - add tags to page -- macro/filter
|
* - add tags to page -- macro/filter
|
||||||
* - <page>.text -> <page>.tags (cached on .update(..))
|
* - <page>.text -> <page>.tags (cached on .update(..))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user