forked from janosgyerik/upvotejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
259 lines (251 loc) · 9.6 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
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
253
254
255
256
257
258
259
<!doctype html>
<head>
<meta charset="utf-8">
<title>jQuery Upvote</title>
<meta name="author" content="Janos Gyerik">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="js/jquery-2.0.2.min.js"></script>
<script src="lib/jquery.upvote.js"></script>
<link rel="stylesheet" href="lib/jquery.upvote.css">
<style type="text/css">
<!--
.hidden {
display: none;
}
.examples {
overflow: auto;
}
.examples div.upvote {
float: left;
}
#footer {
height: 60px;
background-color: #f5f5f5;
}
.credit {
margin: 20px 0;
}
-->
</style>
<script type="text/javascript">
function gen(target, cssClass, params) {
var obj = $('#templates .upvote').clone();
obj.addClass(cssClass);
$(target).append(obj);
return obj.upvote(params);
}
$(function() {
function gen_examples(params) {
gen('#examples', '', params);
}
function gen_unix(params) {
gen('#unix', 'upvote-unix', params);
}
function gen_programmers(params) {
gen('#programmers', 'upvote-programmers', params);
}
function gen_serverfault(params) {
gen('#serverfault', 'upvote-serverfault', params);
}
var functions = [gen_examples, gen_unix, gen_programmers, gen_serverfault];
for (var i in functions) {
var fun = functions[i];
fun();
fun({count: 5});
fun({count: 6, upvoted: 1});
fun({count: 4, downvoted: 1});
fun({count: 15, starred: 1});
fun({count: 16, upvoted: 1, starred: 1});
fun({count: 14, downvoted: 1, starred: 1});
}
});
</script>
</head>
<body>
<a href="http://github.com/janosgyerik/jquery-upvote"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" /></a>
<div class="container">
<h1>jQuery Upvote - a voting plugin</h1>
<div>jQuery Upvote is a plugin that generates a voting widget like the one used on <a href="http://stackoverflow.com/">Stack Exchange</a> sites.</div>
<h2>Examples</h2>
<div class="row">
<div class="span6">
<h3>stackoverflow.com</h3>
<div class="examples" id="examples"></div>
</div>
<div class="span6">
<h3>unix.stackexchange.com</h3>
<div class="examples" id="unix"></div>
</div>
</div>
<div class="row">
<div class="span6">
<h3>programmers.stackexchange.com</h3>
<div class="examples" id="programmers"></div>
</div>
<div class="span6">
<h3>serverfault.com</h3>
<div class="examples" id="serverfault"></div>
</div>
</div>
<h2>Markup ("read-only" examples)</h2>
<div class="row">
<div class="span6">
<h3>Basic</h3>
<div class="row">
<div class="span1">
<div class="upvote">
<a class="upvote"></a>
<span class="count">5</span>
<a class="downvote"></a>
<a class="star"></a>
</div>
</div>
<div class="span5">
<pre>
<div class="upvote">
<a class="upvote"></a>
<span class="count">5</span>
<a class="downvote"></a>
<a class="star"></a>
</div></pre>
</div>
</div>
</div><!-- end of column -->
<div class="span6">
<h3>Upvoted</h3>
<div class="row">
<div class="span1">
<div class="upvote">
<a class="upvote upvote-on"></a>
<span class="count">6</span>
<a class="downvote"></a>
<a class="star"></a>
</div>
</div>
<div class="span5">
<pre>
<div class="upvote">
<a class="upvote"></a>
<span class="count">6</span>
<a class="downvote"></a>
<a class="star"></a>
</div></pre>
</div>
</div>
</div><!-- end of column -->
</div><!-- end of row -->
<div class="row">
<div class="span6">
<h3>Downvoted</h3>
<div class="row">
<div class="span1">
<div class="upvote">
<a class="upvote"></a>
<span class="count">4</span>
<a class="downvote downvote-on"></a>
<a class="star"></a>
</div>
</div>
<div class="span5">
<pre>
<div class="upvote">
<a class="upvote"></a>
<span class="count">4</span>
<a class="downvote downvote-on"></a>
<a class="star"></a>
</div></pre>
</div>
</div>
</div><!-- end of column -->
<div class="span6">
<h3>Upvoted and starred</h3>
<div class="row">
<div class="span1">
<div class="upvote">
<a class="upvote upvote-on"></a>
<span class="count">6</span>
<a class="downvote"></a>
<a class="star star-on"></a>
</div>
</div>
<div class="span5">
<pre>
<div class="upvote">
<a class="upvote"></a>
<span class="count">6</span>
<a class="downvote"></a>
<a class="star star-on"></a>
</div></pre>
</div>
</div>
</div><!-- end of column -->
</div><!-- end of row -->
<div class="row">
<div class="span6">
<h3>unix.stackexchange.com style</h3>
<div class="row">
<div class="span1">
<div class="upvote upvote-unix">
<a class="upvote"></a>
<span class="count">4</span>
<a class="downvote downvote-on"></a>
<a class="star"></a>
</div>
</div>
<div class="span5">
<pre>
<div class="upvote upvote-unix">
<a class="upvote"></a>
<span class="count">4</span>
<a class="downvote downvote-on"></a>
<a class="star"></a>
</div></pre>
</div>
</div>
</div><!-- end of column -->
<div class="span6">
<h3>serverfault.com style</h3>
<div class="row">
<div class="span1">
<div class="upvote upvote-serverfault">
<a class="upvote upvote-on"></a>
<span class="count">6</span>
<a class="downvote"></a>
<a class="star star-on"></a>
</div>
</div>
<div class="span5">
<pre>
<div class="upvote upvote-serverfault">
<a class="upvote"></a>
<span class="count">6</span>
<a class="downvote"></a>
<a class="star star-on"></a>
</div></pre>
</div>
</div>
</div><!-- end of column -->
</div><!-- end of row -->
<h2>Links</h2>
<ul>
<li><a href="http://github.com/janosgyerik/jquery-upvote">Documentation / Download</a></li>
<li><a href="tests/test1.html">Unit tests</a></li>
<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SQTLZB5QCLR82">Donate via PayPal</a></li>
</ul>
</div>
<div id="footer">
<div class="container">
<p class="muted credit"><a href="https://github.com/janosgyerik/jquery-upvote">jQuery Upvote</a> by <a href="http://janosgyerik.com/">Janos Gyerik</a></p>
</div>
</div>
<div id="templates" class="hidden">
<div class="upvote">
<a class="upvote" title="This is good stuff. Vote it up! (Click again to undo)"></a>
<span class="count" title="Total number of votes"></span>
<a class="downvote" title="This is not useful. Vote it down. (Click again to undo)"></a>
<a class="star" title="Mark as favorite. (Click again to undo)"></a>
</div>
</div>
</body>
</html>