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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Fancytree - Example: Awesome Extension</title>
<link href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet">
<script src="//code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css">
<link href="../src/skin-awesome/ui.fancytree.css" rel="stylesheet" class="skinswitcher">
<script src="../src/jquery.fancytree.js"></script>
<script src="../src/jquery.fancytree.glyph.js"></script>
<!-- Start_Exclude: This block is not part of the sample code -->
<link href="../lib/prettify.css" rel="stylesheet">
<script src="../lib/prettify.js"></script>
<link href="../demo/sample.css" rel="stylesheet">
<script src="../demo/sample.js"></script>
<style type="text/css">
ul.fancytree-container {
/*font-size: 2em;*/
}
</style>
<!-- End_Exclude -->
<!-- Add code to initialize the tree when the document is loaded: -->
<script type="text/javascript">
$(function(){
// Initialize Fancytree
$("#tree").fancytree({
extensions: ["glyph"],
checkbox: true,
selectMode: 3,
glyph: {
map: {
doc: "icon-file-alt",
docOpen: "icon-file-alt",
checkbox: "icon-check-empty",
checkboxSelected: "icon-check",
checkboxUnknown: "icon-check icon-muted",
error: "icon-exclamation-sign",
expanderClosed: "icon-caret-right",
expanderLazy: "icon-angle-right",
// expanderLazy: "icon-refresh icon-spin",
expanderOpen: "icon-caret-down",
folder: "icon-folder-close-alt",
folderOpen: "icon-folder-open-alt",
loading: "icon-refresh icon-spin"
// loading: "icon-spinner icon-spin"
}
},
// source: {url: "ajax-tree-plain.json", debugDelay: 1000},
source: {url: "ajax-tree-taxonomy.json", debugDelay: 1000},
lazyLoad: function(event, ctx) {
ctx.result = {url: "ajax-sub2.json", debugDelay: 1000};
}
});
});
</script>
<!-- Start_Exclude: This block is not part of the sample code -->
<script>
$(function(){
// Adjust skinswitcher for current folder layout
function setSize(event, ui){
$("#tree .fancytree-container").css("font-size", ui.value + "pt");
$("#curSize").text(ui.value + " pt");
}
$( "#fontSlider" ).slider({
min: 4,
max: 64,
value: 10,
change: setSize,
slide: setSize
}).slider("value", 10);
/*
$("#skinswitcher")
// .skinswitcher("option", "base", "../../src/")
.skinswitcher("addChoices", [
{name: "Awesome", value: "awesome", href: "skin-awesome/ui.fancytree.css"}
])
.skinswitcher("change", "awesome");
*/
/*
addSampleButton({
label: "Generate <input> elements",
code: function(){
$("#tree").fancytree("getTree").generateInput();
$("#tree2").fancytree("getTree").generateInput();
}
});
*/
});
</script>
<!-- End_Exclude -->
</head>
<body class="example">
<h1>Example: 'glyph' extension with awesome theme</h1>
<div class="description">
<p>
The 'glyph' extension adds <code>icon-...</code> classes to the
node's <code>span</code> tags, so scalable vector icons as provided by
<a href="http://fortawesome.github.io/Font-Awesome/" class="external" target="_blank">Font Awesome</a>
can be used.
</p>
<p>
<b>Status</b>: pre-alpha
</p>
</div>
<!--
<div>
<label for="skinswitcher">Skin:</label> <select id="skinswitcher"></select>
</div>
-->
<hr>
Font size: <span id="curSize"></span>
<div id="fontSlider"></div>
<hr>
<div id="tree">
</div>
<!-- Start_Exclude: This block is not part of the sample code -->
<p id="sampleButtons">
</p>
<hr>
<p class="sample-links no_code">
<a class="hideInsideFS" href="https://github.com/mar10/fancytree/">Fancytree project home</a>
<a class="hideOutsideFS" href="#">Link to this page</a>
<a class="hideInsideFS" href="index.html">Example Browser</a>
<a href="#" id="codeExample">View source code</a>
</p>
<pre id="sourceCode" class="prettyprint" style="display:none"></pre>
<!-- End_Exclude -->
</body>
</html>