Skip to content

Commit 84a1679

Browse files
committed
Use MarkDown formatting with defined language
1 parent 781b71d commit 84a1679

1 file changed

Lines changed: 35 additions & 35 deletions

File tree

README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,41 @@ Download a latest build from https://github.com/flowjs/flow.js/releases
2121
it contains development and minified production files in `dist/` folder.
2222

2323
or use bower:
24-
25-
bower install flow.js#~2
26-
24+
```console
25+
bower install flow.js#~2
26+
```
2727
or use git clone
28-
29-
git clone https://github.com/flowjs/flow.js
30-
28+
```console
29+
git clone https://github.com/flowjs/flow.js
30+
```
3131
## How can I use it?
3232

3333
A new `Flow` object is created with information of what and where to post:
34-
35-
var flow = new Flow({
36-
target:'/api/photo/redeem-upload-token',
37-
query:{upload_token:'my_token'}
38-
});
39-
// Flow.js isn't supported, fall back on a different method
40-
if(!flow.support) location.href = '/some-old-crappy-uploader';
41-
34+
```javascript
35+
var flow = new Flow({
36+
target:'/api/photo/redeem-upload-token',
37+
query:{upload_token:'my_token'}
38+
});
39+
// Flow.js isn't supported, fall back on a different method
40+
if(!flow.support) location.href = '/some-old-crappy-uploader';
41+
```
4242
To allow files to be either selected and drag-dropped, you'll assign drop target and a DOM item to be clicked for browsing:
43-
44-
flow.assignBrowse(document.getElementById('browseButton'));
45-
flow.assignDrop(document.getElementById('dropTarget'));
46-
43+
```javascript
44+
flow.assignBrowse(document.getElementById('browseButton'));
45+
flow.assignDrop(document.getElementById('dropTarget'));
46+
```
4747
After this, interaction with Flow.js is done by listening to events:
48-
49-
flow.on('fileAdded', function(file, event){
50-
console.log(file, event);
51-
});
52-
flow.on('fileSuccess', function(file,message){
53-
console.log(file,message);
54-
});
55-
flow.on('fileError', function(file, message){
56-
console.log(file, message);
57-
});
58-
48+
```javascript
49+
flow.on('fileAdded', function(file, event){
50+
console.log(file, event);
51+
});
52+
flow.on('fileSuccess', function(file,message){
53+
console.log(file,message);
54+
});
55+
flow.on('fileError', function(file, message){
56+
console.log(file, message);
57+
});
58+
```
5959
## How do I set it up with my server?
6060

6161
Most of the magic for Flow.js happens in the user's browser, but files still need to be reassembled from chunks on the server side. This should be a fairly simple task and can be achieved in any web framework or language, which is able to receive file uploads.
@@ -249,13 +249,13 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
249249

250250
Our unit and integration tests are written with Jasmine and executed with Karma. To run all of the
251251
tests on Chrome run:
252-
253-
grunt karma:watch
254-
252+
```console
253+
grunt karma:watch
254+
```
255255
Or choose other browser
256-
257-
grunt karma:watch --browsers=Firefox,Chrome
258-
256+
```console
257+
grunt karma:watch --browsers=Firefox,Chrome
258+
```
259259
Browsers should be comma separated and case sensitive.
260260

261261
To re-run tests just change any source or test file.

0 commit comments

Comments
 (0)