diff options
-rw-r--r-- | Zotlabs/Module/Item.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Mail.php | 2 | ||||
-rw-r--r-- | view/tpl/cdav_widget_addressbook.tpl | 1 | ||||
-rwxr-xr-x | view/tpl/msg-header.tpl | 53 | ||||
-rwxr-xr-x | view/tpl/prv_message.tpl | 1 |
5 files changed, 29 insertions, 30 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 9e64528fa..5e7a3fbc0 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -634,7 +634,7 @@ class Item extends \Zotlabs\Web\Controller { $attach_link = ''; $hash = substr($mtch,0,strpos($mtch,',')); $rev = intval(substr($mtch,strpos($mtch,','))); - $r = attach_by_hash_nodata($hash,$rev); + $r = attach_by_hash_nodata($hash, $observer['xchan_hash'], $rev); if($r['success']) { $attachments[] = array( 'href' => z_root() . '/attach/' . $r['data']['hash'], diff --git a/Zotlabs/Module/Mail.php b/Zotlabs/Module/Mail.php index 7e6ec0cf9..e5509961a 100644 --- a/Zotlabs/Module/Mail.php +++ b/Zotlabs/Module/Mail.php @@ -53,8 +53,8 @@ class Mail extends \Zotlabs\Web\Controller { } $body = trim(str_replace($match[1],'',$body)); } - echo json_encode(['preview' => zidify_links(smilies(bbcode($body)))]); } + echo json_encode(['preview' => zidify_links(smilies(bbcode($body)))]); } killme(); } diff --git a/view/tpl/cdav_widget_addressbook.tpl b/view/tpl/cdav_widget_addressbook.tpl index c875dc977..80b5feaf6 100644 --- a/view/tpl/cdav_widget_addressbook.tpl +++ b/view/tpl/cdav_widget_addressbook.tpl @@ -47,6 +47,7 @@ </li> <div id="upload-form" class="sub-menu-wrapper"> <div class="sub-menu"> + <form enctype="multipart/form-data" method="post" action=""> <div class="form-group"> <select id="import" name="target" class="form-control"> <option value="">{{$import_placeholder}}</option> diff --git a/view/tpl/msg-header.tpl b/view/tpl/msg-header.tpl index 013e1cfdc..0e8fb0389 100755 --- a/view/tpl/msg-header.tpl +++ b/view/tpl/msg-header.tpl @@ -1,34 +1,31 @@ -<script type="text/javascript" src="view/js/ajaxupload.js" ></script> -<script language="javascript" type="text/javascript"> - - $("#prvmail-text").editor_autocomplete(baseurl+"/acl"); - - +<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> +<script> $(document).ready(function() { - var file_uploader = new window.AjaxUpload( - 'prvmail-attach-wrapper', - { action: 'wall_attach/{{$nickname}}', - name: 'userfile', - onSubmit: function(file,ext) { $('#prvmail-rotator').spin('tiny'); }, - onComplete: function(file,response) { - addmailtext(response); - $('#prvmail-rotator').spin(false); - } - } - ); + $("#prvmail-text").editor_autocomplete(baseurl+"/acl"); + + $('#invisible-wall-file-upload').fileupload({ + url: 'wall_attach/{{$nickname}}', + dataType: 'json', + dropZone: $('#prvmail-text'), + maxChunkSize: 4 * 1024 * 1024, + add: function(e,data) { + $('#prvmail-rotator').spin('tiny'); + data.submit(); + }, + done: function(e,data) { + addmailtext(data.result.message); + $('#jot-media').val($('#jot-media').val() + data.result.message); + }, + stop: function(e,data) { + $('#prvmail-rotator').spin(false); + }, + }); - var file_uploader_sub = new window.AjaxUpload( - 'prvmail-attach-sub', - { action: 'wall_attach/{{$nickname}}', - name: 'userfile', - onSubmit: function(file,ext) { $('#prvmail-rotator').spin('tiny'); }, - onComplete: function(file,response) { - addmailtext(response); - $('#prvmail-rotator').spin(false); - } - } - ); + $('#prvmail-attach-wrapper').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;}); + $('#prvmail-attach-wrapper-sub').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;}); }); diff --git a/view/tpl/prv_message.tpl b/view/tpl/prv_message.tpl index 925447ff2..af6315c7e 100755 --- a/view/tpl/prv_message.tpl +++ b/view/tpl/prv_message.tpl @@ -6,6 +6,7 @@ <div class="section-content-wrapper"> {{/if}} <div id="prvmail-wrapper" > + <input id="invisible-wall-file-upload" type="file" name="files" style="visibility:hidden;position:absolute;top:-50;left:-50;width:0;height:0;" multiple> <form id="prvmail-form" action="mail" method="post" > <input type="hidden" id="inp-prvmail-expires" name="expires" value="{{$defexpire}}" /> <input type="hidden" name="media_str" id="jot-media" value="" /> |