-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.html
252 lines (212 loc) · 5.19 KB
/
api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Destroydrop » Javascripts » Tree » Api</title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
<link rel="stylesheet" href="/dd.css" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<div id="shadow">
<div id="content">
<div id="location">
<h1><a href="/">Destroydrop</a> » <a href="/javascripts/">Javascripts</a> » <a href="/javascripts/tree/">Tree</a> » <a href="/javascripts/tree/api/">Api</a></h1>
</div>
<div class="line"></div>
<div id="files">
<h3>Overview</h3>
<div class="line"></div>
<div class="item">
<ul class="arrow">
<li><a href="#functions">Functions</a>
<ul class="arrow">
<li><a href="#add">add</a></li>
<li><a href="#openall">openAll</a></li>
<li><a href="#closeall">closeAll</a></li>
<li><a href="#opento">openTo</a></li>
</ul>
</li>
<li><a href="#configuration">Configuration</a></li>
</ul>
</div>
<a name="functions"></a>
<h3>Functions</h3>
<div class="line"></div>
<div class="item">
<a name="add"></a>
<h4 class="func">add()</h4>
<p>Adds a node to the tree.<br />Can only be called before the tree is drawn.</p>
<p>id, pid and name are required.</p>
<h4>Parameters</h4>
<table class="files">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>id</td>
<td>Number</td>
<td>Unique identity number.</td>
</tr>
<tr>
<td>pid</td>
<td>Number</td>
<td>Number refering to the parent node. The value for the root node has to be -1.</td>
</tr>
<tr>
<td>name</td>
<td>String</td>
<td>Text label for the node.</td>
</tr>
<tr>
<td>url</td>
<td>String</td>
<td>Url for the node.</td>
</tr>
<tr>
<td>title</td>
<td>String</td>
<td>Title for the node.</td>
</tr>
<tr>
<td>target</td>
<td>String</td>
<td>Target for the node.</td>
</tr>
<tr>
<td>icon</td>
<td>String</td>
<td>Image file to use as the icon. Uses default if not specified.</td>
</tr>
<tr>
<td>iconOpen</td>
<td>String</td>
<td>Image file to use as the open icon. Uses default if not specified.</td>
</tr>
<tr>
<td>open</td>
<td>Boolean</td>
<td>Is the node open.</td>
</tr>
</table>
<br />
<h4>Example</h4>
<p><code>mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');</code></p>
<br />
<a name="openall"></a>
<h4 class="func">openAll()</h4>
<p>Opens all the nodes.<br />Can be called before and after the tree is drawn.</p>
<h4>Example</h4>
<p><code>mytree.openAll();</code></p>
<br />
<a name="closeall"></a>
<h4 class="func">closeAll()</h4>
<p>Closes all the nodes.<br />Can be called before and after the tree is drawn.</p>
<h4>Example</h4>
<p><code>mytree.closeAll();</code></p>
<br />
<a name="opento"></a>
<h4 class="func">openTo()</h4>
<p>Opens the tree to a certain node and can also select the node.<br />
Can only be called after the tree is drawn.</p>
<h4>Parameters</h4>
<table class="files">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>id</td>
<td>Number</td>
<td>Identity number for the node.</td>
</tr>
<tr>
<td>select</td>
<td>Boolean</td>
<td>Should the node be selected.</td>
</tr>
</table>
<h4>Example</h4>
<p><code>mytree.openTo(4, true);</code></p>
</div>
<a name="configuration"></a>
<h3>Configuration</h3>
<div class="line"></div>
<div class="item">
<table class="files">
<tr>
<th>Variable</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td>target</td>
<td>String</td>
<td>true</td>
<td>Target for all the nodes.</td>
</tr>
<tr>
<td>folderLinks</td>
<td>Boolean</td>
<td>true</td>
<td>Should folders be links.</td>
</tr>
<tr>
<td>useSelection</td>
<td>Boolean</td>
<td>true</td>
<td>Nodes can be selected(highlighted).</td>
</tr>
<tr>
<td>useCookies</td>
<td>Boolean</td>
<td>true</td>
<td>The tree uses cookies to rember it's state.</td>
</tr>
<tr>
<td>useLines</td>
<td>Boolean</td>
<td>true</td>
<td>Tree is drawn with lines.</td>
</tr>
<tr>
<td>useIcons</td>
<td>Boolean</td>
<td>true</td>
<td>Tree is drawn with icons.</td>
</tr>
<tr>
<td>useStatusText</td>
<td>Boolean</td>
<td>false</td>
<td>Displays node names in the statusbar instead of the url.</td>
</tr>
<tr>
<td>closeSameLevel</td>
<td>Boolean</td>
<td>false</td>
<td>Only one node within a parent can be expanded at the same time. openAll() and closeAll() functions do not work when this is enabled.</td>
</tr>
<tr>
<td>inOrder</td>
<td>Boolean</td>
<td>false</td>
<td>If parent nodes are always added before children, setting this to true speeds up the tree.</td>
</tr>
</table>
<h4>Example</h4>
<p><code>mytree.config.target = "mytarget";</code></p>
</div>
</div>
<div class="line"></div>
<div id="copy">
<p class="right"><a href="http://validator.w3.org/check/referer">XHTML</a>, <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></p>
<p><a href="mailto:drop@destroydrop.com">©2002-2003 Geir Landrö</a></p>
</div>
</div>
</div>
</body>
</html>