On May 14, 2:17 am, FND <[email protected]> wrote:
> I was curious whether one could add JavaScript code to a single-tiddler
> theme (sometimes HTML and CSS is not sufficient), so I did 
> this:http://fnd.lewcid.org/tmp/PIMTheme.html

http://www.TiddlyTools.com/#SwitchThemePlugin

add support for 3 additional theme slices:

| Run | ... |
| Check | ... |
| Init | ... |

These slices refer to tiddlers (or tiddler sections) containing
javascript code.

* The code referenced by the Check slice (if any) is invoked before
switching to a selected theme. If this code returns a non-zero (or
true) 'error' result, then the new theme will not be applied. A zero
(or false) value allows the theme switch to continue as usual. For
example, the following code asks for confirmation, allowing the user
to cancel the theme switch:

      return !confirm('Are you sure you want to use this theme?');

* After a theme has been applied, the code referenced by the Init
slice (if any) is invoked. This can be used to perform theme-related
side-effects, such as modifying various config.options['...'] settings
or displaying instructions/messages.

* When switching to another theme, any code referenced by a Reset
slice in the current theme is invoked before the new theme is applied.
If this code returns a non-zero error result, then the new theme will
not be applied. As with the Check code, this can be used to ask the
user to confirm before switching themes. However, the primary intent
of the Reset code is to permit restoration any modified settings that
were altered by Init code that was previously invoked for the current
theme.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" 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/tiddlywiki?hl=en.

Reply via email to