Re: [tw5] Re: [TW 5.1.23] New features - Toggle operator and Datat tiddler

2021-01-05 Thread TiddlyTweeter
M, Very good example! Thanks. TT On Tuesday, 5 January 2021 at 05:13:58 UTC+1 Mohammad wrote: > Hi Josiah, > > > On Mon, Jan 4, 2021 at 11:28 AM TiddlyTweeter wrote: > >> Toggles/Cyclers are very, very useful! >> >> But I think *I need to see more examples* to actually understand how to >>

Re: [tw5] Re: [TW 5.1.23] New features - Toggle operator and Datat tiddler

2021-01-04 Thread Mohammad Rahmani
Hi Josiah, On Mon, Jan 4, 2021 at 11:28 AM TiddlyTweeter wrote: > Toggles/Cyclers are very, very useful! > > But I think *I need to see more examples* to actually understand how to > implement them in TW. > > One common use case, for theoretical example, could be cycling through > Stylesheets.

Re: [tw5] Re: [TW 5.1.23] New features - Toggle operator and Datat tiddler

2021-01-03 Thread TiddlyTweeter
Toggles/Cyclers are very, very useful! But I think *I need to see more examples* to actually understand how to implement them in TW. One common use case, for theoretical example, could be cycling through Stylesheets. The point being to have one button that toggles through a set of different

Re: [tw5] Re: [TW 5.1.23] New features - Toggle operator and Datat tiddler

2021-01-03 Thread Mohammad Rahmani
Hi Mark, Nice solution! Saq is the developer behind toggle and cycle operators. As much as I know toggle is a listop operator and that is the reason for such behaviour. Of course Saq can explain this much better than me. Best wishes Mohammad On Sun, Jan 3, 2021 at 11:43 PM 'Mark S.' via

Re: [tw5] Re: [TW 5.1.23] New features - Toggle operator and Datat tiddler

2021-01-03 Thread 'Mark S.' via TiddlyWiki
Ok, I think you can do it without the list widget using this instead of the action-listops: <$action-setfield $tiddler=<> $index="mode" $value={{{ [getindex[mode]compare:string:eq[author-mode]][getindex[mode]compare:string:eq[presentation-mode]]+[toggle[author-mode],[presentation-mode]] }}}

Re: [tw5] Re: [TW 5.1.23] New features - Toggle operator and Datat tiddler

2021-01-01 Thread Mohammad Rahmani
Hi Mark, Yes, the first loop is not necessary in all cases except one, if a user or another action sets a third value in that index of data tiddler. As toggle is a listops operator, it does not toggle the whole value, so you may see your code has appended a value to the list of current values.

[tw5] Re: [TW 5.1.23] New features - Toggle operator and Datat tiddler

2021-01-01 Thread 'Mark S.' via TiddlyWiki
Hi Mohammad! Interesting! But the first list loop doesn't seem to be necessary. On Friday, January 1, 2021 at 6:46:14 AM UTC-8 Mohammad wrote: > I use data tiddler (Json tiddler) to store settings and configs of a > plugin or other tools. > > Below is an example how to toggle/switch a value in