diff --git a/www/extras/Navigation/dtree/api.html b/www/extras/Navigation/dtree/api.html new file mode 100644 index 000000000..3686a8021 --- /dev/null +++ b/www/extras/Navigation/dtree/api.html @@ -0,0 +1,252 @@ + + + + + + Destroydrop » Javascripts » Tree » Api + + + + + + + + +
+ +
+ + + + +
+ +
+ + +

Overview

+
+
+ + + +
+ + +

Functions

+
+
+ + +

add()

+

Adds a node to the tree.
Can only be called before the tree is drawn.

+

id, pid and name are required.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
idNumberUnique identity number.
pidNumberNumber refering to the parent node. The value for the root node has to be -1.
nameStringText label for the node.
urlStringUrl for the node.
titleStringTitle for the node.
targetStringTarget for the node.
iconStringImage file to use as the icon. Uses default if not specified.
iconOpenStringImage file to use as the open icon. Uses default if not specified.
openBooleanIs the node open.
+
+ + +

Example

+

mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');

+
+ + +

openAll()

+

Opens all the nodes.
Can be called before and after the tree is drawn.

+

Example

+

mytree.openAll();

+
+ + + +

closeAll()

+

Closes all the nodes.
Can be called before and after the tree is drawn.

+

Example

+

mytree.closeAll();

+
+ + + +

openTo()

+

Opens the tree to a certain node and can also select the node.
+ Can only be called after the tree is drawn.

+ +

Parameters

+ + + + + + + + + + + + + + + + +
NameTypeDescription
idNumberIdentity number for the node.
selectBooleanShould the node be selected.
+ +

Example

+

mytree.openTo(4, true);

+ +
+ + +

Configuration

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableTypeDefaultDescription
targetStringtrueTarget for all the nodes.
folderLinksBooleantrueShould folders be links.
useSelectionBooleantrueNodes can be selected(highlighted).
useCookiesBooleantrueThe tree uses cookies to rember it's state.
useLinesBooleantrueTree is drawn with lines.
useIconsBooleantrueTree is drawn with icons.
useStatusTextBooleanfalseDisplays node names in the statusbar instead of the url.
closeSameLevelBooleanfalseOnly one node within a parent can be expanded at the same time. openAll() and closeAll() functions do not work when this is enabled.
inOrderBooleanfalseIf parent nodes are always added before children, setting this to true speeds up the tree.
+ +

Example

+

mytree.config.target = "mytarget";

+ +
+ +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/www/extras/Navigation/dtree/dtree.css b/www/extras/Navigation/dtree/dtree.css new file mode 100644 index 000000000..b201c2fd6 --- /dev/null +++ b/www/extras/Navigation/dtree/dtree.css @@ -0,0 +1,34 @@ +/*--------------------------------------------------| +| dTree 2.05 | www.destroydrop.com/javascript/tree/ | +|---------------------------------------------------| +| Copyright (c) 2002-2003 Geir Landrö | +|--------------------------------------------------*/ + +.dtree { + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; + font-size: 11px; + color: #666; + white-space: nowrap; +} +.dtree img { + border: 0px; + vertical-align: middle; +} +.dtree a { + color: #333; + text-decoration: none; +} +.dtree a.node, .dtree a.nodeSel { + white-space: nowrap; + padding: 1px 2px 1px 2px; +} +.dtree a.node:hover, .dtree a.nodeSel:hover { + color: #333; + text-decoration: underline; +} +.dtree a.nodeSel { + background-color: #c0d2ec; +} +.dtree .clip { + overflow: hidden; +} \ No newline at end of file diff --git a/www/extras/Navigation/dtree/dtree.js b/www/extras/Navigation/dtree/dtree.js new file mode 100644 index 000000000..97268a65f --- /dev/null +++ b/www/extras/Navigation/dtree/dtree.js @@ -0,0 +1,693 @@ +/*--------------------------------------------------| + +| 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 | + +|--------------------------------------------------*/ + + + +// Node object + +function Node(id, pid, name, url, title, target, icon, iconOpen, open) { + + this.id = id; + + this.pid = pid; + + this.name = name; + + this.url = url; + + this.title = title; + + this.target = target; + + this.icon = icon; + + this.iconOpen = iconOpen; + + this._io = open || false; + + this._is = false; + + this._ls = false; + + this._hc = false; + + this._ai = 0; + + this._p; + +}; + + + +// Tree object + +function dTree(objName) { + + this.config = { + + target : null, + + folderLinks : true, + + useSelection : true, + + useCookies : true, + + useLines : true, + + useIcons : true, + + useStatusText : false, + + closeSameLevel : false, + + inOrder : false + + } + + this.icon = { + + root : _dtree_url + 'img/base.gif', // LK, 20040222: Added _dtree_url + + folder : _dtree_url + 'img/folder.gif', // LK, 20040222: Added _dtree_url + + folderOpen : _dtree_url + 'img/folderopen.gif', // LK, 20040222: Added _dtree_url + + node : _dtree_url + 'img/page.gif', // LK, 20040222: Added _dtree_url + + empty : _dtree_url + 'img/empty.gif',// LK, 20040222: Added _dtree_url + + line : _dtree_url + 'img/line.gif',// LK, 20040222: Added _dtree_url + + join : _dtree_url + 'img/join.gif',// LK, 20040222: Added _dtree_url + + joinBottom : _dtree_url + 'img/joinbottom.gif',// LK, 20040222: Added _dtree_url + + plus : _dtree_url + 'img/plus.gif',// LK, 20040222: Added _dtree_url + + plusBottom : _dtree_url + 'img/plusbottom.gif',// LK, 20040222: Added _dtree_url + + minus : _dtree_url + 'img/minus.gif',// LK, 20040222: Added _dtree_url + + minusBottom : _dtree_url + 'img/minusbottom.gif',// LK, 20040222: Added _dtree_url + + nlPlus : _dtree_url + 'img/nolines_plus.gif',// LK, 20040222: Added _dtree_url + + nlMinus : _dtree_url + 'img/nolines_minus.gif'// LK, 20040222: Added _dtree_url + + }; + + this.obj = objName; + + this.aNodes = []; + + this.aIndent = []; + + this.root = new Node(-99); // LK, 20040222: Changes -1 to -99 because pageId -1 is an existing + // (reserved) page in WebGUI + this.selectedNode = null; + + this.selectedFound = false; + + this.completed = false; + +}; + + + +// Adds a new node to the node array + +dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) { + + this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open); + +}; + + + +// Open/close all nodes + +dTree.prototype.openAll = function() { + + this.oAll(true); + +}; + +dTree.prototype.closeAll = function() { + + this.oAll(false); + +}; + + + +// Outputs the tree to the page + +dTree.prototype.toString = function() { + + var str = '
\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; + +}; + + + +// Creates the tree structure + +dTree.prototype.addNode = function(pNode) { + + var str = ''; + + var n=0; + + if (this.config.inOrder) n = pNode._ai; + + for (n; n'; + + } + + if (node.url) { + + 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 + +dTree.prototype.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 + +dTree.prototype.setCS = function(node) { + + var lastId; + + for (var n=0; n + + + + + Destroydrop » Javascripts » Tree + + + + + + + + +

Destroydrop » Javascripts » Tree

+ +

Example

+ +
+ +

open all | close all

+ + + +
+ +

©2002-2003 Geir Landrö

+ + + + \ No newline at end of file diff --git a/www/extras/Navigation/dtree/img/base.gif b/www/extras/Navigation/dtree/img/base.gif new file mode 100644 index 000000000..9ac0b117b Binary files /dev/null and b/www/extras/Navigation/dtree/img/base.gif differ diff --git a/www/extras/Navigation/dtree/img/cd.gif b/www/extras/Navigation/dtree/img/cd.gif new file mode 100644 index 000000000..750381940 Binary files /dev/null and b/www/extras/Navigation/dtree/img/cd.gif differ diff --git a/www/extras/Navigation/dtree/img/empty.gif b/www/extras/Navigation/dtree/img/empty.gif new file mode 100644 index 000000000..b5cf52378 Binary files /dev/null and b/www/extras/Navigation/dtree/img/empty.gif differ diff --git a/www/extras/Navigation/dtree/img/folder.gif b/www/extras/Navigation/dtree/img/folder.gif new file mode 100644 index 000000000..eb129763d Binary files /dev/null and b/www/extras/Navigation/dtree/img/folder.gif differ diff --git a/www/extras/Navigation/dtree/img/folderopen.gif b/www/extras/Navigation/dtree/img/folderopen.gif new file mode 100644 index 000000000..c5c31102d Binary files /dev/null and b/www/extras/Navigation/dtree/img/folderopen.gif differ diff --git a/www/extras/Navigation/dtree/img/globe.gif b/www/extras/Navigation/dtree/img/globe.gif new file mode 100644 index 000000000..57123d0e6 Binary files /dev/null and b/www/extras/Navigation/dtree/img/globe.gif differ diff --git a/www/extras/Navigation/dtree/img/imgfolder.gif b/www/extras/Navigation/dtree/img/imgfolder.gif new file mode 100644 index 000000000..e6d880347 Binary files /dev/null and b/www/extras/Navigation/dtree/img/imgfolder.gif differ diff --git a/www/extras/Navigation/dtree/img/join.gif b/www/extras/Navigation/dtree/img/join.gif new file mode 100644 index 000000000..34dd47610 Binary files /dev/null and b/www/extras/Navigation/dtree/img/join.gif differ diff --git a/www/extras/Navigation/dtree/img/joinbottom.gif b/www/extras/Navigation/dtree/img/joinbottom.gif new file mode 100644 index 000000000..48b81c80a Binary files /dev/null and b/www/extras/Navigation/dtree/img/joinbottom.gif differ diff --git a/www/extras/Navigation/dtree/img/line.gif b/www/extras/Navigation/dtree/img/line.gif new file mode 100644 index 000000000..1a259eea0 Binary files /dev/null and b/www/extras/Navigation/dtree/img/line.gif differ diff --git a/www/extras/Navigation/dtree/img/minus.gif b/www/extras/Navigation/dtree/img/minus.gif new file mode 100644 index 000000000..3d212a97a Binary files /dev/null and b/www/extras/Navigation/dtree/img/minus.gif differ diff --git a/www/extras/Navigation/dtree/img/minusbottom.gif b/www/extras/Navigation/dtree/img/minusbottom.gif new file mode 100644 index 000000000..dc3198be2 Binary files /dev/null and b/www/extras/Navigation/dtree/img/minusbottom.gif differ diff --git a/www/extras/Navigation/dtree/img/musicfolder.gif b/www/extras/Navigation/dtree/img/musicfolder.gif new file mode 100644 index 000000000..f620789fe Binary files /dev/null and b/www/extras/Navigation/dtree/img/musicfolder.gif differ diff --git a/www/extras/Navigation/dtree/img/nolines_minus.gif b/www/extras/Navigation/dtree/img/nolines_minus.gif new file mode 100644 index 000000000..2592ac20f Binary files /dev/null and b/www/extras/Navigation/dtree/img/nolines_minus.gif differ diff --git a/www/extras/Navigation/dtree/img/nolines_plus.gif b/www/extras/Navigation/dtree/img/nolines_plus.gif new file mode 100644 index 000000000..f258ce211 Binary files /dev/null and b/www/extras/Navigation/dtree/img/nolines_plus.gif differ diff --git a/www/extras/Navigation/dtree/img/page.gif b/www/extras/Navigation/dtree/img/page.gif new file mode 100644 index 000000000..42d7318c5 Binary files /dev/null and b/www/extras/Navigation/dtree/img/page.gif differ diff --git a/www/extras/Navigation/dtree/img/plus.gif b/www/extras/Navigation/dtree/img/plus.gif new file mode 100644 index 000000000..b2c997233 Binary files /dev/null and b/www/extras/Navigation/dtree/img/plus.gif differ diff --git a/www/extras/Navigation/dtree/img/plusbottom.gif b/www/extras/Navigation/dtree/img/plusbottom.gif new file mode 100644 index 000000000..b5671d891 Binary files /dev/null and b/www/extras/Navigation/dtree/img/plusbottom.gif differ diff --git a/www/extras/Navigation/dtree/img/question.gif b/www/extras/Navigation/dtree/img/question.gif new file mode 100644 index 000000000..dd4e68507 Binary files /dev/null and b/www/extras/Navigation/dtree/img/question.gif differ diff --git a/www/extras/Navigation/dtree/img/trash.gif b/www/extras/Navigation/dtree/img/trash.gif new file mode 100644 index 000000000..cfa0f000e Binary files /dev/null and b/www/extras/Navigation/dtree/img/trash.gif differ