Hi Tony,
thanks a lot for your concrete code.
For my wished toggle-button I found another solution, which works really
fantastic.
But no matter- maybe, your code will help another time in other situations.
So I will keep it.
Every concrete code-example, where I can see in live-mode what it does,
helps me to learn.
In this way- thanks :-)
(My toggle-button - solution now is also only one tiddler. Code:
\define SwapActiveStyle(style1,style2)
<$fieldmangler tiddler="$style1$">
<$action-sendmessage $message="tm-add-tag" $param="$:/tags/Stylesheet"/>
</$fieldmangler>
<$fieldmangler tiddler="$style2$">
<$action-sendmessage $message="tm-remove-tag" $param="$:/tags/Stylesheet"/>
</$fieldmangler>
\end
\define swapper(style1,style2)
<$vars sheet="$:/tags/Stylesheet">
<$list filter="[[$style1$]tag<sheet>]">
<$button><$text text="""<m"""/>
<<SwapActiveStyle """$style2$""" """$style1$""">>
</$button>
</$list>
<$list filter="[[$style2$]tag<sheet>]">
<$button><$text text=""">D"""/>
<<SwapActiveStyle """$style1$""" """$style2$""">>
</$button>
</$list>
</$vars>
\end
<<swapper DesktopStyle mobilStyle>>
The tiddler "DesktopStyle" is for optimized view & handling on the Laptop.
And the tiddler "mobilStyle" for optimized view & handling on my tablet.
And Birthes code lets the sidebar to behave like expected:
<<if-no-sidebar "
.tc-story-river {
width: calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}});
}
.tc-tiddler-frame {
width: 100%;
}
">>
Maybe, these codes helps other people too...
Surya
On Thursday, October 10, 2019 at 5:29:48 AM UTC+2, TonyM wrote:
>
> Syrya,
>
> A Quick example, use on tiddlywiki.com and explore how this works, one
> button allows another button to be toggled.
>
> <$button set="!!edit-fields-list" setTo="" class="tc-btn-invisible"
> tooltip="Create edit-fields-list and customise which fields to display for
> edit in view mode"><$action-setfield
> show-edit-fields="yes"/>{{$:/core/images/edit-button}}{{$:/core/images/storyview-classic}}</$button>
>
>
> <$reveal type="match" state="!!show-edit-fields" text="yes"><$button
> set="!!show-edit-fields" setTo="no" class="tc-btn-invisible" tooltip="close
> edit fields
> view">{{$:/core/images/preview-closed}}{{$:/core/images/storyview-classic}}</$button></$reveal>
> <$reveal type="match" state="!!show-edit-fields" text="no"><$button
> set="!!show-edit-fields" setTo="yes" class="tc-btn-invisible"
> tooltip="open edit fields
> view">{{$:/core/images/preview-open}}{{$:/core/images/storyview-classic}}</$button></$reveal>
>
>
> The first allows you to create the show-edit-fields. if this field exists
> the second button(s) (one at a time displayed but made up of two buttons)
> provides the ability to toggle the value yes/no.
>
> Regards
> Tony
>
> On Thursday, October 10, 2019 at 11:41:30 AM UTC+11, Surya wrote:
>>
>> Hi Tony,
>>
>> that sounds interesting!
>> But I really don't know how to do , I mean how to write what you describe.
>> And please believe me, I am searching for the codes and learn from them
>> and try to modify them and so on and so on.
>> Doing that since 3 days รก 7 hours only for this one button. And the same
>> for many other wanted functions, sometimes even more time spending. And
>> knowing that somebody here possibly knows the code...
>>
>> Thanks for your help, Surya
>>
>>
>> On Tuesday, October 8, 2019 at 10:31:26 AM UTC+2, TonyM wrote:
>>>
>>> A quick tip
>>>
>>> Create two buttons one mobile, one desktop in the same tiddler. set an
>>> initial value then display one when mobile selected hide it when desktop is
>>> enabled and visa versa for the other. Basically have a complex toggle.
>>>
>>> You can load each button with multiple actions.
>>>
>>> Forcing the initial value stops you having to deal with the first button
>>> press, ie before either is pressed.
>>>
>>> Remember you can search for the code for any existing button core or
>>> coming with a plugin that behaves similarly to what you want and learn from
>>> how its done, even clone and modify.
>>>
>>> Regards
>>> Tony
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/b90abb6a-9ca8-4078-ac46-16f4cb43b767%40googlegroups.com.