/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*--------------------------------------------------| | dTree 2.05 | www.destroydrop.com/javascript/tree/ | |---------------------------------------------------| | Copyright (c) 2002-2003 Geir Landrö | | | | This script can be used freely as long as all | | copyright messages are intact. | | | | Updated: 17.04.2003 | |--------------------------------------------------*/ /* The content of attribute values should be quoted properly by using the equivalent entities. */ function dTreeQuote(str) { return (str .replace(/&/g, "&") .replace(/\n'; if (document.getElementById) { if (this.config.useCookies) this.selectedNode = this.getSelected(); str += this.addNode(this.root); } else str += 'Browser not supported.'; str += ''; if (!this.selectedFound) this.selectedNode = null; this.completed = true; return str; }, valueOf: function() { return this.toString(); }, // Creates the tree structure addNode: function(pNode) { var str = ''; var n=0; if (this.config.inOrder) n = pNode._ai; for (n; n'; if (this.config.useIcons) { if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node); if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node; if (this.root.id == node.pid) { node.icon = this.icon.root; node.iconOpen = this.icon.root; } str += ''; } str += '' + node.name + ''; if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += ''; str += ''; } if (node._hc) { str += '
'; str += this.addNode(node); str += '
'; } this.aIndent.pop(); return str; }, // Adds the empty and line icons indent: function(node, nodeId) { var str = ''; if (this.root.id != node.pid) { for (var n=0; n'; (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1); if (node._hc) { str += ''; } else str += ''; } return str; }, // Checks if a node has any children and if it is the last sibling setCS: function(node) { var lastId; for (var n=0; n