summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-16 01:06:24 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-16 01:06:24 -0700
commit46f59b165e5bd1908509e8a62b67bf983cfd6224 (patch)
tree0de426136cd0050eb3f1f8249bafeb0614f8af2d /apps/files_sharing/js
parentc20f01bbf0a1fe00efcdbd01898cdbdf76aafcb0 (diff)
parent7854cf04eec68da83655a819f081d2f2e12f607b (diff)
downloadnextcloud-server-46f59b165e5bd1908509e8a62b67bf983cfd6224.tar.gz
nextcloud-server-46f59b165e5bd1908509e8a62b67bf983cfd6224.zip
Merge pull request #4838 from owncloud/refactor_upload_js
refactor upload js & html to always use only js to fill form data
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/public.js27
1 files changed, 13 insertions, 14 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 357c6fdf540..acabc9a5c10 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -7,8 +7,6 @@ function fileDownloadPath(dir, file) {
return url;
}
-var form_data;
-
$(document).ready(function() {
$('#data-upload-form').tipsy({gravity:'ne', fade:true});
@@ -50,19 +48,20 @@ $(document).ready(function() {
});
}
- // Add some form data to the upload handler
- file_upload_param.formData = {
- MAX_FILE_SIZE: $('#uploadMaxFilesize').val(),
- requesttoken: $('#publicUploadRequestToken').val(),
- dirToken: $('#dirToken').val(),
- appname: 'files_sharing',
- subdir: $('input#dir').val()
- };
+ var file_upload_start = $('#file_upload_start');
+ file_upload_start.on('fileuploadadd', function(e, data) {
+ // Add custom data to the upload handler
+ data.formData = {
+ requesttoken: $('#publicUploadRequestToken').val(),
+ dirToken: $('#dirToken').val(),
+ subdir: $('input#dir').val()
+ };
+ });
- // Add Uploadprogress Wrapper to controls bar
- $('#controls').append($('#additional_controls div#uploadprogresswrapper'));
+ // Add Uploadprogress Wrapper to controls bar
+ $('#controls').append($('#additional_controls div#uploadprogresswrapper'));
- // Cancel upload trigger
- $('#cancel_upload_button').click(Files.cancelUploads);
+ // Cancel upload trigger
+ $('#cancel_upload_button').click(Files.cancelUploads);
});