reworked the global style...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-10-28 01:44:04 +03:00
parent 2c6c3d367b
commit e3948d3a3a
3 changed files with 18 additions and 3 deletions

View File

@ -1920,6 +1920,8 @@ module.System = {
text: '@include(.:$ARGS isolated join="@source(file-separator)")' }, text: '@include(.:$ARGS isolated join="@source(file-separator)")' },
_view: { _view: {
text: object.doc` text: object.doc`
<style>@include(./Style)</style>
<slot pre/> <slot pre/>
<slot header> <slot header>
@ -2127,6 +2129,10 @@ module.System = {
QuoteActionPage: { QuoteActionPage: {
text: '[ native code ]' }, text: '[ native code ]' },
Style: {
text: object.doc`
` },
// page actions... // page actions...
// //

View File

@ -239,11 +239,13 @@ require.config({
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Editor -- save changes... // Editor -- save changes...
/* XXX GLOBAL_STYLE
// XXX might be a good idea to make this a method of pwiki??? // XXX might be a good idea to make this a method of pwiki???
var STYLE_UPDATED = false var STYLE_UPDATED = false
var updateStyle = async function(){ var updateStyle = async function(){
document.querySelector('#style').innerHTML = document.querySelector('#style').innerHTML =
await pwiki.get('/.config/Style/_raw').text } await pwiki.get('/.config/Style/_raw').text }
//*/
// XXX might be a good idea to make this a method of pwiki??? // XXX might be a good idea to make this a method of pwiki???
var CONFIG_UPDATED = false var CONFIG_UPDATED = false
@ -367,10 +369,13 @@ require(['./browser'], function(browser){
+(this.hash ? +(this.hash ?
'#'+this.hash '#'+this.hash
: '')) : ''))
/* XXX GLOBAL_STYLE
// style... // style...
if(STYLE_UPDATED){ if(STYLE_UPDATED){
STYLE_UPDATED = false STYLE_UPDATED = false
await updateStyle() } await updateStyle() }
//*/
// config... // config...
if(CONFIG_UPDATED){ if(CONFIG_UPDATED){
CONFIG_UPDATED = false CONFIG_UPDATED = false
@ -411,8 +416,9 @@ require(['./browser'], function(browser){
// NOTE: the actual updates are done .onNavigate(..) // NOTE: the actual updates are done .onNavigate(..)
pwiki.store pwiki.store
.update(function(_, path){ .update(function(_, path){
if(path == '/.config/Style'){ // XXX GLOBAL_STYLE
STYLE_UPDATED = true } //if(path == '/.config/Style'){
// STYLE_UPDATED = true }
if(path == '/.config/Config'){ if(path == '/.config/Config'){
CONFIG_UPDATED = true } }) CONFIG_UPDATED = true } })
@ -423,7 +429,8 @@ require(['./browser'], function(browser){
pwiki.store.index(), pwiki.store.index(),
'Indexing') 'Indexing')
// setup global stuff... // setup global stuff...
updateStyle() // XXX GLOBAL_STYLE
//updateStyle()
updateConfig() updateConfig()
// show current page... // show current page...
pwiki.location = decodeURI(location.hash).slice(1) }) }) pwiki.location = decodeURI(location.hash).slice(1) }) })

View File

@ -18,6 +18,8 @@
* - CLI - * - 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 NAMING: revise .onNavigate(..) and .onBeforeNavigate(..) event names...
* XXX BUG: parser: * XXX BUG: parser:
* This will break: * This will break: