📄 myft_new.js
字号:
font = this.setNodeFont()
if (useTextLinks && this.hreference)
strbuf += "<a " + fullLink + " >" + font + this.desc + "</font></a>"
else
strbuf += font + this.desc + "</font>"
if (!(cascade && noFrame)) {
strbuf += "</td></tr></table>"
} else {
strbuf += "</td><td align=right>"
if (this.isFolder) strbuf += "<IMG border=0 src='" + iTA["arr"].src + "'>"
else strbuf += "<IMG border=0 src='" + iTA["b"].src + "'>"
strbuf += "</td></tr></table>"
}
if (bV == 1) strbuf += "</div>"
if (this.nodeLevel == 0 && noTopFolder)
{
if (bV == 2) strbuf = "<layer id='node" + this.id + "' visibility='hidden'>"
else if (bV == 1) strbuf = "<div id='node" + this.id + "'></div>"
else if (bV == 0) strbuf = ""
}
this.navObj = null
if (this.isFolder) this.nodeImg = null
this.iconImg = null
if (bV == 0 || !prior)
{
if (bV != 1)
doc.write(strbuf)
else
strbufarray[this.id] = strbuf
}
else
{
if (bV == 2)
{
testlayer.document.open()
testlayer.document.write(strbuf)
testlayer.document.close()
testlayer.zIndex=1
this.navObj = testlayer
this.navObj.top = doc.yPos
this.navObj.visibility = "show"
doc.yPos += this.navObj.clip.height
}
else if (bV == 1)
{
strbufarray[strbufIndex] = strbuf
strbufIndex++
}
}
}
function setNodeFont()
{
font = "<FONT>"
if (!levelDefFont[this.nodeLevel])
levelDefFont[this.nodeLevel] = ""
if (this.font != "")
font = this.font
else
if (levelDefFont[this.nodeLevel] != "")
font = levelDefFont[this.nodeLevel]
else
if (defFolderFont != "" && this.isFolder)
font = defFolderFont
else
if (defDocFont != "" && !this.isFolder)
font = defDocFont
return font;
}
function createEntryIndex()
{
this.id = nEntries
indexOfEntries[nEntries] = this
nEntries++
}
function mouseOverNode(type, folderId)
{
var mouseNode = 0;
mouseNode = indexOfEntries[folderId];
if (! mouseNode)
return false;
if (bV == 1 && ! mouseNode.navObj) {
mouseNode.navObj = doc.all["node" + mouseNode.id];
}
if (bV == 1 && (doc != mouseNode.navObj.document && !isNav6)) {
clearTimeout(rewriteID);
checkload();
return true;
}
if (type == 0)
if (mouseNode.isOpen) {
setStatus("Click to close");
if (mouseOverPMMode == 2)
clickOnNode(folderId);
}
else {
setStatus("Click to open");
if (mouseOverPMMode > 0)
clickOnNode(folderId);
}
else if (type == 1) {
clearTimeout(timeoutIDOver);
if (mouseNode.statusText == "") {
setStatus(mouseNode.desc);
}
else {
setStatus(mouseNode.statusText)
}
if (mouseNode.isFolder)
if ((!mouseNode.isOpen && mouseOverIconMode == 1) || mouseOverIconMode == 2) {
if (cascade && noFrame)
timeoutIDOver = setTimeout("clickOnNode(" + folderId + ")",50)
else
timeoutIDOver = setTimeout("clickOnNode(" + folderId + ")",350)
}
}
if (document.images && type == 1) {
over = "Over";
var iA = iNAO;
if (!mouseNode.iconImg) {
mouseNode.iconImg = doc.images["nodeIcon"+mouseNode.id]
}
mouseNode.iconImg.src = mouseNode.nodeIcon(over,iA)
}
return true;
}
function clickNode(folderId)
{
var thisNode = 0
thisNode = indexOfEntries[folderId]
if (!thisNode) return false;
if (thisNode.isFolder) {
if (clickIconMode == 1 && thisNode.isOpen != null)
{
if(!thisNode.isOpen) clickOnNode(folderId)
}
else if (clickIconMode == 2 && thisNode.isOpen != null)
clickOnNode(folderId)
}
if (clickAction)
clickAction(thisNode)
if (thisNode.hreference) return true;
else return false;
}
function nodeTIcon (){
iName = ""
if (this.isFolder) {
if (this.isOpen)
{
if (this.isLastNode == 0)
iName = "mn"
else if (this.isLastNode == 1)
iName = "mln"
else
iName = "mfn"
}
else
{
if (this.isLastNode == 0)
iName = "pn"
else if (this.isLastNode == 1)
iName = "pln"
else
iName = "pfn"
}
if (noDocs)
{
folderChildren = false
for (i=0 ; i < this.nC; i++)
{
if (this.c[i].isFolder) folderChildren = true
}
if (!folderChildren)
if (this.isLastNode == 0)
iName = "n"
else if (this.isLastNode == 1)
iName = "ln"
else
iName = "fn"
}
}
else
{
if (this.isLastNode == 0)
iName = "n"
else if (this.isLastNode == 1)
iName = "ln"
else
iName = "fn"
}
if (treeLines == 0) iName = "b"
tmpIcon = iTA[iName].src
return tmpIcon
}
function nodeIcon(over,iA){
tmpIcon = ""
if (this.isFolder)
{
if (this.isOpen)
{
if (this["openIcon"+over] != "")
tmpIcon = imageArray[this["openIcon"+over]].src
else if (this.nodeLevel == 0)
tmpIcon = iA["tOF"].src
else
tmpIcon = iA["oF"].src
}
else
{
if (this["closedIcon" + over] != "")
tmpIcon = imageArray[this["closedIcon"+over]].src
else if (this.nodeLevel == 0)
tmpIcon = iA["tCF"].src
else
tmpIcon = iA["cF"].src
}
}
else
{
if (this["openIcon"+over] != "")
tmpIcon = imageArray[this["openIcon"+over]].src
else
tmpIcon = iA["d"].src
}
if (tmpIcon == "") tmpIcon = iTA["b"].src
return tmpIcon;
}
function mouseOutNode(type,folderId)
{
var mouseNode = 0;
mouseNode = indexOfEntries[folderId];
if (! mouseNode)
return false;
clearTimeout(timeoutIDOver);
if (document.images && type == 1) {
over = "";
var iA = iNA;
if (! mouseNode.iconImg) {
if (bV == 2) mouseNode.iconImg = mouseNode.navObj.document.images["nodeIcon"+mouseNode.id]
else if (bV == 1 || doc.images) mouseNode.iconImg = doc.images["nodeIcon"+mouseNode.id]
}
mouseNode.iconImg.src = mouseNode.nodeIcon(over,iA)
}
if (cascade && noFrame && bV == 1) mouseNode.navObj.style.backgroundColor = menuBackColor
if (cascade && noFrame && bV == 2) mouseNode.navObj.bgColor = menuBackColor
setStatus("")
return true;
}
function setStatus(statusText)
{
top.window.status = statusText;
}
function clickOnNode(folderId)
{
var cF = 0;
var state = 0;
oldwinheight = self.innerHeight;
oldwinwidth = self.innerWidth;
cF = indexOfEntries[folderId];
if (!cF) return false;
if (!cF.navObj && bV == 1) cF.navObj = doc.all["node" + cF.id]
state = cF.isOpen
if (!state) {
if (cF.isInitial == false) {
if(cF.nC == 0)
if (!addToTree)
alert("Folder has no children")
else
if (addToTree(cF) == true) return false;
if(cF.nC > 0) {
if (bV == 2)
if (noFrame && cascade ) doc.yPos = 0
else doc.yPos = cF.navObj.clip.height
if (bV > 0) prior = cF.navObj
if (bV == 2 && noFrame && cascade) {
var divLayer = new Layer(menuWidth, topLayer)
divLayer.document.open()
divLayer.document.write("")
divLayer.document.close()
divLayer.top = cF.navObj.top
if (cF.nodeParent.divObj)
divLayer.top += cF.nodeParent.divObj.top
divLayer.bgColor = menuBackColor
divLayer.left = menuWidth * cF.nodeLevel
topLayer.clip.width = Math.max(topLayer.clip.width, menuWidth * (cF.nodeLevel + 1))
divLayer.visibility = "show"
divLayer.zIndex=6000 + cF.id
divLayer.clip.width = menuWidth
cF.divObj = divLayer
}
if (bV > 0) {
level = cF.nodeLevel
leftSide = cF.nodeLeftSide
if (bV == 1) {
strbufarray = new Array()
strbufIndex = 0
}
for (var i=0 ; i < cF.nC; i++)
{
cF.c[i].nodeParent = cF
if (i == cF.nC-1)
newLastNode = 1
else
last = 0
if (noDocs)
{
newLastNode = 1
for (var j=i+1; j < cF.nC; j++)
if (cF.c[j].isFolder) newLastNode = 0
}
else
{
newLastNode = 0
if (i == cF.nC-1) newLastNode = 1
}
if (!noDocs || cF.c[i].isFolder) {
if (bV == 2 && noFrame && cascade)
cF.c[i].initialize(level + 1, newLastNode, leftSide, doc, divLayer)
else
cF.c[i].initialize(level + 1, newLastNode, leftSide, doc, prior)
needRewrite = true
}
}
if (bV == 1){
htmlStr = strbufarray.join("")
if (cascade && noFrame) {
leftdivpos = prior.offsetWidth + prior.offsetLeft
topdivpos = prior.offsetTop
zpos = 6000 + level
}
if (isNav6) {
newObj = thisFrame.document.createElement("DIV")
newObj.innerHTML = htmlStr
prior.appendChild(newObj)
if (cascade && noFrame) {
newObj.style.position = "absolute"
newObj.style.backgroundColor = menuBackColor
newObj.style.top = topdivpos
newObj.style.left = leftdivpos
newObj.style.borderWidth = "2px"
newObj.style.borderStyle = "solid"
newObj.style.borderColor = menuBorderColor
newObj.style.width = menuWidth
newObj.zindex = zpos
newObj.id = "div" + cF.id
}
} else {
if (!(cascade && noFrame))prior.insertAdjacentHTML("AfterEnd",htmlStr)
else {
htmlStr = "<DIV id = 'div" + cF.id + "' style='position:absolute;border-style:solid;border-color:" + menuBorderColor + ";border-width:2px;background-color:" + menuBackColor + ";zindex:" + zpos + ";top:" + topdivpos + ";left:" +leftdivpos + "'>" + htmlStr + "</DIV>"
prior.insertAdjacentHTML("AfterBegin",htmlStr)
}
}
}
}
cF.setState(!state)
cF.isInitial = true
}
}
else {
cF.setState(!state)
}
}
else {
if (bV == 0) cF.isInitial = false
cF.setState(!state)
}
if (bV == 2)cF.moveState(!state);
if (!state && modalClick && (cF.nodeLevel > 0))
for (i=0; i < cF.nodeParent.nC; i++)
{
if (cF.nodeParent.c[i].isOpen && (cF.nodeParent.c[i] != cF))
{
if (bV == 2) cF.nodeParent.c[i].moveState(false)
if (bV == 0) cF.nodeParent.c[i].isInitial = false
cF.nodeParent.c[i].setState(false)
}
}
if (bV == 0)
setTimeout("rewritepage()",50)
else
doc.close()
return false;
}
function collExp(mode)
{
var i=0
if (mode == 1)
{
this.isInitial = true
if (this.isFolder)
this.isOpen = true
}
else
{
this.isInitial = false
if (this.isFolder)
this.isOpen = false
}
if (this.isFolder) {
for (i=0; i<this.nC; i++)
this.c[i].collExp(mode)
}
}
function initMode()
{
var i = 0;
if (initialMode == 2) {
if (this.isFolder)
this.isOpen = true;
this.isInitial = true
}
if (this.isFolder) {
for (i = 0; i < this.nC; i++) {
this.c[i].initMode();
if (this.c[i].isOpen && this.c[i].isInitial) {
this.isOpen = true;
this.isInitial = true;
}
}
}
}
function reInitMode(state)
{
var i=0
if (this.isFolder) {
if (!this.isOpen || !state)
{
state = false
this.isInitial = false
}
for (i=0; i<this.nC; i++)
{
if (!state) this.c[i].isInitial = false
if (!state) this.c[i].isOpen = false
this.c[i].reInitMode(state)
}
}
}
function initializeDocument()
{
if (firstInitial) {
if (initialMode == 0) {
fT.isInitial = false;
fT.isOpen = false;
}
if (initialMode == 1) {
fT.isInitial = true;
fT.isOpen = true;
}
fT.initMode();
}
else
fT.reInitMode(true);
prior = null;
fT.initialize(0, 1, "", doc, prior);
firstInitial = false;
}
function collapseAll(){
var i=0
if (noFrame)
{
if (initialMode == 0)
{
if (!fT.navObj && bV == 1) fT.navObj = doc.all["node" + fT.id]
if (fT.isOpen){
fT.setState(!state)
if (bV == 2)fT.moveState(!state);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -