[tw] combining themes and plugins

90 views
Skip to first unread message

FND

unread,
May 14, 2010, 5:17:31 AM5/14/10
to TiddlyWiki
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

Nothing that hasn't been done before, and not very polished either - but
I figured it might be worth sharing in case others wanna build on it.

(Note that what appears to be story columns are just floated tiddlers,
which is hardly suitable for regular use.)


-- F.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To post to this group, send email to tiddl...@googlegroups.com.
To unsubscribe from this group, send email to tiddlywiki+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tiddlywiki?hl=en.

Eric Shulman

unread,
May 14, 2010, 5:42:46 AM5/14/10
to TiddlyWiki


On May 14, 2:17 am, FND <F...@gmx.net> 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

Eric Shulman

unread,
May 14, 2010, 5:56:26 AM5/14/10
to TiddlyWiki
errata:

> adds support for 3 additional theme slices:
>
> | Check | ... |
> | Init | ... |
> | Reset | ... |

-e
Reply all
Reply to author
Forward
0 new messages