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, 42 insertions, 123 deletions
diff --git a/src/treeview.h b/src/treeview.h
index aa65bfe..9cbcccd 100644
--- a/src/treeview.h
+++ b/src/treeview.h
@@ -103,20 +103,13 @@
" \n"
"function hideFolder() \n"
"{ \n"
-" if (browserVersion == 1 || browserVersion == 3) \n"
-" { \n"
+" if (browserVersion == 1 || browserVersion == 3) { \n"
" if (this.navObj.style.display == \"none\") \n"
-" {\n"
-" return\n"
-" }\n"
+" return \n"
" this.navObj.style.display = \"none\" \n"
-" } \n"
-" else \n"
-" { \n"
+" } else { \n"
" if (this.navObj.visibility == \"hidden\") \n"
-" {\n"
" return \n"
-" }\n"
" this.navObj.visibility = \"hidden\" \n"
" } \n"
" \n"
@@ -125,11 +118,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"
@@ -173,12 +166,9 @@
" \n"
"function drawFolder(leftSide) \n"
"{ \n"
-" if (browserVersion == 2) \n"
-" { \n"
-" if (!doc.yPos)\n"
-" {\n"
+" if (browserVersion == 2) { \n"
+" if (!doc.yPos) \n"
" doc.yPos=8 \n"
-" }\n"
" doc.write(\"<layer id='folder\" + this.id + \"' top=\" + doc.yPos + \" visibility=hidden>\") \n"
" } \n"
" if (browserVersion == 3) \n"
@@ -188,9 +178,7 @@
" \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"
@@ -204,9 +192,7 @@
" 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"
@@ -214,30 +200,23 @@
" doc.write(\"</td>\") \n"
" doc.write(\"\\n</table>\\n\") \n"
" \n"
-" if (browserVersion == 2) \n"
-" { \n"
+" if (browserVersion == 2) { \n"
" doc.write(\"</layer>\") \n"
" } \n"
-" if (browserVersion == 3) \n"
-" { \n"
+" if (browserVersion == 3) { \n"
" doc.write(\"</div>\") \n"
" } \n"
" \n"
-" if (browserVersion == 1) \n"
-" { \n"
+" if (browserVersion == 1) { \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"
-" } \n"
-" else if (browserVersion == 2) \n"
-" { \n"
+" } else if (browserVersion == 2) { \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"
-" } \n"
-" else if (browserVersion == 3) \n"
-" {\n"
+" } else if (browserVersion == 3) {\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"
@@ -324,7 +303,6 @@
" 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"
@@ -335,29 +313,20 @@
" 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"
-" {\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"
+" 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"
" \n"
" doc.write(\"\\n<table \") \n"
-" if (browserVersion == 1)\n"
-" {\n"
-" doc.write(\" id='item\" + this.id + \"' style='position:block;' \")\n"
-" }\n"
+" if (browserVersion == 1) \n"
+" doc.write(\" id='item\" + this.id + \"' style='position:block;' \") \n"
" doc.write(\" border=0 cellspacing=0 cellpadding=0>\\n\") \n"
" doc.write(\"<tr><td>\") \n"
" doc.write(leftSide) \n"
@@ -373,13 +342,9 @@
" } \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"
@@ -387,27 +352,18 @@
" doc.write(\"\\n</table>\\n\") \n"
" \n"
" if (browserVersion == 2) \n"
-" {\n"
" doc.write(\"</layer>\") \n"
-" }\n"
-" else if (browserVersion == 3) \n"
-" {\n"
+" if (browserVersion == 3) \n"
" doc.write(\"</div>\")\n"
-" }\n"
" \n"
-" if (browserVersion == 1) \n"
-" { \n"
+" if (browserVersion == 1) { \n"
" this.navObj = doc.all[\"item\"+this.id] \n"
" this.iconImg = doc.all[\"itemIcon\"+this.id] \n"
-" } \n"
-" else if (browserVersion == 2) \n"
-" { \n"
+" } else if (browserVersion == 2) { \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"
-" } \n"
-" else if (browserVersion == 3) \n"
-" {\n"
+" } else if (browserVersion == 3) {\n"
" this.navObj = doc.getElementById(\"item\"+this.id)\n"
" this.iconImg = doc.images.namedItem(\"itemIcon\"+this.id)\n"
" }\n"
@@ -420,13 +376,9 @@
"function display() \n"
"{ \n"
" if (browserVersion == 1 || browserVersion == 3) \n"
-" {\n"
" this.navObj.style.display = \"block\" \n"
-" }\n"
" else \n"
-" {\n"
-" this.navObj.visibility = \"show\"\n"
-" }\n"
+" this.navObj.visibility = \"show\" \n"
"} \n"
" \n"
"function createEntryIndex() \n"
@@ -477,49 +429,18 @@
" 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"
-" 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"
+" 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"
"\n"
" foldersTree.initialize(0, 1, \"\") \n"
" foldersTree.display()\n"
@@ -539,7 +460,6 @@
"// 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"
@@ -572,10 +492,9 @@
"// Global variables \n"
"// **************** \n"
" \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"
+"USETEXTLINKS = 1\n"
+"indexOfEntries = new Array \n"
+"nEntries = 0 \n"
+"doc = document \n"
+"browserVersion = 0 \n"
+"selectedFolder=0\n"