📄 main82.js
字号:
xmlhttp.open("post",forumpath+"GetBoardlist.asp",true);
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlhttp.send("");
}
else
{
var sObj = document.getElementById(selectname);
if (sObj)
{
sObj.options[0] = new Option(fristoption, fristvalue);
eval("var boardlist="+cache["boardlist"]+".data");
appOption(boardlist,sObj,boardid,checknopost,0)
}
}
}
function appOption(boardlist,Obj,boardid,checknopost,pid)
{
for(var i=0;i<boardlist.length;i++)
{
if(parseInt(boardlist[i].parentid)==pid)
{
var LoadBoard =parseInt(boardlist[i].boardid);
var depth = parseInt(boardlist[i].depth);
var boardtype = boardlist[i].boardtype;
if (depth ==0)
{
var outtext="╋";
}
else
{
var outtext="";
for (var j=0;j<depth ;j++)
{
if (j>0){outtext+=" |"}
outtext+=" "
}
outtext+="├"
}
boardtype = boardtype.replace(/<[^>]*>/g, "")
boardtype = boardtype.replace(/&[^&]*;/g, "")
if(checknopost==1 && boardlist[i].nopost=="1")
{
boardtype+="(不许转移)"
}
var index=Obj.length;
Obj.options[index] = new Option(outtext+boardtype, LoadBoard);
if(LoadBoard==boardid) Obj.options[index].selected = true;
appOption(boardlist,Obj,boardid,checknopost,LoadBoard)
}
}
}
//SELECT表单选取 Obj 表单名,VAL所选的值
function ChkSelected(Obj,Val)
{
Val = Val.replace(/\s*/g,"");
if (Obj)
{
for (i=0;i<Obj.length;i++){
if (Obj.options[i].value==Val||(","+Val+",").indexOf(","+Obj.options[i].value+",")!=-1){
Obj.options[i].selected=true;
}
}
}
}
//单选表单选取 Obj 表单名,VAL所选的值
function chkradio(Obj,Val){
if (Obj){
Val = Val.replace(/\s*/g,"");
for (i=0;i<Obj.length;i++){
if (Obj[i].value==Val){
Obj[i].checked=true;
break;
}
}
}
}
//多选表单选取 Obj 表单名,VAL所选的值
function chkcheckbox(Obj,Val){
if (Obj){
Val = Val.replace(/\s*/g,"");
Val = ","+Val+",";
if (Obj.length==null){
if(Val.indexOf(","+Obj.value+",")!=-1){
Obj.checked=true;
}
}
for (i=0;i<Obj.length;i++){
if(Val.indexOf(","+Obj[i].value+",")!=-1){
Obj[i].checked=true;
}
}
}
}
//复选表单全选事件
function boxCheckAll(obj,chkobj) {
if (!obj){return false;}
for (var i=0;i<obj.length;i++)
{
var e = obj[i];
if (e.type=="checkbox")
{
e.checked = chkobj.checked;
}
}
}
// 修改编辑栏高度
function textarea_size(num,objname){
var obj=document.getElementById(objname)
if (obj){
if (parseInt(obj.style.height)+num>20){
obj.style.height = parseInt(obj.style.height)+num+"px";
}
}
}
function readCookie(name){
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
};
return null;
};
function createCookie(name,value,days){
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
};
document.cookie = name+"="+value+expires+"; path=/";
};
//图片自动调整的模式,1为按比例调整 ,2 按大小调整。
var resizemode=2;
function imgresize(o){
if (resizemode==2 || o.onmousewheel){
if(o.width > 500 ){
o.style.width='500px';
}
if(o.height > 800){
o.style.height='800px';
}
}
else{
var parentNode=o.parentNode.parentNode
if (parentNode){
if (o.offsetWidth>=parentNode.offsetWidth) o.style.width='98%';
}
else{
var parentNode=o.parentNode
if (parentNode){
if (o.offsetWidth>=parentNode.offsetWidth) o.style.width='98%';
}
}
}
}
function bbimg(o){
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
return false;
}
function boardbarover(obj)
{
obj.className = obj.className.indexOf("mainbarhover")>0? "mainbar":"mainbar mainbarhover";
}
function getOffsetTop(elm) {
var mOffsetTop = elm.offsetTop;
var mOffsetParent = elm.offsetParent;
while(mOffsetParent){
mOffsetTop += mOffsetParent.offsetTop;
mOffsetParent = mOffsetParent.offsetParent;
}
return mOffsetTop;
}
function getOffsetLeft(elm) {
var mOffsetLeft = elm.offsetLeft;
var mOffsetParent = elm.offsetParent;
while(mOffsetParent) {
mOffsetLeft += mOffsetParent.offsetLeft;
mOffsetParent = mOffsetParent.offsetParent;
}
return mOffsetLeft;
}
function postUrl(poststyle,act,bid,stype){
var thisUrl ="post.asp?poststyle="+poststyle+"&action="+act+"&boardid="+bid+"&stype="+stype;
return thisUrl;
}
function close_postform(){
var obj=document.getElementById("post_div");
if (obj.style.display!="none"){
obj.style.display="none";
document.getElementById("post_iframe").src="";
}
}
function post_topic(buttonElement,pstyle,act,bid,stype){
var obj=document.getElementById("post_div");
var buttonElement = document.getElementById("postbutton");
if (pstyle!="1"){
return this.location = postUrl(pstyle,act,bid,stype);
}
if (obj.style.display=="none")
{
obj.style.display="block";
document.getElementById("post_iframe").style.height="760px";
document.getElementById("post_iframe").src=postUrl(pstyle,act,bid,stype);
}else {
obj.style.display="none";
document.getElementById("post_iframe").src="";
}
};
function ActiveOnline(boardid)
{
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4){
try{
if(xmlhttp.status==200){
updateonline(xmlhttp.responseText);
}else{}}catch(e){}
}
}
var param="state="+escape(document.title.toString())+"&boardid="+boardid;
xmlhttp.open("post","activeonline.asp",true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-Length",param.length);
xmlhttp.send(param);
}
function updateonline(XMLstr)
{
eval(XMLstr);
var AllOnlie=document.getElementById("allonline");
var UserOnlie=document.getElementById("useronline");
var GuestOnlie=document.getElementById("guestonline");
if(AllOnlie) AllOnlie.innerHTML=allonline.toString();
if(UserOnlie) UserOnlie.innerHTML=useronline.toString();
if(GuestOnlie) GuestOnlie.innerHTML=guestonline.toString();
}
var cacheobj=function(){};
function frameon(url,img){
if (window == top){
top.location.href = "index.asp?action=frameon&url="+escape(url);
}else{
top.location.href = url;
}
}
function changeframeicon(img){
if (!img){return false;}
if (window == top){
img.src = 'images/others/isleft.gif';
}else{
img.src = 'images/others/noleft.gif';
}
}
function ajaxMsg(t){
tb_remove();
var msg;
switch(t){
case 5:msg="状态信息:发表新主题成功!";break;
case 6:msg="状态信息:回复帖子成功!";break;
case 7:msg="状态信息:发表新投票成功!";break;
case 8:msg="状态信息:保存编辑帖子成功!";break;
default:msg="状态信息:发表成功!";
}
document.getElementById("ajaxMsg_1").style.display = "";
document.getElementById("ajaxMsg_1").innerHTML = '<img src="Css/cndw/images/ok.gif" width="19" height="16" alt="Ok" /><font color="#33CC00">'+msg+'</font>';
window.setTimeout("document.getElementById('ajaxMsg_1').style.display = 'none'",3000);
}
//页面完成后加载事件列表
function page_init(){
}
//url参数分割
function parseQuery ( query ) {
var Params = {};
if ( ! query ) {return Params;}// return empty object
var Pairs = query.split(/[;&]/);
for ( var i = 0; i < Pairs.length; i++ ) {
var KeyVal = Pairs[i].split('=');
if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
var key = unescape( KeyVal[0] );
var val = unescape( KeyVal[1] );
val = val.replace(/\+/g, ' ');
Params[key] = val;
}
return Params;
}
function inputStyle(fEvent,oInput){
if (!oInput.style) return;
var put=oInput.getAttribute("type").toLowerCase();
switch (fEvent){
case "focus" :
oInput.isfocus = true;
case "mouseover" :
if(put=="submit" || put=="button" || put=="reset")
oInput.className="input_on";
else
oInput.className = "TextBoxFocus";
break;
case "blur" :
oInput.isfocus = false;
case "mouseout" :
if(put=="submit" || put=="button" || put=="reset")
oInput.className = "input0";
else if(!oInput.isfocus)
oInput.className = "TextBox";
break;
//case else :
//if(oInput.getAttribute(fEvent+"_2"))
//eval(oInput.getAttribute(fEvent+"_2"));
}
}
window.onload = function(){
var oInput = document.getElementsByTagName("input");
var onfocusStr = [];
var onblurStr = [];
//alert(oInput.length);
try
{
for (var i=0; i<oInput.length; i++)
{
if (!oInput[i]||!oInput[i].getAttribute("type")) continue;
var put=oInput[i].getAttribute("type").toLowerCase();
if(put=="submit" || put=="button" || put=="reset")
{
oInput[i].className="input0";
}
if (put=="text" || put=="password" || put=="submit" || put=="button" || put=="reset")
{
if (document.all)
{
oInput[i].attachEvent("onmouseover",oInput[i].onmouseover=function(){inputStyle("mouseover",this);});
oInput[i].attachEvent("onmouseout",oInput[i].onmouseout=function(){inputStyle("mouseout",this);});
}
else{
oInput[i].addEventListener("onmouseover",oInput[i].onmouseover=function(){inputStyle("mouseover",this);},false);
oInput[i].addEventListener("onmouseout",oInput[i].onmouseout=function(){inputStyle("mouseout",this);},false);
//获取焦点
if(oInput[i].getAttribute("onfocus")){
oInput[i].addEventListener("onfocus",oInput[i].onblur=function(){eval(this.getAttribute("onfocus"));inputStyle("focus",this);},false);
}else{
oInput[i].addEventListener("onfocus",oInput[i].onfocus=function(){inputStyle("focus",this);},false);
}
//失去焦点
if(oInput[i].getAttribute("onblur")){
oInput[i].addEventListener("onblur",oInput[i].onblur=function(){eval(this.getAttribute("onblur"));inputStyle("blur",this);},false);
}else{
oInput[i].addEventListener("onblur",oInput[i].onblur=function(){inputStyle("blur",this);},false);
}
}
}
}
}catch(e){}
for(i=1;i<=8;i++)//控制面板
{
if(document.getElementById('con_two_'+i))
{
document.getElementById('two'+i).className="hover";
break;
}
}
}
function disp(id){
if (!document.getElementById(id)) return;
var disp=document.getElementById(id).style.display;
if (disp=="")
document.getElementById(id).style.display="none";
else
document.getElementById(id).style.display="";
}
/*显示认证码 o start1*/
function get_Code() {
var Dv_CodeFile = "Dv_GetCode.asp";
if(document.getElementById("imgid"))
document.getElementById("imgid").innerHTML = '<img src="'+Dv_CodeFile+'?t='+Math.random()+'" alt="点击刷新验证码" style="cursor:pointer;border:0;vertical-align:middle;" onclick="this.src=\''+Dv_CodeFile+'?t=\'+Math.random()" />'
}
/*o end*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -