-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
192 lines (175 loc) · 5.11 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>JS-Cumulus => WP-Cumulus in Javascript</title>
<script type="text/javascript" src="js-cumulus.js"></script>
<script type="text/javascript">
//JSCumulus.noConflict();
/* DEBUG */ window.console && console.time && console.time("TagCloud1");
/* TagCloud 1 */
var tags = [
new Tag("JS-Cumulus", 100),
new Tag("WP-Cumulus", 80, "http://www.roytanck.com/2008/05/19/how-to-repurpose-my-tag-cloud-flash-movie/", true),
new Tag("Jeroen van Warmerdam", 60, "http://www.jeroenvanwarmerdam.nl"),
new Tag("Stratus", "http://student.agh.edu.pl/~fatyga/repos/stratus/example.php"),
new Tag("JavaScript", {
color: "red"
}),
new Tag("Object Oriented"),
new Tag("XB (Cross Browser)"),
new Tag("Firefox", 5),
new Tag("Chrome", 4),
new Tag("Safari", 3),
new Tag("Opera", 2),
new Tag("IE", 1),
new Tag("<del>No flash</del>"),
new Tag("<del>No JavaScript library</del>"),
new Tag("Tag"),
new Tag("Tag Cloud"),
new Tag("<img src='icon-tagcloud.gif' />")
];
var tagCloud1 = new TagCloud(tags, 400, 400);
/* DEBUG */ window.console && console.time && console.timeEnd("TagCloud1");
</script>
<style>
#tagCloud1
{
padding: 25px;
}
#tagCloud2
{
border-bottom: 1px solid silver;
margin-bottom: 5px;
padding-bottom: 5px;
width: 100%; /* needed for IE to calc width */
}
#widget
{
border: 1px solid silver;
margin: 5px;
padding: 5px;
text-align:center;
width: 240px;
}
#widget h4
{
border-bottom: 1px solid silver;
color: #999999;
font-size: 15px;
margin: 0 0 5px;
padding-bottom: 5px;
}
#jsCumulus1
{
color: #86C25E;
}
#jsCumulus2
{
color: #50B5D5;
}
.tagCloud
{
background: transparent url("bg_blue.gif") 0 0 repeat;
}
.tagCloud ul, .tagCloud li
{
list-style: none;
margin: 0;
padding: 0;
}
.tagCloud .tagClass img
{
border: 0 none;
}
.tagCloud .tagClass a
{
color: #fff;
font-family: Sans;
font-weight: normal;
padding: 3px;
text-align: center;
text-decoration: none;
vertical-align: middle;
}
.tagCloud .tagClass a:hover
{
border: solid 1px #ffdb00;
color: #ffdb00;
text-decoration: none;
}
</style>
</head>
<body>
<h1>JS-Cumulus => WP-Cumulus in JavaScript <small>v1</small></h1>
<p>Made by <a href="http://www.jeroenvanwarmerdam.nl">jerone</a></p>
<p></p>
<p>Check the source for code examples.<br/>
And check <a href="http://jeroenvanwarmerdam.nl/content/resources/javascript/jscumulus/jscumulus.aspx">this page</a> for more information.</p>
<hr />
<h2>Example 1</h2>
<p>A simple tagcloud with size 400 x 400.</p>
<div id="tagCloud1"></div>
<script type="text/javascript">
tagCloud1.Distribute(document.getElementById("tagCloud1")).Animate();
</script>
<hr />
<h2>Example 2</h2>
<p>Another example tagcloud with the size from it's parent. An extra option is added to override the existing HTML. The buttons below controls the tagcloud manually.</p>
<div id="widget">
<h4>Tag Cloud <small id="TagCloud2X_fps" /></h4>
<div id="tagCloud2">This text should be overriden!</div>
<input type="button" id="btn_tagcloud_reset" value="Reset" />
<input type="button" id="btn_tagcloud_update" value="Spin" />
<input type="button" id="btn_tagcloud_pause" value="Pause" />
<input type="button" id="btn_tagcloud_stop" value="Stop" />
</div>
<script type="text/javascript">
/* DEBUG */ window.console && console.time && console.time("TagCloud2");
/* TagCloud 2 */
var tags2 = [
new Tag("JS-Cumulus", 100),
new Tag("WP-Cumulus", 80, "http://www.roytanck.com/2008/05/19/how-to-repurpose-my-tag-cloud-flash-movie/"),
new Tag("Jeroen van Warmerdam", 60, "http://www.jeroenvanwarmerdam.nl"),
new Tag("Stratus", "http://student.agh.edu.pl/~fatyga/repos/stratus/example.php"),
new Tag("JavaScript"),
new Tag("Object Oriented"),
new Tag("XB (Cross Browser)"),
new Tag("Firefox", 5),
new Tag("Chrome", 4),
new Tag("Safari", 3),
new Tag("Opera", 2),
new Tag("IE", 1),
new Tag("<del>No flash</del>"),
new Tag("<del>No JavaScript library</del>"),
new Tag("Tag"),
new Tag("Tag Cloud"),
new Tag("<img src='icon-tagcloud.gif' alt='tagcloud' />")
];
var tagCloud2 = new TagCloud(
document.getElementById("tagCloud2"),
tags2,
parseFloat(document.getElementById("tagCloud2").clientWidth),
parseFloat(document.getElementById("tagCloud2").clientWidth),
{ overwrite: true, id: "TagCloud2X" }
);
tagCloud2.Animate();
/* DEBUG */ window.console && console.time && console.timeEnd("TagCloud2");
/* buttons */
document.getElementById("btn_tagcloud_reset").onclick = function() {
tagCloud2.Distribute();
};
document.getElementById("btn_tagcloud_update").onclick = function() {
tagCloud2.Animate(new Vector(-2, -2, 0));
};
var x = 0;
document.getElementById("btn_tagcloud_pause").onclick = function() {
var running = x++ % 2;
tagCloud2[running ? "Animate" : "Pause"]();
this.value = running ? "Pause" : "Resume";
};
document.getElementById("btn_tagcloud_stop").onclick = function() {
tagCloud2.Stop();
};
</script>
</body>
</html>