mirror of https://github.com/vtrois/kratos
parent
b24e719982
commit
6271bb7486
|
@ -1463,11 +1463,11 @@ button:focus {
|
|||
|
||||
.k-main .details .comments .comment .info .author_name {
|
||||
display: inline-block;
|
||||
margin-top: 3px;
|
||||
color: #4a4a4a;
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
color: #252525;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
margin-top: 3px;
|
||||
font-style: normal;
|
||||
line-height: 1.375;
|
||||
}
|
||||
|
||||
|
@ -1489,7 +1489,6 @@ button:focus {
|
|||
|
||||
.k-main .details .comments .comment .info .content p span {
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.k-main .details .comments .comment .info .meta,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
var addComment = { moveForm: function (a, b, c, d) { var e, f, g, h, p, i = this, j = i.I(a), k = i.I(c), l = i.I("cancel-comment-reply-link"), m = i.I("comment_parent"), n = i.I("comment_post_ID"), o = k.getElementsByTagName("form")[0]; if (j && k && l && m && o) { i.respondId = c, d = d || !1, i.I("wp-temp-form-div") || (e = document.createElement("div"), e.id = "wp-temp-form-div", e.style.display = "none", k.parentNode.insertBefore(e, k)), j.parentNode.insertBefore(k, j.nextSibling), n && d && (n.value = d), m.value = b, l.style.display = "", l.onclick = function () { var a = addComment, b = a.I("wp-temp-form-div"), c = a.I(a.respondId); if (b && c) return a.I("comment_parent").value = "0", b.parentNode.insertBefore(c, b), b.parentNode.removeChild(b), this.style.display = "none", this.onclick = null, !1 }; try { for (p = 0; p < o.elements.length; p++)if (f = o.elements[p], h = !1, "getComputedStyle" in window ? g = window.getComputedStyle(f) : document.documentElement.currentStyle && (g = f.currentStyle), (f.offsetWidth <= 0 && f.offsetHeight <= 0 || "hidden" === g.visibility) && (h = !0), "hidden" !== f.type && !f.disabled && !h) { f.focus(); break } } catch (q) { } return !1 } }, I: function (a) { return document.getElementById(a) } }, EditComment = function (a, b, c, d) { return addComment.moveForm(a, b, c, d), respond = addComment.I(c), commentForm = respond.getElementsByTagName("form")[0], comm = addComment.I(a), console.log(comm), commentForm.querySelector("#comment").value = comm.querySelector(".comment-body").innerText, commentForm.action = "/comment/edit/" + b, !1 };
|
||||
jQuery(document).ready(function(e){var t=e("#cancel-comment-reply-link"),n=t.text(),o="list";e(document).on("submit","#commentform",function(){return e.ajax({url:ajaxcomment.ajax_url,data:e(this).serialize()+"&action=ajax_comment",type:e(this).attr("method"),beforeSend:function(){layer.msg("评论正在提交中")},error:function(e){layer.msg(e.responseText)},success:function(t){e("textarea").each(function(){this.value=""});var n=addComment,r=n.I("cancel-comment-reply-link"),m=n.I("wp-temp-form-div"),a=n.I(n.respondId),c=(n.I("comment_post_ID").value,n.I("comment_parent").value);"0"!=c?e("#comment-"+c).append('<ul class="children">'+t+"</ul>"):"asc"==ajaxcomment.order?e("."+o).append(t):e("."+o).prepend(t),layer.msg("评论提交成功"),r.style.display="none",r.onclick=null,n.I("comment_parent").value="0",m&&a&&(m.parentNode.insertBefore(a,m),m.parentNode.removeChild(m))}}),!1}),addComment={moveForm:function(o,r,m){var a,c=this,l=c.I(o),p=c.I(m),d=c.I("cancel-comment-reply-link"),i=c.I("comment_parent");c.I("comment_post_ID");t.text(n),c.respondId=m,c.I("wp-temp-form-div")||(a=document.createElement("div"),a.id="wp-temp-form-div",a.style.display="none",p.parentNode.insertBefore(a,p)),l?l.parentNode.insertBefore(p,l.nextSibling):(temp=c.I("wp-temp-form-div"),c.I("comment_parent").value="0",temp.parentNode.insertBefore(p,temp),temp.parentNode.removeChild(temp)),e("body").animate({scrollTop:e("#respond").offset().top-150},400),i.value=r,d.style.display="",d.onclick=function(){var e=addComment,t=e.I("wp-temp-form-div"),n=e.I(e.respondId);return e.I("comment_parent").value="0",t&&n&&(t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t)),this.style.display="none",this.onclick=null,!1};try{c.I("comment").focus()}catch(e){}return!1},I:function(e){return document.getElementById(e)},createButterbar:function(e){layer.msg(e)}}});
|
|
@ -203,8 +203,7 @@ function comment_scripts()
|
|||
wp_enqueue_script('comment', ASSET_PATH . '/assets/js/comments.min.js', array(), THEME_VERSION);
|
||||
wp_localize_script('comment', 'ajaxcomment', array(
|
||||
'ajax_url' => admin_url('admin-ajax.php'),
|
||||
'order' => get_option('comment_order'),
|
||||
'formpostion' => 'bottom',
|
||||
'order' => get_option('comment_order')
|
||||
));
|
||||
}
|
||||
add_action('wp_enqueue_scripts', 'comment_scripts');
|
||||
|
@ -232,20 +231,17 @@ function comment_callback()
|
|||
do_action('set_comment_cookies', $comment, $user);
|
||||
$GLOBALS['comment'] = $comment;
|
||||
?>
|
||||
<li class="comment cleanfix" id="comment-<?php comment_ID();?>">
|
||||
<li class="comment cleanfix" id="comment-<?php echo esc_attr(comment_ID()); ?>">
|
||||
<div class="avatar float-left d-inline-block mr-2">
|
||||
<?php if (function_exists('get_avatar') && get_option('show_avatars')) {echo get_avatar($comment, 50);}?>
|
||||
</div>
|
||||
<div class="info clearfix">
|
||||
<div class="clearfix">
|
||||
<cite class="author_name"><?php echo get_comment_author_link();?></cite>
|
||||
<div class="content pb-2">
|
||||
<?php comment_text();?>
|
||||
</div>
|
||||
<cite class="author_name"><?php echo get_comment_author_link();?></cite>
|
||||
<div class="content pb-2">
|
||||
<?php comment_text();?>
|
||||
</div>
|
||||
<div>
|
||||
<div class="meta">
|
||||
<span class="date"><?php echo get_comment_date('Y年m月d日'); ?></span>
|
||||
<div class="meta clearfix">
|
||||
<div class="date d-inline-block float-left"><?php echo get_comment_date('Y年m月d日'); ?><?php if (current_user_can('edit_posts')) {echo '<span class="ml-2">';edit_comment_link(__('编辑', 'kratos'));echo '</span>';};?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -274,31 +270,26 @@ add_filter('comment_text', 'comment_display', '', 1);
|
|||
function comment_callbacks($comment, $args, $depth = 2)
|
||||
{
|
||||
$GLOBALS['comment'] = $comment;?>
|
||||
<li class="comment cleanfix" id="comment-<?php comment_ID();?>">
|
||||
<div class="avatar float-left d-inline-block mr-2">
|
||||
<?php if (function_exists('get_avatar') && get_option('show_avatars')) {echo get_avatar($comment, 50);}?>
|
||||
</div>
|
||||
<div class="info clearfix">
|
||||
<div class="clearfix">
|
||||
<cite class="author_name"><?php echo get_comment_author_link();?></cite>
|
||||
<div class="content pb-2">
|
||||
<?php comment_text();?>
|
||||
<li class="comment cleanfix" id="comment-<?php echo esc_attr(comment_ID()); ?>">
|
||||
<div class="avatar float-left d-inline-block mr-2">
|
||||
<?php if (function_exists('get_avatar') && get_option('show_avatars')) {echo get_avatar($comment, 50);}?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<div class="meta clearfix">
|
||||
<div class="date d-inline-block float-left"><?php echo get_comment_date('Y年m月d日'); ?><?php if (current_user_can('edit_posts')) {echo '<span class="ml-2">';
|
||||
edit_comment_link(__('编辑', 'kratos'));
|
||||
echo '</span>';}
|
||||
;?></div>
|
||||
<div class="tool reply ml-2 d-inline-block float-right">
|
||||
<?php
|
||||
$defaults = array('add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => '<i class="kicon i-reply"></i><span class="ml-1">' . __('回复', 'kratos') . '</span>');
|
||||
comment_reply_link(array_merge($defaults, array('depth' => $depth, 'max_depth' => $args['max_depth'])));?>
|
||||
<div class="info clearfix">
|
||||
<cite class="author_name"><?php echo get_comment_author_link();?></cite>
|
||||
<div class="content pb-2">
|
||||
<?php comment_text();?>
|
||||
</div>
|
||||
<div class="meta clearfix">
|
||||
<div class="date d-inline-block float-left"><?php echo get_comment_date('Y年m月d日'); ?><?php if (current_user_can('edit_posts')) {echo '<span class="ml-2">';edit_comment_link(__('编辑', 'kratos'));echo '</span>';};?>
|
||||
</div>
|
||||
<div class="tool reply ml-2 d-inline-block float-right">
|
||||
<?php
|
||||
$defaults = array('add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => '<i class="kicon i-reply"></i><span class="ml-1">' . __('回复', 'kratos') . '</span>');
|
||||
comment_reply_link(array_merge($defaults, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue