📄 function.js
字号:
//插入图片
function image()
{
var FoundErrors = '';
var enterURL = prompt("请输入图片地址","http://");
if (!enterURL)
{
FoundErrors +="\n";
}
if (FoundErrors)
{
return;
}
var ToAdd = "[图片]"+enterURL+"[/图片]";
document.form.msgContent.value+=ToAdd;
document.form.msgContent.focus();
gbcount();
}
//检测留言内容长度
function gbcount()
{
var max;
max = parseInt(document.getElementById('total').innerText);
if (form.msgContent.value.length > max) {
form.msgContent.value = form.msgContent.value.substring(0,max);
document.getElementById('used').innerText = max;
document.getElementById('remain').innerText = 0;
alert("您输入的留言内容已经超过系统允许的最多500字!\n请删减部分留言内容再发表!");
}
else {
document.getElementById('used').innerText = form.msgContent.value.length;
document.getElementById('remain').innerText = max - parseInt(document.getElementById('used').innerText);
}
}
//显示表情列表
function showEmtList()
{
if(emtList.style.display=='')
{
emtList.style.display='none';
}
else
{
emtList.style.display='';
}
}
//插入表情
function emoticon(theSmilie){
document.form.msgContent.value +=theSmilie + '';
document.form.msgContent.focus();
gbcount();
}
//**********************************
//头像选择
//**********************************
//头像表单选择事件
function SelectFaceSex()
{
if(document.form.MsgPersonSex[0].checked)
{
with(document.form.MsgPersonFace)
{
length = 9;
for(I1=0;I1<9;I1++)
{
options[I1].text = '男'+(I1+1);
options[I1].value = 'M' + (I1+1) + '.gif';
}
}
}
else
{
with(document.form.MsgPersonFace)
{
length = 9;
for(I2=0;I2<9;I2++)
{
options[I2].text = '女'+(I2+1);
options[I2].value = 'W' + (I2+1) + '.gif';
}
}
}
}
//头像列表事件
function ShowFaceList()
{
if(document.form.MsgPersonSex[0].checked)
{
var FaceValue = window.showModalDialog("faceList.aspx?FaceSex=M","", "scroll:no; center:yes; dialogHeight:170px; dialogWidth:430px;");
if(FaceValue!='')
{
with(document.form.MsgPersonFace)
{
for(I1=0;I1<9;I1++)
{
if(options[I1].text == FaceValue)
{
options[I1].selected = "selected";
}
}
}
}
}
else
{
var FaceValue = window.showModalDialog("faceList.aspx?FaceSex=W","", "scroll:no; center:yes; dialogHeight:170px; dialogWidth:430px;");
if(FaceValue!='')
{
with(document.form.MsgPersonFace)
{
for(I2=0;I2<9;I2++)
{
if(options[I2].text == FaceValue)
{
options[I2].selected = "selected";
}
}
}
}
}
}
//回到DIV顶部
function backDivTop()
{
var tempHash;
//防止改变hash值
tempHash = window.location.hash;
location.href("#mainFormTop");
//改回hash值
window.location.hash = tempHash;
}
//显示系统信息
function showSysMsg(msg,flag)
{
if(flag=="open")
{
document.getElementById("sysMsg").innerText=msg;
sysMsgBox.style.display="";
}
else if(flag=="close")
{
sysMsgBox.style.display="none";
document.getElementById("sysMsg").innerText="";
}
}
//显示皮肤列表
function showSkinList()
{
if(skinList.style.display=="")
{
skinList.style.display="none";
}
else
{
skinList.style.display="";
}
}
//刷新验证码
function resetValidate()
{
document.images['validateImg'].src='validate.aspx';
}
//**********************************
//********* 数据的返回 *********
//**********************************
function getDataInit(initJS)
{
switch(initJS)
{
case"SelectFaceSex":
SelectFaceSex();
break;
case"showSkinList":
showSkinList();
break;
}
}
function postDataInit(initJS)
{
if(initJS.substr(0,9)=="msgEdited")
{
var id;
id=initJS.substr(9,initJS.length)
if(id.replace(/ /g,'') == "")
{
return false;
}
else
{
showSysMsg("留言修改成功......","open");
window.setTimeout("postdata('正在刷新留言主题,请稍等....','Mode.aspx?Mode=ReturnHead&id=" + id + "','aHead" + id + "');postdata('正在刷新留言内容,请稍等....','Mode.aspx?Mode=ReturnContent&id=" + id + "','aContent" + id + "');",1500);
return true;
}
}
if(initJS.substr(0,10)=="msgReplyed")
{
var id;
id=initJS.substr(10,initJS.length)
if(id.replace(/ /g,'') == "")
{
return false;
}
else
{
showSysMsg("回复留言成功......","open");
window.setTimeout("postdata('正在刷新回复留言,请稍等....','Mode.aspx?Mode=ReturnReply&id=" + id + "','aReply" + id + "');",1500);
return true;
}
}
switch(initJS)
{
case"msgAdded":
showSysMsg("留言成功......","open");
window.setTimeout("addHash('msgList1');",1500);
return true;
break;
case"msgStop":
alert("警告,管理员已经禁止用户留言!");
window.setTimeout("addHash('msgList1');",1500);
return true;
break;
case"msgDeleted":
showSysMsg("留言删除成功......","open");
window.setTimeout("urlCode();",1500);
return true;
break;
case"changeSkin":
showSysMsg("更换皮肤成功......","open");
window.setTimeout("postdata('正在刷新CSS样式表,请稍等....','Mode.aspx?Mode=GetCssStyle','cssStyle');getdata('正在刷新留言本背景,请稍等....','Mode.aspx?Mode=GetBG','backGround');getdata('正在刷新右侧GIF动画,请稍等....','Mode.aspx?Mode=GetRightGif','rightGif');getdata('正在刷新左侧菜单,请稍等....','Mode.aspx?Mode=GetLeftMenu','leftMenu');getdata('正在刷新留言列表,请稍等....','Mode.aspx?Mode=GetMsgList','mainForm');",1500);
return true;
break;
case"validateError":
alert("你输入的验证码错误,请重试!");
resetValidate();
return true;
break;
case"loginError":
alert("ID或密码错误,请重试!");
resetValidate();
return true;
break;
case"loginTrue":
showSysMsg("登陆成功,欢迎你......","open");
window.setTimeout("getdata('正在加载左侧菜单,请稍等....','Mode.aspx?Mode=GetLeftMenu','leftMenu');addHash('msgList1');",1500);
return true;
break;
case"loginFalse":
showSysMsg("非法登陆或会话超时......","open");
window.setTimeout("addHash('adminLogin');",1500);
return true;
break;
case"Logoff":
showSysMsg("注销成功......","open");
window.setTimeout("getdata('正在加载左侧菜单,请稍等....','Mode.aspx?Mode=GetLeftMenu','leftMenu');getdata('正在加载留言列表,请稍等....','Mode.aspx?Mode=GetMsgList','mainForm');",1500);
return true;
break;
case"configed":
showSysMsg("设置成功......","open");
window.setTimeout("getdata('正在加载系统公告,请稍等....','Mode.aspx?Mode=GetAnnounce','TopAnnounce');addHash('msgList1');",1500);
return true;
break;
case"oldPSWError":
alert("旧密码错误,请重试!");
resetValidate();
return true;
break;
case"PSWEdited":
showSysMsg("密码修改成功......","open");
window.setTimeout("addHash('msgList1');",1500);
return true;
break;
case"css1":
cssStyle.href="skins/1/style.css";
return true;
break;
case"css2":
cssStyle.href="skins/2/style.css";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -