diff --git a/browser.js b/browser.js index 53174d5..3b5b1be 100755 --- a/browser.js +++ b/browser.js @@ -51,8 +51,8 @@ Promise.all([ store.next.update( pwpath.sanitize(pwpath.SYSTEM_PATH), Object.create(basestore.BaseStore).load(page.System)), - store.update('Settings', - Object.create(basestore.BaseStore).load(page.Settings)), + store.update('.config', + Object.create(basestore.BaseStore).load(page.Config)), store.update('Test', Object.create(basestore.BaseStore).load(page.Test)), diff --git a/pwiki/page.js b/pwiki/page.js index 4554b27..9f40b92 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -1313,7 +1313,7 @@ object.Constructor('Page', BasePage, { '!': Object.assign( function(){ - return this.get('.:$ARGS', {energetic: true}).raw }, + return this.get('..:$ARGS', {energetic: true}).raw }, {energetic: true}), // XXX DEBUG -- remove these... @@ -1790,16 +1790,11 @@ module.System = { text: '@include(.:$ARGS isolated join="@source(file-separator)")' }, // XXX /rootpath here is not relative -- makes reuse harder... _view: { - // XXX can we avoid explicitly passing args to ./location ???? - // i.e. do: - // @source(./location) - // instead of (current): - // @source(./location:$ARGS) text: object.doc` - @source(./location) - + @source(./location/!) +
@@ -1838,7 +1833,7 @@ module.System = { /*/ _edit: { text: - '@source(./path)' + '@source(./path/!)' +'
' +'' +'

`}, // XXX debug... - _path: {text: '@source(./path join=" ")'}, - _location: {text: '@source(./location join=" ")'}, + _path: {text: '@source(./path/! join=" ")'}, + _location: {text: '@source(./location/! join=" ")'}, list: { @@ -2166,8 +2161,8 @@ PAGES=100 for(var i=0; iExport' }, // XXX diff --git a/pwiki2.html b/pwiki2.html index 3450f88..633c7fe 100755 --- a/pwiki2.html +++ b/pwiki2.html @@ -297,12 +297,20 @@ require(['./browser'], function(browser){ // Export... // XXX -var exportData = async function(){ - var blob = new Blob([await pwiki.store.json(true)], {type: "text/plain;charset=utf-8"}); +var exportData = async function(options={}){ + var filename + if(typeof(options) == 'string'){ + filename = options + options = arguments[1] ?? {} } + var blob = new Blob( + [await pwiki.store.json({stringify: true, space: 4, ...options})], + {type: "text/plain;charset=utf-8"}); var a = document.createElement('a') var blobURL = a.href = URL.createObjectURL(blob) - a.download = 'pWiki-dump.json' + a.download = filename + ?? options.filename + ?? 'pWiki-dump.json' //document.body.appendChild(a) a.dispatchEvent(new MouseEvent("click")) diff --git a/pwiki2.js b/pwiki2.js index 102cf11..4407852 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -4,6 +4,8 @@ * XXX ASAP start writing docs in pwiki * - WYSIWYG markdown editor/viewer (ASAP) * - fs store/export in browser or a simple way to export/import... +* +* * XXX might also be a good idea to investigate a .tree directory index * as a supplement to .paths() * XXX Q: can we access fs from a pwa??? @@ -33,6 +35,7 @@ * +--------------+ . . search * order is not relevant here... * each of the methods narrows down the previous' results +* XXX revise/update sort... * XXX FEATURE tags: might be a good idea to add a .__match__(..) hook * to enable store-level matching optimization... * ...not trivial to route to alk the stores... @@ -52,9 +55,6 @@ * i.e. a way to pass tags through path... * /some/path:tags=a,b,c * XXX FEATURE images... -* XXX rename?? -* System -> .system -* Config -> .pwiki * XXX async/live render... * might be fun to push the async parts of the render to the dom... * ...i.e. return a partially rendered DOM with handlers to fill @@ -93,7 +93,6 @@ * any resyrictions other than the internally reserved * cars... * (currently: '#', and ':') -* XXX revise/update sort... * XXX ASAP: MetaStore: need to correctly integrate the following store * methods: * .get(..) -- DONE @@ -488,8 +487,8 @@ Promise.all([ store.next.update( pwpath.sanitize(pwpath.SYSTEM_PATH), Object.create(basestore.BaseStore).load(page.System)), - store.update('Settings', - Object.create(basestore.BaseStore).load(page.Settings)), + store.update('.config', + Object.create(basestore.BaseStore).load(page.Config)), ])