|
1 | 1 | HTML5 Drag and Drop for Dart
|
2 | 2 | ================
|
3 | 3 |
|
4 |
| -Library to streamline **Native HTML5 Drag and Drop** in Dart. |
| 4 | +Helper library to simplify **Native HTML5 Drag and Drop** in Dart. |
5 | 5 |
|
6 | 6 | ## Features ##
|
7 |
| -* Sortable |
8 |
| -* Same functionality and API for IE9+, Firefox, Chrome, ?Safari? (not tested yet), |
9 |
| - ?Opera? (not tested yet) |
| 7 | +* Make any HTML Element `Draggable`. |
| 8 | +* Create `Dropzone`s and connect them with `Draggable`s. |
| 9 | +* Sortable (similar to jQuery UI Sortable). |
| 10 | +* Uses fast native HTML5 Drag and Drop of the browser. |
| 11 | +* Same functionality and API for IE9+, Firefox, Chrome. (Safari and Opera have |
| 12 | + not been tested yet, let me know if it works). |
10 | 13 |
|
11 | 14 | ## Demo ##
|
12 |
| -TODO: demo page... |
13 |
| -Examples are available in the `example` directory. |
| 15 | +See [HTML5 Drag and Drop in action](http://edu.makery.ch/projects/dart-html5-drag-and-drop/) (with code examples). |
14 | 16 |
|
15 |
| -## Usage ## |
| 17 | +All examples are also available in the `example` directory on GitHub. |
| 18 | + |
| 19 | +## Installation ## |
16 | 20 |
|
17 | 21 | ### 1. Add Dependency ###
|
18 | 22 | Add the folowing to your **pubspec.yaml** and run **pub install**
|
19 | 23 | ```yaml
|
20 | 24 | dependencies:
|
21 |
| - html5_drag_and_drop: any |
| 25 | + html5_dnd: any |
22 | 26 | ```
|
23 | 27 |
|
24 |
| -### 2. ... ### |
25 |
| -```dart |
26 |
| -import 'package:html5_drag_and_drop/drag_and_drop.dart'; |
27 |
| -
|
28 |
| -// ... |
| 28 | +### 2. Add Polyfill JavaScript ### |
| 29 | +To make HTML5 Drag and Drop work in Internet Explorer include the following |
| 30 | +JavaScript file inside the `<head>` of your application's HTML like so: |
| 31 | +```html |
| 32 | +<script type="text/javascript" src="packages/html5_dnd/dnd.polyfill.js"></script> |
29 | 33 | ```
|
30 | 34 |
|
31 |
| -## License ## |
32 |
| -The MIT License (MIT) |
33 |
| - |
34 |
| - |
35 |
| - |
36 |
| - |
37 |
| - |
38 |
| - |
39 |
| - |
40 |
| - |
41 |
| - |
42 |
| - |
43 |
| - |
44 |
| - |
45 |
| - |
46 |
| - |
47 |
| - |
48 |
| - |
49 |
| - |
50 |
| - |
51 |
| - |
| 35 | +### 3. Import ### |
| 36 | +Import the `html5_dnd` library in your Dart code. If your using the Sortable |
| 37 | +functionality, also |
| 38 | +add `html5_sortable`. |
52 | 39 |
|
| 40 | +```dart |
| 41 | +import 'package:html5_dnd/html5_dnd.dart'; |
| 42 | +import 'package:html5_dnd/html5_sortable.dart'; |
53 | 43 |
|
| 44 | +// ... |
| 45 | +``` |
54 | 46 |
|
| 47 | +### 4. Use it ### |
| 48 | +See the demo page above or the `example` directory to see how to use it. There |
| 49 | +are also plenty of Dart Doc comments in the code for some additional details. |
55 | 50 |
|
56 | 51 |
|
| 52 | +## Thanks and Contributions ## |
| 53 | +I'd like to thank the people who kindly helped me with their answers or put |
| 54 | +some tutorial or code examples online. They've already contributed to this |
| 55 | +project. |
57 | 56 |
|
| 57 | +If you'd like to contribute too, you're welcome to file issues or |
| 58 | +[fork](https://help.github.com/articles/fork-a-repo) my repository on GitHub. |
58 | 59 |
|
59 | 60 |
|
| 61 | +## License ## |
| 62 | +The MIT License (MIT) |
0 commit comments