[TW5] Would a DragDropTouch plugin reinvent the wheel?

62 views
Skip to first unread message

andrew harrison

unread,
Jun 25, 2016, 2:42:06 PM6/25/16
to tiddly...@googlegroups.com
I would like the ability to make items generated by the list widget draggable='true' and be able to also make them drop zones that could modify list orders. It appears that the native dropzone is specialized and only imports tiddlers, so would a plugin be overkill? I'm thinking something like dragdroptouch which has an MIT license could be stuck in a plugin. Has anyone done this yet with drag drop and touch?

PMario

unread,
Jun 26, 2016, 2:15:11 PM6/26/16
to TiddlyWikiDev
Hi Andrew,

You are right. Native drag and drop is really missing.

There is a dnd plugin: http://bjtools.tiddlyspot.com/#drag-and-drop which works with the mouse. readme: http://bjtools.tiddlyspot.com/#%24%3A%2Fplugins%2Fbj%2Fdrag-and-drop%2Freadme

-m

infurnoape

unread,
Jun 27, 2016, 9:10:33 PM6/27/16
to tiddly...@googlegroups.com
Ok, the real question should be if the core should be refactored to handle drag drop and touch or if it should go in a pluggin?



Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5
--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/e5349763-287e-4e35-b750-cd8d2e31dd59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PMario

unread,
Jun 28, 2016, 9:31:08 AM6/28/16
to TiddlyWikiDev
On Tuesday, June 28, 2016 at 3:10:33 AM UTC+2, Andrew wrote:
Ok, the real question should be if the core should be refactored to handle drag drop and touch or if it should go in a pluggin?

Imo the best way to start will be a plugin. So we see, what's needed (to overwrite) and what's possible, in terms of functionality.

One drawback is, that Jeremy doesn't like too many 3rd party dependencies. Especially not in the core (That's good !:). ... Since "dragdroptouch" is MIT licensed, about 17k including comments and itself has no dependency, we can easily include it with a plugin. Even including most of the code into the TW core would be possible, because of the MIT license. ...

There's still one problem.

The TW UI mechanism works like this:

 - programmatically change a system tiddler  ... and ..
 - the UI is redrawn by the core.

The mentioned library moves, drags and drops UI elements and doesn't change any thing else.

eg: if you want to change the order of the story list you need to edit the tiddler and change the "list-field". If you save the tiddler, the UI will be redrawn by the core.

So the plugin would need to be able to manipulate "tiddler list-fields" ... but ... not every UI element actually uses list fields atm. ... So there will be quite some work to do, to make d&d work consistently in TW. ...

just some thougts
-mario




PMario

unread,
Jun 28, 2016, 9:34:24 AM6/28/16
to TiddlyWikiDev
To see the story list working just open: http://tiddlywiki.com/#%24%3A%2FStoryList

and set the list field to

list: a b c

If you save the tiddler, you'll see how it works.

-m
Reply all
Reply to author
Forward
0 new messages