📄 ft.js
字号:
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) {
if (noFrame) {
doc = document
}
else
{
doc = self.frames[menuFrame].document
}
mouseNode.navObj = doc.all["node" + mouseNode.id]
}
if (bV == 1 && (doc != mouseNode.navObj.document && !isNav6)) {
clearTimeout(rewriteID)
checkload()
return true;
}
if (cascade && noFrame && bV == 1) mouseNode.navObj.style.backgroundColor = menuBackColorOver
if (cascade && noFrame && bV == 2) mouseNode.navObj.bgColor = menuBackColorOver
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)
{
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) {
if (modalClick && (mouseNode.nodeLevel > 0))
for (i=0; i < mouseNode.nodeParent.nC; i++)
{
if (mouseNode.nodeParent.c[i].isOpen && (mouseNode.nodeParent.c[i] != mouseNode))
{
for (j=0; j < mouseNode.nodeParent.c[i].nC; j++) {
if (mouseNode.nodeParent.c[i].c[j].isFolder && mouseNode.nodeParent.c[i].c[j].isOpen) mouseNode.nodeParent.c[i].c[j].setState(false)
}
mouseNode.nodeParent.c[i].setState(false)
}
}
}
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){
var str = statusText
if (bV > 0)
eval("str = str.replace(/<[^<>]*>/g,'');")
top.window.defaultStatus = ""
top.window.status = str
thisFrame.defaultStatus = str
thisFrame.status = str
if (bV == 0)
{
clearTimeout(timeoutID)
timeoutID = setTimeout("top.status = ''",5000)
}
}
function clickOnNode(folderId)
{
var cF = 0
var state = 0
oldwinheight = thisFrame.innerHeight
oldwinwidth = thisFrame.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 {
if (bV == 1)
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);
}
}
if (initialMode > 0)
{
for (i=0; i<fT.nC; i++)
{
if (fT.c[i].isOpen) {
if (!fT.c[i].navObj && bV == 1) fT.c[i].navObj = doc.all["node" + fT.c[i].id]
state = fT.c[i].isOpen
fT.c[i].setState(!state)
if (bV == 2)fT.c[i].moveState(!state);
}
}
}
}
else
{
if (initialMode == 0)
{
fT.isInitial = false
fT.isOpen = false
}
if (initialMode > 0)
{
fT.isInitial = true
fT.isOpen = true
}
for (i=0; i<fT.nC; i++)
fT.c[i].collExp(0)
backButton = false
setTimeout("rewritepage()",50)
}
}
function expandAll(){
var i=0
if (noFrame)
{
for (i=0; i<nEntries; i++)
if (!indexOfEntries[i].isOpen)
{
indexOfEntries[i].setState(!state)
if (bV == 2)indexOfEntries[i].moveState(!state);
}
}
else
{
fT.collExp(1)
backButton = false
setTimeout("rewritepage()",50)
}
}
function initLayer() {
var i
var totalHeight
var oldyPos
var width = 0
if (!this.nodeParent)
layer = topLayer
else
layer = this.nodeParent.navObj
this.navObj = layer.document.layers["node"+this.id]
this.navObj.top = doc.yPos
this.navObj.visibility = "show"
if (this.nC > 0 && this.isInitial)
{
doc.yPos += this.navObj.document.layers[0].top
oldyPos = doc.yPos
doc.yPos = this.navObj.document.layers[0].top
this.navObj.clip.height = doc.yPos
totalHeight = 0
for (i=0 ; i < this.nC; i++)
{
if (!noDocs || this.c[i].isFolder)
{
if (this.c[i].hidden == false) this.c[i].initLayer()
if (bV == 2)
{
totalHeight += this.c[i].navObj.clip.height
width = Math.max(width,this.c[i].navObj.clip.width)
}
}
}
if (this.isOpen)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -