Skip to content

Commit 35971ec

Browse files
committed
chore: rename to flow.js
1 parent 57595d6 commit 35971ec

27 files changed

+373
-1922
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ node_js:
33
- 0.1
44
env:
55
global:
6-
- secure: QnbopydTyvqD3CmNZa6Ppu68m7ug+HKXYOvWhcdbqWQryDHGzoMk/ehQjrFszAAO0s+4a//aMzlNJnZQW8wYxtXyA5RlPGl4Vbr9uhSeHNEgxBzgeqSD8+3ZjgE/ORmuds7jjPDStG50uotD+DubQKLiMe/vn9Ej9bArpZ2pGKk=
7-
- secure: GkU6vcxcmPtVo3nnMj+HGX+Hde1jU/ad/Un2Sexx0nBZzYd3d/A2HGdbd4NAtjioyucUCyHSYaG2n3yE+u16ucFDYBB9Wu1zlXynku39pSiDcz/pjh9mR7VBHg4VNGKqe5ZtU5udohFsOZMYTegqk5nw9yW6VgZzRa/1mWsg2YY=
6+
- SAUCE_USERNAME=aidaskk
7+
- SAUCE_ACCESS_KEY=6e96b47e-6665-4f69-beaa-085e5d5b6b9b
88
before_script:
99
- sh -e /etc/init.d/xvfb start
1010
- npm install --quiet -g grunt-cli karma

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
- **singleFile** parameter added. Then enabled, uploaded file will replace current one.
2323

2424
## Breaking Changes
25-
25+
- **Resumable** was renamed to **Flow**
2626
- **ResumableFile.fileName** parameter renamed to **ResumableFile.name**
2727
- **Resumable.getOpt** method dropped, use Resumable.opts parameter instead if needed.
2828
- **Resumable.maxFiles**, **Resumable.minFileSize**, **Resumable.maxFileSize**,

Gruntfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module.exports = function(grunt) {
88
banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
99
},
1010
build: {
11-
src: 'src/resumable.js',
12-
dest: 'build/resumable.min.js'
11+
src: 'src/flow.js',
12+
dest: 'build/flow.min.js'
1313
}
1414
},
1515
coveralls: {

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Flow.js [![Build Status](https://travis-ci.org/resumable2/resumable.js.png)](https://travis-ci.org/resumable2/resumable.js) [![Coverage Status](https://coveralls.io/repos/resumable2/resumable.js/badge.png?branch=master)](https://coveralls.io/r/resumable2/resumable.js?branch=master)
1+
## Flow.js [![Build Status](https://travis-ci.org/flowjs/flow.js.png)](https://travis-ci.org/flowjs/flow.js) [![Coverage Status](https://coveralls.io/repos/flowjs/flow.js/badge.png?branch=master)](https://coveralls.io/r/flowjs/flow.js?branch=master)
22

33

44
Flow.js is a JavaScript library providing multiple simultaneous, stable and resumable uploads via the HTML5 File API.

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "resumable.js",
3-
"version": "2.0.0-beta",
4-
"main": "src/resumable.js",
2+
"name": "flow.js",
3+
"version": "2.0.0-beta2",
4+
"main": "src/flow.js",
55
"ignore": [
66
"**/.*",
77
"node_modules",

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
2-
"name": "resumable.js",
2+
"name": "flow.js",
33
"version": "2.0.0-beta",
4-
"description": "Resumable.js is a JavaScript library providing multiple simultaneous, stable and resumable uploads via the HTML5 File API",
5-
"main": "resumable.js",
4+
"description": "Flow.js library implements html5 file upload and provides multiple simultaneous, stable, fault tolerant and resumable uploads.",
5+
"main": "src/flow.js",
66
"scripts": {
77
"test": "grunt test"
88
},
99
"repository": {
1010
"type": "git",
11-
"url": "git://github.com/resumable2/resumable.js.git"
11+
"url": "git://github.com/flowjs/flow.js.git"
1212
},
1313
"keywords": [
14+
"flow.js",
15+
"flow",
1416
"resumable.js",
1517
"file upload",
1618
"resumable upload",
@@ -19,12 +21,11 @@
1921
"javascript upload",
2022
"upload"
2123
],
22-
"author": "",
24+
"author": "Aidas Klimas",
2325
"license": "MIT",
24-
"gitHead": "75d9526a46767454ca304ad257d0cef448815f1a",
2526
"readmeFilename": "README.md",
2627
"bugs": {
27-
"url": "https://github.com/resumable2/resumable.js/issues"
28+
"url": "https://github.com/flowjs/flow.js/issues"
2829
},
2930
"devDependencies": {
3031
"grunt": "~0.4.1",

samples/Backend on PHP.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Sample server implementation in PHP
1+
# Sample server implementation in PHP
2+
3+
Take a look at flow.js php library https://github.com/flowjs/flow-php-server.
24

35
[Chris Gregory](http://online-php.com) has provided this sample implementation for PHP.
46

@@ -8,7 +10,7 @@ It's a sample implementation to illustrate chunking. It should probably not be u
810
<?php
911
/**
1012
* This is the implementation of the server side part of
11-
* Resumable.js client script, which sends/uploads files
13+
* Flow.js client script, which sends/uploads files
1214
* to a server in several chunks.
1315
*
1416
* The script receives the files in a standard way as if
@@ -123,8 +125,8 @@ function createFileFromChunks($temp_dir, $fileName, $chunkSize, $totalSize) {
123125
//check if request is GET and the requested chunk exists or not. this makes testChunks work
124126
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
125127

126-
$temp_dir = 'temp/'.$_GET['resumableIdentifier'];
127-
$chunk_file = $temp_dir.'/'.$_GET['resumableFilename'].'.part'.$_GET['resumableChunkNumber'];
128+
$temp_dir = 'temp/'.$_GET['flowIdentifier'];
129+
$chunk_file = $temp_dir.'/'.$_GET['flowFilename'].'.part'.$_GET['flowChunkNumber'];
128130
if (file_exists($chunk_file)) {
129131
header("HTTP/1.0 200 Ok");
130132
} else
@@ -140,14 +142,14 @@ if (!empty($_FILES)) foreach ($_FILES as $file) {
140142

141143
// check the error status
142144
if ($file['error'] != 0) {
143-
_log('error '.$file['error'].' in file '.$_POST['resumableFilename']);
145+
_log('error '.$file['error'].' in file '.$_POST['flowFilename']);
144146
continue;
145147
}
146148

147149
// init the destination file (format <filename.ext>.part<#chunk>
148150
// the file is stored in a temporary directory
149-
$temp_dir = 'temp/'.$_POST['resumableIdentifier'];
150-
$dest_file = $temp_dir.'/'.$_POST['resumableFilename'].'.part'.$_POST['resumableChunkNumber'];
151+
$temp_dir = 'temp/'.$_POST['flowIdentifier'];
152+
$dest_file = $temp_dir.'/'.$_POST['flowFilename'].'.part'.$_POST['flowChunkNumber'];
151153

152154
// create the temporary directory
153155
if (!is_dir($temp_dir)) {
@@ -156,12 +158,12 @@ if (!empty($_FILES)) foreach ($_FILES as $file) {
156158

157159
// move the temporary file
158160
if (!move_uploaded_file($file['tmp_name'], $dest_file)) {
159-
_log('Error saving (move_uploaded_file) chunk '.$_POST['resumableChunkNumber'].' for file '.$_POST['resumableFilename']);
161+
_log('Error saving (move_uploaded_file) chunk '.$_POST['flowChunkNumber'].' for file '.$_POST['flowFilename']);
160162
} else {
161163

162164
// check if all the parts present, and create the final destination file
163-
createFileFromChunks($temp_dir, $_POST['resumableFilename'],
164-
$_POST['resumableChunkSize'], $_POST['resumableTotalSize']);
165+
createFileFromChunks($temp_dir, $_POST['flowFilename'],
166+
$_POST['flowChunkSize'], $_POST['flowTotalSize']);
165167
}
166168
}
167169
```

samples/Frontend in jQuery.md

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,2 @@
1-
# Resumable.js front-end in jQuery
2-
[@steffentchr](http://twitter.com/steffentchr)
3-
4-
This library is originally built to work with [23 Video](http://www.23video.com), and the 23 uploader is a good example of:
5-
6-
* Selecing files or drag-dropping them in
7-
* Using events to build UI and progress bar
8-
* Pausing and Resuming uploads
9-
* Recovering uploads after browser crashes and even across different computers
10-
* Detecting file support from chunks, for example whether an upload is actually a video file
11-
* Building thumbnails from chunks to give better feedback during upload
12-
* Falling back to alternative upload options when Resumable.js is not supported.
13-
14-
There's [a free trial for 23 Video](http://www.23video.com/signup) if
15-
you want to see this in action, but the pieces are:
16-
17-
* Resumable.js itself.
18-
* [A piece of jQuery](http://reinvent.23video.com/resources/um/script/resumable-uploader.js), which sets up Resumable.js and glues it to the UI.
19-
* [An API methods](http://www.23developer.com/api/photo-redeem-upload-token) with support for Resumable.js chunks and feedback.
20-
* Finally, some HTML elements for the glue script to use.
21-
22-
```html
23-
<div class="resumable-drop" ondragenter="jQuery(this).addClass('resumable-dragover');" ondragend="jQuery(this).removeClass('resumable-dragover');" ondrop="jQuery(this).removeClass('resumable-dragover');">
24-
Drop video files here to upload or <a class="resumable-browse"><u>select from your computer</u></a>
25-
</div>
26-
27-
<div class="progress" style="display:none;">
28-
<table>
29-
<tr>
30-
<td width="100%"><div class="progress-container"><div class="progress-bar"></div></div></td>
31-
<td class="progress-text" nowrap="nowrap"></td>
32-
<td class="progress-pause" nowrap="nowrap">
33-
<a href="#" onclick="uploader.resumable.upload(); return(false);" class="progress-resume-link"><img src="/resources/um/graphics/uploader/resume.png" title="Resume upload" /></a>
34-
<a href="#" onclick="uploader.resumable.pause(); return(false);" class="progress-pause-link"><img src="/resources/um/graphics/uploader/pause.png" title="Pause upload" /></a>
35-
</td>
36-
</tr>
37-
</table>
38-
</div>
39-
40-
<div class="uploader-list" style="display:none;">
41-
<div class="uploader-item">
42-
... (generated thumbnails for each file)
43-
</div>
44-
</div>
45-
46-
<div class="file-edit-container" style="display:none;">
47-
... (elements for the edit UI)
48-
</div>
49-
50-
<script src="/resources/um/script/resumable.js"></script>
51-
<script src="/resources/um/script/resumable-uploader.js"></script>
52-
<script>
53-
uploader = (function($){
54-
var upload_token = '<api upload token>';
55-
var meta = {};
56-
return (new ResumableUploader(upload_token, meta, $('.resumable-browse'), $('.resumable-drop'), $('.progress'), $('.uploader-list'), $('.file-edit-container')));
57-
})(jQuery);
58-
</script>
59-
```
1+
# Flow.js front-end in jQuery
2+
Waiting for your contribution, for now look in Node.js sample at https://github.com/flowjs/flow.js/tree/master/samples/Node.js

samples/Node.js/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ File chunks will be uploaded to samples/Node.js/tmp directory.
1414

1515
## Enabling Cross-domain Uploads
1616

17-
If you would like to load the resumable.js library from one domain and have your Node.js reside on another, you must allow 'Access-Control-Allow-Origin' from '*'. Please remember, there are some potential security risks with enabling this functionality. If you would still like to implement cross-domain uploads, open app.js and uncomment lines 24-31 and uncomment line 17.
17+
If you would like to load the flow.js library from one domain and have your Node.js reside on another, you must allow 'Access-Control-Allow-Origin' from '*'. Please remember, there are some potential security risks with enabling this functionality. If you would still like to implement cross-domain uploads, open app.js and uncomment lines 24-31 and uncomment line 17.
1818

1919
Then in public/index.html, on line 49, update the target with your server's address. For example: target:'http://www.example.com/upload'

samples/Node.js/app.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var express = require('express');
2-
var resumable = require('./resumable-node.js')('tmp/');
2+
var flow = require('./flow-node.js')('tmp/');
33
var app = express();
44

55
// Host most stuff in the public folder
@@ -8,9 +8,9 @@ app.use(express.static(__dirname + '/../../src'));
88

99
app.use(express.bodyParser());
1010

11-
// Handle uploads through Resumable.js
11+
// Handle uploads through Flow.js
1212
app.post('/upload', function(req, res){
13-
resumable.post(req, function(status, filename, original_filename, identifier){
13+
flow.post(req, function(status, filename, original_filename, identifier){
1414
console.log('POST', status, original_filename, identifier);
1515
res.send(200, {
1616
// NOTE: Uncomment this funciton to enable cross-domain request.
@@ -30,16 +30,16 @@ app.post('/upload', function(req, res){
3030
});
3131
*/
3232

33-
// Handle status checks on chunks through Resumable.js
33+
// Handle status checks on chunks through Flow.js
3434
app.get('/upload', function(req, res){
35-
resumable.get(req, function(status, filename, original_filename, identifier){
35+
flow.get(req, function(status, filename, original_filename, identifier){
3636
console.log('GET', status);
3737
res.send(200, (status == 'found' ? 200 : 404));
3838
});
3939
});
4040

4141
app.get('/download/:identifier', function(req, res){
42-
resumable.write(req.params.identifier, res);
42+
flow.write(req.params.identifier, res);
4343
});
4444

4545
app.listen(3000);

0 commit comments

Comments
 (0)