How to add/use Javascript in splashscreen?

58 views
Skip to first unread message

Magnus

unread,
Jun 6, 2020, 7:48:25 PM6/6/20
to TiddlyWiki
I would like to use 


to open a "random" tiddler with the tag factoid in the SplashScreen. Is it even possible?

Thanks
Magnus

Eric Shulman

unread,
Jun 6, 2020, 8:05:33 PM6/6/20
to TiddlyWiki
In order for the splash screen to be displayed before TiddlyWiki is initialised it is embedded as static HTML/CSS within the TiddlyWiki HTML file.
Because the splash screen content is displayed before the TWCore has been initialized, the "tiddler store" doesn't exist yet, and it's not possible to use tags and filters to select and render tiddlers at that point.

-e


Magnus

unread,
Jun 6, 2020, 8:27:14 PM6/6/20
to TiddlyWiki
Ok, just noted when I build the current SplashScreen I have that 

use 
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]

so I thought I could import all tiddler with tag factoid & run the script on them

Eric Shulman

unread,
Jun 6, 2020, 8:40:13 PM6/6/20
to TiddlyWiki
Actually, I might have been overstating the limitations.

The SplashScreen tiddler has to be tagged with $:/tags/RawMarkupWikified/TopBody.  This means that the content of that tiddler can contain wiki syntax, including output of content filtered by matching a tag.

However, the output it produces will then be statically embedded in the HTML file to show that output the next time the file is loaded.  Thus, you *can* select a randomized "factoid" to be included in the SplashScreen when you *save* the file, but you can't select a randomized factoid when the file is loaded.  The randomly selected factoid will remain the same each time the file is re-loaded, and will only change each time you re-save the file.

-e

Magnus

unread,
Jun 6, 2020, 11:00:32 PM6/6/20
to TiddlyWiki
Aah, I see. Thank you, a very good explanation :)


Den söndag 7 juni 2020 kl. 02:40:13 UTC+2 skrev Eric Shulman:
On Saturday, June 6, 2020 at 5:27:14 PM UTC-7, Magnus wrote:
Ok, just noted when I build the current SplashScreen I have that 
use 
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
so I thought I could import all tiddler with tag factoid & run the script on themAah
Reply all
Reply to author
Forward
0 new messages