On Saturday, 15 December 2018 13:47:23 UTC+1, PMario wrote: > > Hi Joe, > > That <<tabs ..>> macro internally uses the <$reveal> widget. The reveal > widget stores it's state in a state-tiddler, as you found out. The strange > number at the end is a hash to make the state tiddler name unique. Unique > state names are needed because of this: > > Copy the following code into a new tiddler and save it: > > <$button set="$:/state/SampleReveal1" setTo="show">Show me</$button> > <$button set="$:/state/SampleReveal1" setTo="hide">Hide me</$button> > > <$reveal type="match" state="$:/state/SampleReveal1" text="show"> > > ! This is the revealed content > And this is some text > > </$reveal> > > <$button set="$:/state/SampleReveal1" setTo="show">Show me</$button> > <$button set="$:/state/SampleReveal1" setTo="hide">Hide me</$button> > > <$reveal type="match" state="$:/state/SampleReveal1" text="show"> > > ! This is the revealed content > And this is some text > > </$reveal> > > You can see 4 buttons, which will show and hide some text. ... BUT only 1 > button is needed to expand both sections. ... that's a problem. > > That's why the tabs-macro us the <<qualify >> macro to create unique > names. > > Click the link: list of tiddlers > <https://tiddlywiki.com/#RevealWidget:RevealWidget%20%5B%5Bqualify%20Macro%5D%5D%20%5B%5Bqualify%20Macro%20(Examples)%5D%5D%20%5B%5Btransclusion%20Variable%5D%5D>, > > that may help > > ------------------------------- > > >> If I close the window containing the tabs the state tiddler is not >> destroyed. But it's not written to disk - so the state change is transient. >> > > $:/state/ .. tiddlers are saved, if you save the wiki. > $:/state/popup/ ... are not saved. > > The shadow-tiddler: $:/core/save/all contains some code that allows us to > define, what's saved, and what not. > > \define saveTiddlerFilter() > [is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] > -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] > -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] > $(publishFilter)$ > \end > > have fun! > mario >
Thanks Mario, Yes this is fun. Golly -- using global state variables for communication between tiddlers -- now where have I seen that before? Cheers /Joe -- 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 [email protected]. To post to this group, send email to [email protected]. 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/6cd309a8-d1c0-4fe0-bf63-6768a1ee6754%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
