New plugin: Override navigation: Handle links differently, override opening of next link or tab switch

103 views
Skip to first unread message

bimlas

unread,
Jul 19, 2019, 8:26:41 AM7/19/19
to TiddlyWiki
Dear all,

The plugin contains a new, irregular action-overridenavigation ActionWidget, which instead of performing the action immediately, performs it at the next navigation (when you open an internal link) or tab switch. For example, we can determine that if we click on a link, we would like to open in edit mode.

The average user has nothing else to do, just install the plugin and copy any of the sample buttons.

Mat

unread,
Jul 19, 2019, 9:07:16 AM7/19/19
to TiddlyWiki
Aha, very interesting. Could this be used for aliases, i.e navigation to another tiddler instead of the title?

....

The average user has nothing else to do,

Yeah - let's get rid of them. Waste of oxygen.  ;-) ;-) ;-)


<:-)



bimlas

unread,
Jul 19, 2019, 9:22:57 AM7/19/19
to TiddlyWiki
Mat,

You can't change the target of navigation, just how to manage that, so as I know what you want is not possible. Basically the plugin is a replacement for "open in edit mode" and "open tab in edit mode" plugins.

PMario

unread,
Jul 19, 2019, 4:58:36 PM7/19/19
to TiddlyWiki
Hi,
Seems to be the same as the link-catcher widget.
-m

bimlas

unread,
Jul 19, 2019, 5:15:58 PM7/19/19
to TiddlyWiki
PMario,

Yes, the logic is similar, but the plugin not only receives children's navigation, but responds globally to any link + it's catching tab switching as well.


The link catcher widget traps WidgetMessage: tm-navigate dispatched within its child content by performing any or all of these actions:

PMario

unread,
Jul 19, 2019, 6:10:15 PM7/19/19
to TiddlyWiki
On Friday, July 19, 2019 at 2:26:41 PM UTC+2, bimlas wrote:
...
The plugin contains a new, irregular action-overridenavigation ActionWidget, which instead of performing the action immediately, performs it at the next navigation (when you open an internal link) or tab switch. For example, we can determine that if we click on a link, we would like to open in edit mode.

Please excuse my ignorance, but I don't see the usecase. ..

If I open a tiddler and then click the edit-button it needs 2 clicks.
If I click the "edit-next-link" button and then click the link it needs to clicks. .. but is much more error prone, If I mis-click the second link.

Same thing for More:Open in new window ... 2 clicks vs 2 clicks.

How is it intended to be used?

-m


bimlas

unread,
Jul 19, 2019, 6:21:49 PM7/19/19
to TiddlyWiki
Originally, the goal was "open in edit mode": if you have a tiddler that causes RSOD, you can open it for editing without error. In addition, it also works on tabs, which require a lot of clicks (thus you also wrote your own edit-tabs plugin). When I came up with the plugin, I realized that it was suitable for several things so i made some example buttons and gave the option to create additional buttons.

Please excuse my ignorance, but I don't see the usecase.

I appreciate your knowledge and the ability to create great things by writing minimal code, so please do not apologize. I also welcome the negative critism if it is constructive.

TonyM

unread,
Jul 19, 2019, 8:28:59 PM7/19/19
to TiddlyWiki
Bimlas

Thanks for sharing once again. One of your values of your contribution to the community is you often come from a different angle. Divercity is good. This means that if you are brief in your explanation it can be difficult for others to understand why you did something or how they can use it.

If possible please provide a few use cases and examples.

From experience you are quick to find limitations in tiddlywiki and quick to destroy these by developing a working solution.

Thanks for sharing again.

Tony

TonyM

unread,
Jul 19, 2019, 8:31:27 PM7/19/19
to TiddlyWiki
Bimlas

I have a sidebar tab called edit recent that allows me to open recent tiddlers in edit mode directly to avoid the rsod.

Regards
Tony

bimlas

unread,
Jul 21, 2019, 3:52:22 PM7/21/19
to TiddlyWiki
TonyM,

Could you give an example to copy-title? :D Because of your comment I thought it might be useful: https://groups.google.com/forum/#!msg/tiddlywiki/k3Mp2PQnD6Y/khXFq7dsAAAJ ("The ability to copy the tiddler title wrapped [[as required]] from the search results list")

TonyM

unread,
Jul 21, 2019, 11:40:21 PM7/21/19
to TiddlyWiki
Bimlas,

This works for me with currentTiddler but I am not sure if it is enough for you, since it is used with system tags.

<$button message="tm-copy-to-clipboard" param={{!!title}} class="tc-btn-invisible" tooltip="Copy tag name to clipboard">
{{$:/core/images/copy-clipboard}}
</$button>

If however you control the value param={{!!title}} you should be able to use a macro defined with [[{{!!title}}]]

Here is my edit recent tab
\define EditRecent(limit:"200",format:"DDth MMM YYYY",subfilter:"",dateField:"modified")
<div class="tc-timeline">
<$list filter="[all[shadows+tiddlers]$subfilter$has[$dateField$]!sort[$dateField$]limit[$limit$]eachday[$dateField$]]">
<div class="tc-menu-list-item">
<$view field="$dateField$" format="date" template="$format$"/>
<$list filter="[sameday:$dateField${!!$dateField$}$subfilter$!sort[$dateField$]]  -[[$:/HistoryList]] -[prefix[$:/state]] -[prefix[$:/temp]] -[prefix[$:/config]] -[prefix[$:/temp]] -[[$:/core/ui/PageTemplate/story]]">
<div class="tc-menu-list-subitem">
<small>
   
<$button tooltip="Open for Edit" class="w3-block w3-left-align">
     
<$action-sendmessage $message="tm-edit-tiddler" $param=<<currentTiddler>>/>
     <<currentTiddler>>
   </
$button>
</small>


</
div>
</$list>
</
div>
</$list>
</
div>
\end
[[EditRecent|$:/PSaT/EditRecent/SideBarTab]]
<$macrocall $name="EditRecent" format={{$:/language/RecentChanges/DateFormat}}/>




Regards
TOny
Reply all
Reply to author
Forward
0 new messages