diff --git a/pwiki2.html b/pwiki2.html index 2bcdd55..ac67ffe 100755 --- a/pwiki2.html +++ b/pwiki2.html @@ -131,13 +131,20 @@ require(['./browser'], function(browser){ // separates the navigate and load events... this.refresh() }) .onLoad(function(evt){ + var that = this // handle title... document.querySelector('title').innerHTML = this.title // scroll to anchor element... this.hash && this.dom .querySelector('#'+ this.hash) - .scrollIntoView() }) + .scrollIntoView() + // handle refresh... + // NOTE: we need to do this as hashchange is only triggered + // when the hash is actually changed... + for(var lnk of this.dom.querySelectorAll(`a[href="${window.location.hash}"]`)){ + lnk.addEventListener('click', function(evt){ + that.refresh() }) } }) // wait for stuff to finish... browser.setup.then(function(){ diff --git a/pwiki2.js b/pwiki2.js index 91ffcaf..ceb29b9 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -3,12 +3,15 @@ * * XXX BUG: for some reason pwiki.get('/TestPage').raw does nothing when * the root store is not BaseStore... -* ...seems to be a problem explicitly with /TestPage, could this -* be a name clash with /Test??? +* ...the cause is: +* pwiki.store.substore('/TestPage') -> 'Test' +* should be: +* pwiki.store.substore('/TestPage') -> undefined * XXX BUG service pages (*Error) now print "[ native code ]" instead of * the path and replacing @quote(..) with @source(..) breaks things... * ...this seems to happen only if the root store is not * MetaStore/BaseStore... +* XXX BUG: .get(..) does not seem to resolve to .next... * XXX page search: make things invariant via .names * - if a page is in a system path and there are no alternatives * just return it and do not search.