修复登录页问题,添加论坛表情

This commit is contained in:
FJY
2017-11-30 17:24:00 +08:00
parent 5e87ddf1ba
commit 40483bae6a
22 changed files with 788 additions and 198 deletions

View File

@@ -19,6 +19,7 @@
rel="stylesheet">
<link href="forum/css/animate.css" rel="stylesheet">
<link href="forum/css/style.css" rel="stylesheet">
<link href="css/emoji.css" rel="stylesheet">
<script type="text/javascript">
function validateSubject(field) {
@@ -30,8 +31,7 @@
function validate(form) {
fail = validateSubject(form.subject.value)
fail += validateContent(form.content.value)
if (fail == "") return true;
else {
if (fail == "") return true;else {
alert(fail);return false;
} //判断表单的内容不能为空
}
@@ -64,7 +64,8 @@
</div>
</div>
<div class="row">
<form action="forum/send.jsp" method="post" onsubmit="return validate(this)">
<form action="forum/send.jsp" method="post"
onsubmit="return validate(this)">
<div class="form-group">
<label for="textTitle">主题</label> <input type="text"
@@ -74,7 +75,7 @@
<label for="textContent">内容</label>
<textarea rows="10" cols="135" name="content"
class="form-control" placeholder="内容"></textarea>
class="form-control" placeholder="内容" id="form-control"></textarea><img src="chartroom/arclist/1.gif" class="emotion" style="margin-left: 30px;">
<input class="btn btn-default pull-right createNew"
type="submit" value="发表帖子"> <input type="hidden"
name="username" value="<%=user1%>" />
@@ -132,6 +133,46 @@
$('.click2edit').destroy();
};
</script>
<script src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.qqFace_forum.js"></script>
<script type="text/javascript">
$(function() {
$('.emotion').qqFace({
id : 'facebox',
assign : 'form-control',
path : 'chartroom/arclist/' //表情存放的路径
});
$(".send").click(function() {
var str = $("#form-control").val();
$("#show").html(replace_em(str));
});
});
//查看结果
function replace_em(str) {
str = str.replace(/\</g, '&lt;');
str = str.replace(/\>/g, '&gt;');
str = str.replace(/\n/g, '<br/>');
str = str.replace(/\[em_([0-9]*)\]/g, '< img src="chartroom/arclist/$1.gif" border="0" />');
return str;
}
</script>
</body>
</html>