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)")' },
_view: {
text: object.doc`
<style>@include(./Style)</style>
<slot pre/>
<slot header>
@ -2127,6 +2129,10 @@ module.System = {
QuoteActionPage: {
text: '[ native code ]' },
Style: {
text: object.doc`
` },
// page actions...
//

View File

@ -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) }) })

View File

@ -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: