/* * File version $Revision: 17 $ * Last modified $Date : $ * Papirfly extensions to the xTREE Cross Browser Tree Widget by WebFX stored in the file xtree.js * Please avoid making changes to the original file; make your changes here and make sure that * this file gets included after the original. * * NB! I hope you remember to branch this file in SourceSafe before making your changes! */ // Override: new default file names. // New option (autoSlam) to automatically close nodes as they loose focus to other nodes. // New option (showRoot) to display root node or not. var webFXTreeConfig = { rootIcon : '/Internet/SkrettingAustralia/webInternet.nsf/blank.gif', openRootIcon :'/Internet/SkrettingAustralia/webInternet.nsf/blank.gif', folderIcon : '/Internet/SkrettingAustralia/webInternet.nsf/blank.gif', openFolderIcon : '/Internet/SkrettingAustralia/webInternet.nsf/blank.gif', fileIcon : '/Internet/SkrettingAustralia/webInternet.nsf/blank.gif', iIcon : '/Internet/SkrettingAustralia/webInternet.nsf/blank.gif', lIcon : '/Internet/SkrettingAustralia/webInternet.nsf/blank.gif', lMinusIcon : '/Internet/SkrettingAustralia/webInternet.nsf/minus.gif', lPlusIcon : '/Internet/SkrettingAustralia/webInternet.nsf/plus.gif', tIcon : '/Internet/SkrettingAustralia/webInternet.nsf/blank.gif', tMinusIcon : '/Internet/SkrettingAustralia/webInternet.nsf/minus.gif', tPlusIcon : '/Internet/SkrettingAustralia/webInternet.nsf/plus.gif', blankIcon : '/Internet/SkrettingAustralia/webInternet.nsf/blank.gif', defaultText : 'Tree Item', defaultAction : 'javascript:void(0);', defaultBehavior : 'classic', usePersistence : false, autoSlam : false, showRoot : false }; /* * WebFXTreeAbstractNode class */ // New: collapse all siblings for this node WebFXTreeAbstractNode.prototype.collapseSiblings = function() { if (!this.parentNode) return; for (var i = 0; i < this.parentNode.childNodes.length; i++) { if (this != this.parentNode.childNodes[i] && this.parentNode.childNodes[i].childNodes.length) { this.parentNode.childNodes[i].collapse(true); } } } /* // New: collapse all nodes in the same generation as this node WebFXTreeAbstractNode.prototype.collapseMyGeneration = function() { if (!this.parentNode) return; for (var i = 0; i < webFXTreeHandler.idCounter; i++) { var that = webFXTreeHandler.all[xxxxx]; if (this != this.parentNode.childNodes[i] && this.parentNode.childNodes[i].childNodes.length) { this.parentNode.childNodes[i].collapse(true); } } } */ // Override: collapse open node(s) after toggling this one if autoSlam options are on. WebFXTreeAbstractNode.prototype.toggle = function() { if (this.folder) { if (this.open) { this.collapse(); } else { this.expand(); } } if (webFXTreeConfig.autoSlam) this.collapseSiblings(); //this.collapseMyGeneration(); } // Override: don't collapse pre-expanded nodes. WebFXTreeAbstractNode.prototype.doCollapse = function() { if (this.jammed) return false; if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.icon; } if (this.childNodes.length) { document.getElementById(this.id + '-cont').style.display = 'none'; } this.open = false; if (webFXTreeConfig.usePersistence) webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '0'); } /* * WebFXTree class */ // Override: generate an additional