aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/mod_cloud.js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-07-29 11:30:33 +0200
committerMario Vavti <mario@mariovavti.com>2016-07-29 11:30:33 +0200
commit5e5ec5a66a64d43ef5ea14c03b32055863f11bf1 (patch)
tree5612d94e67052d5634988490fd311a8e9bc2ef06 /view/js/mod_cloud.js
parent3a320462faedca9ec29a452e82d874fce0138136 (diff)
downloadvolse-hubzilla-5e5ec5a66a64d43ef5ea14c03b32055863f11bf1.tar.gz
volse-hubzilla-5e5ec5a66a64d43ef5ea14c03b32055863f11bf1.tar.bz2
volse-hubzilla-5e5ec5a66a64d43ef5ea14c03b32055863f11bf1.zip
catch all input fields (in preparation for acl in this place) and display the files to upload in the right order
Diffstat (limited to 'view/js/mod_cloud.js')
-rw-r--r--view/js/mod_cloud.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js
index 0c3bfe120..e56ec2a81 100644
--- a/view/js/mod_cloud.js
+++ b/view/js/mod_cloud.js
@@ -74,8 +74,6 @@ function UploadFileSelectHandler(e) {
var files = e.target.files;
}
-
-
// process all File objects
for (var i = 0, f; f = files[i]; i++) {
if(e.target.id === 'files-upload')
@@ -87,7 +85,8 @@ function UploadFileSelectHandler(e) {
}
function prepareHtml(f, i) {
- $("#cloud-index tr:nth-child(2)").after(
+ var num = i - 1;
+ $('#cloud-index #new-upload-progress-bar-' + num.toString()).after(
'<tr id="new-upload-' + i + '" class="new-upload">' +
'<td><i class="fa ' + getIconFromType(f.type) + '" title="' + f.type + '"></i></td>' +
'<td>' + f.name + '</td>' +
@@ -205,8 +204,12 @@ function UploadFile(file, idx) {
// POST to the entire cloud path
xhr.open('post', window.location.pathname, true);
+ var formfields = $("#ajax-upload-files").serializeArray();
+
var data = new FormData();
- data.append('sabreAction', 'put');
+ $.each(formfields, function(i, field) {
+ data.append(field.name, field.value);
+ });
data.append('file', file);
xhr.send(data);