|
91 | 91 | generateUniqueIdentifier: null,
|
92 | 92 | maxChunkRetries: 0,
|
93 | 93 | chunkRetryInterval: null,
|
94 |
| - permanentErrors: [404, 415, 500, 501], |
| 94 | + permanentErrors: [404, 413, 415, 500, 501], |
95 | 95 | successStatuses: [200, 201, 202],
|
96 | 96 | onDropStopPropagation: false,
|
97 | 97 | initFileFn: null,
|
|
155 | 155 | /**
|
156 | 156 | * Set a callback for an event, possible events:
|
157 | 157 | * fileSuccess(file), fileProgress(file), fileAdded(file, event),
|
158 |
| - * fileRetry(file), fileError(file, message), complete(), |
159 |
| - * progress(), error(message, file), pause() |
| 158 | + * fileRemoved(file), fileRetry(file), fileError(file, message), |
| 159 | + * complete(), progress(), error(message, file), pause() |
160 | 160 | * @function
|
161 | 161 | * @param {string} event
|
162 | 162 | * @param {Function} callback
|
|
368 | 368 | * be selected (Chrome only).
|
369 | 369 | */
|
370 | 370 | assignBrowse: function (domNodes, isDirectory, singleFile, attributes) {
|
371 |
| - if (typeof domNodes.length === 'undefined') { |
| 371 | + if (domNodes instanceof Element) { |
372 | 372 | domNodes = [domNodes];
|
373 | 373 | }
|
374 | 374 |
|
|
594 | 594 | }
|
595 | 595 | this.files.push(file);
|
596 | 596 | }, this);
|
| 597 | + this.fire('filesSubmitted', files, event); |
597 | 598 | }
|
598 |
| - this.fire('filesSubmitted', files, event); |
599 | 599 | },
|
600 | 600 |
|
601 | 601 |
|
|
609 | 609 | if (this.files[i] === file) {
|
610 | 610 | this.files.splice(i, 1);
|
611 | 611 | file.abort();
|
| 612 | + this.fire('fileRemoved', file); |
612 | 613 | }
|
613 | 614 | }
|
614 | 615 | },
|
|
1046 | 1047 | /**
|
1047 | 1048 | * Default read function using the webAPI
|
1048 | 1049 | *
|
1049 |
| - * @function webAPIFileRead(fileObj, fileType, startByte, endByte, chunk) |
| 1050 | + * @function webAPIFileRead(fileObj, startByte, endByte, fileType, chunk) |
1050 | 1051 | *
|
1051 | 1052 | */
|
1052 | 1053 | function webAPIFileRead(fileObj, startByte, endByte, fileType, chunk) {
|
|
1336 | 1337 | switch (this.readState) {
|
1337 | 1338 | case 0:
|
1338 | 1339 | this.readState = 1;
|
1339 |
| - read(this.fileObj, this.startByte, this.endByte, this.fileType, this); |
| 1340 | + read(this.fileObj, this.startByte, this.endByte, this.fileObj.file.type, this); |
1340 | 1341 | return;
|
1341 | 1342 | case 1:
|
1342 | 1343 | return;
|
|
1399 | 1400 | return 'success';
|
1400 | 1401 | } else if (this.flowObj.opts.permanentErrors.indexOf(this.xhr.status) > -1 ||
|
1401 | 1402 | !isTest && this.retries >= this.flowObj.opts.maxChunkRetries) {
|
1402 |
| - // HTTP 415/500/501, permanent error |
| 1403 | + // HTTP 413/415/500/501, permanent error |
1403 | 1404 | return 'error';
|
1404 | 1405 | } else {
|
1405 | 1406 | // this should never happen, but we'll reset and queue a retry
|
|
1599 | 1600 | * Library version
|
1600 | 1601 | * @type {string}
|
1601 | 1602 | */
|
1602 |
| - Flow.version = '2.10.1'; |
| 1603 | + Flow.version = '2.11.2'; |
1603 | 1604 |
|
1604 | 1605 | if ( typeof module === "object" && module && typeof module.exports === "object" ) {
|
1605 | 1606 | // Expose Flow as module.exports in loaders that implement the Node
|
|
0 commit comments