1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 18:47:20 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/widgets/DropzoneWidget.tid
saqimtiaz d46872c061
Extend tm-import-tiddlers message (#4741)
* Allow tm-import-tiddlers event to override tv-auto-open-on-import

* Add autoOpenOnImport attribute to dropzone

* Updated DropZone docs

* Updated dropzone to support importTitle attribute

* Updated navigator to support importTitle attribute on tm-import-tiddlers

* Update dropzone docs for importTitle attribute

* Updated docs for tm-import-tiddlers

* Fixed formatting
2020-06-27 12:32:11 +01:00

38 lines
1.9 KiB
Plaintext

caption: dropzone
created: 20131024141900000
modified: 20200403103224328
tags: Widgets
title: DropzoneWidget
type: text/vnd.tiddlywiki
! Introduction
The dropzone widget creates an area into which the user can drag files and other objects. It also supports pasting via the clipboard, although browser support is currently limited.
It sends a [[WidgetMessage: tm-import-tiddlers]] carrying a JSON representation of the tiddlers to be imported up through its parents. This message usually trapped by the NavigatorWidget which adds the tiddlers to the store and updates the story to display them.
! Content and Attributes
|!Attribute |!Description |
|deserializer |<<.from-version "5.1.15">> Optional name of deserializer to be used (by default the deserializer is derived from the file extension) |
|enable |<<.from-version "5.1.22">> Optional value "no" to disable the dropzone functionality (defaults to "yes") |
|class |<<.from-version "5.1.22">> Optional CSS class to be assigned to the dropzone (defaults to "tc-drag-over") |
|autoOpenOnImport |<<.from-version "5.1.23">> Optional value "no" or "yes" that can override tv-auto-open-on-import |
|importTitle|<<.from-version "5.1.23">> optional tiddler title to use for import process instead of ~$:/Import |
The list of available deserializers can be inspected by executing `Object.keys($tw.Wiki.tiddlerDeserializerModules).sort().join("\n")` in the browser JavaScript console.
The dropzone widget displays any contained content within the dropzone.
! Display
The dropzone widget creates an HTML `<div class="tc-dropzone">` to contain its content. During a drag operation the class `tc-dragover` is added. CSS is used to provide user feedback.
! Data types supported
The following data transfer types are supported:
* ''text/vnd.tiddler'' - a list of tiddlers in JSON format (this format is generated by the LinkWidget)
* ''text/plain'' - plain text
* ''text/uri-list'' - a list of URIs as a single tiddler