diff options
author | zotlabs <mike@macgirvin.com> | 2017-11-28 14:30:46 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-11-28 14:30:46 -0800 |
commit | df45c13f622d01241ac96b2f16cb964ba688d72c (patch) | |
tree | be86f5ce8702a84c416b57d077b533f3374e0c59 /view | |
parent | 455720ae938126d9a0d3c728beb0a7ba3268a4d0 (diff) | |
download | volse-hubzilla-df45c13f622d01241ac96b2f16cb964ba688d72c.tar.gz volse-hubzilla-df45c13f622d01241ac96b2f16cb964ba688d72c.tar.bz2 volse-hubzilla-df45c13f622d01241ac96b2f16cb964ba688d72c.zip |
first integration attempt with /cloud and blueimp uploader
Diffstat (limited to 'view')
-rw-r--r-- | view/js/mod_cloud.js | 27 | ||||
-rw-r--r-- | view/tpl/cloud.tpl | 5 |
2 files changed, 32 insertions, 0 deletions
diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index 8af90863e..32aae2029 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -17,6 +17,33 @@ function UploadInit() { var filedrag = $("#cloud-drag-area"); var submit = $("#upload-submit"); + + $('#invisible-cloud-file-upload').fileupload({ + url: 'file_upload', + dataType: 'json', + // dropZone: $('#profile-jot-text'), + maxChunkSize: 4 * 1024 * 1024, + add: function(e,data) { + $('#profile-rotator').show(); + data.submit(); + }, + done: function(e,data) { + addeditortext(data.result.message); + $('#jot-media').val($('#jot-media').val() + data.result.message); + }, + stop: function(e,data) { + preview_post(); + $('#profile-rotator').hide(); + }, + }); + + $('#files-upload').click(function(event) { event.preventDefault(); $('#invisible-cloud-file-upload').trigger('click'); return false;}); + + + + + + // is XHR2 available? var xhr = new XMLHttpRequest(); if (xhr.upload) { diff --git a/view/tpl/cloud.tpl b/view/tpl/cloud.tpl index d1567af9f..ccd59d81a 100644 --- a/view/tpl/cloud.tpl +++ b/view/tpl/cloud.tpl @@ -1,3 +1,8 @@ +<script src="library/blueimp_upload/js/vendor/jquery.ui.widget.js"></script> +<script src="library/blueimp_upload/js/jquery.iframe-transport.js"></script> +<script src="library/blueimp_upload/js/jquery.fileupload.js"></script> +<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 class="generic-content-wrapper"> {{include file="cloud_header.tpl"}} {{include file="cloud_directory.tpl"}} |