Skip to content

Commit e1a44b7

Browse files
committed
Preparing for first release
1 parent 79dfaa1 commit e1a44b7

File tree

6 files changed

+58
-46
lines changed

6 files changed

+58
-46
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Changelog
22
================
33

4-
## Version 0.0.1 (2013-05-??) ##
4+
## Version 0.0.1 (2013-06-05) ##
55
* Initial Version.

README.md

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,62 @@
11
HTML5 Drag and Drop for Dart
22
================
33

4-
Library to streamline **Native HTML5 Drag and Drop** in Dart.
4+
Helper library to simplify **Native HTML5 Drag and Drop** in Dart.
55

66
## 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).
1013

1114
## 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).
1416

15-
## Usage ##
17+
All examples are also available in the `example` directory on GitHub.
18+
19+
## Installation ##
1620

1721
### 1. Add Dependency ###
1822
Add the folowing to your **pubspec.yaml** and run **pub install**
1923
```yaml
2024
dependencies:
21-
html5_drag_and_drop: any
25+
html5_dnd: any
2226
```
2327

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>
2933
```
3034

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`.
5239

40+
```dart
41+
import 'package:html5_dnd/html5_dnd.dart';
42+
import 'package:html5_dnd/html5_sortable.dart';
5343
44+
// ...
45+
```
5446

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.
5550

5651

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.
5756

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.
5859

5960

61+
## License ##
62+
The MIT License (MIT)

example/html5_dnd_example.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ h1, h2 {
2626
font-weight: normal;
2727
margin-top: 60px;
2828
margin-bottom: 20px;
29-
clear: both;
3029
}
3130

3231
/* --------------------------------------------------------------------------
3332
* General styles
3433
* ------------------------------------------------------------------------*/
34+
h2 {
35+
clear: both;
36+
}
37+
3538
.example-container {
3639
width: 306px;
3740
padding: 0;
@@ -137,7 +140,7 @@ h1, h2 {
137140
margin-bottom: 80px;
138141
}
139142

140-
.example-code .content div {
143+
.example-code .content > div {
141144
display: none;
142145
color: #93a1a1;
143146
}

example/html5_dnd_example.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'package:html5_dnd/html5_sortable.dart';
1111
part 'codeblocks.dart';
1212

1313
main() {
14-
// Default PrintHandler prints output to console.
14+
// Uncomment to enable logging.
1515
// Logger.root.onRecord.listen(new PrintHandler().call);
1616
// Logger.root.level = Level.FINEST;
1717

@@ -151,6 +151,7 @@ sectionNestedElements() {
151151
TextAreaElement textarea = query('#nested-elements .dropzone textarea');
152152
InputElement input = query('#nested-elements .dropzone input');
153153
input.value = 'Drag here!';
154+
textarea.text = '';
154155

155156
new Draggable(dragme);
156157

example/html5_dnd_example.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<link rel="stylesheet" href="html5_dnd_example.css">
99

10-
<!-- Script to make HTML5 drag and drop work in IE9 on elements other links and images -->
10+
<!-- Script to make HTML5 drag and drop work in IE -->
1111
<script type="text/javascript" src="packages/html5_dnd/dnd.polyfill.js"></script>
1212
</head>
1313
<body>
@@ -38,8 +38,12 @@ <h1>Dart HTML5 Drag and Drop</h1>
3838
</p>
3939
<p>
4040
For <strong>installation instructions, download and source code</strong>
41-
see <a href="https://github.com/marcojakob/dart-html5-dnd">Dart HTML5
42-
Drag and Drop</a> on GitHub.
41+
see
42+
<ul>
43+
<li>
44+
<a href="https://github.com/marcojakob/dart-html5-dnd">Dart HTML5 Drag and Drop</a> on GitHub.
45+
</li>
46+
</ul>
4347
</p>
4448
</div>
4549

@@ -236,9 +240,9 @@ <h2>Connected Sortable Lists</h2>
236240
<li class="other">Item 6</li>
237241
</ul>
238242
</div>
239-
240-
<script type="application/dart" src="html5_dnd_example.dart"></script>
241-
<script src="packages/browser/dart.js"></script>
242243
</article>
244+
245+
<script type="application/dart" src="html5_dnd_example.dart"></script>
246+
<script src="packages/browser/dart.js"></script>
243247
</body>
244248
</html>

pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name: html5_dnd
2-
version: 0.0.1
2+
version: 0.1.0
33
author: Marco Jakob <[email protected]>
44
description: HTML5 Drag and Drop
55
homepage: https://github.com/marcojakob/dart-html5-dnd
6+
documentation: http://edu.makery.ch/projects/dart-html5-drag-and-drop/
67
dependencies:
78
js: any
8-
meta: any
99
logging: any
10+
meta: any
1011
dev_dependencies:
1112
browser: any
1213
logging_handlers: any

0 commit comments

Comments
 (0)