62,234
社区成员




protected void rpComment_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Footer)
{
Literal ltContetn = e.Item.FindControl("ltContent") as Literal;
HiddenField HFcontent = e.Item.FindControl("HFcontent") as HiddenField;
string content = HFcontent.Value;
string[] face = { "[:-)]","[:-D]","[;-)]","[8-)]","[(6)]","[:-$]","[8o|]","[:-(]","[:-@]","[:-|]",
"[(&)]","[&-|]","[:-#]","[$-)]","[:-P]","[(@)]","[:'(]","[|-)]","[:-Z]","[:-S]",
"[*-(]","[:-%]","[^-)]","[:-*]","[(R)]","[(W)]","[(%)]","[(S)]","[(*)]","[(M)]",
"[(so)]","[(I)]","[(F)]","[(L)]","[(U)]","[(=)]","[(#)]","[(O)]","[(D)]","[(T)]" };
string[] faceImg = {"../../face/01.gif", "../../face/02.gif","../../face/03.gif", "../../face/04.gif",
"../../face/05.gif", "../../face/06.gif","../../face/07.gif", "../../face/08.gif",
"../../face/09.gif", "../../face/10.gif","../../face/11.gif", "../../face/12.gif",
"../../face/13.gif", "../../face/14.gif","../../face/15.gif", "../../face/16.gif",
"../../face/17.gif", "../../face/18.gif","../../face/19.gif", "../../face/20.gif",
"../../face/21.gif", "../../face/22.gif","../../face/23.gif", "../../face/24.gif",
"../../face/25.gif", "../../face/26.gif","../../face/27.gif", "../../face/28.gif",
"../../face/29.gif", "../../face/30.gif","../../face/31.gif", "../../face/32.gif",
"../../face/33.gif", "../../face/34.gif","../../face/35.gif", "../../face/36.gif",
"../../face/37.gif", "../../face/38.gif","../../face/39.gif", "../../face/40.gif"};
for (int i = 0; i < face.Length; i++)
{
content = content.Replace(face[i], "<img src='" + faceImg[i] + "' border='0'/> ");
}
ltContetn.Text += content.ToString();
}
}
DisplayEmotions("EmotionsDiv", "NoHtmlCommentContent");
function DisplayEmotions(container, editor)
{
var em = "<img src='../../face/01.gif' alt=\"微笑 [:-)]\" onclick=\"AddEmotion('{editor}','[:-)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/02.gif' alt=\"大笑 [:-D]\" onclick=\"AddEmotion('{editor}','[:-D]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/03.gif' alt=\"眨眼 [;-)]\" onclick=\"AddEmotion('{editor}','[;-)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/04.gif' alt=\"装酷 [8-)]\" onclick=\"AddEmotion('{editor}','[8-)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/05.gif' alt=\"独眼龙 [(6)]\" onclick=\"AddEmotion('{editor}','[(6)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/06.gif' alt=\"害羞 [:-$]\" onclick=\"AddEmotion('{editor}','[:-$]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/07.gif' alt=\"生气 [8o|]\" onclick=\"AddEmotion('{editor}','[8o|]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/08.gif' alt=\"发呆 [:-(]\" onclick=\"AddEmotion('{editor}','[:-(]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/09.gif' alt=\"发怒 [:-@]\" onclick=\"AddEmotion('{editor}','[:-@]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/10.gif' alt=\"惊讶 [:-|]\" onclick=\"AddEmotion('{editor}','[:-|]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/11.gif' alt=\"猫猫 [(&)]\" onclick=\"AddEmotion('{editor}','[(&)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/12.gif' alt=\"白眼 [&-|]\" onclick=\"AddEmotion('{editor}','[&-|]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/13.gif' alt=\"不说 [:-#]\" onclick=\"AddEmotion('{editor}','[:-#]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/14.gif' alt=\"眼馋 [$-)]\" onclick=\"AddEmotion('{editor}','[$-)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/15.gif' alt=\"吐舌头 [:-P]\" onclick=\"AddEmotion('{editor}','[:-P]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/16.gif' alt=\"猫咪 [(@)]\" onclick=\"AddEmotion('{editor}','[(@)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/17.gif' alt=\"大哭 [:'(]\" onclick=\"AddEmotion('{editor}','[:\\\'(]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/18.gif' alt=\"低头 [|-)]\" onclick=\"AddEmotion('{editor}','[|-)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/19.gif' alt=\"困了 [:-Z]\" onclick=\"AddEmotion('{editor}','[:-Z]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/20.gif' alt=\"困惑 [:-S]\" onclick=\"AddEmotion('{editor}','[:-S]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/21.gif' alt=\"悲伤 [*-(]\" onclick=\"AddEmotion('{editor}','[*-(]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/22.gif' alt=\"狂吐 [:-%]\" onclick=\"AddEmotion('{editor}','[:-%]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/23.gif' alt=\"伤心 [^-)]\" onclick=\"AddEmotion('{editor}','[^-)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/24.gif' alt=\"汗 [:-*]\" onclick=\"AddEmotion('{editor}','[:-*]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/25.gif' alt=\"花 [(R)]\" onclick=\"AddEmotion('{editor}','[(R)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/26.gif' alt=\"花 [(W)]\" onclick=\"AddEmotion('{editor}','[(W)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/27.gif' alt=\"太阳 [(%)]\" onclick=\"AddEmotion('{editor}','[(%)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/28.gif' alt=\"月亮 [(S)]\" onclick=\"AddEmotion('{editor}','[(S)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/29.gif' alt=\"星星 [(*)]\" onclick=\"AddEmotion('{editor}','[(*)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/30.gif' alt=\"邮件 [(M)]\" onclick=\"AddEmotion('{editor}','[(M)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/31.gif' alt=\"足球 [(so)]\" onclick=\"AddEmotion('{editor}','[(so)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/32.gif' alt=\"亮亮 [(I)]\" onclick=\"AddEmotion('{editor}','[(I)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/33.gif' alt=\"咖啡 [(F)]\" onclick=\"AddEmotion('{editor}','[(F)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/34.gif' alt=\"心 [(L)]\" onclick=\"AddEmotion('{editor}','[(L)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/35.gif' alt=\"心 [(U)]\" onclick=\"AddEmotion('{editor}','[(U)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/36.gif' alt=\"便便 [(=)]\" onclick=\"AddEmotion('{editor}','[(=)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/37.gif' alt=\"电视 [(#)]\" onclick=\"AddEmotion('{editor}','[(#)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/38.gif' alt=\"时间 [(O)]\" onclick=\"AddEmotion('{editor}','[(O)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/39.gif' alt=\"酒 [(D)]\" onclick=\"AddEmotion('{editor}','[(D)]')\" border=\"0\" class=\"editorEmotion\"/> <img src='../../face/40.gif' alt=\"电话 [(T)]\" onclick=\"AddEmotion('{editor}','[(T)]')\" border=\"0\" class=\"editorEmotion\"/> ";
if (em != "")
{
em = em.replace(new RegExp("{editor}","gm"), editor);
}
if(document.getElementById(container))
{
document.getElementById(container).innerHTML = em;
}
}
function AddEmotion(editor, emotion)
{
var edt = document.getElementById(editor);
if(edt)
{
if (edt.value == "字数上限为2000字")
{
edt.value = "";
}
edt.value += emotion;
}
}
<div id="EmotionsDiv" style="width:200px;font-family:verdana;font-size:12px;" align="left">
<img alt="微笑 [:-)]" border="0" class="editorEmotion"
onclick="AddEmotion('NoHtmlCommentContent','[:-)]')"
src="../../face/01.gif" /> <img
alt="大笑 [:-D]" border="0" class="editorEmotion"
onclick="AddEmotion('NoHtmlCommentContent','[:-D]')"
src="../../face/02.gif" /> <img
alt="眨眼 [;-)]" border="0" class="editorEmotion"
onclick="AddEmotion('NoHtmlCommentContent','[;-)]')"
src="../../face/03.gif" /> <img
alt="装酷 [8-)]" border="0" class="editorEmotion"
onclick="AddEmotion('NoHtmlCommentContent','[8-)]')"
src="../../face/04.gif" /> <img
alt="独眼龙 [(6)]" border="0" class="editorEmotion"
onclick="AddEmotion('NoHtmlCommentContent','[(6)]')"
src="../../face/05.gif" /> <img
alt="发呆 [:-(]" border="0" class="editorEmotion"
onclick="AddEmotion('NoHtmlCommentContent','[:-(]')"
src="../../face/08.gif" /> <br /></div>