📄 ehlpdhtm.js
字号:
var nEventX = 0;
var nEventY = 0;
var nWindowWidth = 0;
if (gbBsIE4) {
layerPopup = document.all["PopupMenu"];
layerPopup.innerHTML = strMenu;
stylePopup = layerPopup.style;
_BSPSGetClientSize();
// Get the position of the item causing the event (relative to its parent)
nEventX = window.event.clientX;
nEventY = window.event.clientY;
if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {
nEventY += document.body.scrollTop + 10;
} else {
nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;
}
stylePopup.top = nEventY;
var nPopupWidth = layerPopup.scrollWidth;
if (gbBsMac) {
nPopupWidth = 80; // we have no idea how to get the dynamic width of the popup.
}
if (nEventX + nPopupWidth + 20 > gBsClientWidth) {
if (gBsClientWidth - nPopupWidth < 5) {
stylePopup.left = 5;
} else {
stylePopup.left = gBsClientWidth - nPopupWidth - 5;
}
} else {
stylePopup.left = nEventX + document.body.scrollLeft + 20;
}
stylePopup.visibility = "visible";
if (!gOlddocumentClick && document.onclick)
gOlddocumentClick = document.onclick;
document.onclick = PopupMenu_HandleClick;
} else if (gbBsNS6) {
layerPopup = document.getElementById("PopupMenu");
layerPopup.style.visibility = "hidden";
var e = fn_arguments[0];
nEventX = e.pageX;
nEventY = e.pageY;
_BSPSGetClientSize();
layerPopup.innerHTML = strMenu;
if (nEventY + layerPopup.offsetHeight + 20 < window.pageYOffset + gBsClientHeight) {
nEventY += 20;
} else {
nEventY = gBsClientHeight + window.pageYOffset - layerPopup.offsetHeight - 20;
}
if (nEventX + layerPopup.offsetWidth + 20 > gBsClientWidth + window.pageXOffset) {
if (gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth < 20) {
nEventX = 5;
} else {
nEventX = gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth - 20;
}
} else {
nEventX += 20;
}
layerPopup.style.top = nEventY;
layerPopup.style.left = nEventX;
// set again to avoid the stupid frash in netscape 6.
layerPopup.innerHTML = strMenu;
layerPopup.style.visibility = "visible";
//window.captureEvents(Event.MOUSEDOWN);
if (!gOlddocumentClick && document.onclick)
gOlddocumentClick = document.onclick;
window.onclick = PopupMenu_HandleClick;
}
else if (gbBsNS4) {
layerPopup = document.layers.PopupMenu;
layerPopup.visibility = "hide";
stylePopup = layerPopup.document;
stylePopup.write(strMenu);
stylePopup.close();
var e = fn_arguments[0];
nEventX = e.pageX;
nEventY = e.pageY;
_BSPSGetClientSize();
if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {
nEventY += 20;
} else {
nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;
}
layerPopup.top = nEventY;
if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {
if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {
nEventX = 5;
} else {
nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;
}
} else {
nEventX += 20;
}
layerPopup.left = nEventX;
layerPopup.visibility = "show";
window.captureEvents(Event.MOUSEDOWN);
if (!gOlddocumentClick && document.onmousedown)
gOlddocumentClick = document.onmousedown;
window.onmousedown = PopupMenu_HandleClick;
}
window.gbInPopupMenu = true;
window.gbPopupMenuTimeoutExpired = false;
setTimeout("PopupMenu_Timeout();", 100);
return false;
}
function PopupMenu_Timeout()
{
window.gbPopupMenuTimeoutExpired = true;
}
function PopupMenu_Over(e)
{
if (gbBsIE4) {
e.srcElement.className = "PopupOver";
} else if (gbBsNS4) {
// this.bgColor = "red";
// e.target.document.className = "PopupOver";
}
return;
}
function PopupMenu_Out(e)
{
if (gbBsIE4) {
e.srcElement.className = "PopupNotOver";
} else if (gbBsNS4) {
this.bgColor = "#f0f0f0";
}
return;
}
function PopupMenu_HandleClick(e)
{
if (window.gbPopupMenuTimeoutExpired) {
window.gbInPopupMenu = false;
if (gbBsNS4 && !gbBsNS6) {
window.releaseEvents(Event.MOUSEDOWN);
}
var layerPopup = null;
var stylePopup = null;
if (gbBsIE4) {
layerPopup = document.all["PopupMenu"];
stylePopup = layerPopup.style;
stylePopup.visibility = "hidden";
} else if (gbBsNS6) {
layerPopup = document.getElementById("PopupMenu");
layerPopup.style.visibility = "hidden";
} else if (gbBsNS4) {
layerPopup = document.layers.PopupMenu;
layerPopup.visibility = "hide";
}
if (gOlddocumentClick)
{
if (gbBsNS4 && !gbBsNS6)
document.onmousedown = gOlddocumentClick;
else
document.onclick = gOlddocumentClick;
}
}
return;
}
// This function should be deleted when all old projects are cleaned up
function BSPSWritePopupFrameForIE4()
{
return false;
}
/////////////////////////////////////////////////////////////////////
function BSSCPopup_ClickMac()
{
if ((!DHTMLPopupSupport()) && (gbBsIE4))
{
var bClickOnAnchor = false;
var el;
if ((window.event != null) &&
(window.event.srcElement != null))
{
el = window.event.srcElement;
while (el != null)
{
if ((el.tagName == "A") || (el.tagName == "AREA")) {
bClickOnAnchor = true;
break;
}
if (el.tagName == "BODY") {
break;
}
el = el.parentElement;
}
}
if (BSSCPopup_IsPopup())
{
if (!bClickOnAnchor) {
parent.window.gPopupWindow = null;
self.close();
}
}
else
{
bClosePopupWindow = true;
if ((bClickOnAnchor) &&
(el.href) &&
((el.href.indexOf("javascript:BSSCPopup") != -1) || (el.href.indexOf("javascript:null") != -1) || (el.href.indexOf("javascript:void(0)") != -1)))
{
bClosePopupWindow = false;
}
if (bClosePopupWindow)
{
if (window.gPopupWindow != null && !window.gPopupWindow.closed )
{
window.gPopupWindow.close();
}
}
}
}
}
//////////////////////////////////////////////////////////////////////
function BsPopupOnClick()
{
if (!gbBsIE4)
return;
BSSCPopup_ClickMac();
}
function _BSSCOnError(message)
{
if(-1 != message.indexOf("denied")
|| -1 != message.indexOf("Object required"))
return true;
}
//End to support previous relative topics
/// Section End - General and relative topics (JavaScript 1.0)
/// Section Begin - Popup (JavaScript 1.0)
//Begin to support previous popup functions
//////////////////////////////////////////////////////////////////////////////////////////////
//
// Begin DHTML Popup Functions
//
//////////////////////////////////////////////////////////////////////////////////////////////
//variables used to isolate the browser type
var gBsDoc = null;
var gBsSty = null;
var gBsHtm = null;
var gBsStyVisShow = null;
var gBsStyVisHide = null;
var gBsClientWidth = 640;
var gBsClientHeight = 480;
var gBsBrowser = null;
// here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others.
var gBRateH_W = 0.618; // 1.618 Golden cut.
var gBMaxXOfParent = 0.8;
var gBMaxYOfParent = 0.8;
var gBscrollHeight = 16;
var gBscrollWidth = 16;
var gBpermitXDelta = 3;
var gBpermitYDelta = 3;
var arrayPopupURL = new Array();
var arrayAbsPopupURL = new Array();
var arrayDirty = new Array();
function setAbsPopupURL(nIndex, strURL)
{
arrayAbsPopupURL[nIndex] = strURL;
}
function getAbsPopupURL(nIndex)
{
if (nIndex == -1 || arrayAbsPopupURL.length <= nIndex) return null;
else
return arrayAbsPopupURL[nIndex];
}
function getPopupURL(nIndex)
{
if (nIndex == -1 || arrayPopupURL.length <= nIndex) return null;
else
return arrayPopupURL[nIndex];
}
function getPopupID(nIndex)
{
return gstrPopupID + nIndex;
}
function getPopupShadowID(nIndex)
{
return gstrPopupShadowID + nIndex;
}
function getPopupTopicID(nIndex)
{
return gstrPopupTopicID + nIndex;
}
function getPopupIFrameID(nIndex)
{
return gstrPopupIFrameID + nIndex;
}
function getPopupIFrameName(nIndex)
{
return gstrPopupIFrameName + nIndex;
}
function getPopupTopicStyle(nIndex)
{
return eval("document.all['" + getPopupTopicID(nIndex) + "']").style;
}
function getPopupShadowStyle(nIndex)
{
return eval("document.all['" + getPopupShadowID(nIndex) + "']").style;
}
function getPopupIFrame(nIndex)
{
return eval("document.frames['" + getPopupIFrameName(nIndex) + "']");
}
function getPopupDivStyle(nIndex)
{
return eval("document.all['" + getPopupID(nIndex) + "']").style;
}
function getPopupIFrameStyle(nIndex)
{
return eval("document.all['" + getPopupIFrameName(nIndex) + "'].style");
}
function findDiv(strURL)
{
var i = 0;
for (i = 0; i < arrayPopupURL.length; i ++ ) {
if (arrayPopupURL[i] == strURL) {
return i;
}
}
return -1;
}
var gnToken = -1;
function takeToken()
{
gnToken ++;
if (gnToken > 10000) gnToken = 0;
return gnToken;
}
function IsValidToken(nToken)
{
return (gnToken == nToken);
}
function addDiv(strURL)
{
var i = 0;
for (i = 0; i < arrayPopupURL.length; i ++) {
if (arrayPopupURL[i] == null) {
arrayPopupURL[i] = strURL;
return i;
}
}
arrayPopupURL[i] = strURL;
arrayDirty[i] = true;
return i;
}
function setDirty()
{
var i = 0;
for (i = 0; i < arrayPopupURL.length; i ++ )
arrayDirty[i] = true;
}
function IsDirty(nIndex)
{
if (nIndex == -1)
return true;
else
if (arrayDirty.length > nIndex)
return arrayDirty[nIndex];
else
return true;
}
function hideAll()
{
var i = 0;
for (i = 0; i < arrayPopupURL.length; i ++ )
getPopupDivStyle(i).visibility = gBsStyVisHide;
}
function getCurrentPopupIFrame()
{
var i = 0;
for (i = 0; i < arrayPopupURL.length; i ++)
if (getPopupDivStyle(i).visibility == gBsStyVisShow)
return getPopupIFrame(i);
return null;
}
function setClear(nIndex)
{
if (nIndex != -1)
arrayDirty[nIndex] = false;
}
function _BSSCCreatePopupDiv(strURL)
{
var nIndex = findDiv(strURL);
if (nIndex == -1 ) {
nIndex = addDiv(strURL);
BsPopup_CreateDiv(nIndex);
}
else {
if (IsDirty(nIndex)) {
if("object" == typeof(getPopupIFrame(nIndex).document))
getPopupIFrame(nIndex).document.location.href = strURL;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -