list.js

来自「AR9001.rar ZUOM AR9001.rar」· JavaScript 代码 · 共 260 行

JS
260
字号
//cookie functionsfunction readCookie(name){  var cookieValue = '';  var search = name + '=';  if(document.cookie.length > 0)  {     offset = document.cookie.indexOf(search);    if (offset != -1)    {       offset += search.length;      end = document.cookie.indexOf(';', offset);      if (end == -1) end = document.cookie.length;      cookieValue = unescape(document.cookie.substring(offset, end))    }  }  return cookieValue;}function writeCookie(name, value, hours){  var expire = '';  if(hours != null){    expire = new Date((new Date()).getTime() + hours * 3600000);    expire = '; expires=' + expire.toGMTString();  }  document.cookie = name + '=' + escape(value) + expire;}function show_more_manu(){    var obj=document.getElementById('more_manu');    obj.style.display=(obj.style.display == 'none')?'':'none';}function cksform(){    if(0==document.search_form.kword.value.length){        alert('请填写搜索关键字');        document.search_form.kword.focus();		return false;    }else if(document.search_form.ws[1].selected){        document.search_form.action="/search.php";    }else{		return true;	}}function ctlent(eventobject){    if(event.ctrlKey && window.event.keyCode==13){	if(onok()){            document.form1.submit();           }    }}function onok(){    if(0 == document.form1.title.value.length){        alert('标题不能为空');        document.form1.title.focus();	return false;    }else if(document.form1.title.value.length <= 4){        alert('标题不可少于5个字');        document.form1.title.focus();	return false;    }else if(0 == document.form1.content.value.length){        alert('内容不能为空');        document.form1.content.focus();	return false;    }    document.form1.up_date.value="正在提交..";    document.form1.up_date.disabled=true;    return true;}function showtab(m,n,count){	var strPic1 = "url(http://icon.zol.com.cn/group/images0522/frm/22.jpg)";	var strPic2 = "url()";	var class1  = "lan12";	var class2  = "a_bai12";	for(var i=1;i<=count;i++){		if(i==n){			getObject('div_'+m+'_'+i).style.background = strPic1;			getObject('tab_'+m+'_'+i).style.display = ''; 			getObject('div_'+m+'_'+i).className = class1;		}else{			getObject('div_'+m+'_'+i).style.background = strPic2;			getObject('tab_'+m+'_'+i).style.display = 'none'; 			getObject('div_'+m+'_'+i).className = class2;		}	}}function getObject(objectId) {	if(document.getElementById && document.getElementById(objectId)) {	// W3C DOM		return document.getElementById(objectId);	} else if (document.all && document.all(objectId)) {	// MSIE 4 DOM		return document.all(objectId);	} else if (document.layers && document.layers[objectId]) {	// NN 4 DOM.. note: this won't find nested layers		return document.layers[objectId];	} else {		return false;	}} // getObjectfunction show_double_div(m,n,count){    for(var i=1;i<=count;i++){		if(i==n){			getObject('tab_'+m+'_'+i).style.display = ''; 		}else{			getObject('tab_'+m+'_'+i).style.display = 'none'; 		}	}}function showindextab(m,n,count){	var class1  = "normal lan12";	var class2  = "active lan12";	for(var i=1;i<=count;i++){		if(i==n){			getObject('tab_'+m+'_'+i).style.display = ''; 			getObject('div_'+m+'_'+i).className = class1;		}else{			getObject('tab_'+m+'_'+i).style.display = 'none'; 			getObject('div_'+m+'_'+i).className = class2;		}	}}function ctlent_onlogin2(eventobject){    if(event.ctrlKey && window.event.keyCode==13){	    onlogin();    }}function ctlent_onlogin(){	if(window.event.keyCode==13){		onlogin();	}}function onlogin(){	if(0==document.getElementById("userid").value.length){		alert("请填写登录用户名");		document.getElementById("userid").focus();		return;	}else if(0==document.getElementById("pwd").value.length){		alert("请填写登录密码");		document.getElementById("pwd").focus();		return;	}else{		document.loginform.submit();	}}function ckform(obj){    if(0==obj.kword.value.length){        alert('请填写搜索关键词,多个关键词用空格分开');        obj.kword.focus();        return false;    }    return true;}function setPointer(theRow, thePointerColor){    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {        return false;    }    if (typeof(document.getElementsByTagName) != 'undefined') {        var theCells = theRow.getElementsByTagName('td');    }    else if (typeof(theRow.cells) != 'undefined') {        var theCells = theRow.cells;    }    else {        return false;    }    var rowCellsCnt  = theCells.length;    for (var c = 0; c < rowCellsCnt; c++) {        theCells[c].style.backgroundColor = thePointerColor;    }    return true;} // end of the 'setPointer()' functionfunction getOs() {    if(navigator.userAgent.indexOf("MSIE")>0)return 1;    if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)return 2;    if(isSafari=navigator.userAgent.indexOf("Safari")>0)return 3;       if(isCamino=navigator.userAgent.indexOf("Camino")>0)return 4;    if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0)return 5;    return 0; }//getOsfunction show_hidden(name,tag){    tag=(tag)?'':'none';    try{       document.getElementById(name).style.display=tag;    }catch(e){        }}function addrow(tableToSort,maxpolloptions){    num++;    if (num <= maxpolloptions || 0==maxpolloptions)    {        var tr_bg='#FFFFFF';                newRow    = document.getElementById(tableToSort).insertRow(-1);        var currow= document.getElementById(tableToSort).rows.length-1;        firstcell = newRow.insertCell(-1);        firstcell.bgColor=tr_bg;        firstcell.style.width='15%';        firstcell.style.textAlign='left';        firstcell.style.border='0px';        firstcell.innerHTML='选项'+num+'&nbsp;&nbsp;<INPUT TYPE="text" id="vote_option_'+num+'" NAME="option[]" size=40 onfocus=" addrow(\'ProjectTab\',maxpolloptions);">';    }}function copyToClipboard(txt) {     if(window.clipboardData)      {         window.clipboardData.clearData();         window.clipboardData.setData("Text", txt);     }     else if(navigator.userAgent.indexOf("Opera") != -1)      {         window.location = txt;     }      else if (window.netscape)      {         try          {             netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");         }          catch (e)          {             alert("您的firefox安全限制限制您进行剪贴板操作,请在地址栏中输入“about:config”将“signed.applets.codebase_principal_support”设置为“true”之后重试");             return false;         }         var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);         if (!clip)           return;         var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);         if (!trans)           return;         trans.addDataFlavor('text/unicode');         var str = new Object();         var len = new Object();         var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);         var copytext = txt;         str.data = copytext;         trans.setTransferData("text/unicode",str,copytext.length*2);         var clipid = Components.interfaces.nsIClipboard;         if (!clip)           return false;         clip.setData(trans,null,clipid.kGlobalClipboard);     } }  var zol_content_grouptext = '';

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?