Skip to content
Newer
Older
100644 382 lines (373 sloc) 13.3 KB
59e4bef @pilu initial layout
authored May 5, 2008
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3
4 <html lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7 <title>Prototype Rating</title>
8 <link rel="stylesheet" href="stylesheets/base.css" type="text/css">
9 <link rel="stylesheet" href="stylesheets/rating.css" type="text/css">
10 <script type="text/javascript" charset="utf-8" src="javascripts/prototype.js"></script>
11 <script type="text/javascript" charset="utf-8" src="javascripts/rating.js"></script>
12 <script type="text/javascript" charset="utf-8">
13 document.observe('dom:loaded', function(event) {
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
14 new Rating('simple_rating');
15 new Rating('simple_label');
16 new Rating('custom_label', {
17 labelValues: ['custom bad', 'custom not bad', 'custom good', 'custom very bad', 'custom excellent']
18 });
19 new Rating('custom_label_template', {
20 labelValues: ['custom bad', 'custom not bad', 'custom good', 'custom very bad', 'custom excellent'],
21 labelText: "#{rate} (#{text})"
59e4bef @pilu initial layout
authored May 4, 2008
22 });
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
23
24 new Rating('custom_label_after_rating', {
28be41b @pilu changed example page style
authored Jun 21, 2008
25 afterRatinglabelText: "Thank for voting the item #{id} (#{rate} - #{text})."
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
26 });
27
28 new Rating('not_disabled_rating', {
29 disabledOnRating: false
30 });
31
32 new Rating('custom_delay_rating', {
33 resetDelay: 1
34 });
35
36 new Rating('after_rate_rating', {
37 afterRate: function(element, id, rate, text) {
28be41b @pilu changed example page style
authored Jun 21, 2008
38 alert('You have chosen "' + rate + ' - ' + text + '" for the item with id ' + id)
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
39 }
40 });
41
a2d1122 @pilu Removed blank lines
authored May 6, 2008
42 new Rating('ajax_update_rating', {
28be41b @pilu changed example page style
authored Jun 21, 2008
43 ajaxUrl: 'ajax-update-response.html?item_id=#{id}',
a2d1122 @pilu Removed blank lines
authored May 6, 2008
44 ajaxMethod: 'GET',
45 ajaxParameters: 'rate=#{rate}'
46 });
47
48 new Rating('ajax_request_rating', {
28be41b @pilu changed example page style
authored Jun 21, 2008
49 ajaxUrl: 'ajax-request-response.js?item_id=#{id}',
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
50 ajaxMethod: 'GET',
51 ajaxParameters: 'rate=#{rate}'
52 });
53
59e4bef @pilu initial layout
authored May 4, 2008
54 });
55 </script>
56 </head>
57 <body>
28be41b @pilu changed example page style
authored Jun 21, 2008
58 <div id="container">
5f58571 @pilu changed homepage url
authored Jun 21, 2008
59 <h1><a href="http://gravityblast.com/projects/super-star-rating/">Super Star Rating</a></h1>
28be41b @pilu changed example page style
authored Jun 21, 2008
60 <p><a href="http://gravityblast.com/">by Andrea Franz</a></p>
61
62 <div id="content">
63 <div class="example">
64 <h3>Simple</h3>
65 <div class="item first">
66 <h4 class="title">Item 1</h4>
67 <div class="simple_rating rating" id="rating_item_1">
68 <div class="stars">
69 <div class="star on"></div>
70 <div class="star on"></div>
71 <div class="star on"></div>
72 <div class="star on half"></div>
73 <div class="star"></div>
74 </div>
75 <div class="clearer"></div>
76 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
77 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
78 <div class="item second">
79 <h4 class="title">Item 2</h4>
80 <div class="simple_rating rating" id="rating_item_2">
81 <div class="stars">
82 <div class="star on"></div>
83 <div class="star on"></div>
84 <div class="star"></div>
85 <div class="star"></div>
86 <div class="star"></div>
87 </div>
88 <div class="clearer"></div>
89 </div>
90 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
91 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
92 <div class="clearer"></div>
93 <div class="example">
94 <h3>With label</h3>
95 <div class="item second">
96 <h4 class="title">Item 3</h4>
97 <div class="simple_label rating" id="rating_item_3">
98 <div class="stars">
99 <div class="star on"></div>
100 <div class="star on"></div>
101 <div class="star"></div>
102 <div class="star"></div>
103 <div class="star"></div>
104 </div>
105 <div class="label"></div>
106 <div class="clearer"></div>
107 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
108 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
109 <div class="item first">
110 <h4 class="title">Item 4</h4>
111 <div class="simple_label rating" id="rating_item_4">
112 <div class="stars">
113 <div class="star on"></div>
114 <div class="star on"></div>
115 <div class="star"></div>
116 <div class="star"></div>
117 <div class="star"></div>
118 </div>
119 <div class="label"></div>
120 <div class="clearer"></div>
121 </div>
122 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
123 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
124 <div class="clearer"></div>
125 <div class="example">
126 <h3>Custom label</h3>
127 <div class="item second">
128 <h4 class="title">Item 5</h4>
129 <div class="custom_label rating" id="rating_item_5">
130 <div class="stars">
131 <div class="star on"></div>
132 <div class="star on"></div>
133 <div class="star"></div>
134 <div class="star"></div>
135 <div class="star"></div>
136 </div>
137 <div class="label"></div>
138 <div class="clearer"></div>
139 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
140 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
141 <div class="item first">
142 <h4 class="title">Item 6</h4>
143 <div class="custom_label rating" id="rating_item_6">
144 <div class="stars">
145 <div class="star on"></div>
146 <div class="star on"></div>
147 <div class="star"></div>
148 <div class="star"></div>
149 <div class="star"></div>
150 </div>
151 <div class="label"></div>
152 <div class="clearer"></div>
153 </div>
154 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
155 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
156 <div class="clearer"></div>
157 <div class="example">
158 <h3>Custom label template</h3>
159 <div class="item second">
160 <h4 class="title">Item 7</h4>
161 <div class="custom_label_template rating" id="rating_item_7">
162 <div class="stars">
163 <div class="star on"></div>
164 <div class="star on"></div>
165 <div class="star"></div>
166 <div class="star"></div>
167 <div class="star"></div>
168 </div>
169 <div class="label"></div>
170 <div class="clearer"></div>
171 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
172 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
173 <div class="item first">
174 <h4 class="title">Item 8</h4>
175 <div class="custom_label_template rating" id="rating_item_8">
176 <div class="stars">
177 <div class="star on"></div>
178 <div class="star on"></div>
179 <div class="star"></div>
180 <div class="star"></div>
181 <div class="star"></div>
182 </div>
183 <div class="label"></div>
184 <div class="clearer"></div>
185 </div>
186 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
187 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
188 <div class="clearer"></div>
189 <div class="example">
190 <h3>Custom label after rating</h3>
191 <div class="item second">
192 <h4 class="title">Item 9</h4>
193 <div class="custom_label_after_rating rating" id="rating_item_9">
194 <div class="stars">
195 <div class="star on"></div>
196 <div class="star on"></div>
197 <div class="star"></div>
198 <div class="star"></div>
199 <div class="star"></div>
200 </div>
201 <div class="label"></div>
202 <div class="clearer"></div>
203 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
204 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
205 <div class="item first">
206 <h4 class="title">Item 10</h4>
207 <div class="custom_label_after_rating rating" id="rating_item_10">
208 <div class="stars">
209 <div class="star on"></div>
210 <div class="star on"></div>
211 <div class="star"></div>
212 <div class="star"></div>
213 <div class="star"></div>
214 </div>
215 <div class="label"></div>
216 <div class="clearer"></div>
217 </div>
218 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
219 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
220 <div class="clearer"></div>
221 <div class="example">
222 <h3>Not disabled after voting</h3>
223 <div class="item second">
224 <h4 class="title">Item 11</h4>
225 <div class="not_disabled_rating rating" id="rating_item_11">
226 <div class="stars">
227 <div class="star on"></div>
228 <div class="star on"></div>
229 <div class="star"></div>
230 <div class="star"></div>
231 <div class="star"></div>
232 </div>
233 <div class="label"></div>
234 <div class="clearer"></div>
235 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
236 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
237 <div class="item first">
238 <h4 class="title">Item 12</h4>
239 <div class="not_disabled_rating rating" id="rating_item_12">
240 <div class="stars">
241 <div class="star on"></div>
242 <div class="star on"></div>
243 <div class="star"></div>
244 <div class="star"></div>
245 <div class="star"></div>
246 </div>
247 <div class="label"></div>
248 <div class="clearer"></div>
249 </div>
250 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
251 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
252 <div class="clearer"></div>
253 <div class="example">
254 <h3>Custom resetting delay (1 second after mouseout)</h3>
255 <div class="item second">
256 <h4 class="title">Item 13</h4>
257 <div class="custom_delay_rating rating" id="rating_item_13">
258 <div class="stars">
259 <div class="star on"></div>
260 <div class="star on"></div>
261 <div class="star"></div>
262 <div class="star"></div>
263 <div class="star"></div>
264 </div>
265 <div class="label"></div>
266 <div class="clearer"></div>
267 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
268 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
269 <div class="item first">
270 <h4 class="title">Item 14</h4>
271 <div class="custom_delay_rating rating" id="rating_item_14">
272 <div class="stars">
273 <div class="star on"></div>
274 <div class="star on"></div>
275 <div class="star"></div>
276 <div class="star"></div>
277 <div class="star"></div>
278 </div>
279 <div class="label"></div>
280 <div class="clearer"></div>
281 </div>
282 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
283 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
284 <div class="clearer"></div>
285 <div class="example">
286 <h3>After rate callback</h3>
287 <div class="item second">
288 <h4 class="title">Item 15</h4>
289 <div class="after_rate_rating rating" id="rating_item_15">
290 <div class="stars">
291 <div class="star on"></div>
292 <div class="star on"></div>
293 <div class="star"></div>
294 <div class="star"></div>
295 <div class="star"></div>
296 </div>
297 <div class="label"></div>
298 <div class="clearer"></div>
299 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
300 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
301 <div class="item first">
302 <h4 class="title">Item 16</h4>
303 <div class="after_rate_rating rating" id="rating_item_16">
304 <div class="stars">
305 <div class="star on"></div>
306 <div class="star on"></div>
307 <div class="star"></div>
308 <div class="star"></div>
309 <div class="star"></div>
310 </div>
311 <div class="label"></div>
312 <div class="clearer"></div>
313 </div>
314 </div>
ab6911e @pilu Added the element id as variable for templates
authored May 5, 2008
315 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
316 <div class="clearer"></div>
317 <div class="example">
318 <h3>Ajax.Update</h3>
319 <div class="item second">
320 <h4 class="title">Item 17</h4>
321 <div class="ajax_update_rating rating" id="rating_item_17">
322 <div class="stars">
323 <div class="star on"></div>
324 <div class="star on"></div>
325 <div class="star"></div>
326 <div class="star"></div>
327 <div class="star"></div>
328 </div>
329 <div class="label"></div>
330 <div class="clearer"></div>
331 </div>
805c1dc @pilu added starsContainer div
authored May 5, 2008
332 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
333 <div class="item first">
334 <h4 class="title">Item 18</h4>
335 <div class="ajax_update_rating rating" id="rating_item_18">
336 <div class="stars">
337 <div class="star on"></div>
338 <div class="star on"></div>
339 <div class="star"></div>
340 <div class="star"></div>
341 <div class="star"></div>
342 </div>
343 <div class="label"></div>
344 <div class="clearer"></div>
345 </div>
346 </div>
a2d1122 @pilu Removed blank lines
authored May 6, 2008
347 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
348 <div class="clearer"></div>
349 <div class="example">
350 <h3>Ajax.Request (you can test it only with a webserver. Not offline.)</h3>
351 <div class="item second">
352 <h4 class="title">Item 19</h4>
353 <div class="ajax_request_rating rating" id="rating_item_19">
354 <div class="stars">
355 <div class="star on"></div>
356 <div class="star on"></div>
357 <div class="star"></div>
358 <div class="star"></div>
359 <div class="star"></div>
360 </div>
361 <div class="clearer"></div>
362 </div>
a2d1122 @pilu Removed blank lines
authored May 6, 2008
363 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
364 <div class="item first">
365 <h4 class="title">Item 20</h4>
366 <div class="ajax_request_rating rating" id="rating_item_20">
367 <div class="stars">
368 <div class="star on"></div>
369 <div class="star on"></div>
370 <div class="star"></div>
371 <div class="star"></div>
372 <div class="star"></div>
373 </div>
374 <div class="clearer"></div>
375 </div>
376 </div>
a2d1122 @pilu Removed blank lines
authored May 6, 2008
377 </div>
28be41b @pilu changed example page style
authored Jun 21, 2008
378 <div class="clearer"></div>
379 </div>
a2d1122 @pilu Removed blank lines
authored May 6, 2008
380 </div>
59e4bef @pilu initial layout
authored May 4, 2008
381 </body>
382 </html>
Something went wrong with that request. Please try again.