diff --git a/browser.js b/browser.js index f222dd1..1835c2c 100755 --- a/browser.js +++ b/browser.js @@ -25,18 +25,27 @@ var pouchdbstore = require('./pwiki/store/pouchdb') //--------------------------------------------------------------------- var store = -module.store = - { __proto__: basestore.BaseStore } - .nest({ __proto__: basestore.MetaStore }) +module.store = { + // XXX base localstorage... + __proto__: localstoragestore.localStorageStore, + __prefix__: '--pwiki-root:', + data: localStorage, + /*/ + __proto__: basestore.MetaStore, + //*/ + + next: { __proto__: basestore.BaseStore }, +} module.setup = Promise.all([ // static stores... // - store.update('Settings', - Object.create(basestore.BaseStore).load(page.Settings)), + //store.next.update('System', store.update('System', Object.create(basestore.BaseStore).load(page.System)), + store.update('Settings', + Object.create(basestore.BaseStore).load(page.Settings)), store.update('Test', Object.create(basestore.BaseStore).load(page.Test)), diff --git a/pwiki/page.js b/pwiki/page.js index f2a1e62..9dcb0ba 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -1643,6 +1643,10 @@ module.System = {
` }, + // XXX need to also be able to list things about each store... + stores: function(){ + return Object.keys(this.store.substores ?? {}) }, + // page parts... // 'line-separator': { text: '
' }, @@ -1651,6 +1655,7 @@ module.System = { // base system pages... // // NOTE: these are last resort pages, preferably overloaded in /Templates. + // RecursionError: { text: 'RECURSION ERROR: @quote(../path)' }, NotFoundError: { diff --git a/pwiki/store/base.js b/pwiki/store/base.js index cd88af5..cafa5de 100755 --- a/pwiki/store/base.js +++ b/pwiki/store/base.js @@ -503,7 +503,7 @@ module.BaseStore = { JSON.stringify(res, options.replacer, options.space) : res }, - // XXX NEXT EXPERIMENTAL... + /*/ XXX NEXT EXPERIMENTAL... nest: function(base){ return { __proto__: base @@ -511,6 +511,7 @@ module.BaseStore = { next: this, data: {} } }, + //*/ } diff --git a/pwiki/store/file.js b/pwiki/store/file.js index fc182f3..528f1c6 100755 --- a/pwiki/store/file.js +++ b/pwiki/store/file.js @@ -520,7 +520,8 @@ module.backup = { // XXX add monitor API + cache + live mode (auto on when lock detected)... var FileStoreRO = module.FileStoreRO = { - __proto__: base.BaseStore, + //__proto__: base.BaseStore, + __proto__: base.MetaStore, // XXX __path__: 'data/fs', diff --git a/pwiki/store/localstorage.js b/pwiki/store/localstorage.js index 22de735..c974bd0 100755 --- a/pwiki/store/localstorage.js +++ b/pwiki/store/localstorage.js @@ -20,7 +20,8 @@ var base = require('./base') // XXX EXPERIMENTAL, needs testing in browser... var localStorageStore = module.localStorageStore = { - __proto__: base.BaseStore, + //__proto__: base.BaseStore, + __proto__: base.MetaStore, __prefix__: '--pwiki:', // XXX add caching of unserialized data??? diff --git a/pwiki/store/pouchdb.js b/pwiki/store/pouchdb.js index 9bbbf19..c54a17a 100755 --- a/pwiki/store/pouchdb.js +++ b/pwiki/store/pouchdb.js @@ -20,7 +20,8 @@ var PouchDB = require('pouchdb') var PouchDBStore = module.PouchDBStore = { - __proto__: base.BaseStore, + //__proto__: base.BaseStore, + __proto__: base.MetaStore, // XXX should this be __path__??? // ...this sets the path where the store is created... diff --git a/pwiki2.js b/pwiki2.js index 9a619e3..91ffcaf 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -1,6 +1,14 @@ /********************************************************************** * * +* 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??? +* 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 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.