Newer
Older
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta name="robots" content="noindex,follow">
<script src="../lib/jquery.js"></script>
<script src="../lib/jquery-ui.custom.js"></script>
<link href="../src/skin-win8/ui.fancytree.css" rel="stylesheet">
<script src="../src/jquery.fancytree.js"></script>
<script src="sample.js"></script>
<title>Fancytree - Example Browser Nav</title>
<style type="text/css">
body {
background-color: #39414A;
color: white;
font-family: Helvetica, Arial, sans-serif;
font-size: smaller;
background-image: url("nav_bg.png");
background-repeat: repeat-x;
}
div#tree {
position: absolute;
height: 95%;
width: 95%;
padding: 5px;
margin-right: 16px;
}
ul.fancytree-container {
height: 100%;
width: 100%;
overflow: auto;
background-color: transparent;
}
span.fancytree-node span.fancytree-title {
color: white;
text-decoration: none;
}
span.fancytree-focused span.fancytree-title {
outline-color: white;
}
span.fancytree-node:hover span.fancytree-title,
span.fancytree-active span.fancytree-title,
span.fancytree-active.fancytree-focused span.fancytree-title,
.fancytree-treefocus span.fancytree-title:hover,
.fancytree-treefocus span.fancytree-active span.fancytree-title {
color: #39414A;
}
span.external span.fancytree-title:after {
content: "";
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAFVBMVEVmmcwzmcyZzP8AZswAZv////////9E6giVAAAAB3RSTlP///////8AGksDRgAAADhJREFUGFcly0ESAEAEA0Ei6/9P3sEcVB8kmrwFyni0bOeyyDpy9JTLEaOhQq7Ongf5FeMhHS/4AVnsAZubxDVmAAAAAElFTkSuQmCC") 100% 50% no-repeat;
padding-right: 13px;
}
/* Remove system outline for focused container */
.ui-fancytree.fancytree-container:focus {
outline: none;
}
.ui-fancytree.fancytree-container {
border: none;
}
</style>
<script type="text/javascript">
$(function(){
// --- Initialize sample trees
$("#tree").fancytree({
autoActivate: false, // we use scheduleAction()
autoCollapse: true,
// autoFocus: true,
autoScroll: true,
clickFolderMode: 3, // expand with single click
minExpandLevel: 2,
tabindex: "-1", // we don't want the focus frame
// toggleEffect: { effect: "blind", options: {direction: "vertical", scale: "box"}, duration: 2000 },
// scrollParent: null, // use $container
focus: function(event, data) {
var node = data.node;
// Auto-activate focused node after 1 second
if(node.data.href){
node.scheduleAction("activate", 1000);
}
},
blur: function(event, data) {
data.node.scheduleAction("cancel");
},
beforeActivate: function(event, data){
var node = data.node;
if( node.data.href && node.data.target === "_blank") {
window.open(node.data.href, "_blank");
return false; // don't activate
}
},
activate: function(event, data){
var node = data.node,
orgEvent = data.originalEvent || {};
// Open href (force new window if Ctrl is pressed)
if(node.data.href){
window.open(node.data.href, (orgEvent.ctrlKey || orgEvent.metaKey) ? "_blank" : node.data.target);
}
// When an external link was clicked, we don't want the node to become
// active. Also the URL fragment should not be changed
if( node.data.target === "_blank") {
return false;
}
// Append #HREF to URL without actually loading content
// (We check for this value on page load re-activate the node.)
if( window.parent && parent.history && parent.history.pushState ) {
parent.history.pushState({title: node.title}, "", "#" + (node.data.href || ""));
}
},
click: function(event, data){
// We implement this in the `click` event, because `activate` is not
// triggered if the node already was active.
// We want to allow re-loads by clicking again.
var node = data.node,
orgEvent = data.originalEvent;
// Open href (force new window if Ctrl is pressed)
if(node.isActive() && node.data.href){
window.open(node.data.href, (orgEvent.ctrlKey || orgEvent.metaKey) ? "_blank" : node.data.target);
}
}
});
// On page load, activate node if node.data.href matches the url#href
var tree = $(":ui-fancytree").fancytree("getTree"),
frameHash = window.parent && window.parent.location.hash;
if( frameHash ) {
frameHash = frameHash.replace("#", "");
tree.visit(function(n) {
if( n.data.href && n.data.href === frameHash ) {
n.setActive();
return false; // done: break traversal
}
});
}
});
</script>
</head>
<body>
<div id="tree">
<ul>
<li class="folder expanded">Documentation
<ul>
<li class="external">
<a target="_blank" href="https://github.com/mar10/fancytree/">Project home</a>
<li class="external">
<a target="_blank" href="https://github.com/mar10/fancytree/wiki/">Documentation</a>
<li class="external">
<a target="_blank" href="../doc/jsdoc/">API reference</a>
</ul>
<li class="folder expanded"> Examples
<ul>
<li><a target="content" href="welcome.html">Welcome</a>
<li><a target="content" href="sample-default.html">Default options</a>
<li><a target="content" href="sample-playground.html">Playground</a>
<li><a target="content" href="sample-configurator.html">Option configurator</a>
<li><a target="content" href="sample-multi-ext.html">Complex demo</a>
<li><a target="content" href="sample-source.html">Initialization</a>
<li><a target="content" href="sample-events.html">Event handling</a>
<li><a target="content" href="sample-api.html">Programming API</a>
<li><a target="content" href="sample-select.html">Checkbox & select</a>
<li><a target="content" href="sample-theming.html">Theming</a>
<li><a target="content" href="sample-ext-bootstrap.html">Bootstrap</a>
<li><a target="content" href="sample-form.html">Embed in forms</a>
<li class="external">
<a target="_blank" href="sample-aria.html">WAI-ARIA</a>
<li class="external">
<a target="_blank" href="http://wwwendt.de/tech/fancytree/demo/taxonomy-browser/">
Taxonomy Browser</a>
<li class="folder">Extensions
<ul>
<li><a target="content" href="sample-ext-childcounter.html">Child counter</a>
<li><a target="content" href="sample-ext-clones.html">Clones</a>
<li><a target="content" href="sample-ext-columnview.html">Column view</a>
<li><a target="content" href="sample-ext-menu.html">Context menu</a>
<li><a target="content" href="sample-ext-dnd.html">Drag'n'drop (jQuery UI)</a>
<li><a target="content" href="sample-ext-dnd5.html">Drag'n'drop (HTML5)</a>
<li><a target="content" href="sample-ext-filter.html">Filter</a>
<li><a target="content" href="sample-ext-fixed.html">Fixed headers</a>
<li><a target="content" href="sample-ext-bootstrap.html">Glyph fonts</a>
<li><a target="content" href="sample-ext-edit.html">Inline edit</a>
<li class="external"><a target="_blank" href="sample-ext-persist.html">Persist</a>
<li><a target="content" href="sample-ext-table.html">Table</a>
<li><a target="content" href="sample-ext-themeroller.html">ThemeRoller</a>
<li><a target="content" href="sample-ext-select.html">Select</a>
<li><a target="content" href="sample-ext-wide.html">Wide</a>
</ul>
<li class="folder">Tweaks
<ul>
<li><a target="content" href="sample-iframe.html">URL navigation and <iframe></a>
<li><a target="content" href="sample-accordion.html">Accordion</a>
<li><a target="content" href="sample-3rd-ui-contextmenu.html">ui-contextmenu</a>
<li><a target="content" href="sample-3rd-jQuery-contextMenu.html">jQuery contextMenu</a>
<li><a target="content" href="sample-3rd-contextmenu-abs.html">Context menu (ABS), Copy/paste</a>
<li><a target="content" href="sample-ext-awesome.html">font-awesome</a>
<li><a target="content" href="sample-load-errors.html">Lazy load errors handling</a>
<li><a target="content" href="sample-rtl.html">RTL</a>
<li><a target="content" href="sample-multiline.html">Large nodes</a>
<li><a target="content" href="sample-multi-dnd.html">Drag multiple nodes</a>
<li><a target="content" href="sample-scroll.html">Smart scrolling</a>
<li><a target="content" href="sample-webservice.html">Webservice</a>
<li><a target="content" href="../test/test-ext-keyboard.html">Keyboard nav.</a>
</ul>
<li class="folder">Test
<ul>
<li class="external"><a target="_blank" href="../test/unit/test-core.html">Core unit tests</a>
<li class="external"><a target="_blank" href="../test/unit/test-suite.html">Suite</a>
<li><a target="content" href="../test/test-ext-dnd.html">Drag'n'drop</a>
<li class="external"><a target="_blank" href="../test/unit/test-bench.html">Benchmarks</a>
<!--
<li><a target="content" href="sample-pyserver.html">Local server</a>
-->
<li class="folder">DTD
<ul>
<li><a target="content" href="../test/doctypes/doctype-none.html">No DTD</a>
<li><a target="content" href="../test/doctypes/doctype-html4-loose.html">HTML4 transitional</a>
<li><a target="content" href="../test/doctypes/doctype-html4-strict.html">HTML4 strict</a>
<li><a target="content" href="../test/doctypes/doctype-html5.html">HTML5</a>
<li><a target="content" href="../test/doctypes/doctype-xml-transitional.html">XHTML transitional</a>
<li><a target="content" href="../test/doctypes/doctype-xml-strict.html">XHTML strict</a>
</ul>
</ul>
</ul>
<li class="folder expanded">3rd party
<ul>
<li class="folder">Extensions
<ul>
<li><a target="content" href="../3rd-party/extensions/contextmenu/contextmenu.html">jQuery contextMenu</a>
<li><a target="content" href="../3rd-party/extensions/hotkeys/hotkeys.html">hotkeys</a>
</ul>
<li class="folder">Samples
<ul>
<li><a target="content" href="sample-3rd-ui-contextmenu.html">ui-contextmenu</a>
</ul>
</ul>
</ul>
</div>
</body>
</html>