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

📄 whtopic.js

📁 tomcat最新安装程序
💻 JS
📖 第 1 页 / 共 2 页
字号:
		{
			oParam = createSyncInfo();
		}
		var oMsg = new whMessage(WH_MSG_SYNCINFO, this, 1, oParam);
		SendMessage(oMsg);
	}
}

function sendInvalidSyncInfo()
{
	if (!isInPopup())
	{
		var oMsg = new whMessage(WH_MSG_SYNCINFO, this, 1, null);
		SendMessage(oMsg);
	}
}

function enableWebSearch(bEnable)
{
	if (!isInPopup())
	{
		var oMsg = new whMessage(WH_MSG_ENABLEWEBSEARCH, this, 1, bEnable);
		SendMessage(oMsg);
	}
}

function autoSync(nSync)
{
	if (nSync == 0) return;
	if (isInPopup()) return;
	if (isOutMostTopic())
		sync();
}

function isOutMostTopic()
{
	if (gnOutmostTopic == -1)
	{
		var oMessage = new whMessage(WH_MSG_ISINFRAMESET, this, 1 , null);
		if (SendMessage(oMessage))
			gnOutmostTopic = 0;
		else
			gnOutmostTopic = 1;
	}
	return (gnOutmostTopic == 1);
}

function sync()
{
	if (gaPaths.length > 0)
	{
		var oParam = createSyncInfo();
		var oMessage = new whMessage(WH_MSG_SYNCTOC, this, 1, oParam);
		SendMessage(oMessage);
	}
}


function avenueInfo(sName, sPrev, sNext)
{
	this.sName = sName;
	this.sPrev = sPrev;
	this.sNext = sNext;
}

function getCurrentAvenue()
{
	var oParam = new Object();
	oParam.sAvenue = null;
	var oMessage = new whMessage(WH_MSG_GETCURRENTAVENUE, this, 1, oParam);
	SendMessage(oMessage);
	return oParam.sAvenue;
}

function unRegisterListener()
{
	sendInvalidSyncInfo();
	enableWebSearch(false);
	if (whtopic_foldUnload)
		whtopic_foldUnload();
}

function onSendMessage(oMsg)
{
	var nMsgId = oMsg.nMessageId;
	if (nMsgId == WH_MSG_GETAVIAVENUES)
	{
		oMsg.oParam.aAvenues = gaAvenues;
		return false;
	}
	else if (nMsgId == WH_MSG_GETTOCPATHS)
	{
		if (isOutMostTopic())
		{
			oMsg.oParam.oTocInfo = createSyncInfo();
			return false;		
		}
		else
			return true;
	}
	else if (nMsgId == WH_MSG_NEXT)
	{
		goAvenue(true);
	}
	else if (nMsgId == WH_MSG_PREV)
	{
		goAvenue(false);
	}
	else if (nMsgId == WH_MSG_WEBSEARCH)
	{
		websearch();
	}
	return true;
}

function goAvenue(bNext)
{
	var sTopic = null;
	var sAvenue = getCurrentAvenue();
	var nAvenue = -1;
	if (sAvenue != null && sAvenue != "")
	{
		for (var i = 0; i < gaAvenues.length ; i ++)
		{
			if (gaAvenues[i].sName == sAvenue)
			{
				nAvenue = i;
				break;
			}
		}
		if (nAvenue != -1)
		{
			if (bNext)
				sTopic = gaAvenues[nAvenue].sNext;
			else
				sTopic = gaAvenues[nAvenue].sPrev;
		}
	}
	else
	{ 
		for (var i = 0; i < gaAvenues.length ; i ++)
		{
			if (gaAvenues[i].sNext != null && gaAvenues[i].sNext.length > 0 && bNext)
			{
				sTopic = gaAvenues[i].sNext;
				break;
			}
			else if (gaAvenues[i].sPrev != null && gaAvenues[i].sPrev.length > 0 && !bNext)
			{
				sTopic = gaAvenues[i].sPrev;
				break;
			}
		}
	}
	
	if (sTopic != null && sTopic != "")
	{
		if (gsPPath != null && gsPPath != "")
		{
			sFullTopicPath = _getFullPath(gsPPath, sTopic);
			document.location = sFullTopicPath;
		}
	}
}

function canGo(bNext)
{
	for (var i = 0; i < gaAvenues.length ; i ++)
	{
		if ((gaAvenues[i].sNext != null && gaAvenues[i].sNext.length > 0 && bNext) ||
			(gaAvenues[i].sPrev != null && gaAvenues[i].sPrev.length > 0 && !bNext))
			return true;
	}
	return false;
}

function show()
{
	if (gsStartPage != "")
		window.location =  gsStartPage + "#" + gsRelCurPagePath;
}

function hide()
{
	if (goFrame != null)
	{
		goFrame.location = window.location;
	}
}

function isTopicOnly()
{
	if (gnTopicOnly == -1)
	{
		var oParam = new Object();
		oParam.oFrame = null;
		var oMsg = new whMessage(WH_MSG_GETSTARTFRAME, this, 1, oParam);
		if (SendMessage(oMsg))
		{
			goFrame = oParam.oFrame;
			gnTopicOnly = 0;
		}
		else
			gnTopicOnly = 1;
	}
	if (gnTopicOnly == 1)
		return true;
	else
		return false;
}

function websearch()
{
	if (gbNav4)
	{
		if (document.ehelpform)
			document.ehelpform.submit();
	}
	else
	{
		if (window.ehelpform)
			window.ehelpform.submit();
	}
}

function addSearchFormHref(sHref)
{
	gsSearchFormHref = sHref;
	enableWebSearch(true);
}

function searchB(nForm)
{
	var sValue = eval("document.searchForm" + nForm + ".searchString.value");
	var oMsg = new whMessage(WH_MSG_SEARCHTHIS, this, 1, sValue);
	SendMessage(oMsg);
}

function getSearchFormHTML()
{
	var sHTML = "";
	gnForm ++;
	var sFormName = "searchForm" + gnForm;
	var sButton = "<form name=\"" + sFormName + "\" method=\"POST\" action=\"javascript:searchB("+ gnForm + ")\">"
	sButton += "<input type=\"text\" name=\"searchString\" value=\"- Full Text search -\" size=\"20\"/>";
	if ("" == "text")
	{
		sButton+="<a class=\"searchbtn\" href=\"javascript:void(0);\" onclick=\"" + sFormName + ".submit(); return false;\"></a>";
	}
	else if ("" == "image")
	{
		sButton+="<a class=\"searchbtn\" href=\"javascript:void(0);\" onclick=\"" + sFormName + ".submit(); return false;\">"
		sButton+="<img src=\"\" border=0></a>";
	}
	sButton += "</form>";
	sHTML ="<td align=\"center\">" + sButton + "</td>";
	return sHTML;
}

function showHidePane(bShow)
{
	var oMsg=null;
	if (bShow)
		oMsg=new whMessage(WH_MSG_SHOWPANE, this, 1, null);
	else
	 	oMsg=new whMessage(WH_MSG_HIDEPANE, this, 1, null);
	SendMessage(oMsg);
}

function isShowHideEnable()
{
	if (gbIE4)
		return true;
	else
		return false;
}


function PickupDialog_Invoke()
{
	if (!gbIE4 || gbMac)
	{
		if (typeof(_PopupMenu_Invoke)=="function")
			return _PopupMenu_Invoke(PickupDialog_Invoke.arguments);
	}
	else
	{
		if (PickupDialog_Invoke.arguments.length > 2)
		{
			var sPickup = "whskin_pickup.htm";
			var sPickupPath=gsPPath+sPickup; 
			if (gbIE4)
			{
				var sFrame = PickupDialog_Invoke.arguments[1];
				var aTopics = new Array();
				for (var i = 2; i< PickupDialog_Invoke.arguments.length; i+=2)
				{
					var j=aTopics.length;
					aTopics[j] = new Object();
					aTopics[j].m_sName=PickupDialog_Invoke.arguments[i];
					aTopics[j].m_sURL=PickupDialog_Invoke.arguments[i+1];
				}

				if (aTopics.length > 1)
				{
					var nWidth = 300;
					var nHeight =180;
					var	nScreenWidth=screen.width;
					var	nScreenHeight=screen.height;
					var nLeft=(nScreenWidth-nWidth)/2;
					var nTop=(nScreenHeight-nHeight)/2;
					if (gbIE4)
					{
						var vRet = window.showModalDialog(sPickupPath,aTopics,"dialogHeight:"+nHeight+"px;dialogWidth:"+nWidth+"px;resizable:yes;status:no;scroll:no;help:no;center:yes;");
						if (vRet)
						{
							var sURL = vRet.m_url;
							if (sFrame)
								window.open(sURL, sFrame);
							else
								window.open(sURL, "_self");
						}
					}
				}
				else if (aTopics.length == 1)
				{
					var sURL = 	aTopics[0].m_sURL
					if (sFrame)
						window.open(sURL, sFrame);
					else
						window.open(sURL, "_self");
				}
			}
		}
	}
}

if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy)
{
	RegisterListener("bsscright", WH_MSG_GETAVIAVENUES);
	RegisterListener("bsscright", WH_MSG_GETTOCPATHS);
	RegisterListener("bsscright", WH_MSG_NEXT);
	RegisterListener("bsscright", WH_MSG_PREV);
	RegisterListener("bsscright", WH_MSG_WEBSEARCH);
	if (gbMac && gbIE4)
	{
		if (typeof(window.onunload) != "unknown")
			whtopic_foldUnload = window.onunload;
	}
	else
	{
		if (window.onunload)
			whtopic_foldUnload = window.onunload;
	}
	window.onunload = unRegisterListener;
	setButtonFont("show","","10pt","","","","");

	gbWhTopic=true;
}
else
	document.location.reload();

⌨️ 快捷键说明

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