A tester: Saving TiddlyWiki config settings to local storage

57 views
Skip to first unread message

Charlie Veniot

unread,
Mar 11, 2022, 12:09:15 AM3/11/22
to TiddlyWiki
https://cjveniot.neocities.org/TiddlyWikiDotCom.html

I've taken the tiddlywiki.com instance (I want a good-sized TiddlyWiki to experiment with) and added the following tiddlers:
  • SetLocalStorageItem.js
  • GetLocalStorageItem.js
  • Save Config To Local Storage
  • Startup Actions
Nothing fancy here, just bare-bones to test things out.

When you open that TiddlyWiki instance, go into the Control Panel and set values for the following:
  • $:/themes/tiddlywiki/vanilla/metrics/fontsize
  • $:/themes/tiddlywiki/vanilla/metrics/lineheight
  • $:/themes/tiddlywiki/vanilla/metrics/bodyfontsize
  • $:/themes/tiddlywiki/vanilla/metrics/bodylineheight
Then go to the "Save Config To Local Storage" and press the buttons to save each of those configuration settings to local storage.

Refresh the browser page to reload the TiddlyWiki, and the TiddlyWiki should reload but at startup grab your settings from local storage.

I'm thinking this is really useful for a few things, like:
  • letting viewers of your published TiddlyWiki personalize their experience with your TiddlyWiki in a way that fits them best
  • multi-user TiddlyWiki (single file, nodejs, wherever it is located) personalized settings

Charlie Veniot

unread,
Mar 11, 2022, 1:01:03 PM3/11/22
to TiddlyWiki
Should anybody wonder how what I am prototyping is different from the Local Storage Plugin (very wildly different goals/behaviour in my mind), that is a discussion in this other Google Google thread.

Charlie Veniot

unread,
Mar 11, 2022, 4:43:56 PM3/11/22
to TiddlyWiki
Upon startup, TiddlyWiki, via action-confirm widget, explains that the TiddlyWiki allows saving to local storage a few settings to personalize your experience viewing the TiddlyWiki.  It also explains how to save your personal settings to local storage before closing the TiddlyWiki session.

Finally, it also prompts whether or not you want to load your personal settings from the previous visit.  Nice to have the option.

Eventually, I'll add to the "Save Config To Local Storage" tiddler an option to stop prompting on startup and immediately go ahead and apply personal settings.

And eventually a button to delete personal settings.

And a bunch of other stuff I might not be thinking of at the moment.

On Friday, March 11, 2022 at 1:09:15 AM UTC-4 Charlie Veniot wrote:

Charlie Veniot

unread,
Mar 11, 2022, 9:58:28 PM3/11/22
to TiddlyWiki
(2 images below)

Now, in addition to the previously added prompt, I've setup a checkbox in the "Save Config To Local Storage" tiddler to disable the prompt and immediately apply personal settings.

Give it a spin:  https://cjveniot.neocities.org/TiddlyWikiDotCom.html


The popup confirmation message when accessing the TiddlyWiki:
Screenshot 2022-03-11 10.46.12 PM.png

Save Config To Local Storage tiddler:
Screenshot 2022-03-11 10.50.50 PM.png

phil...@gmail.com

unread,
May 5, 2022, 6:06:41 PM5/5/22
to TiddlyWiki
This. Is. Wicked!!! 

Thank you CJ for this awesome tool. I am building a new TW app on Node for a client, and needed a quick way to save a State Tiddler in Local Storage. This worked perfectly!

In my case here I have a small team of ~5 people who will be using the app. They're all trusted users with same level of permission; but I still need to manage their states individually. Your work helped me set up a simple multi-user TiddlyWiki by letting users select their name when they first come to the app and storing that value. Now as long as they are in that browser the app will only show their stuff! 

I will do a more detailed writeup of this when I have some time. Basically I just built all my views and macros to accept a  $USER$ variable. Then I store the user's state in his or her tiddler. 

Cheers!

Phil 

Charlie Veniot

unread,
May 5, 2022, 8:01:01 PM5/5/22
to TiddlyWiki
G'day Phil,

That rocks !

You letting me know that something I played around with is helping you out, it makes my day.  Very much appreciate, and thank-you for describing the use case: that's a gift for everybody.

Very good stuff.
Reply all
Reply to author
Forward
0 new messages