[tw5] Re: How to reset tiddler fields when it opens

2021-05-18 Thread PMario
On Monday, May 17, 2021 at 11:08:35 AM UTC+2 vpl wrote:

I try to invokea macro that reset tiddler fields when we open it. By 
> opening I do not mean *for editing*, I mean the tiddler is invoked via a 
> link for example
>

h, You should have highlighted the _not_  ... I did only see/read *for 
editing*. 

I do have a widget, which is called <$trigger actions=<> /> ... 
It is "triggered" whenever the widget is rendered or re-rendered. ... 

So it has some potential to completely brick your wiki, if done wrong. ... 

The risk to loose data is especially high, while developing the action-code 
and the "preview pane" is active. Because <$action-setfield .. with wrong 
parameters can completely ruin tiddler content. ... So be warned  
BACKUP - BACKUP  - BACKUP 

see: https://wikilabs.github.io/editions/trigger/

There is no documentation yet. So you have to open the tiddlers in the 
link, to see what's going on. 

I would implement the development code like this: 

title: myFooter
tags: $:/tags/ViewTemplate

<$list filter="[all[current]tag[test]]">
<$trigger actions= ./>


So you can use the tag: test to switch the action on / off. 

have fun!
mario
PS: Be sure to BACKUP - BACKUP  - BACKUP 
PPS: The preview-pane will trigger the actions!!!

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7178fff0-30e5-43ef-a3bf-7952019277a3n%40googlegroups.com.


[tw5] Re: How to reset tiddler fields when it opens

2021-05-17 Thread TW Tones
vpl,

You need to delve into the link catcher widget 
. You can then add actions 
(ideally conditional) , perhaps designing it to happen with a particular 
modifier key (not ctrl) pressed at the same time as a click. You could try 
and intervein in the core process, but if you are happy to generate a list 
of tiddler links that have their own link catcher and matching additional 
actions it would be safer and easier.

Tones

On Monday, 17 May 2021 at 21:17:46 UTC+10 vpl wrote:

> Hi
>
> Thanks a lot for your answer
> In fact I have a tiddler containing different fields that I use in 
> different macros
> I've successfully added a "Reset" button that reset all my fields to the 
> default value
> What I'm looking for is a way to avoid this "manual" reset operation and 
> trigger automatically the macro when the tiddler is invoked from the home 
> tiddler for ex (via a link) or from the search button.
>
> So I suspect that internally tiddlywiki has a mechanism to invoke macro at 
> that time, but I cannot find it
>
> Thanks again for your support
>
> Regards
>
> Le lundi 17 mai 2021 à 12:42:41 UTC+2, PMario a écrit :
>
>> Hi vpl,
>>
>> Action-widgets are only activated, if a "user-action" happens. So mainly 
>> by clicking a button, radio- and checkbox-widget, keyboard-shortcuts and so 
>> on. 
>>
>> You would need to modify the "edit-button". ... But why do you need this?
>>
>> see: 
>> https://tiddlywiki.com/#WidgetMessage%3A%20tm-edit-tiddler:%5B%5BWidgetMessage%3A%20tm-edit-tiddler%5D%5D%20%24%3A%2Fcore%2Fui%2FButtons%2Fedit
>>
>> -mario
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6fa2b839-5205-4d8a-bae5-18a9b9f37b53n%40googlegroups.com.


[tw5] Re: How to reset tiddler fields when it opens

2021-05-17 Thread vpl
Hi

Thanks a lot for your answer
In fact I have a tiddler containing different fields that I use in 
different macros
I've successfully added a "Reset" button that reset all my fields to the 
default value
What I'm looking for is a way to avoid this "manual" reset operation and 
trigger automatically the macro when the tiddler is invoked from the home 
tiddler for ex (via a link) or from the search button.

So I suspect that internally tiddlywiki has a mechanism to invoke macro at 
that time, but I cannot find it

Thanks again for your support

Regards

Le lundi 17 mai 2021 à 12:42:41 UTC+2, PMario a écrit :

> Hi vpl,
>
> Action-widgets are only activated, if a "user-action" happens. So mainly 
> by clicking a button, radio- and checkbox-widget, keyboard-shortcuts and so 
> on. 
>
> You would need to modify the "edit-button". ... But why do you need this?
>
> see: 
> https://tiddlywiki.com/#WidgetMessage%3A%20tm-edit-tiddler:%5B%5BWidgetMessage%3A%20tm-edit-tiddler%5D%5D%20%24%3A%2Fcore%2Fui%2FButtons%2Fedit
>
> -mario
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/13941061-4f6e-4358-9606-979431c774acn%40googlegroups.com.


[tw5] Re: How to reset tiddler fields when it opens

2021-05-17 Thread PMario
Hi vpl,

Action-widgets are only activated, if a "user-action" happens. So mainly by 
clicking a button, radio- and checkbox-widget, keyboard-shortcuts and so 
on. 

You would need to modify the "edit-button". ... But why do you need this?

see: 
https://tiddlywiki.com/#WidgetMessage%3A%20tm-edit-tiddler:%5B%5BWidgetMessage%3A%20tm-edit-tiddler%5D%5D%20%24%3A%2Fcore%2Fui%2FButtons%2Fedit

-mario

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/dfccf16e-e3df-449c-b623-540227affd68n%40googlegroups.com.