aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/jot-header.tpl
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-10-12 12:13:44 +0200
committerMario Vavti <mario@mariovavti.com>2016-10-12 12:13:44 +0200
commitcf547be1d6900d12719a9372cbc1a5d433d31863 (patch)
tree03a525cf40905adafc21b0c4146e467bad288437 /view/tpl/jot-header.tpl
parent29617737ca2c03c800ebbe4701dc21cf9f25ce22 (diff)
parent16da1a4e810889448eecbd13d68183a820bcebe2 (diff)
downloadvolse-hubzilla-cf547be1d6900d12719a9372cbc1a5d433d31863.tar.gz
volse-hubzilla-cf547be1d6900d12719a9372cbc1a5d433d31863.tar.bz2
volse-hubzilla-cf547be1d6900d12719a9372cbc1a5d433d31863.zip
Merge branch '1.14RC'
Diffstat (limited to 'view/tpl/jot-header.tpl')
-rwxr-xr-xview/tpl/jot-header.tpl45
1 files changed, 43 insertions, 2 deletions
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index 63691f842..ac657e63f 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -262,8 +262,30 @@ function enableOnUser(){
function linkdropper(event) {
var linkFound = event.dataTransfer.types.contains("text/uri-list");
- if(linkFound)
+ if(linkFound) {
event.preventDefault();
+ var editwin = '#' + event.target.id;
+ var commentwin = false;
+ if(editwin) {
+ commentwin = ((editwin.indexOf('comment') >= 0) ? true : false);
+ if(commentwin) {
+ var commentid = editwin.substring(editwin.lastIndexOf('-') + 1);
+ $('#comment-edit-text-' + commentid).addClass('hover');
+ }
+ }
+ }
+ }
+
+ function linkdropexit(event) {
+ var editwin = '#' + event.target.id;
+ var commentwin = false;
+ if(editwin) {
+ commentwin = ((editwin.indexOf('comment') >= 0) ? true : false);
+ if(commentwin) {
+ var commentid = editwin.substring(editwin.lastIndexOf('-') + 1);
+ $('#comment-edit-text-' + commentid).removeClass('hover');
+ }
+ }
}
function linkdrop(event) {
@@ -276,6 +298,7 @@ function enableOnUser(){
if(commentwin) {
var commentid = editwin.substring(editwin.lastIndexOf('-') + 1);
commentOpen(document.getElementById(event.target.id),commentid);
+
}
}
@@ -371,6 +394,19 @@ function enableOnUser(){
}
}
+ function toggleNoComment() {
+ if($('#jot-nocomment').val() > 0) {
+ $('#jot-nocomment').val(0);
+ $('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments-o').addClass('fa-comments');
+ $('#profile-nocomment-wrapper').attr('title', '{{$nocomment_enabled}}');
+ }
+ else {
+ $('#jot-nocomment').val(1);
+ $('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments').addClass('fa-comments-o');
+ $('#profile-nocomment-wrapper').attr('title', '{{$nocomment_disabled}}');
+ }
+ }
+
function jotReact(id,icon) {
if(id && icon) {
$.get('{{$baseurl}}/react?f=&postid=' + id + '&emoji=' + icon);
@@ -503,6 +539,7 @@ function enableOnUser(){
// cancel event and hover styling
DragDropUploadFileHover(e);
+ if (!editor) $("#profile-jot-text").val("");
// fetch FileList object
@@ -527,7 +564,11 @@ function enableOnUser(){
xhr.addEventListener('load', function (e) {
//console.log('xhr upload complete', e);
window.fileUploadsCompleted = window.fileUploadsCompleted + 1;
- addeditortext(xhr.responseText);
+
+ initEditor(function() {
+ addeditortext(xhr.responseText);
+ });
+
$('#jot-media').val($('#jot-media').val() + xhr.responseText);
// When all the uploads have completed, refresh the page
if (window.filesToUpload > 0 && window.fileUploadsCompleted === window.filesToUpload) {