From e3948d3a3a0101fee45b2607b4193b8f871a5f32 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 28 Oct 2022 01:44:04 +0300 Subject: [PATCH] reworked the global style... Signed-off-by: Alex A. Naanou --- pwiki/page.js | 6 ++++++ pwiki2.html | 13 ++++++++++--- pwiki2.js | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pwiki/page.js b/pwiki/page.js index b51bd19..e2eeb9e 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -1920,6 +1920,8 @@ module.System = { text: '@include(.:$ARGS isolated join="@source(file-separator)")' }, _view: { text: object.doc` + + @@ -2127,6 +2129,10 @@ module.System = { QuoteActionPage: { text: '[ native code ]' }, + Style: { + text: object.doc` + ` }, + // page actions... // diff --git a/pwiki2.html b/pwiki2.html index 56e355d..0a83f66 100755 --- a/pwiki2.html +++ b/pwiki2.html @@ -239,11 +239,13 @@ require.config({ //--------------------------------------------------------------------- // Editor -- save changes... +/* XXX GLOBAL_STYLE // XXX might be a good idea to make this a method of pwiki??? var STYLE_UPDATED = false var updateStyle = async function(){ document.querySelector('#style').innerHTML = await pwiki.get('/.config/Style/_raw').text } +//*/ // XXX might be a good idea to make this a method of pwiki??? var CONFIG_UPDATED = false @@ -367,10 +369,13 @@ require(['./browser'], function(browser){ +(this.hash ? '#'+this.hash : '')) + + /* XXX GLOBAL_STYLE // style... if(STYLE_UPDATED){ STYLE_UPDATED = false await updateStyle() } + //*/ // config... if(CONFIG_UPDATED){ CONFIG_UPDATED = false @@ -411,8 +416,9 @@ require(['./browser'], function(browser){ // NOTE: the actual updates are done .onNavigate(..) pwiki.store .update(function(_, path){ - if(path == '/.config/Style'){ - STYLE_UPDATED = true } + // XXX GLOBAL_STYLE + //if(path == '/.config/Style'){ + // STYLE_UPDATED = true } if(path == '/.config/Config'){ CONFIG_UPDATED = true } }) @@ -423,7 +429,8 @@ require(['./browser'], function(browser){ pwiki.store.index(), 'Indexing') // setup global stuff... - updateStyle() + // XXX GLOBAL_STYLE + //updateStyle() updateConfig() // show current page... pwiki.location = decodeURI(location.hash).slice(1) }) }) diff --git a/pwiki2.js b/pwiki2.js index acbf89b..acede5a 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -18,6 +18,8 @@ * - CLI - * * +* XXX STYLE: should style loading be done via the event mechanics or via +* the base templates??? * XXX NAMING: revise .onNavigate(..) and .onBeforeNavigate(..) event names... * XXX BUG: parser: * This will break: