Introducing the <$dropaction> widget.

169 views
Skip to first unread message

Matthew Lauber

unread,
Jun 21, 2016, 1:00:13 PM6/21/16
to tiddl...@googlegroups.com
Hello All,

I'm introducing a tool I created that made my life easier, and may be useful to some of you.  Essentially, I had a huge number of tiddlers I need to tag, and I wanted to drag the tiddler onto the tag to add it.  With the following I can do that.  It can also do anything that you can implement using the ActionWidgets.  For the purposes of the widget, at the time of dropping it, <<currentTiddler>> is set to the target of the dropped link.

<$dropaction>
<$fieldmangler>
<$action-sendmessage $message ="tm-add-tag" $param="Testing" />
</$fieldmangler>
<<tag Testing>>
</$dropaction>


This plugin is available at my plugin library as the "DropAction Widget".  It overrides "$:/core/modules/widgets/fieldmangler.js".  To access my plugin library, go to http://mklauber.github.io/tw5-plugins/ 

To just try out this plugin, look at the attached empty.html

Thanks,
Matt
empty.html

Matthew Lauber

unread,
Jun 21, 2016, 2:22:05 PM6/21/16
to TiddlyWiki
To everyone, I've discovered that my changes to the <$fieldmangler> widget cause issues adding fields to tiddlers.  Be aware of that until I manage to resolve these issues.


On Tuesday, June 21, 2016 at 1:00:13 PM UTC-4, Matthew Lauber wrote:
Hello All,

I'm introducing a tool I created that made my life easier, and may be useful to some of you.  Essentially, I had a huge number of tiddlers I need to tag, and I wanted to drag the tiddler onto the tag to add it.  With the following I can do that.  It can also do anything that you can implement using the ActionWidgets.  For the purposes of the widget, at the time of dropping it, <<currentTiddler>> is set to the target of the dropped link.

<$dropaction>
<$fieldmangler>
<$action-sendmessage $message ="tm-add-tag" $param="Testing" />
</$fieldmangler>
<<tag Testing>>
</$dropaction>


This plugin is available at my plugin library as the "DropAction Widget".  It overrides "$:/core/modules/widgets/fieldmangler.js".  To access my plugin library, use the attached tiddler.

Thanks,
Matt

Matthew Lauber

unread,
Jun 21, 2016, 3:56:23 PM6/21/16
to tiddl...@googlegroups.com
I've resolved the issues with the <$fieldmangler> widget.  Should be good for testing now.  It does take some additional work though.  I've added a parameter to the <$fieldmangler> widget where if the message includes the attribute tiddler, that's the tiddler affected by tm-add/remove-tag and tm-add/remove-field.

<$dropaction>
<$fieldmangler>
<$action-sendmessage $message ="tm-add-tag" $param="Testing" tiddler=<
<droppedTiddler>> />
</$fieldmangler>
<
<tag Testing>>
</$dropaction>

c pa

unread,
Jun 21, 2016, 6:58:17 PM6/21/16
to TiddlyWiki
Matt,

Awesome concept. I would love to use this.


>> This plugin is available at my plugin library as the "DropAction Widget". 

So I followed these instructions and get a tiddler with http://mklauber.github.io/tw5-plugins/library/index.html in the url field. I saved and then I get "Undefined widget dropaction" when I copy and paste your code

Could you create a demo on tiddlyspot so we can copy the plugin from there?

I also did the drag and drop from http://mklauber.github.io/tw5-plugins and got the same lack of importing of plugin.

Matthew Lauber

unread,
Jun 21, 2016, 8:16:14 PM6/21/16
to TiddlyWiki
Ok, after you add/drag the plugin library to your wiki, you still need to install the plugins.  Go to settings>plugins and click on "Get More Plugins" you should see an entry "Matt's Plugin Library" with the green button "open plugin library".  Click that to open the library, look for "DropAction Widget" with an install button.  After that, it should work for you.  I've attached a test document that should work in case those instructions don't work for you.  
empty.html
Reply all
Reply to author
Forward
0 new messages