TW5 Linkcatcher

152 views
Skip to first unread message

Danielo Rodríguez

unread,
Apr 8, 2014, 10:18:52 AM4/8/14
to tiddl...@googlegroups.com
Hello,

I noticed the linkcatcher has a special feature that is not used in any place. The message parameter.

<$linkcatcher message="tw-close-all-tiddlers">

Does that mean that the linkcatcher will intercept any other messache and change it? or will it deliver both messages? Is it possible to construct a chain?

Other question: Is possible to use a tw-save-tiddler without navigating to it? I'm editing some drafts from other tiddlers and I don't want to open the resultant tiddlers after clicking my custom save button.

Regards.

Jeremy Ruston

unread,
Apr 9, 2014, 3:55:15 AM4/9/14
to TiddlyWiki
Hi Danielo

> Does that mean that the linkcatcher will intercept any other messache and change it? or will it deliver both messages? Is it possible to construct a chain?

The link catcher only responds to navigation messages. It absorbs the navigation event and just sends the message identified in the `message` attribute. So, one could create a chain of navigation message handlers, I think, but not of arbitrary messages.

> I noticed the linkcatcher has a special feature that is not used in any place 

The linkcatcher's ability to forward a message is actually used as part of the tag drop down handling:


> Other question: Is possible to use a tw-save-tiddler without navigating to it? I'm editing some drafts from other tiddlers and I don't want to open the resultant tiddlers after clicking my custom save button.

It sounds like you might be better off displaying these tiddlers in a custom sub-story. See the interactive version of this tiddler on tiddlywiki.com:


If you put the tiddlers you're editing in a story you'll still get the navigation behaviour, but the navigation will take place within the substory, which is probably what you want.

Best wishes

Jeremy






--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Danielo Rodríguez

unread,
Apr 9, 2014, 4:40:34 AM4/9/14
to tiddl...@googlegroups.com, jeremy...@gmail.com

The link catcher only responds to navigation messages. It absorbs the navigation event and just sends the message identified in the `message` attribute. So, one could create a chain of navigation message handlers, I think, but not of arbitrary messages.

So it stops the event propagation right? Maybe it could be interesting to capture a event, react and raise a secondary event.
 
> I noticed the linkcatcher has a special feature that is not used in any place 

The linkcatcher's ability to forward a message is actually used as part of the tag drop down handling:


Thank you
 
> Other question: Is possible to use a tw-save-tiddler without navigating to it? I'm editing some drafts from other tiddlers and I don't want to open the resultant tiddlers after clicking my custom save button.

It sounds like you might be better off displaying these tiddlers in a custom sub-story. See the interactive version of this tiddler on tiddlywiki.com:


If you put the tiddlers you're editing in a story you'll still get the navigation behaviour, but the navigation will take place within the substory, which is probably what you want.

Best wishes

Jeremy


That is very interesting. Is not what I was looking for exactly but it could work.
But I see it very interesting for TOC tables. Really really interesting. 

Jeremy Ruston

unread,
Apr 9, 2014, 6:19:01 AM4/9/14
to Danielo Rodríguez, TiddlyWiki
Hi Danielo
 
So it stops the event propagation right? Maybe it could be interesting to capture a event, react and raise a secondary event.

That is exactly what the linkcatcher widget does: it captures the tw-navigate event and raises the event named in the `message` attribute. Do you mean that you'd like the ability to capture arbitrary messages?

Best wishes

Jeremy

Danielo Rodríguez

unread,
Apr 9, 2014, 9:37:22 AM4/9/14
to tiddl...@googlegroups.com
Hello Jeremy

I didn't explained myself. I mean capture an event, react is some way and then launch a different one.
What if I want to react to a navigate event and navigate to that tiddler too? For example for clear the search field after clicking a link. Maybe using a button?

Jeremy Ruston

unread,
Apr 9, 2014, 9:53:11 AM4/9/14
to TiddlyWiki
Hi Danielo

>  I didn't explained myself. I mean capture an event, react is some way and then launch a different one.
> What if I want to react to a navigate event and navigate to that tiddler too? For example for clear the search field after clicking a link. Maybe using a button?

That makes sense.

Right now, as you've discovered, widgets that perform actions in response to user interface input events are fairly restricted in what they can do:

* Emit a message
* Set a tiddler/field/property to a value
* Apply popup processing to a state tiddler
etc

All of the actions at the moment are "canned", without much flexibility. At the other end of the spectrum, one can always write a JavaScript widget that performs arbitrary logic. So we need to add some flexibility without making a mechanism that is more complicated than just dropping down to JavaScript.

For me, this suggests that any way of encoding action logic that resembles a conventional program is on the wrong track; people might as well just write JavaScript.

The present system of canned actions could be made more generic: the presence of an attribute triggers the instantiation of a canned event handler (which in some cases is parameterised).

So, one way of handling your initial question would be:

* Refactor <$linkcatcher> widget to be able to catch any message
* Refactor "action attributes" (ie set/setTo, message, navigateTo etc.) so that they can be applied to all relevant widgets (including the generic linkcatcher above)

Then your original example might be:

<$eventcatcher catch="tw-navigate" set="$:/search" setTo="" message="tw-navigate></$eventcatcher>

Best wishes

Jeremy






--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Danielo Rodríguez

unread,
Apr 9, 2014, 3:14:44 PM4/9/14
to tiddl...@googlegroups.com
Hello Jeremy.

Thank you for your explanation. I agree with you that is not possible to support all the posible use cases. It's just that I used to stick to TW basic core functionalities for compatability reasons and some times I miss some more options. It's not too hard to make a specific widget for this functionality and I prefer that rather than editing the core. In fact that is the actual power of TW

Again, thank you very much.

Jeremy Ruston

unread,
Apr 9, 2014, 5:26:01 PM4/9/14
to TiddlyWiki
Hi Danielo
 
It's not too hard to make a specific widget for this functionality and I prefer that rather than editing the core. In fact that is the actual power of TW

What's the specific functionality you're after? My proposal covered the use case as I understood it:

* Refactor <$linkcatcher> widget to be able to catch any message
* Refactor "action attributes" (ie set/setTo, message, navigateTo etc.) so that they can be applied to all relevant widgets (including the generic linkcatcher above)

Then your original example might be:

<$eventcatcher catch="tw-navigate" set="$:/search" setTo="" message="tw-navigate></$eventcatcher>

Best wishes

Jeremy
 
Again, thank you very much.
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages