tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-10-26 19:18:21 +03:00
parent 9343c4f0c4
commit a0152c4192
2 changed files with 18 additions and 1 deletions

View File

@ -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: '<br>' },

View File

@ -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) }) })