-
-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34f7ae8
commit ccfdb4f
Showing
34 changed files
with
397 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
leantime.commentsComponent = (function () { | ||
|
||
var enableCommenterForms = function () { | ||
|
||
jQuery(".commentBox").show(); | ||
|
||
//Hide reply comment boxes | ||
jQuery("#comments .replies .commentBox").hide(); | ||
jQuery(".deleteComment, .replyButton").show(); | ||
|
||
jQuery(".commentReply .tinymceSimple").tinymce().getBody().setAttribute('contenteditable', "true"); | ||
jQuery(".commentReply .tox-editor-header").show(); | ||
|
||
jQuery(".commenterFields input").prop("readonly", false); | ||
jQuery(".commenterFields input").prop("disabled", false); | ||
|
||
jQuery(".commenterFields textarea").prop("readonly", false); | ||
jQuery(".commenterFields textarea").prop("disabled", false); | ||
|
||
}; | ||
|
||
var toggleCommentBoxes = function (parentId, formHash, commentId, editComment = false, isReply = false) { | ||
|
||
this.resetForm(parentId, formHash); | ||
|
||
if (parseInt(parentId, 10) === 0) { | ||
jQuery('.mainToggler-'+formHash).hide(); | ||
} else { | ||
jQuery('.mainToggler-'+formHash).show(); | ||
} | ||
|
||
let content = ""; | ||
|
||
if (editComment) { | ||
content = jQuery("#commentText-"+formHash+"-"+commentId).html(); | ||
|
||
//Top level comment edit | ||
if(parentId == commentId) { | ||
jQuery('#commentReplyBox-'+formHash+'-' + parentId + ' > .commentImage').hide(); | ||
jQuery('#comment-'+formHash+'-' + parentId + ' > .commentMain > .replies > form').insertBefore(jQuery('#comment-'+formHash+'-' + parentId + ' .replies > div:first-child')); | ||
} else { | ||
jQuery('#comment-'+formHash+'-' + commentId + ' > .commentImage').hide(); | ||
} | ||
jQuery('#comment-'+formHash+'-' + commentId + ' > .commentMain > .commentContent').hide(); | ||
jQuery('#comment-'+formHash+'-' + commentId + ' > .commentMain > .commentLinks').hide(); | ||
jQuery('#edit-comment-' + formHash + '-' + parentId +'').val(commentId); | ||
} | ||
|
||
jQuery('.commentBox-'+formHash+' textarea').remove(); | ||
|
||
jQuery('.commentBox-'+formHash+'').hide(); | ||
|
||
jQuery('#commentReplyBox-'+formHash+'-' + parentId + ' .commentReply').prepend('<textarea rows="5" cols="75" name="text" id="editor-'+formHash+'-' + parentId + '" class="tinymceSimple">'+ content +'</textarea>'); | ||
leantime.editorController.initSimpleEditor(); | ||
|
||
jQuery('#commentReplyBox-' + formHash + '-' + parentId + '').show(); | ||
|
||
jQuery('#father-'+formHash).val(parentId); | ||
|
||
setTimeout(function () { // you may not need the timeout | ||
jQuery('#commentReplyBox-' + formHash + '-' + parentId + '')[0].scrollIntoView(); | ||
tinyMCE.get('editor-'+formHash+'-' + parentId + '').focus(); | ||
}, 75); | ||
|
||
|
||
|
||
}; | ||
|
||
var resetForm = function(id, formHash) { | ||
|
||
jQuery('.mainToggler-'+formHash).show(); | ||
jQuery('#comments-'+formHash+' .commentImage').show(); | ||
jQuery('#comments-'+formHash+' .commentContent').show(); | ||
jQuery('#comments-'+formHash+' .commentLinks').show(); | ||
|
||
jQuery('.commentReplyBox-'+formHash+'').hide(); | ||
|
||
jQuery('.commentReplyBox-'+formHash+' textarea').each(function(){ | ||
if(jQuery(this).tinymce()) { | ||
jQuery(this).tinymce().remove(); | ||
} | ||
}); | ||
|
||
jQuery('.commentReplyBox-'+formHash+' textarea').remove(); | ||
|
||
} | ||
|
||
// Make public what you want to have public, everything else is private | ||
return { | ||
enableCommenterForms:enableCommenterForms, | ||
toggleCommentBoxes:toggleCommentBoxes, | ||
resetForm:resetForm | ||
}; | ||
|
||
})(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
<div class="commentBox tw-hidden" id="comment{!! $commentId !!}"> | ||
<div class="commentImage"> | ||
<x-users::profile-image :user="$user" /> | ||
<form hx-post="{{ BASE_URL }}/comments/comment-list/save?module={{ $module }}&moduleId={{ $moduleId }}" | ||
hx-target="#comments-{{ $module }}-{{ $moduleId }}"> | ||
<div id="commentReplyBox-{{ $formHash }}-{{ $parentId }}" class="commentBox-{{ $formHash }} commentReplyBox-{{ $formHash }} commenterFields tw-hidden tw-mb-sm" > | ||
<div class="commentImage"> | ||
<x-users::profile-image :user="array('id'=> session('userdata.id'), 'modified' => session('userdata.modified'))" ></x-users::profile-image> | ||
</div> | ||
<div class="commentReply"> | ||
<x-global::forms.submit-button name="{{ __('links.save') }}" /> | ||
<x-global::forms.reset-button name="{{ __('links.cancel') }}" onclick="leantime.commentsComponent.resetForm(-1, '{{ $formHash }}')" /> | ||
</div> | ||
<input type="hidden" name="saveComment" class="commenterField" value="1"/> | ||
<input type="hidden" name="editComment" class="commenterField" id="edit-comment-{{ $formHash }}-{{ $parentId }}" value="" /> | ||
<input type="hidden" name="father" class="commenterField" id="father-{{ $formHash }}" value="{{ $parentId }}"/> | ||
|
||
<div class="clearall"></div> | ||
<br/> | ||
</div> | ||
<div class="commentReply"> | ||
<input | ||
type="submit" | ||
value="{{ __('links.reply') }}" | ||
name="comment" | ||
class="btn btn-default" | ||
/> | ||
</div> | ||
<div class="clearall"></div> | ||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.