aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/jot-header.tpl
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-08-08 22:55:47 -0700
committerzotlabs <mike@macgirvin.com>2017-08-08 22:55:47 -0700
commitca11d7b9a76c41c7cea0dbec1befacb0ff182de2 (patch)
treeb341eae028b38707e2282ebd29632eaf74c8066c /view/tpl/jot-header.tpl
parenta7a73a5150e8da202b1ea84408434e284f4ceda2 (diff)
downloadvolse-hubzilla-ca11d7b9a76c41c7cea0dbec1befacb0ff182de2.tar.gz
volse-hubzilla-ca11d7b9a76c41c7cea0dbec1befacb0ff182de2.tar.bz2
volse-hubzilla-ca11d7b9a76c41c7cea0dbec1befacb0ff182de2.zip
support upload of files and attachments into comments. This has some repercussions when it comes to post permissions since the commenter will not know the distribution of the post. Basically the files will be uploaded with the commenter's default ACL. Most of the time this will do the right thing.
Diffstat (limited to 'view/tpl/jot-header.tpl')
-rwxr-xr-xview/tpl/jot-header.tpl31
1 files changed, 31 insertions, 0 deletions
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index 815d17c3c..91c30423d 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -106,6 +106,9 @@ function enableOnUser(){
<script src="library/blueimp_upload/js/jquery.fileupload.js"></script>
<script>
+var activeCommentID = 0;
+var activeCommentText = '';
+
$(document).ready(function() {
/* enable tinymce on focus and click */
$("#profile-jot-text").focus(enableOnUser);
@@ -139,6 +142,34 @@ function enableOnUser(){
DragDropUploadInit();
}
+
+ $('#invisible-comment-upload').fileupload({
+ url: 'wall_attach/{{$nickname}}',
+ dataType: 'json',
+ maxChunkSize: 4 * 1024 * 1024,
+ add: function(e,data) {
+
+ var tmpStr = $("#comment-edit-text-" + activeCommentID).val();
+ if(tmpStr == activeCommentText) {
+ tmpStr = "";
+ $("#comment-edit-text-" + activeCommentID).addClass("comment-edit-text-full");
+ $("#comment-edit-text-" + activeCommentID).removeClass("comment-edit-text-empty");
+ openMenu("comment-tools-" + activeCommentID);
+ $("#comment-edit-text-" + activeCommentID).val(tmpStr);
+ }
+ data.submit();
+ },
+
+ done: function(e,data) {
+ textarea = document.getElementById("comment-edit-text-" + activeCommentID);
+ textarea.value = textarea.value + data.result.message;
+ },
+ stop: function(e,data) {
+ $('body').css('cursor', 'auto');
+ preview_comment(activeCommentID);
+ activeCommentID = 0;
+ },
+ });
});
function deleteCheckedItems() {