/*
评论 2 级嵌套后的样式处理：放置在主评论下，用 @ 方式 by zwwooooo (http://zww.me)
 */
jQuery(document).ready(function($){	//启用 jQ

/* $('.depth-1').each(function() {
	var zzz = $(this).find('ul.children li.depth-2 > div');
	$(this).find(".reply:first").clone().removeClass("reply").addClass("atclass").appendTo(zzz);
});
$('.atclass').click(function() { //定义从属评论回复按钮被点击后的动作
	var atid = '"#' + $(this).parent().attr("id") + '"'; 
	var atname = $(this).prevAll().find('cite:first').text();
	$("#comment").attr("value","<a href=" + atid + ">@" + atname + " </a>").focus();
}); */

//jQuery 实现自动在评论框添加 @用户名 
$('.reply').click(function() {
	var atid = '"#' + $(this).parent().attr("id") + '"'; 
	var atname = $(this).prevAll().find('cite:first').text();
	$("#comment").attr("value","<a href=" + atid + ">@" + atname + " </a>").focus();
});
$('.cancel-comment-reply a').click(function() { //点击取消回复评论清空评论框的内容
	$("#comment").attr("value",'');
});

})									//结束jQuery
