﻿function ListComments(cDocId, cCommentContainerDivId)
{
	var jsonCmtList = 
	[
	{
		UserLogo:"/Data/Test/Guest.png",
		UserName:"Bruce",
		UserNickname:"精思入神",
		IP:"210.27.88.99",
		Id:"001",
		PubTime:"2009-02-12 13:54:30",
		Title:"不错!",
		Content:"文笔还不错，内容仍需精炼！"
	},
	{
		UserLogo:"/Data/Test/Anonymous.gif",
		UserName:"Bruce",
		UserNickname:"精思入神",
		IP:"210.27.88.99",
		Id:"002",
		PubTime:"2009-02-12 13:54:30",
		Title:"",
		Content:"好,有改进!"
	},
	{
		UserLogo:"/Data/Test/UserFace.jpg",
		UserName:"Bruce",
		UserNickname:"精思入神",
		IP:"210.27.88.99",
		Id:"003",
		PubTime:"2009-02-12 13:54:30",
		Title:"不错!",
		Content:"现在修改的还可以,文笔内容俱佳!"
	}		
	];
	
	var CmtList_Html = "";
	
	$.each(jsonCmtList,function(i,jsonCmt) {
	//---------------------------------------------
	CmtList_Html += '<table width="570" border="0" align="center" cellpadding="0" cellspacing="0" class="comment_list">';
	CmtList_Html += '<tr><td width="60" rowspan="4" style="text-align:left; padding-top:10px;">';
	CmtList_Html += '<img src="';
	CmtList_Html += jsonCmt.UserLogo;
	CmtList_Html += '" width="32" />';
	CmtList_Html += '</td><td width="240" style="height:30px; text-align:left;">';
	CmtList_Html += '<a href="';
	CmtList_Html += _WebRoot+'/';
	CmtList_Html += jsonCmt.UserName;
	CmtList_Html += '.card">';
	CmtList_Html += jsonCmt.UserNickname;
	CmtList_Html += '</a>';
	CmtList_Html += '</td>';
	CmtList_Html += '<td width="120" class="comment_ip">'

	if (WebConfig.Visitor.CanAudit)
	{
		CmtList_Html += '<strong>IP:</strong>';
		CmtList_Html += jsonCmt.IP;
	}

	CmtList_Html += '</td>';
	CmtList_Html += '<td width="150" class="comment_time">';
	CmtList_Html += jsonCmt.PubTime;
	CmtList_Html += '</td>';
	CmtList_Html += '</tr>';
	CmtList_Html += '<tr>';
	CmtList_Html += '<td colspan="3" style="text-align:left;">'
	CmtList_Html += '<strong>';
	CmtList_Html += jsonCmt.Title;
	CmtList_Html += '</strong><br />';
	CmtList_Html += jsonCmt.Content;
	CmtList_Html += '</td>';
	CmtList_Html += '</tr>';
	CmtList_Html += '<tr>';
	CmtList_Html += '<td colspan="3" style="height:15px;"></td>';
	CmtList_Html += '</tr>';
	CmtList_Html += '<tr>';
	CmtList_Html += '<td colspan="2" style="text-align:left">&nbsp;</td>';
	CmtList_Html += '<td class="comment_del">';

	if (WebConfig.Visitor.CanAudit)
	{
		CmtList_Html += '<span style="cursor:pointer;" onclick="DeleteComment(\'';
		CmtList_Html += jsonCmt.Id;
		CmtList_Html += '\');">删除</span>'
	}
	
	CmtList_Html += '</td>';
	CmtList_Html += '</tr></table>';
	//---------------------------------------------
     });
	$("#"+cCommentContainerDivId).html(CmtList_Html);
/*
  <table width="570" border="0" align="center" cellpadding="0" cellspacing="0" class="comment_list">
    <tr>
      <td width="100" rowspan="4" style="text-align:left; padding-top:10px;"><img src="bbs_avator_side.gif" width="48" height="48" /></td>
      <td width="200" class="comment_name" style="height:30px;">ivy2009</td>
      <td width="200" class="comment_ip"><strong>IP:</strong>212.212.1.33</td>
      <td width="70" class="comment_time">2009-02-10 16:08</td>
    </tr>
    <tr>
      <td colspan="3" style="text-align:left;">评论内容</td>
      </tr>
    <tr>
      <td colspan="3" style="height:15px;"></td>
      </tr>
    <tr>
      <td colspan="2" style="text-align:left">&nbsp;</td>
      <td class="comment_del"><a href="#">删除</a></td>
    </tr>
  </table>
  */
}

/*
发表论坛话题
*/
function PubForumTopic()
{
	alert("进入论坛讨论此篇文档");
}

/*
对当前文档发表评论
*/
function PostComment()
{
	alert("发表评论");
}

/*
重设评论
*/
function ResetComment()
{
	alert("重设评论");
}

/* 
删除指定的评论条目
*/
function DeleteComment(id)
{
	alert("删除 Id="+id+" 的评论!");
}

/*
Copy 当前文档的Wiki格式链接
*/
function CopyWikiUrl()
{
	alert("拷贝Wiki链接");
}
