I’ve done a very tiny bit of drag-and-drop in TW, but not enough to see how to meet my latest goal. I have a form to enter biographical/demographical information about various people (new members of my local chess club.) I would like to be able to drop an image into one of the fields, and then when the user clicks “Save”, to save most of the fields in a new “Person”-tagged tiddler, but save the image as a separate tiddler, with a name derived from other fields. (That is, this might become a new JPG tiddler with name FredFlinstone.jpg
.) Ideally, either the drop-zone itself or something nearby would serve to preview the image as well.
Any advice on how to do this would be appreciated. Any pointers to similar implementations would be great.
There are two drop-related widgets, but neither seems appropriate:
-
The Dropzone Widget looks designed to accept tiddlers, by going through the
$:/Import
widget. -
The DroppableWidget looks designed to accept current tiddlers – or collections of them – and do something with them when they’re dropped.
I don’t want to go through $:/Import
. I just want to drop the image into a target on the form, show a preview, and save it to a new tiddler when I save.
Any ideas?