Theme switching

28 views
Skip to first unread message

FrD

unread,
Dec 20, 2018, 6:33:26 AM12/20/18
to TiddlyWikiDev
Hi,

I'm trying to figure out how theme switching works.
I've found$:/core/modules/pluginswitcher.js  and where the theme manager is started ($:/core/modules/startup.js).

What I can't find is how the tiddlers related to the "previous" theme are deleted (?) or removed (?) from the store.
I can see that they are "unregistered" and then I loose their trail ...

If somebody could fill the blanks ...

Thanks

Regards

FrD


Jeremy Ruston

unread,
Dec 20, 2018, 6:40:18 AM12/20/18
to TiddlyWikiDev
Hi FrD



On 20 Dec 2018, at 11:33, FrD <soku...@gmail.com> wrote:

Hi,

I'm trying to figure out how theme switching works.
I've found$:/core/modules/pluginswitcher.js  and where the theme manager is started ($:/core/modules/startup.js).

What I can't find is how the tiddlers related to the "previous" theme are deleted (?) or removed (?) from the store.
I can see that they are "unregistered" and then I loose their trail …

You’ve found the right place: there are two instances of the plugin switcher, one for themes and one for languages.

At a high level, each time a plugin is switched in or out (e.g. as the result of the theme or language being changed), the system rebuilds the cache of shadow tiddlers by re-reading the tiddlers from each of the active plugins. So, when we switch from one theme to another the shadow tiddlers from the old theme are not included in the new cache of shadow tiddlers.

Best wishes

Jeremy.


If somebody could fill the blanks ...

Thanks

Regards

FrD



--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/b0181f2c-77a8-492d-b8d3-c88eebc4d7b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

FrD

unread,
Dec 20, 2018, 6:56:36 AM12/20/18
to TiddlyWikiDev
Hi Jeremy,

Thanks for your quick answer. I see now that the call to unpackPluginTiddlers does the job !

	// Unpack the current theme tiddlers
	$tw.wiki.unpackPluginTiddlers();

My mistake was to believe it was "unpacking" only the new theme tiddlers. But I can see it re-builds the cache of shadow tiddlers from all "active" plugins.

Thanks and regards

FrD
Reply all
Reply to author
Forward
0 new messages