Disable drop zone

191 views
Skip to first unread message

Mohammad

unread,
Mar 15, 2020, 6:32:23 AM3/15/20
to TiddlyWiki
Is there any settings to disable dropzone?

Consider you have created a Tiddlywiki and hide most UI elements to prevent readers from any change!
Still drag and drop works! How one can simply disable drag and drop feature of TW temporary?

Jeremy Ruston

unread,
Mar 15, 2020, 4:50:19 PM3/15/20
to tiddl...@googlegroups.com
Hi Mohammad

I’ve been meaning to do something about that, and have now added a hidden setting to disable the dropzone:


There are docs here:


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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/51c39046-28db-4b70-b119-6cfdcbad1307%40googlegroups.com.

TonyM

unread,
Mar 15, 2020, 8:41:32 PM3/15/20
to TiddlyWiki
Mohammad,

Just some inspiration

Some of your nice buttons, cards and boxes in Shiraz could be used to display a drop zone that bypasses the default one and potentially treats the payload differently. Currently I drop links on a wiki which creates an untitled tiddler, which I have to open and configure as a link tiddler, however custom dropzones would be a nice addition, even one for the default drop if desired so it is less temperamental.

One trick I use is if the text field has the prefix[http://] or prefix[https://] then it is most likely a link. Arguably we could start a tiddler with \define trigger-macroname() and test for this prefix as an in text way to trigger a view template etc...

Regards
Tony

Mohammad

unread,
Mar 16, 2020, 3:35:28 AM3/16/20
to TiddlyWiki
Hi Jeremy,
 That is wonderful. Works like a charm. A million thanks.
I have minor comment, I will put on the GitHub

By the way, I have developed an Admin feature in TW-Utility plugin uses a shortcut combination alt+ctl+L 
to switch between admin-read-only mode and now it works great.

I soon announce TW-Utility with this new feature.

--Mohammad


On Monday, March 16, 2020 at 12:20:19 AM UTC+3:30, Jeremy Ruston wrote:
Hi Mohammad

I’ve been meaning to do something about that, and have now added a hidden setting to disable the dropzone:


There are docs here:


Best wishes

Jeremy.

On 15 Mar 2020, at 10:32, Mohammad <mohamma...@gmail.com> wrote:

Is there any settings to disable dropzone?

Consider you have created a Tiddlywiki and hide most UI elements to prevent readers from any change!
Still drag and drop works! How one can simply disable drag and drop feature of TW temporary?

--
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 tiddl...@googlegroups.com.

Mohammad

unread,
Mar 16, 2020, 3:52:59 AM3/16/20
to TiddlyWiki


On Monday, March 16, 2020 at 4:11:32 AM UTC+3:30, TonyM wrote:
Mohammad,

Just some inspiration

Some of your nice buttons, cards and boxes in Shiraz could be used to display a drop zone that bypasses the default one and potentially treats the payload differently. Currently I drop links on a wiki which creates an untitled tiddler, which I have to open and configure as a link tiddler, however custom dropzones would be a nice addition, even one for the default drop if desired so it is less temperamental.

This is a nice idea! I will look how we can have customized drop zone! Like dragging a link from other browser tab, one can quickly create a bookmark to that page/link somehow a tiddlyclip effect.

Eric Shulman

unread,
Mar 16, 2020, 5:12:39 AM3/16/20
to TiddlyWiki
On Monday, March 16, 2020 at 12:52:59 AM UTC-7, Mohammad wrote:

This is a nice idea! I will look how we can have customized drop zone! Like dragging a link from other browser tab, one can quickly create a bookmark to that page/link somehow a tiddlyclip effect.

The <$dropzone> widget is intended for triggering an "import" handler.  As noted in the documentation:

It sends a WidgetMessage: tm-import-tiddlers carrying a JSON representation of the tiddlers to be imported up through its parents.

To implement general purpose drag-and-drop handling, use the <$droppable> widget.

When something is dropped onto the <$droppable> widget, it automatically sets the <<actionTiddler>> variable to contain the value of what was dropped.  While this is typically used to handle dropping of tiddler titles within a TW document it also works if you drag a link or text from any non-TW browser tab.  The result is that the <<actionTiddler>> value will be the link (or text) that was dragged from the other browser tab.  It is then up to you to define the desired actions="..." parameter for the <$droppable> widget to do what you want with the <<actionTiddler>> value you receive.  Thus, something like this might be used to create a new "bookmark" tiddler containing a dropped link:

\define make_bookmark() <$action-createtiddler $basetitle="Bookmark" text=<<actionTiddler>> />
<$droppable actions=<<make_bookmark>>> DROP HERE </
$droppable>

enjoy,
-e

Mohammad

unread,
Mar 16, 2020, 5:43:13 AM3/16/20
to TiddlyWiki
added to TW-Scripts

Hi Eric,
  This is really amazing! A nice bookmark creator by drag and drop links for example from a web page or Google search result.
  This specially works nice when the Page dropzone is disabled.

Cheers
Mohammad

TonyM

unread,
Mar 16, 2020, 5:42:33 PM3/16/20
to TiddlyWiki
Eric,

Thanks for this, very helpful from your experience where it is difficult building from the documentation for me at leaste.

Regards
Tony

Joshua Fontany

unread,
Mar 17, 2020, 10:40:19 PM3/17/20
to TiddlyWiki
Agreed, really good implementation. Mahalo (thanks)!

Mohamed Amin

unread,
Mar 18, 2020, 9:42:26 AM3/18/20
to TiddlyWiki
Hello Eric

I've tried to copy/past your example to tiddlywiki.com (in a new tiddler) then drag/drop a "json" file into the droppable area , but it didn't work with me. what did I miss here?

Thanks in advance

Eric Shulman

unread,
Mar 18, 2020, 10:09:34 AM3/18/20
to TiddlyWiki
On Wednesday, March 18, 2020 at 6:42:26 AM UTC-7, Mohamed Amin wrote:
I've tried to copy/past your example to tiddlywiki.com (in a new tiddler) then drag/drop a "json" file into the droppable area , but it didn't work with me. what did I miss here?

My example is specifically *not* for handling the dropping of a file (JSON or otherwise).  Rather, it is for dropping a selected link (or text) and writing that value into the text field of a tiddler.

If you want to drop a file, then use
<$dropzone> drop file here </$dropzone>

as previously noted, this will trigger a tm-import-file message, which will then parse the JSON file for tiddlers and present the TWCore standard $:/import interface.

-e


Mohamed Amin

unread,
Mar 18, 2020, 10:17:57 AM3/18/20
to TiddlyWiki
Thanks Eric for your reply, and yes, it works with me when I drag/drop links/text

Jeremy Ruston

unread,
Mar 20, 2020, 7:19:58 AM3/20/20
to TiddlyWiki
I’ve made an update so that disabling drag and drop also disables drag and drop within the draggable list widgets:


The updated docs are here:


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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9ee036c8-b426-431c-89a7-3913dbda1001%40googlegroups.com.

Mohammad

unread,
Mar 20, 2020, 10:53:08 AM3/20/20
to TiddlyWiki
Many thanks Jeremy!
This really helps to create read-only wikis.

--Mohammad 


On Friday, March 20, 2020 at 2:49:58 PM UTC+3:30, Jeremy Ruston wrote:
I’ve made an update so that disabling drag and drop also disables drag and drop within the draggable list widgets:


The updated docs are here:


Best wishes

Jeremy.

On 18 Mar 2020, at 14:17, Mohamed Amin <msam...@gmail.com> wrote:

Thanks Eric for your reply, and yes, it works with me when I drag/drop links/text


On Wednesday, March 18, 2020 at 4:09:34 PM UTC+2, Eric Shulman wrote:
On Wednesday, March 18, 2020 at 6:42:26 AM UTC-7, Mohamed Amin wrote:
I've tried to copy/past your example to tiddlywiki.com (in a new tiddler) then drag/drop a "json" file into the droppable area , but it didn't work with me. what did I miss here?

My example is specifically *not* for handling the dropping of a file (JSON or otherwise).  Rather, it is for dropping a selected link (or text) and writing that value into the text field of a tiddler.

If you want to drop a file, then use
<$dropzone> drop file here </$dropzone>

as previously noted, this will trigger a tm-import-file message, which will then parse the JSON file for tiddlers and present the TWCore standard $:/import interface.

-e



-- 
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 tiddl...@googlegroups.com.

Sylvain Naudin

unread,
Mar 20, 2020, 1:40:52 PM3/20/20
to TiddlyWiki


Le vendredi 20 mars 2020 15:53:08 UTC+1, Mohammad a écrit :
Many thanks Jeremy!
This really helps to create read-only wikis.

--Mohammad 


I agree !!
Sylvain 
Reply all
Reply to author
Forward
0 new messages