📄 whtbar.js
字号:
var oIs=getElementsByTag(oEl,"img"); if(oIs.length>0&&gaObjBtns[nBtn]&&gaObjBtns[nBtn].aIs&&gaObjBtns[nBtn].aIs.length>3) { if(gaObjBtns[nBtn].aIs[3]) oIs[0].src=gaObjBtns[nBtn].aIs[3]; } if(sState=="down") oEl.className=sPF+"Down"; } else { var oIs=getElementsByTag(oEl,"img"); if(oIs.length>0&&gaObjBtns[nBtn]&&gaObjBtns[nBtn].aIs&&gaObjBtns[nBtn].aIs.length>0) { if(gaObjBtns[nBtn].aIs[0]) oIs[0].src=gaObjBtns[nBtn].aIs[0]; } oEl.className=sPF+"Normal"; }}function showToc(){ var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null) SendMessage(oMsg);}function showIndex(){ var oMsg=new whMessage(WH_MSG_SHOWIDX,this,1,null) SendMessage(oMsg);}function showFts(){ var oMsg=new whMessage(WH_MSG_SHOWFTS,this,1,null) SendMessage(oMsg);}function showGlossary(){ var oMsg=new whMessage(WH_MSG_SHOWGLO,this,1,null) SendMessage(oMsg);}function syncWithShow(){ if(!gbTocInfoInited) { getTocInfo(); } if(goTocInfo) { showToc(); var oParam=goTocInfo; var oMsg=new whMessage(WH_MSG_SYNCTOC,this,1,oParam); SendMessage(oMsg); }}function markButton(e){ var oEl=null; if(gbNav6) { var oElo=e.target; while(oElo&&oElo.nodeName.indexOf("#")==0) oElo=getParentNode(oElo); oEl=oElo; } else oEl=event.srcElement; while(oEl&&oEl.tagName!="TD") oEl=getParentNode(oEl); if(oEl) goEl=oEl;}function showHidePane(){ var oMsg=null; if(hasNavPane()) oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null); else oMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null); SendMessage(oMsg);}function goAveNext(){ goAvenue(true);}function goAvePrev(){ goAvenue(false);}function doWebSearch(){ if (goWebSearchEnable) { var oMsg=new whMessage(WH_MSG_WEBSEARCH,this,1,null); SendMessage(oMsg); }}function goAvenue(bNext){ var oMsg=null; initAveButtonObj(); gsCurAveName=getCurrentAveName(); if(gbNav4&&!gbNav6) { if(bNext) { gaAvenues=null; updateAvenue(); oMsg=new whMessage(WH_MSG_NEXT,this,1,null); SendMessage(oMsg); } else if(!bNext) { gaAvenues=null; updateAvenue(); oMsg=new whMessage(WH_MSG_PREV,this,1,null); SendMessage(oMsg); } } else { if(bNext&&goNextParent) { var sState=getState(goNextParent); if(sState!="disable") { gaAvenues=null; gbNeedUpdateAve=true; gbUpdateTimerCount++; setTimeout("updateAvenueIfNeeded();", 2000); oMsg=new whMessage(WH_MSG_NEXT,this,1,null); SendMessage(oMsg); } } else if(!bNext&&goPrevParent) { var sState=getState(goPrevParent); if(sState!="disable") { gaAvenues=null; gbNeedUpdateAve=true; gbUpdateTimerCount++; setTimeout("updateAvenueIfNeeded();", 2000); oMsg=new whMessage(WH_MSG_PREV,this,1,null); SendMessage(oMsg); } } }}function window_Unload(){ if(!gbNav4||gbNav6) { UnRegisterListener2(this,WH_MSG_GETSEARCHS); UnRegisterListener2(this,WH_MSG_PANESTATUE); UnRegisterListener2(this,WH_MSG_SYNCINFO); UnRegisterListener2(this,WH_MSG_PANEINFO); UnRegisterListener2(this,WH_MSG_AVENUEINFO); UnRegisterListener2(this,WH_MSG_GETCURRENTAVENUE); UnRegisterListener2(this,WH_MSG_ENABLEWEBSEARCH); UnRegisterListener2(this,WH_MSG_INITSEARCHSTRING); UnRegisterListener2(this,WH_MSG_NOSEARCHINPUT); UnRegisterListener2(this,WH_MSG_NOSYNC); }}function window_OnLoad(){ if(!gbOpera7&&document.body) { if(gsBgImage&&gsBgImage.length>0) { document.body.background=gsBgImage; } if(gsBgColor&&gsBgColor.length>0) { document.body.bgColor=gsBgColor; } } doCusOnLoad(); var oMsg=new whMessage(WH_MSG_GETPANEINFO,this,1,null); if(SendMessage(oMsg)) { setTimeout("flipPaneButton(\""+oMsg.oParam+"\");",1); } if (!gaAvenues) { var oMsg2=new whMessage(WH_MSG_GETAVIAVENUES,this,1,new Object()); if(SendMessage(oMsg2)) { gaAvenues=oMsg2.oParam.aAvenues; gbNeedUpdateAve=false; setTimeout("updateAvenue();",1); } }}function onSendMessage(oMsg){ var nMsgId=oMsg.nMessageId; if(nMsgId==WH_MSG_GETSEARCHS) { if(document.searchForm&&document.searchForm.searchString) { oMsg.oParam.sValue=document.searchForm.searchString.value; return false; } } else if(nMsgId==WH_MSG_PANESTATUE) { if(oMsg.oParam=="visible") { if(isShowHideEnable()) setTimeout("flipShowHide(true);",1); setTimeout("showPaneButton();",1); } else { if(isShowHideEnable()) setTimeout("flipShowHide(false);",1); setTimeout("hidePaneButton();",1); } } else if(nMsgId==WH_MSG_PANEINFO) { if(oMsg.oParam) setTimeout("flipPaneButton(\""+oMsg.oParam+"\");",1); else setTimeout("hidePaneButton();",1); } else if(nMsgId==WH_MSG_SYNCINFO) { if(oMsg.oParam) goTocInfo=oMsg.oParam; else goTocInfo=null; gbTocInfoInited=true; } else if(nMsgId==WH_MSG_AVENUEINFO) { gaAvenues=oMsg.oParam; gbNeedUpdateAve=false; setTimeout("updateAvenue();",1); } else if(nMsgId==WH_MSG_GETCURRENTAVENUE) { var sAveName=getCurrentAvenue(); if(sAveName!="") { oMsg.oParam.sAvenue=sAveName; return false; } else return true; } else if(nMsgId==WH_MSG_ENABLEWEBSEARCH) { setTimeout("updateWebSearch("+oMsg.oParam+");",1); } else if(nMsgId==WH_MSG_INITSEARCHSTRING) { if(gstrSearch!="") { oMsg.oParam=gstrSearch; gstrSearch=""; return false; } } else if(nMsgId==WH_MSG_NOSEARCHINPUT) { var oSearchInput = getElement("searchInput"); if (oSearchInput) { oSearchInput.style.visibility = "hidden"; return false; } } else if(nMsgId==WH_MSG_NOSYNC) { var oSync = getElement("btnsynctoc"); if (oSync) { oSync.style.visibility = "hidden"; return false; } } return true;}function getCurrentAvenue(){ var strAveName=""; var oSelect=getElement("avenue"); if(oSelect) { strAveName=oSelect.value; } return strAveName;}function initBtn(){ var oBtn=null; oBtn=getElement("btntoc"); if(oBtn) gaBtns[gaBtns.length]=oBtn; oBtn=getElement("btnidx"); if(oBtn) gaBtns[gaBtns.length]=oBtn; oBtn=getElement("btnfts"); if(oBtn) gaBtns[gaBtns.length]=oBtn; oBtn=getElement("btnglo"); if(oBtn) gaBtns[gaBtns.length]=oBtn; gbInitBtn=true;}function showPaneButton(){ flipPaneButton(gsPane);}function hidePaneButton(){ flipPaneButton("");}function flipPaneButton(sPane){ if (sPane) gsPane=sPane; if(!gbInitBtn) initBtn(); var oUp=null; if(sPane) { oUp=getElement("btn"+sPane); } for(var i=0;i<gaBtns.length;i++) { if(gaBtns[i]) { if(gaBtns[i]==oUp) { var oEl=getParentNode(oUp); var sPF=oEl.className.substring(0,6); var sState=getState(oEl); if(sState=="up") { setState(oEl,"down"); oEl.className=sPF+"Down"; if(sPF=="clsBtn") { if(gaBtns[i].id) { var sColor=getBtnColor(gaBtns[i].id.substring(3),true); if(sColor) { oEl.style.backgroundColor=sColor } else { oEl.style.backgroundColor=""; } } var oaA=getElementsByTag(oEl,"A"); if(oaA.length>0) { var strClassName=oaA[0].className; oaA[0].className="btnsel"+strClassName.substring(3); } } var oIs=getElementsByTag(oEl,"img"); var oBtn=getButtonObjByType(gaBtns[i].id.substring(3)); if(oIs.length>0&&oBtn&&oBtn.aIs&&oBtn.aIs.length>3) { if(oBtn.aIs[3]) oIs[0].src=oBtn.aIs[3]; } } } else { var oEl=getParentNode(gaBtns[i]); var sState=getState(oEl); var sPF=oEl.className.substring(0,6); if(sState=="down") { setState(oEl,"up"); if(oEl==goEl) oEl.className=sPF+"Up"; else oEl.className=sPF+"Normal"; if(sPF=="clsBtn") { if(gaBtns[i].id) { var sColor=getBtnColor(gaBtns[i].id.substring(3),false); if(sColor) { oEl.style.backgroundColor=sColor } else { oEl.style.backgroundColor=""; } } var oaA=getElementsByTag(oEl,"A"); if(oaA.length>0) { var strClassName=oaA[0].className; oaA[0].className="btn"+strClassName.substring(6); } } var oIs=getElementsByTag(oEl,"img"); var oBtn=getButtonObjByType(gaBtns[i].id.substring(3)); if(oIs.length>0&&oBtn&&oBtn.aIs&&oBtn.aIs.length>0) { if(oBtn.aIs[0]) oIs[0].src=oBtn.aIs[0]; } } } } }}function flipShowHide(bShow){ gnHasNavPane=-1; var oA=getElement("btnshowhide"); if(oA) { var oEl=getParentNode(oA); var sPF=oEl.className.substring(0,6); if(oEl&&oEl.state) { if(bShow) { oEl.state="down"; oEl.className=sPF+"Down"; } else { oEl.state="up"; if(oEl==goEl) oEl.className=sPF+"Up"; else oEl.className=sPF+"Normal"; } } oA.innerHTML=getShowHide(); }}function cusOnClick(nIdx){ if(goCusButton.length>nIdx) { var sOnClick=goCusButton[nIdx].sOnClick; if(sOnClick&&sOnClick.length>0) { if(!gbPreview) eval(sOnClick); return false; } } return true;}function cusOnMouseOver(nIdx){ if(goCusButton.length>nIdx) { var sOnMouseOver=goCusButton[nIdx].sOnMouseOver; if(sOnMouseOver&&sOnMouseOver.length>0) { if(!gbPreview) eval(sOnMouseOver); return false; } } return true;}function doCusOnLoad(){ if(!gbPreview&&gaOrders) { for(var i=0;i<gaOrders.length;i++) { for(var j=0;j<gaOnLoads.length;j++) { if(gaOrders[i]==gaOnLoads[j].sType) { eval(gaOnLoads[j].sOnLoad); break; } } } }}function registerOnLoad(sOnLoad,sType){ gaOnLoads[gaOnLoads.length]=new cusOnLoad(sType,sOnLoad); }function cusOnLoad(sType,sOnLoad){ this.sType=sType; this.sOnLoad=sOnLoad;}function cusButton(sType,sText,sOnClick,sOnMouseOver,sOnLoad,nWidth,nHeight){ this.sType=sType; this.sText=sText; this.sOnClick=sOnClick; this.sOnMouseOver=sOnMouseOver; this.sOnLoad=sOnLoad; this.nWidth=nWidth; this.nHeight=nHeight; this.aIs=new Array(); var i=0; while(cusButton.arguments.length>i+7) { if (cusButton.arguments[7+i]) this.aIs[i]=_getFullPath(_getPath(document.location.href),cusButton.arguments[7+i]); else this.aIs[i]=""; i++; } if(sOnLoad) { registerOnLoad(sOnLoad,sType); }}function getBtnColor(sType,bSel){ var aBtnColors=null; if(bSel) aBtnColors=gaSelBtnBgColor; else aBtnColors=gaBtnBgColor; if(aBtnColors) { for(var i=0;i<aBtnColors.length;i++) { if(aBtnColors[i].sType==sType) return aBtnColors[i].sColor; } } return "";}function setButtonBgColor(sType,sColor,bSel){ if(sColor) { var aBtnColors=null; if(bSel) aBtnColors=gaSelBtnBgColor; else aBtnColors=gaBtnBgColor; if(aBtnColors!=null) { for(var i=0;i<aBtnColors.length;i++) { if(aBtnColors[i].sType==sType) { aBtnColors[i].sColor=sColor; return; } } aBtnColors[aBtnColors.length]=new btnBgColor(sType,sColor); } }}function getDefaultButtonFont(){ var strFontStyle=""; for(var i=0;i<gaTypes.length;i++) { strFontStyle+=".btnsel"+gaTypes[i]+"{"+getFontStyle(goSelTextFont)+"}"; strFontStyle+=".btn"+gaTypes[i]+"{"+getFontStyle(goTextFont)+"}"; } return strFontStyle;}function setButtonFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration,bSel){ if(sFontName) { var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration); if(bSel) gsBtnStyle+=".btnsel"+sType+"{"+getFontStyle(vFont)+"}\n"; else gsBtnStyle+=".btn"+sType+"{"+getFontStyle(vFont)+"}\n"; } if (sType=="searchform"&&!bSel) { var vFont1=new whFont(sFontName,sFontSize,"black",sFontStyle,sFontWeight,sFontDecoration); gsBtnStyle+=".inputsearchform {" + getFontStyle(vFont1)+"}\n"; }}function getButtonObjByType(sType){ for(var i=0;i<gaObjBtns.length;i++) { if(gaObjBtns[i].sType==sType) return gaObjBtns[i]; } return null;}function onSelect(){ if (event.srcElement&&event.srcElement.name) { if (event.srcElement.name=="searchString") return true; } return false;}function window_onResize(){ gnRE++; setTimeout("tryReload();", 100);}function tryReload(){ if (gnRE==1) document.location.reload(); gnRE--;}if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy){ RegisterListener2(this,WH_MSG_GETSEARCHS); RegisterListener2(this,WH_MSG_PANESTATUE); RegisterListener2(this,WH_MSG_SYNCINFO); RegisterListener2(this,WH_MSG_PANEINFO); RegisterListener2(this,WH_MSG_AVENUEINFO); RegisterListener2(this,WH_MSG_GETCURRENTAVENUE); RegisterListener2(this,WH_MSG_ENABLEWEBSEARCH); RegisterListener2(this,WH_MSG_INITSEARCHSTRING); RegisterListener2(this,WH_MSG_NOSEARCHINPUT); RegisterListener2(this,WH_MSG_NOSYNC); window.onload=window_OnLoad; window.onunload=window_Unload; window.onresize=window_onResize; goTextFont=new whFont("Verdana","8pt","#003063","normal","normal","none"); goSelTextFont=new whFont("Verdana","8pt","white","normal","normal","none"); gbWhTBar=true;}else document.location.reload();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -