From a0152c4192b0955238e5c2ccc6c1f0cbedb90fdf Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 26 Oct 2022 19:18:21 +0300 Subject: [PATCH] tweaking... Signed-off-by: Alex A. Naanou --- pwiki/page.js | 13 +++++++++++++ pwiki2.html | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pwiki/page.js b/pwiki/page.js index 8d99c15..2ec27cb 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -341,8 +341,18 @@ object.Constructor('BasePage', { // tags... // + /* get tags(){ return async function(){ return (await this.data).tags ?? [] }.call(this) }, + /*/ + get tags(){ + var tags = this.store.tags + var path = pwpath.sanitize(this.path) + return tags instanceof Promise ? + tags.then(function(tags){ + return tags.paths[path] ?? [] }) + : this.store.tags.paths[path] ?? [] }, + //*/ set tags(value){ return async function(){ this.data = { ...(await this.data), @@ -2067,6 +2077,9 @@ module.System = { stores: function(){ return Object.keys(this.store.substores ?? {}) }, + tagslist: function(){ + return this.tags }, + // page parts... // 'line-separator': { text: '
' }, diff --git a/pwiki2.html b/pwiki2.html index 4acd91b..9271e7d 100755 --- a/pwiki2.html +++ b/pwiki2.html @@ -380,7 +380,11 @@ require(['./browser'], function(browser){ lnk.addEventListener('click', refresh) } }) // wait for stuff to finish... - browser.setup.then(function(){ + browser.setup.then(async function(){ + // index... + await logTime( + pwiki.store.index(), + 'Indexing') // show current page... pwiki.location = decodeURI(location.hash).slice(1) }) })