diff --git a/js/ng-flow-standalone.js b/js/ng-flow-standalone.js index c80610c3..c8151c83 100644 --- a/js/ng-flow-standalone.js +++ b/js/ng-flow-standalone.js @@ -638,6 +638,16 @@ return ret; }, + /** + * Returns the count of files in the queue + * @function + * @returns {number} + */ + getFilesCount: function () { + var count = this.files.length; + return count; + }, + /** * Returns the total size of all files in bytes. * @function @@ -968,6 +978,22 @@ return this._prevProgress; }, + /** + * Get current number of complete chunks + * @function + * @returns {number} from 0 to chunks.length + */ + completeChunks: function () { + var completeChunks = 0; + + each(this.chunks, function (c) { + if(c.progress() === 1){ + completeChunks++; + } + }); + return completeChunks; + }, + /** * Indicates if file is being uploaded at the moment * @function @@ -1922,4 +1948,4 @@ angular.module('flow.transfers', ['flow.init']) }; }]); angular.module('flow', ['flow.provider', 'flow.init', 'flow.events', 'flow.btn', - 'flow.drop', 'flow.transfers', 'flow.img', 'flow.dragEvents']); \ No newline at end of file + 'flow.drop', 'flow.transfers', 'flow.img', 'flow.dragEvents']); diff --git a/templates/main.php b/templates/main.php index a5e0ae68..73b1dd94 100644 --- a/templates/main.php +++ b/templates/main.php @@ -17,6 +17,7 @@ = $l->t('Pause'); ?> = $l->t('Cancel'); ?> = $l->t('Size'); ?>: {{$flow.getSize() | bytes}} + = $l->t('Progress'); ?>: {{$flow.progress()*100 | number:2}}% = $l->t('Uploading'); ?>...
| {{$index+1}} | {{file.relativePath}} | -{{file.size*file.progress() | bytes}}/{{file.size | bytes}} | +{{file.size*file.progress() | bytes}}/{{file.size | bytes}} |
|