📄 whtbar.js
字号:
// WebHelp 5.10.006
var gaButtons=new Array();
var gaTypes=new Array();
var gaBtnBgColor=new Array();
var gaSelBtnBgColor=new Array();
var gaOrders=null;
var gaObjBtns=new Array();
var BTN_TEXT=1;
var BTN_IMG=2;
var BTN_IMG_TOP=4
var BTN_IMG_BOTTOM=8;
var BTN_IMG_LEFT=16;
var BTN_IMG_RIGHT=32;
var gsAlign="left";
var gsBgImage="";
var gsBgColor="#99ccff";
var gsShadow="#cccccc";
var gsTBBgImage="";
var gnShowHideStyle=0;
var goTocInfo=null;
var gbTocInfoInited=false;
var goWebSearch=null;
var gsTBFontFamily="Arial";
var gsTBFontSize="xx-small";
var gsTBFontColor="#003063";
var gsTBDarkColor="#808080";
var gsTBLightColor="#FFFAFA";
var gsTBSelectedBgColor="#639ace";
var gsTBFontSelectedColor="#ffffff";
var gaOnLoads=new Array();
var goWebSearchEnable=true;
var goShow=null;
var goHide=null;
var goHide2=null;
var goSync=null;
var goToc=null;
var goIdx=null;
var goFts=null;
var goGlo=null;
var goNext=null;
var goPrev=null;
var LAYOUT=1;
var HLAYOUT=0;
var VLAYOUT=1;
var ALIGN=2;
var BALIGN=0;
var EALIGN=2;
var goEl=null;
var gnRE=0;
var gnButtonLayout=0;
var gnShowHide=-1;
var gbEqualSize=false;
var goCusButton=new Array();
var gsBtnStyle="";
var gaAvenues=null;
var gsCurAveName="";
var gsIToc=null;
var gsITocS=null;
var gsIIndex=null;
var gsIIndexS=null;
var gsISearch=null;
var gsISearchS=null;
var gsIGlossary=null;
var gsIGlossaryS=null;
var gsIBanner=null;
var gsIGo=null;
var gsIHide=null;
var gsIPrev=null;
var gsINext=null;
var gsISync=null;
var gsINextD=null;
var gsIPrevD=null;
var gsIWebSearch=null;
var gsIWebSearchD=null;
var gbAveButttnInited=false;
var goNextParent=null;
var goPrevParent=null;
var gsSearchPrompt="- Search -";
var gstrSearch="";
var gbPreview=false;
gbPreview=false;
var gsSearchFormTitle="";
var gnHasNavPane=-1;
var gbInitBtn=false;
var gaBtns=new Array();
var gbWhTBar=false;
var goTextFont=null;
var goSelTextFont=null;
var gsPane="";
var gbNeedUpdateAve=false;
var gbUpdateTimerCount=0;
function setGoImage(sGoImage)
{
if(sGoImage)
{
gsIGo=sGoImage;
}
}
function btnBgColor(sType,sColor)
{
this.sType=sType;
this.sColor=sColor;
}
function setBackground(sBgImage)
{
gsBgImage=sBgImage;
}
function setBackgroundcolor(sBgColor)
{
gsBgColor=sBgColor;
}
function setAlignment(strAlignment)
{
gnButtonLayout=0;
if(strAlignment=="left")
{
gnButtonLayout=HLAYOUT|BALIGN;
}
else if(strAlignment=="right")
{
gnButtonLayout=HLAYOUT|EALIGN;
}
else if(strAlignment=="top")
{
gnButtonLayout=VLAYOUT|BALIGN;
}
else if(strAlignment=="bottom")
{
gnButtonLayout=VLAYOUT|EALIGN;
}
}
function writeStyle(bMiniBar)
{
var sStyle="";
sStyle+="<style type='text/css'>\n";
sStyle+="<!--\n";
sStyle+=".clsBtnNormal {\n";
if(!(gbNav4&&!gbNav6))
if (bMiniBar)
sStyle+="padding:2px;\n";
else
sStyle+="padding:5px;\n";
sStyle+="cursor:hand;\n";
sStyle+="font-family:"+gsTBFontFamily+";\n";
sStyle+="font-size:"+gsTBFontSize+";\n";
sStyle+="color:"+gsTBFontColor+";}\n";
sStyle+=".clsNoBNormal {\n";
sStyle+="padding-left:2px;padding-right:2px;\n";
sStyle+="cursor:hand;\n";
sStyle+="font-family:"+gsTBFontFamily+";\n";
sStyle+="font-size:"+gsTBFontSize+";\n";
sStyle+="color:"+gsTBFontColor+";}\n";
sStyle+=".clsBtnDisable {\n";
if(!(gbNav4&&!gbNav6))
if (bMiniBar)
sStyle+="padding:2px;\n";
else
sStyle+="padding:5px;\n";
sStyle+="cursor:default;\n";
sStyle+="font-family:"+gsTBFontFamily+";\n";
sStyle+="font-size:"+gsTBFontSize+";\n";
sStyle+="color:"+gsTBFontColor+";}\n";
sStyle+=".clsNoBDisable {\n";
sStyle+="padding-left:2px;padding-right:2px;\n";
sStyle+="cursor:default;\n";
sStyle+="font-family:"+gsTBFontFamily+";\n";
sStyle+="font-size:"+gsTBFontSize+";\n";
sStyle+="color:"+gsTBFontColor+";}\n";
sStyle+=".clsNotBtn {\n";
if(!(gbNav4&&!gbNav6))
if (bMiniBar)
sStyle+="padding:2px;\n";
else
sStyle+="padding:5px;\n";
sStyle+="font-family:"+gsTBFontFamily+";\n";
sStyle+="font-size:"+gsTBFontSize+";\n";
sStyle+="color:"+gsTBFontColor+";}\n";
sStyle+=".clsBtnUp{\n";
if(!(gbNav4&&!gbNav6))
if (bMiniBar)
sStyle+="padding:1px;\n";
else
sStyle+="padding:4px;\n";
sStyle+="border-bottom:"+gsTBDarkColor+" 1px solid;\n";
sStyle+="border-left:"+gsTBLightColor+" 1px solid;\n";
sStyle+="border-right:"+gsTBDarkColor+" 1px solid;\n";
sStyle+="border-top:"+gsTBLightColor+" 1px solid;\n";
sStyle+="cursor:hand;";
sStyle+="font-family:"+gsTBFontFamily+";\n";
sStyle+="font-size:"+gsTBFontSize+";\n";
sStyle+="color:"+gsTBFontColor+";}\n";
sStyle+=".clsNoBUp{\n";
sStyle+="padding-left:2px;padding-right:2px;\n";
sStyle+="cursor:hand;";
sStyle+="font-family:"+gsTBFontFamily+";\n";
sStyle+="font-size:"+gsTBFontSize+";\n";
sStyle+="color:"+gsTBFontColor+";}\n";
sStyle+=".clsBtnDown{\n";
if(!(gbNav4&&!gbNav6))
if (bMiniBar)
sStyle+="padding:1px;\n";
else
sStyle+="padding:4px;\n";
sStyle+="border-bottom:"+gsTBLightColor+" 1px solid;\n";
sStyle+="border-left:"+gsTBDarkColor+" 1px solid;\n";
sStyle+="border-right:"+gsTBLightColor+" 1px solid;\n";
sStyle+="border-top:"+gsTBDarkColor+" 1px solid;\n";
sStyle+="color:"+gsTBFontColor+";\n";
sStyle+="cursor:hand;\n";
sStyle+="font-family:"+gsTBFontFamily+";\n";
sStyle+="font-size:"+gsTBFontSize+";}\n";
sStyle+=".clsNoBDown{\n";
sStyle+="padding-left:2px;padding-right:2px;\n";
sStyle+="cursor:hand;";
sStyle+="font-family:"+gsTBFontFamily+";\n";
sStyle+="font-size:"+gsTBFontSize+";\n";
sStyle+="color:"+gsTBFontColor+";}\n";
sStyle+=getDefaultButtonFont();
sStyle+=gsBtnStyle;
sStyle+=".clsToolbarBackground{\n";
sStyle+="margin:2px;}\n";
sStyle+="-->\n";
sStyle+=" body {\n";
if (gsBgImage)
sStyle+="border-top:"+gsBgColor+" 1px solid;}\n";
else
sStyle+="border-top:black 1px solid;}\n";
sStyle+="-->\n";
sStyle+="</style>\n";
document.write(sStyle);
}
function button(sType,sText,nWidth,nHeight)
{
this.sType=sType;
this.sText=sText;
this.nWidth=nWidth;
this.nHeight=nHeight;
this.aIs=new Array();
var i=0;
while(button.arguments.length>i+4)
{
if (button.arguments[4+i])
this.aIs[i]=_getFullPath(_getPath(document.location.href),button.arguments[4+i]);
else
this.aIs[i]="";
i++;
}
}
function getImage(oImage,sTitle)
{
if(oImage.aIs[0])
{
var sI="";
if(sTitle=="")
sTitle=oImage.sText;
sI+="<img alt=\""+sTitle+"\" src=\""+oImage.aIs[0]+"\"";
if(oImage.nWidth>0)
sI+=" width="+oImage.nWidth;
if(oImage.nHeight>0)
sI+=" height="+oImage.nHeight;
sI+=" border=0 align=\"absmiddle\">";
return sI;
}
return "";
}
function getCurrentAveName()
{
var oSelect=getElement("avenue");
if(oSelect)
return oSelect.value;
else
return "";
}
function updateWebSearch(bEnable)
{
var oWebSearch=getElement("btnwebsearch");
var oWebSearchParent=null;
if(oWebSearch)
oWebSearchParent=getParentNode(oWebSearch);
goWebSearchEnable=bEnable;
if(oWebSearchParent)
{
if(bEnable)
enableButton(oWebSearchParent,goWebSearch);
else
disableButton(oWebSearchParent,goWebSearch);
}
}
function setState(oEL,sState)
{
if(gbNav6||gbOpera)
oEL.setAttribute("state",sState);
else
oEL.state=sState;
}
function updateAvenueIfNeeded()
{
gbUpdateTimerCount--;
if (gbNeedUpdateAve&&gbUpdateTimerCount==0)
{
updateAvenue();
}
}
function updateAvenue()
{
var sSelect=getAvenueHTML(gaAvenues);
var oSelect=getElement("avenue");
if(oSelect)
{
if(gbNav6)
{
var oParent=getParentNode(oSelect);
if(oParent)
{
removeThis(oSelect);
oParent.insertAdjacentHTML("afterBegin",sSelect);
}
}
else
oSelect.outerHTML=sSelect;
oSelect=getElement("avenue");
if(isValidAvenue(gaAvenues,gsCurAveName))
oSelect.value=gsCurAveName;
}
updateAveButton();
}
function initAveButtonObj()
{
if(!gbAveButttnInited)
{
var oNext=getElement("btnavnext");
if(oNext)
goNextParent=getParentNode(oNext);
var oPrev=getElement("btnavprev");
if(oPrev)
goPrevParent=getParentNode(oPrev);
}
gbAveButttnInited=true;
}
function disableAveButton()
{
initAveButtonObj();
if(goNextParent)
disableButton(goNextParent,goNext);
if(goPrevParent)
disableButton(goPrevParent,goPrev);
}
function disableButton(oEl,oBtn)
{
setState(oEl,"disable");
var sPF=oEl.className.substring(0,6);
oEl.className=sPF+"Disable";
var oAs = getElementsByTag(oEl,"a");
if (oAs.length>0)
{
oAs[0].style.cursor="default";
}
var oIs=getElementsByTag(oEl,"img");
if(oIs.length>0&&oBtn&&oBtn.aIs&&oBtn.aIs.length>3)
{
if(oBtn.aIs[3])
oIs[0].src=oBtn.aIs[3];
}
else
oEl.style.visibility="hidden";
}
function enableButton(oEl,oBtn)
{
setState(oEl,"normal");
if(oEl==goEl)
{
var sPF=oEl.className.substring(0,6);
oEl.className=sPF+"Up";
}
var oAs = getElementsByTag(oEl,"a");
if (oAs.length>0)
{
oAs[0].style.cursor="hand";
}
var oIs=getElementsByTag(oEl,"img");
if(oIs.length>0&&oBtn&&oBtn.aIs&&oBtn.aIs.length>0)
{
if(oBtn.aIs[0])
oIs[0].src=oBtn.aIs[0];
}
oEl.style.visibility="visible";
}
function updateAveButton()
{
initAveButtonObj();
var strAveName=getCurrentAvenue();
if(strAveName!="")
{
if(gaAvenues)
{
for(var i=0;i<gaAvenues.length;i++)
if(gaAvenues[i].sName==strAveName)
{
if(goNextParent)
{
if(gaAvenues[i].sNext!=null&&gaAvenues[i].sNext!="")
enableButton(goNextParent,goNext);
else
disableButton(goNextParent,goNext);
}
if(goPrevParent)
{
if(gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev!="")
enableButton(goPrevParent,goPrev);
else
disableButton(goPrevParent,goPrev);
}
break;
}
}
}
else
{
var bNext=false;
var bPrev=false;
if(gaAvenues&&gaAvenues.length>0)
{
for(var i=0;i<gaAvenues.length&&(!bNext||!bPrev);i++)
{
if(!bNext)
if(gaAvenues[i].sNext!=null&&gaAvenues[i].sNext!="")
bNext=true;
if(!bPrev)
if(gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev!="")
bPrev=true;
}
}
if(goNextParent)
{
if(bNext)
enableButton(goNextParent,goNext);
else
disableButton(goNextParent,goNext);
}
if(goPrevParent)
{
if(bPrev)
enableButton(goPrevParent,goPrev);
else
disableButton(goPrevParent,goPrev);
}
}
}
function isValidAvenue(aAvenues,sValue)
{
if(aAvenues)
{
for(var i=0;i<aAvenues.length;i++)
{
if(aAvenues[i].sName==sValue)
return true;
}
}
return false;
}
function getAvenueHTML(aAvenues)
{
var sSelect="<select id=\"avenue\" size=\"1\" name=\"avenue\" onchange=\"updateAveButton();\">";
sSelect+="<option value=\"\" selected> - Select Avenue - </option>";
if(aAvenues)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -