summaryrefslogtreecommitdiffstats
path: root/src/treeview.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/treeview.h')
-rw-r--r--src/treeview.h165
1 files changed, 123 insertions, 42 deletions
diff --git a/src/treeview.h b/src/treeview.h
index 9cbcccd..aa65bfe 100644
--- a/src/treeview.h
+++ b/src/treeview.h
@@ -103,13 +103,20 @@
" \n"
"function hideFolder() \n"
"{ \n"
-" if (browserVersion == 1 || browserVersion == 3) { \n"
+" if (browserVersion == 1 || browserVersion == 3) \n"
+" { \n"
" if (this.navObj.style.display == \"none\") \n"
-" return \n"
+" {\n"
+" return\n"
+" }\n"
" this.navObj.style.display = \"none\" \n"
-" } else { \n"
+" } \n"
+" else \n"
+" { \n"
" if (this.navObj.visibility == \"hidden\") \n"
+" {\n"
" return \n"
+" }\n"
" this.navObj.visibility = \"hidden\" \n"
" } \n"
" \n"
@@ -118,11 +125,11 @@
" \n"
"function initializeFolder(level, lastNode, leftSide) \n"
"{ \n"
-"var j=0 \n"
-"var i=0 \n"
-"var numberOfFolders \n"
-"var numberOfDocs \n"
-"var nc \n"
+" var j=0 \n"
+" var i=0 \n"
+" var numberOfFolders \n"
+" var numberOfDocs \n"
+" var nc \n"
" \n"
" nc = this.nChildren \n"
" \n"
@@ -166,9 +173,12 @@
" \n"
"function drawFolder(leftSide) \n"
"{ \n"
-" if (browserVersion == 2) { \n"
-" if (!doc.yPos) \n"
+" if (browserVersion == 2) \n"
+" { \n"
+" if (!doc.yPos)\n"
+" {\n"
" doc.yPos=8 \n"
+" }\n"
" doc.write(\"<layer id='folder\" + this.id + \"' top=\" + doc.yPos + \" visibility=hidden>\") \n"
" } \n"
" if (browserVersion == 3) \n"
@@ -178,7 +188,9 @@
" \n"
" doc.write(\"\\n<table \") \n"
" if (browserVersion == 1) \n"
+" {\n"
" doc.write(\" id='folder\" + this.id + \"' style='position:block;' \") \n"
+" }\n"
" doc.write(\" border=0 cellspacing=0 cellpadding=0>\") \n"
" doc.write(\"\\n<tr><td>\") \n"
" doc.write(leftSide) \n"
@@ -192,7 +204,9 @@
" doc.write(this.desc + \"</a>\") \n"
" } \n"
" else \n"
+" {\n"
" doc.write(this.desc) \n"
+" }\n"
" if (this.tagName!=\"\")\n"
" {\n"
" doc.write(\" [external]\")\n"
@@ -200,23 +214,30 @@
" doc.write(\"</td>\") \n"
" doc.write(\"\\n</table>\\n\") \n"
" \n"
-" if (browserVersion == 2) { \n"
+" if (browserVersion == 2) \n"
+" { \n"
" doc.write(\"</layer>\") \n"
" } \n"
-" if (browserVersion == 3) { \n"
+" if (browserVersion == 3) \n"
+" { \n"
" doc.write(\"</div>\") \n"
" } \n"
" \n"
-" if (browserVersion == 1) { \n"
+" if (browserVersion == 1) \n"
+" { \n"
" this.navObj = doc.all[\"folder\"+this.id] \n"
" this.iconImg = doc.all[\"folderIcon\"+this.id] \n"
" this.nodeImg = doc.all[\"nodeIcon\"+this.id] \n"
-" } else if (browserVersion == 2) { \n"
+" } \n"
+" else if (browserVersion == 2) \n"
+" { \n"
" this.navObj = doc.layers[\"folder\"+this.id] \n"
" this.iconImg = this.navObj.document.images[\"folderIcon\"+this.id] \n"
" this.nodeImg = this.navObj.document.images[\"nodeIcon\"+this.id] \n"
" doc.yPos=doc.yPos+this.navObj.clip.height \n"
-" } else if (browserVersion == 3) {\n"
+" } \n"
+" else if (browserVersion == 3) \n"
+" {\n"
" this.navObj = doc.getElementById(\"folder\"+this.id)\n"
" this.iconImg = doc.images.namedItem(\"folderIcon\"+this.id)\n"
" this.nodeImg = doc.images.namedItem(\"nodeIcon\"+this.id)\n"
@@ -303,6 +324,7 @@
" this.createIndex() \n"
" \n"
" if (level>0) \n"
+" {\n"
" if (lastNode) //the last 'brother' in the children array \n"
" { \n"
" this.renderOb(leftSide + \"<img src='ftv2lastnode.png' width=16 height=22>\") \n"
@@ -313,20 +335,29 @@
" this.renderOb(leftSide + \"<img src='ftv2node.png' width=16 height=22>\") \n"
" leftSide = leftSide + \"<img src='ftv2vertline.png' width=16 height=22>\" \n"
" } \n"
+" }\n"
" else \n"
+" {\n"
" this.renderOb(\"\") \n"
+" }\n"
"} \n"
" \n"
"function drawItem(leftSide) \n"
"{ \n"
-" if (browserVersion == 2) \n"
-" doc.write(\"<layer id='item\" + this.id + \"' top=\" + doc.yPos + \" visibility=hidden>\") \n"
-" if (browserVersion == 3) \n"
-" doc.write(\"<div id='item\" + this.id + \"' style='display:block;'>\") \n"
+" if (browserVersion == 2)\n"
+" {\n"
+" doc.write(\"<layer id='item\" + this.id + \"' top=\" + doc.yPos + \" visibility=hidden>\")\n"
+" }\n"
+" else if (browserVersion == 3)\n"
+" {\n"
+" doc.write(\"<div id='item\" + this.id + \"' style='display:block;'>\")\n"
+" }\n"
" \n"
" doc.write(\"\\n<table \") \n"
-" if (browserVersion == 1) \n"
-" doc.write(\" id='item\" + this.id + \"' style='position:block;' \") \n"
+" if (browserVersion == 1)\n"
+" {\n"
+" doc.write(\" id='item\" + this.id + \"' style='position:block;' \")\n"
+" }\n"
" doc.write(\" border=0 cellspacing=0 cellpadding=0>\\n\") \n"
" doc.write(\"<tr><td>\") \n"
" doc.write(leftSide) \n"
@@ -342,9 +373,13 @@
" } \n"
" doc.write(\"</td>\\n<td valign=middle nowrap>\") \n"
" if (USETEXTLINKS && this.link!=\"\") \n"
+" {\n"
" doc.write(\"<a href=\" + this.link + \">\" + this.desc + \"</a>\") \n"
+" }\n"
" else \n"
+" {\n"
" doc.write(this.desc) \n"
+" }\n"
" if (this.tagName!=\"\")\n"
" {\n"
" doc.write(\" [external]\");\n"
@@ -352,18 +387,27 @@
" doc.write(\"\\n</table>\\n\") \n"
" \n"
" if (browserVersion == 2) \n"
+" {\n"
" doc.write(\"</layer>\") \n"
-" if (browserVersion == 3) \n"
+" }\n"
+" else if (browserVersion == 3) \n"
+" {\n"
" doc.write(\"</div>\")\n"
+" }\n"
" \n"
-" if (browserVersion == 1) { \n"
+" if (browserVersion == 1) \n"
+" { \n"
" this.navObj = doc.all[\"item\"+this.id] \n"
" this.iconImg = doc.all[\"itemIcon\"+this.id] \n"
-" } else if (browserVersion == 2) { \n"
+" } \n"
+" else if (browserVersion == 2) \n"
+" { \n"
" this.navObj = doc.layers[\"item\"+this.id] \n"
" this.iconImg = this.navObj.document.images[\"itemIcon\"+this.id] \n"
" doc.yPos=doc.yPos+this.navObj.clip.height \n"
-" } else if (browserVersion == 3) {\n"
+" } \n"
+" else if (browserVersion == 3) \n"
+" {\n"
" this.navObj = doc.getElementById(\"item\"+this.id)\n"
" this.iconImg = doc.images.namedItem(\"itemIcon\"+this.id)\n"
" }\n"
@@ -376,9 +420,13 @@
"function display() \n"
"{ \n"
" if (browserVersion == 1 || browserVersion == 3) \n"
+" {\n"
" this.navObj.style.display = \"block\" \n"
+" }\n"
" else \n"
-" this.navObj.visibility = \"show\" \n"
+" {\n"
+" this.navObj.visibility = \"show\"\n"
+" }\n"
"} \n"
" \n"
"function createEntryIndex() \n"
@@ -429,18 +477,49 @@
" clickedFolder.setState(!state) //open<->close \n"
"} \n"
" \n"
+"function preLoadIcons() \n"
+"{\n"
+" var auxImg\n"
+" auxImg = new Image();\n"
+" auxImg.src = \"ftv2blank.png\";\n"
+" auxImg.src = \"ftv2doc.png\";\n"
+" auxImg.src = \"ftv2folderclosed.png\";\n"
+" auxImg.src = \"ftv2folderopen.png\";\n"
+" auxImg.src = \"ftv2lastnode.png\";\n"
+" auxImg.src = \"ftv2link.png\";\n"
+" auxImg.src = \"ftv2mlastnode.png\";\n"
+" auxImg.src = \"ftv2mnode.png\";\n"
+" auxImg.src = \"ftv2node.png\";\n"
+" auxImg.src = \"ftv2plastnode.png\";\n"
+" auxImg.src = \"ftv2pnode.png\";\n"
+" auxImg.src = \"ftv2vertline.png\";\n"
+"}\n"
+"\n"
"function initializeDocument() \n"
"{ \n"
-" doc = document;\n"
-" if (doc.all) \n"
-" browserVersion = 1 //IE4 \n"
-" else \n"
-" if (doc.layers) \n"
-" browserVersion = 2 //NS4 \n"
-" else if(navigator.userAgent.toLowerCase().indexOf('gecko') != -1)\n"
-" browserVersion = 3 //mozilla\n"
-" else \n"
-" browserVersion = 0 //other \n"
+" preLoadIcons()\n"
+"\n"
+" var ua = window.navigator.userAgent.toLowerCase();\n"
+" if ((ua.indexOf('msie')!=-1) && (navigator.version>=4))\n"
+" {\n"
+" browserVersion = 1 // IE >= 4.x\n"
+" }\n"
+" else if (ua.indexOf('opera')!=-1)\n"
+" {\n"
+" browserVersion = 3; // Opera\n"
+" }\n"
+" else if (ua.indexOf('gecko')!=-1)\n"
+" {\n"
+" browserVersion = 3; // NS6 or Mozilla\n"
+" }\n"
+" else if (ua.indexOf('mozilla')!=-1)\n"
+" {\n"
+" browserVersion = 2; // NS4\n"
+" }\n"
+" else\n"
+" {\n"
+" browserVersion = 0; // unknown or old browser\n"
+" }\n"
"\n"
" foldersTree.initialize(0, 1, \"\") \n"
" foldersTree.display()\n"
@@ -460,6 +539,7 @@
"// Auxiliary Functions for Folder-Treee backward compatibility \n"
"// ********************************************************* \n"
" \n"
+" \n"
"function gFld(description, tagName, hreference) \n"
"{ \n"
" folder = new Folder(description, tagName, hreference) \n"
@@ -492,9 +572,10 @@
"// Global variables \n"
"// **************** \n"
" \n"
-"USETEXTLINKS = 1\n"
-"indexOfEntries = new Array \n"
-"nEntries = 0 \n"
-"doc = document \n"
-"browserVersion = 0 \n"
-"selectedFolder=0\n"
+"var USETEXTLINKS = 1\n"
+"var indexOfEntries = new Array \n"
+"var nEntries = 0 \n"
+"var doc = document \n"
+"var browserVersion = 0 \n"
+"var selectedFolder=0\n"
+"\n"