> [1] pioneered by Mike and Jeremy, if I recall correctly
Actually, use of sections to deliver a 'payload' of CSS, HTML, etc.
that is then dynamically loaded as needed, was something that I
developed shortly after sections were first implemented in the core.
Also note that, in addition to directly setting CSS via setStylesheet,
'section payloads' can also be deposited into shadow definitions
during startup processing.
For example, rather than simply loading the CSS payload directly, like
this:
setStylesheet(store.getTiddlerText('MyPlugin##css'),'myPluginStyles');
you could write the following:
config.shadowTiddlers.StyleSheetMyPlugin
=store.getTiddlerText('MyPlugin##css');
var css=store.getRecursiveTiddlerText('StylesheetMyPlugin','',10);
setStylesheet(css,'myPluginStyles');
This code first deposits the payload into a shadow, then retrieves the
shadow content (or content from a customized tiddler of the same name)
to set the actual stylesheet in the browser. The advantage of this
technique is that it allows the user to customize the default CSS to
match the theme used within their document, simply by editing the
shadow so that a 'real' tiddler is created.
During startup, the payload is still deposited into the shadow;
however, because a 'real' tiddler exists, the user-customized CSS will
be applied instead.
enjoy,
-e
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywikidev?hl=en.