aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-30 15:28:53 -0800
committerzotlabs <mike@macgirvin.com>2017-11-30 15:28:53 -0800
commitcce2b08e6bcb16b1c9fde13b2597ce66fc0c45d6 (patch)
tree8a00f81a913994f2fd952989e2519b1e893df5f2
parentd59c1bb6bf36419344dc355113e56c2254cbcbfa (diff)
downloadvolse-hubzilla-cce2b08e6bcb16b1c9fde13b2597ce66fc0c45d6.tar.gz
volse-hubzilla-cce2b08e6bcb16b1c9fde13b2597ce66fc0c45d6.tar.bz2
volse-hubzilla-cce2b08e6bcb16b1c9fde13b2597ce66fc0c45d6.zip
progress on chunked uploads in /cloud
-rw-r--r--view/js/mod_cloud.js18
-rw-r--r--view/tpl/cloud_actionspanel.tpl7
2 files changed, 13 insertions, 12 deletions
diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js
index e9e8e9241..2215a9df9 100644
--- a/view/js/mod_cloud.js
+++ b/view/js/mod_cloud.js
@@ -18,20 +18,21 @@ function UploadInit() {
var submit = $("#upload-submit");
- $('#files-upload').fileupload({
+ $('#invisible-cloud-file-upload').fileupload({
url: 'file_upload',
dataType: 'json',
dropZone: filedrag,
+ formData: $('#ajax-upload-files').serializeArray(),
maxChunkSize: 100000, // 4 * 1024 * 1024,
-// add: function(e,data) {
-// data.submit();
-// },
-
- submit: function(e,data) {
- e.preventDefault();
+ add: function(e,data) {
+ data.submit();
},
+// submit: function(e,data) {
+// e.preventDefault();
+// },
+
// done: function(e,data) {
// addeditortext(data.result.message);
// $('#jot-media').val($('#jot-media').val() + data.result.message);
@@ -42,7 +43,7 @@ function UploadInit() {
// },
});
-// $('#files-upload').click(function(event) { event.preventDefault(); $('#invisible-cloud-file-upload').trigger('click'); return false;});
+ $('#upload-submit').click(function(event) { event.preventDefault(); $('#invisible-cloud-file-upload').trigger('click'); return false;});
@@ -190,7 +191,6 @@ function getIconFromType(type) {
// upload files
function UploadFile(file, idx) {
- return;
window.filesToUpload = window.filesToUpload + 1;
diff --git a/view/tpl/cloud_actionspanel.tpl b/view/tpl/cloud_actionspanel.tpl
index 2eed5b18b..8d39a8383 100644
--- a/view/tpl/cloud_actionspanel.tpl
+++ b/view/tpl/cloud_actionspanel.tpl
@@ -1,3 +1,4 @@
+<input id="invisible-cloud-file-upload" type="file" name="files" style="visibility:hidden;position:absolute;top:-50;left:-50;width:0;height:0;" multiple>
<div id="files-mkdir-tools" class="section-content-tools-wrapper">
<label for="files-mkdir">{{$folder_header}}</label>
<form id="mkdir-form" method="post" action="file_upload" class="acl-form" data-form_id="mkdir-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
@@ -24,8 +25,8 @@
<input type="hidden" name="directory" value="{{$path}}" />
<input type="hidden" name="channick" value="{{$channick}}" />
<input type="hidden" name="return_url" value="{{$return_url}}" />
- <label for="files-upload">{{$upload_header}}</label>
- <input class="form-group pull-left" id="files-upload" type="file" name="files[]" multiple>
+ <!--label for="files-upload">{{$upload_header}}</label>
+ <input class="form-group pull-left" id="files-upload" type="file" name="files[]" multiple -->
{{include file="field_checkbox.tpl" field=$notify}}
<div class="pull-right btn-group">
<div class="btn-group">
@@ -34,7 +35,7 @@
<i class="jot-perms-icon fa fa-{{$lockstate}}"></i>
</button>
{{/if}}
- <button id="upload-submit" class="btn btn-primary btn-sm pull-right" type="submit" name="submit" value="{{$upload_submit}}">{{$upload_submit}}</button>
+ <button id="upload-submit" class="btn btn-primary btn-sm pull-right">{{$upload_submit}}</button>
</div>
</div>
</form>