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