diff options
Diffstat (limited to 'view/tpl/jot-header.tpl')
-rwxr-xr-x | view/tpl/jot-header.tpl | 45 |
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) { |