⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gssmethods.js

📁 Parallel Port description of the communication port
💻 JS
📖 第 1 页 / 共 2 页
字号:
		
function mgswitch(target, sopen, sclose){
	var mg = "turnoff";
	if(document.all) eval("if("+target+".style.display == 'none') mg = 'turnon';");
	else if(document.getElementById) eval("if(document.getElementById('"+target+"').style.display == 'none') mg = 'turnon';");

	if(mg == "turnoff"){
		if(sclose != '') eval(sclose);
		setcookieval(target+"sw", "0");
		if(document.all) eval(target+".style.display = 'none'");
		else if(document.getElementById) eval("document.getElementById('"+target+"').style.display = 'none'");
	}else{
		setcookieval(target+"sw", "1");
		if(document.all) eval(target+".style.display = ''");
		else if(document.getElementById) eval("document.getElementById('"+target+"').style.display = ''");
		if(sopen != '') eval(sopen);
	}
	calcsearchdivsizes();
}

function gss_showrefine(){
	document.getElementById('refinediv').style.display = "";
}

function gss_hiderefine(){
	document.getElementById('refinediv').style.display = "none";
}

function gss_refineselect(){
	if(document.getElementById){
		gss_showrefine();
		if(document.sortform && document.getElementById('previewdiv')) gss_hidepreview();
	}
	return true
}

function gss_hidepreview(){
	if(document.getElementById('previewdiv')){
		document.getElementById('previewdiv').style.display = "none";
		document.getElementById('previewbardiv').style.display = "none";
	}
	if(document.body.clientHeight){
		totalheight = document.body.clientHeight;
		scrollheight = document.body.scrollHeight;
	}else{
		totalheight = self.innerHeight;
		scrollheight = document.body.offsetHeight;
	}
	sharedheight = totalheight-159-55;
	document.getElementById('resultsdiv').style.height = sharedheight;
	document.getElementById('resultsdiv').style.overflowY = "visible";
}

function gss_showpreview(){
	document.getElementById('previewdiv').style.display = "";
	document.getElementById('previewbardiv').style.display = "";
	document.getElementById('previewdiv').style.height = Math.ceil(sharedheight*srchUIratio);
	document.getElementById('resultsdiv').style.height = Math.floor(sharedheight*(1-srchUIratio));
	document.getElementById('resultsdiv').style.overflowY = "scroll";
}

function gss_previewselect(){
	if(document.getElementById){
		if(document.getElementById('previewdiv')){

			tds = document.getElementsByTagName("td");
			for(i=0; i<tds.length; i++){
				if(tds[i].className == "srchlinkclicked"){
					tds[i].className = "srchlink";
				}
			}


			if(document.body.clientHeight){
				totalheight = document.body.clientHeight;
				scrollheight = document.body.scrollHeight;
			}else{
				totalheight = self.innerHeight;
				scrollheight = document.body.offsetHeight;
			}
			sharedheight = totalheight-staticheight;

			if((scrollheight-totalheight) < 55 && (scrollheight-totalheight) > 0){
				sharedheight += (scrollheight-totalheight);
			}else if((scrollheight-totalheight) >= 55){
				sharedheight += 55;
			}

			if(previewed){
				document.getElementById('previewavail').style.display = "";
				document.getElementById('previewnull').style.display = "none";
			}else{
				document.getElementById('previewavail').style.display = "none";
				document.getElementById('previewnull').style.display = "";
			}

			gss_showpreview();
			gss_hiderefine();
		}
	}
	return true;
}

function gss_srchviewmode(){
	if(document.getElementById){
		switch(document.viewform.srchviewmode.options[document.viewform.srchviewmode.selectedIndex].value){
			case "refine":
				gss_refineselect();
				break;
			case "preview":
				gss_previewselect();
				break;
			case "none":
				if(document.getElementById('previewdiv')) gss_hidepreview();
				gss_hiderefine();
				break;
		}
		setcookieval("srchview", document.viewform.srchviewmode.options[document.viewform.srchviewmode.selectedIndex].value);
		calcsearchdivsizes();
	}
}

function PrintContents(){

	if(document.getElementById){
		var PrintUrl = top.location.href;
		var HostName = top.location.hostname;
		HostName = HostName.toLowerCase();
			
		if(PrintUrl.toLowerCase() == "http://" + HostName) PrintUrl = "http://" + HostName + "/default.aspx" ;

		if(PrintUrl.indexOf(HostName + "/default.aspx") > -1){  
			PrintUrl = PrintUrl.replace("default.aspx","common/print.aspx");
			document.getElementById('printframe').src = PrintUrl;
			printframe.focus();
		}else if( PrintUrl.indexOf(HostName + "/search/default.aspx") > -1){	
			if(document.getElementById('previewdiv').src == 'searchmsg.aspx')top.print();
			else{
				top.frames['previewdiv'].focus();
				top.frames['previewdiv'].print();
			}
		}else if( PrintUrl.indexOf(HostName + "/newsgroups/default.aspx") > -1){
			//Add code to access newsgroup frames
			top.print();		
		}else{
			top.focus();
			top.print();
		}	
	}else{
		top.focus()
		top.print();
	}
	
	event.cancelBubble=true;
	return false; 
}

function showdesc(){
	if(document.getElementsByTagName){
		divs = document.getElementsByTagName("div");
		for(i=0; i<divs.length; i++){
			if(divs[i].className == "srchdesc"){
				if(document.sortform.desccheck.checked){
					eval("document.getElementById('"+divs[i].id+"').style.display = '';");
					setcookieval("srchext","1");
				}else{
					eval("document.getElementById('"+divs[i].id+"').style.display = 'none';");
					setcookieval("srchext","0");
				}
			}
		}
	}
}

function calcsearchdivsizes(){
	if(document.getElementById){
	
		if(document.body.clientHeight){
			totalheight = document.body.clientHeight;
			scrollheight = document.body.scrollHeight;
		}else{
			totalheight = self.innerHeight;
			scrollheight = document.body.offsetHeight;
		}
	
		if(document.getElementById('previewdiv')){
			if(document.getElementById('previewdiv').style.display != "none"){
			
				if(document.getElementById('bluefiller')){
					document.getElementById('bluefiller').style.backgroundColor = "#3366CC";
				}
				
				sharedheight = totalheight-staticheight;

				if((scrollheight-totalheight) < 55 && (scrollheight-totalheight) > 0){
					sharedheight += (scrollheight-totalheight);
				}else if((scrollheight-totalheight) >= 55){
					sharedheight += 55;
				}

				if(sharedheight > srchheightlimit){
					if(document.getElementById('previewdiv').style.display == "none"){
						document.getElementById('resultsdiv').style.height = sharedheight+21;
					}else document.getElementById('resultsdiv').style.height = Math.floor(sharedheight*(1-srchUIratio));
					document.getElementById('previewdiv').style.height = Math.ceil(sharedheight*srchUIratio);
					
					showdesc();
				}
			}else{
				if(document.getElementById('bluefiller')){
					document.getElementById('bluefiller').style.backgroundColor = "#ffffff";
				}
				if(document.getElementById('refinediv')){
					document.getElementById('resultsdiv').style.height = scrollheight-159-55;
				}else{
					document.getElementById('resultsdiv').style.height = scrollheight-108-55;
				}
			}
		}
		if(document.getElementById('xnewsborder')){
			if(document.body.clientHeight) totalheight = document.body.clientHeight;
			else totalheight = self.innerHeight;
			if(document.body.clientHeight) totalwidth = document.body.clientWidth;
			else totalwidth = self.innerWidth;
			document.getElementById('xnewsborder').style.height = totalheight-44;
			document.getElementById('xnewsborder').style.width = totalwidth-4;
		}
	}
}

function scrolled(){
	calcsearchdivsizes();
}

var anchorarray = new Array();

function initxnews(){
	var arrayindex = 0;
	if(document.getElementsByTagName){
		anchors = document.getElementsByTagName("a");
		for(i=0; i<anchors.length; i++){
			if(anchors[i].className == "xnewsgroup" || anchors[i].className == "xnewsheader"){
				anchorarray[arrayindex] = anchors[i].id;
				arrayindex++;
			}
		}
		selectgroup();
		calcsearchdivsizes();
	}
}

function selectgroup(){
	if(anchorarray.length > 0){
		if(document.getElementById(anchorarray[selectedng])){
			if(document.getElementById(anchorarray[selectedng-1])) document.getElementById(anchorarray[selectedng-1]).style.backgroundColor = "#ffffff";
			document.getElementById(anchorarray[selectedng]).style.backgroundColor = "#cccccc";
			if(document.getElementById(anchorarray[selectedng+1])) document.getElementById(anchorarray[selectedng+1]).style.backgroundColor = "#ffffff";
			//document.getElementById(anchorarray[selectedng]).focus();
		}
	}
}

function gss_verifykanisa(textval){
	var srcform = document.wizform;
	goforsubmit = 1;
	var radiochecked;
	for(i=0;i<srcform.elements.length;i++){
		var inputname = srcform.elements[i].name;
		if(inputname != "refinecheck"){
			if(srcform.elements[i].type.toLowerCase() == "text"){
				if(srcform.elements[i].value == '' || srcform.elements[i].value == textval) goforsubmit = 0;
			}
		}
	}
	if(!goforsubmit) alert("Please fill in the entire Search Wizard.");
	return goforsubmit;
}

function gss_srchwindow(url){
	if(document.body.clientHeight){
		winheight = Math.round(window.document.body.clientHeight * 0.9);
		winwidth = Math.round(window.document.body.clientWidth * 0.9);
	}else{
		winheight = Math.round(document.body.offsetHeight * 0.9);
		winwidth = Math.round(document.body.offsetWidth * 0.9);
	}
	var win = window.open(url, "_blank", "resizable=yes,scrollbars=yes,menubar=yes,location=yes,toolbar=yes,status=yes,height="+winheight+",width="+winwidth);
	win.focus();
}

function RestoreState(){

	var strVisibleDIV=fetchcookieval("srchDivPersist");

	if(strVisibleDIV!="blank"){
  		var arrayVisibleDIV=strVisibleDIV.split("|");
  		for(j=0; j<arrayVisibleDIV.length; j++){
			eval("if(document.getElementById('"+arrayVisibleDIV[j]+"')) document.getElementById('"+arrayVisibleDIV[j]+"').style.display = 'block'");
		}
	}
}

function CaptureState(){
	var i,collDIV,strVisibleDIV="";
	collDIV=document.getElementsByTagName("DIV");

	for(i=0;i<collDIV.length;i++){	
		if(collDIV[i].style && collDIV[i].id){
			if (collDIV[i].style.display=="block"){
				if (strVisibleDIV.length!=0) strVisibleDIV=strVisibleDIV + "|";
				strVisibleDIV=strVisibleDIV + collDIV[i].id
			}
		}
	}
	setcookieval("srchDivPersist", strVisibleDIV);
	gss_prepare_refine();
}

function UnicodeFixup(s){
	var result = new String();
	var c = '';
	var i = -1; 
	var l = s.length;
	result = "";
	for(i = 0; i < l; i++) {
		c = s.substring(i, i+1);
		if(c == "%") {
			result += c; i++;
			c = s.substring(i, i+1);
			if(c != "u") {
				if(parseInt("0x" + s.substring(i, i+2)) > 128) result += "u00";
			}
		}
		result += c;
	}
	return result;
}

⌨️ 快捷键说明

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