|
|
|
|
@ -1,14 +1,15 @@ |
|
|
|
|
<script> |
|
|
|
|
var replyForm = { |
|
|
|
|
parentPostId: 0, |
|
|
|
|
show: function() { |
|
|
|
|
show: function(action) { |
|
|
|
|
$('#form_reply').remove(); |
|
|
|
|
|
|
|
|
|
var getForm = $.getJSON('{{ _p.web_ajax }}forum.ajax.php?{{ _p.web_cid_query }}', { |
|
|
|
|
a: 'reply_form', |
|
|
|
|
post: replyForm.parentPostId, |
|
|
|
|
forum: parseInt({{ forum.forum_id }}), |
|
|
|
|
thread: parseInt({{ thread_id }}) |
|
|
|
|
thread: parseInt({{ thread_id }}), |
|
|
|
|
action: action |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$.when(getForm).done(function(response) { |
|
|
|
|
@ -31,13 +32,22 @@ |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
$(document).on('ready', function() { |
|
|
|
|
$('.btn-reply-post, #btn-reply-thread').on('click', function(e) { |
|
|
|
|
$('.btn-reply-post').on('click', function(e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
|
var replyToPost = $(this).data('reply-to') || 0; |
|
|
|
|
var parentPostId = $(this).data('parent-post') || 0; |
|
|
|
|
|
|
|
|
|
replyForm.parentPostId = parseInt(replyToPost); |
|
|
|
|
replyForm.show(); |
|
|
|
|
replyForm.parentPostId = parseInt(parentPostId); |
|
|
|
|
replyForm.show('reply'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('.btn-quote-post').on('click', function(e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
|
var parentPostId = $(this).data('parent-post') || 0; |
|
|
|
|
|
|
|
|
|
replyForm.parentPostId = parseInt(parentPostId); |
|
|
|
|
replyForm.show('quote'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('body').on('submit', '#form_reply', function(e) { |
|
|
|
|
@ -92,11 +102,11 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="tools-disqus"> |
|
|
|
|
{% if allow_reply %} |
|
|
|
|
<a data-reply-to="{{ post.post_id }}" href="#" class="btn btn-primary btn-xs reply-disqus btn-reply-post"> |
|
|
|
|
<a data-parent-post="{{ post.post_id }}" href="#" class="btn btn-primary btn-xs reply-disqus btn-reply-post"> |
|
|
|
|
<i class="fa fa-reply"></i> {{ "Reply"|get_lang }} |
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
<a href="reply.php?{{ _p.web_cid_query ~ '&' ~ {'forum': forum.forum_id, 'thread': thread_id, 'post': post.post_id, 'action': 'quote'}|url_encode }}" class="btn btn-success btn-xs quote-disqus"> |
|
|
|
|
<a data-parent-post="{{ post.post_id }}" href="#" class="btn btn-success btn-xs quote-disqus btn-quote-post"> |
|
|
|
|
<i class="fa fa-quote-left"></i> {{ "Quote"|get_lang }} |
|
|
|
|
</a> |
|
|
|
|
{% endif %} |
|
|
|
|
|