Changes between Version 2 and Version 3 of Ticket #11526, comment 2
- Timestamp:
- Feb 12, 2014, 10:11:45 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #11526, comment 2
v2 v3 5 5 - in `dragstart`, `drop` etc. events as `evt.dataTransfer`. 6 6 7 DataTransfer object support both old and new API.7 DataTransfer object supports both old and new API. 8 8 9 9 == New API == 10 10 11 Basically it a list of items (`dataTransfer.items`). Every item can be a file or a string data in certain type. Data type might be MIME types but it is not necessary. Theoretically it is possible to have mixed files and string data. I wrote "theoretically", because it is not defined how such data should be thread:11 Basically it is a list of items (`dataTransfer.items`). Every item can be a file or a string data in certain type. Data type might be a MIME type but it is not necessary. Theoretically it is possible to have mixed files and string data. I wrote "theoretically", because it is not defined how such data should be treated: 12 12 - if you drop 2 files you will get two items, both of them are "file", so they are two part of data, 13 13 - if you drop html you can get also two items, both of them are strings: one in text/html type, second one in text/plain, so this is the same data in two format (this is what we get in Blink). 14 Specification does not said if data should be thread as a one piece of data in multiple formats of multiple pieces of data. It depend on data. The only information we get is: "The drag data store item list is ordered in the order that the items were added to the list; most recently added last.".15 14 16 Blink is now the only engine which support new API for now. 15 Specification does not state if data should be treated as a one piece of data in multiple formats of multiple pieces of data. It depends on data. The only information we get is: "The drag data store item list, in the order that the items were added to the list; most recently added last.". 16 17 Blink is now the only engine which supports new API. 17 18 18 19 == Old API == 19 20 20 Old API is mo ve complex. DataTransfercontains:21 Old API is more complex. `DataTransfer` contains: 21 22 22 - `types` - a rray of string ex. ['plain/text','plain/html'] or ['Files'],23 - `files` - a rray of files, if files array contains any element then `types` contains 'Files' element,23 - `types` - an array of string e.g. ['plain/text','plain/html'] or ['Files'], 24 - `files` - an array of files, if files array contains any element then `types` contains 'Files' element, 24 25 - `getData(format)` - get string data, format is a string type from `types` array, 25 26 - `setData(format, data)` - set data by format.