From d8814fd182a1592837da57cc96b205821a316985 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 8 Aug 2022 12:29:02 +0300 Subject: [PATCH] notes... Signed-off-by: Alex A. Naanou --- lib/_module.js | 2 +- pwiki/{plugins => dom}/README | 0 pwiki/dom/wikiword.js | 17 +++++++++++++++++ pwiki/filters/base.js | 1 + pwiki/page.js | 9 +++++++++ pwiki2.js | 25 ++++++++++++++++++++----- 6 files changed, 48 insertions(+), 6 deletions(-) rename pwiki/{plugins => dom}/README (100%) create mode 100755 pwiki/dom/wikiword.js diff --git a/lib/_module.js b/lib/_module.js index a8ef802..8df95b9 100755 --- a/lib/_module.js +++ b/lib/_module.js @@ -10,7 +10,7 @@ -/*********************************************************************/ +//--------------------------------------------------------------------- diff --git a/pwiki/plugins/README b/pwiki/dom/README similarity index 100% rename from pwiki/plugins/README rename to pwiki/dom/README diff --git a/pwiki/dom/wikiword.js b/pwiki/dom/wikiword.js new file mode 100755 index 0000000..f812242 --- /dev/null +++ b/pwiki/dom/wikiword.js @@ -0,0 +1,17 @@ +/********************************************************************** +* +* +* +**********************************************************************/ +((typeof define)[0]=='u'?function(f){module.exports=f(require)}:define) +(function(require){ var module={} // make module AMD/node compatible... +/*********************************************************************/ + + + + + + + +/********************************************************************** +* vim:set ts=4 sw=4 : */ return module }) diff --git a/pwiki/filters/base.js b/pwiki/filters/base.js index caf0150..06df7ab 100755 --- a/pwiki/filters/base.js +++ b/pwiki/filters/base.js @@ -21,6 +21,7 @@ function(...args){ //--------------------------------------------------------------------- +// XXX this does not seem to handle html well... var WIKIWORD_PATTERN = RegExp('('+[ diff --git a/pwiki/page.js b/pwiki/page.js index e12890a..f7831c5 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -816,6 +816,8 @@ object.Constructor('Page', BasePage, { // explicit shown/hidden arguments are given. // NOTE: hidden has precedence over shown if both are given. // + // XXX revise the use of hidden/shown use mechanic and if it's + // needed... // XXX how do we handle a slot defined within a slot???? // ...seems that we'll fall into recursion on definition... slot: Macro( @@ -1095,6 +1097,13 @@ module.DOMPage = object.Constructor('DOMPage', Page, { dom: undefined, + plugins: { + // XXX + wikiword: undefined, + }, + + // events... + // // XXX might be a good idea to move this up to Page and trigger when // done updating... onLoad: types.event.Event('onLoad'), diff --git a/pwiki2.js b/pwiki2.js index 4e84e23..4b887f2 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -13,6 +13,7 @@ * XXX add action to reset overloaded (bootstrap) pages... * - per page * - global +* XXX Q: can we access fs from a pwa??? * * * @@ -22,16 +23,30 @@ * - test localStorage / sessionStorage -- DONE * - test pouch -- DONE * - render page -- DONE -* - navigation +* - navigation -- DONE * - hash/anchor -- DONE -* - service worker -* ...handle relative urls (???) * - editor and interactivity * - migrate bootstrap * - store topology -* - WikiWord -- DONE * - markdown -- DONE?? +* - WikiWord -- +* currently this is broken as it does not know how to deal with HTML +* this can be solved by one of: +* - make this a dom filter and only handle text nodes (as v1-2) +* - add a way to go around tags (as pwiki/parser) +* the first approach looks more promising... +* - dom filters ??? +* does this need to be a pWiki level thing or just a js call/load?? +* ...this can be used to contain all to page-side stuff like: +* - hash handling / navigation +* - editors +* - wikiwords +* - configuration +* - defaults +* - System/config (global) * - pwa +* - service worker ??? +* ...handle relative urls (???) * - cli * - basic wiki manipulations (1:1 methods) * - import/export/sync @@ -39,7 +54,7 @@ * - archive old code * - update docs * - refactor and cleanup -* - module structure -- DONE +* - module structure -- REVISE * - pack as electron app (???) * *