📄 b3.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GB2312"
pageEncoding="GB2312"%>
<%@page import="java.util.*" %>
<html>
<head>
<title></title>
<META http-equiv="refresh" content="120">
<script type="text/javascript">
function window_onload()
{
<%String colorStr=request.getParameter("color");
%>
for(var i=0;i<29;i++){
if(document.forms[0].color.options[i].value=="<%=colorStr%>"){
document.forms[0].color.options[i].selected="true";
choiceColor();
break;
}
}
formchat.chatContext.focus();
<%String fontStr=request.getParameter("font");%>
for(var i=0;i<4;i++){
if(document.forms[0].font.options[i].value=="<%=fontStr%>"){
document.forms[0].font.options[i].selected="true";
choicefont();
break;
}
}
}
function choiceMenue(){
var str=document.forms[0].menue.options[document.forms[0].menue.selectedIndex].value;
//修改用户信息
if(str=="updataMyInfo"){
document.forms[0].chatContext.focus();
window.open("updataInfo.jsp","_blank","width=500px;height=500px;status=no;toolbar=no");
}
//查看他人信息
if(str=="seeOtherInfo"){
window.open("searchOthersInfo.jsp","_blank","width=500px;height=500px;status=no;toolbar=no");
}
//寻找在线用户
if(str=="searchOtherUser"){
alert("该功能暂未开放");
}
document.forms[0].menue.options[0].selected="true";
}
//改变颜色
function choiceColor()
{
if(document.forms[0].color.value!='0')
document.forms[0].chatContext.style.color=document.forms[0].color.value;
else
document.forms[0].chatContext.style.color='';
formchat.chatContext.focus();
}
//改变字体
function choicefont(){
if(document.forms[0].font.value!='0')
document.forms[0].chatContext.style.font_family=document.forms[0].font.value;
else
document.forms[0].chatContext.style.font_family='';
formchat.chatContext.focus();
}
</script>
</head>
<body style="FONT-SIZE:15PX" bgcolor="#CCCC99" onLoad="return window_onload()">
<jsp:useBean id="chatbase" scope="application" class="tryChat.DataBaseOfChatRoom"></jsp:useBean>
<jsp:useBean id="userInfo" scope="session" class="tryChat.CurrentlyUser"></jsp:useBean>
<jsp:useBean id="chatHome" scope="application" class="tryChat.ChatHome"></jsp:useBean>
<%
if(request.getParameter("chatContext")!=null&&request.getParameter("object")!=null){
String chatContext=request.getParameter("chatContext");
String object=request.getParameter("object");
String name=userInfo.getName();
String str;
String nameStr=name;
nameStr=new String(nameStr.getBytes("GBK"),"iso-8859-1");
String dui="对";
String shuo="说";
dui=new String(dui.getBytes("GBK"),"iso-8859-1");
shuo=new String(shuo.getBytes("GBK"),"iso-8859-1");
chatContext="<font style=\'color:"+colorStr+";font-family:"+fontStr+"\'>"+chatContext+"</font>";
java.util.Date date=new java.util.Date();
String datestr="["+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()+"]";
if(object.equals("")){
str="<B>"+nameStr+"</B>"+datestr+":"+chatContext;
}
else{
str="<B>"+nameStr+"</B> "+dui+" <font color=#CC0000><B>"+object+"</B></font> "+shuo+datestr+":"+chatContext;
}
str=new String(str.getBytes("iso-8859-1"),"GBK");
chatHome.addNote(str);
}
%>
<form action="b3.jsp" method="post" name="formchat">
<select name="menue" onChange="choiceMenue()">
<option value="">菜单
<option value="updataMyInfo">修改用户信息</option>
<option value="seeOtherInfo">查看其他用户资料</option>
<option value="searchOtherUser">寻找用户</option>
</select>
<select name="color" onchange="choiceColor()">
<option value="0" STYLE="COLOR:black" selected>颜色</option>
<option style="BACKGROUND:#000088" value="000088"></option>
<option style="BACKGROUND:#0000ff" value="0000ff"></option>
<option style="BACKGROUND:#008800" value="008800"></option>
<option style="BACKGROUND:#008888" value="008888"></option>
<option style="BACKGROUND:#0088ff" value="0088ff"></option>
<option style="BACKGROUND:#00a010" value="00a010"></option>
<option style="BACKGROUND:#1100ff" value="1100ff"></option>
<option style="BACKGROUND:#111111" value="111111"></option>
<option style="BACKGROUND:#333333" value="333333"></option>
<option style="BACKGROUND:#50b000" value="50b000"></option>
<option style="BACKGROUND:#880000" value="880000"></option>
<option style="BACKGROUND:#8800ff" value="8800ff"></option>
<option style="BACKGROUND:#888800" value="888800"></option>
<option style="BACKGROUND:#888888" value="888888"></option>
<option style="BACKGROUND:#8888ff" value="8888ff"></option>
<option style="BACKGROUND:#aa00cc" value="aa00cc"></option>
<option style="BACKGROUND:#aaaa00" value="aaaa00"></option>
<option style="BACKGROUND:#ccaa00" value="ccaa00"></option>
<option style="BACKGROUND:#ff0000" value="ff0000"></option>
<option style="BACKGROUND:#ff0088" value="ff0088"></option>
<option style="BACKGROUND:#ff00ff" value="ff00ff"></option>
<option style="BACKGROUND:#ff8800" value="ff8800"></option>
<option style="BACKGROUND:#ff0005" value="ff0005"></option>
<option style="BACKGROUND:#ff88ff" value="ff88ff"></option>
<option style="BACKGROUND:#ee0005" value="ee0005"></option>
<option style="BACKGROUND:#ee01ff" value="ee01ff"></option>
<option style="BACKGROUND:#3388aa" value="3388aa"></option>
<option style="BACKGROUND:#000000" value="000000"></option>
</select>
<select name="font" onchange="choicefont()">
<OPTION value=0>字体</OPTION>
<OPTION value="Arial Black">Arial Black</OPTION>
<OPTION value="Agency FB">Agency FB</OPTION>
<OPTION value="Arial Rounded MT Bold">Arial Rounded MT Bold</OPTION>
</select>
<br>对<select name="object">
<%
String objectValue="";
if(request.getParameter("object")!=null){
if(request.getParameter("object")==""){
out.print("<option value=\'\' selected> </option>");
}else{
out.print("<option value=\'\' > </option>");
objectValue=request.getParameter("object");
objectValue=new String(objectValue.getBytes("iso-8859-1"),"GBK");
}
}else{
out.print("<option value=\'\' > </option>");
}
ArrayList userlist=chatHome.getUserList();
int count=userlist.size();
String str1;
for(int i=0;i<count;i++){
str1=(String)userlist.get(i);
if(objectValue.equals(str1)){
out.print("<option value=\""+str1+"\" selected>"+str1+"</option>");
}
else{
out.print("<option value=\""+str1+"\">"+str1+"</option>");
}
}
%>
</select>说<input name="chatContext" maxlength="60" size="60"/><input name="submit" type="submit" value="提交"/><br>
</form>
<a href="exit.jsp"><img src="tc.jpg"></a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -