diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-04-03 08:50:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 08:50:15 +0200 |
commit | a8452b236b49abf34c9e826a4694c06bbc5882e8 (patch) | |
tree | 7ed0c0fc7bec218e414ab9d5499d6fd4e778888e /apps/files_sharing/js/files_drop.js | |
parent | 483e921f3e9b0d32af6879e7d44afc8b5dc63319 (diff) | |
parent | 49291b905a62d44601be7ff7ee54a19e0796759e (diff) | |
download | nextcloud-server-a8452b236b49abf34c9e826a4694c06bbc5882e8.tar.gz nextcloud-server-a8452b236b49abf34c9e826a4694c06bbc5882e8.zip |
Merge pull request #20244 from CHRINIMUE/add-progress-bar-to-public-upload
Add basic progressbar to public upload page
Diffstat (limited to 'apps/files_sharing/js/files_drop.js')
-rw-r--r-- | apps/files_sharing/js/files_drop.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/files_sharing/js/files_drop.js b/apps/files_sharing/js/files_drop.js index 26bb04a001a..9dff5a06f56 100644 --- a/apps/files_sharing/js/files_drop.js +++ b/apps/files_sharing/js/files_drop.js @@ -95,6 +95,7 @@ }, add: function(e, data) { Drop.addFileToUpload(e, data); + $('#drop-upload-status').text(t('files_sharing', 'waiting...')); //we return true to keep trying to upload next file even //if addFileToUpload did not like the privious one return true; @@ -111,6 +112,7 @@ 'Could not upload "{filename}"', {filename: data.files[0].name} )); + $('#drop-upload-status').text(t('files_sharing', 'error')); var errorIconSrc = OC.imagePath('core', 'actions/error.svg'); var fileItem = output({isUploading: false, iconSrc: errorIconSrc, name: data.files[0].name}); Drop.updateFileItem(data.files[0].name, fileItem); @@ -124,7 +126,17 @@ $('#drop-upload-done-indicator').addClass('hidden'); $('#drop-upload-progress-indicator').removeClass('hidden'); } - } + }, + progress: function (e, data) { + var progress = parseInt(data.loaded / data.total * 100, 10); + if(progress === 100) { + $('#drop-upload-progress-bar').val(100); + $('#drop-upload-status').text(t('files_sharing', 'finished')); + } else { + $('#drop-upload-progress-bar').val(progress); + $('#drop-upload-status').text(progress + '%'); + } + }, }); $('#public-upload .button.icon-upload').click(function(e) { e.preventDefault(); |