forked from Feng2012/jRating
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·248 lines (229 loc) · 5.93 KB
/
index.php
File metadata and controls
executable file
·248 lines (229 loc) · 5.93 KB
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Plugin jRating : Ajax rating system with jQuery</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="jquery/jRating.jquery.css" type="text/css" />
<style type="text/css">
body {margin:15px;font-family:Arial;font-size:13px}
a img{border:0}
.datasSent, .serverResponse{margin-top:20px;width:470px;height:73px;border:1px solid #F0F0F0;background-color:#F8F8F8;padding:10px;float:left;margin-right:10px}
.datasSent{width:200px;position:fixed;left:680px;top:0}
.serverResponse{position:fixed;left:680px;top:100px}
.datasSent p, .serverResponse p {font-style:italic;font-size:12px}
.exemple{margin-top:15px;}
.clr{clear:both}
pre {margin:0;padding:0}
.notice {background-color:#F4F4F4;color:#666;border:1px solid #CECECE;padding:10px;font-weight:bold;width:600px;font-size:12px;margin-top:10px}
</style>
</head>
<body>
<ul>
<li>Full documentation on <a href="http://www.myjqueryplugins.com/jRating">MyjQueryPlugins.com/jRating</a></li>
<li>Live demonstration on <a href="http://www.myjqueryplugins.com/jRating/demo">jRating demonstration page</a></li>
</ul>
<h1>jRating plugin</h1>
<!-- EXEMPLE 1 : BASIC -->
<div class="exemple">
<em>Exemple 1 (<strong>Basic exemple without options</strong>) :</em>
<div class="basic" data-average="12" data-id="1"></div>
</div>
<div class="notice">
<pre>
<?php
echo htmlentities('<!-- JS to add -->
<script type="text/javascript">
$(document).ready(function(){
$(".bacic").jRating();
});
</script>
');
?>
</pre>
</div>
<!-- EXEMPLE 2 -->
<div class="exemple">
<em>Exemple 2 (type : <strong>small</strong> - average <strong>10</strong> - id <strong>2</strong> - <strong>40</strong> stars) :</em>
<div class="exemple2" data-average="10" data-id="2"></div>
</div>
<div class="notice">
<pre>
<?php
echo htmlentities('<!-- JS to add -->
<script type="text/javascript">
$(document).ready(function(){
$(".exemple2").jRating({
type:\'small\', // type of the rate.. can be set to \'small\' or \'big\'
length : 40, // nb of stars
decimalLength : 1 // number of decimal in the rate
});
});
</script>
');
?>
</pre>
</div>
<!-- EXEMPLE 3 -->
<div class="exemple">
<em>Exemple 3 (step : <strong>true</strong> - average <strong>18</strong> - id <strong>3</strong> - <strong>15</strong> stars) :</em>
<div class="exemple3" data-average="18" data-id="3"></div>
</div>
<div class="notice">
<pre>
<?php
echo htmlentities('<!-- JS to add -->
<script type="text/javascript">
$(document).ready(function(){
$(".exemple3").jRating({
step:true, // no half-star when mousemove
length : 20, // nb of stars
decimalLength:0 // number of decimal in the rate
});
});
</script>
');
?>
</pre>
</div>
<!-- EXEMPLE 4 -->
<div class="exemple">
<em>Exemple 4 (<strong>Rate is disabled</strong>) :</em>
<div class="exemple4" data-average="10" data-id="4"></div>
</div>
<div class="notice">
<pre>
<?php
echo htmlentities('<!-- JS to add -->
<script type="text/javascript">
$(document).ready(function(){
$(".exemple4").jRating({
isDisabled : true
});
});
</script>
');
?>
</pre>
</div>
<!-- EXEMPLE 5 -->
<div class="exemple">
<em>Exemple 5 (<strong>With onSuccess & onError methods</strong>) :</em>
<div class="exemple5" data-average="10" data-id="5"></div>
</div>
<div class="notice">
<pre>
<?php
echo htmlentities('<!-- JS to add -->
<script type="text/javascript">
$(document).ready(function(){
$(".exemple5").jRating({
length:10,
decimalLength:1,
onSuccess : function(){
alert(\'Success : your rate has been saved :)\');
},
onError : function(){
alert(\'Error : please retry\');
}
});
});
</script>
');
?>
</pre>
</div>
<!-- EXEMPLE 6 -->
<div class="exemple">
<em>Exemple 6 (<strong>Disabled rate info</strong>) :</em>
<div class="exemple6" data-average="10" data-id="6"></div>
</div>
<div class="notice">
<pre>
<?php
echo htmlentities('<!-- JS to add -->
<script type="text/javascript">
$(document).ready(function(){
$(".exemple6").jRating({
length:10,
decimalLength:1,
showRateInfo:false
});
});
</script>
');
?>
</pre>
</div>
<!-- EXEMPLE 7 -->
<div class="exemple">
<em>Exemple 7 (<strong>Can rate 3 times !</strong>) :</em>
<div class="exemple7" data-average="10" data-id="7"></div>
</div>
<div class="notice">
<pre>
<?php
echo htmlentities('<!-- JS to add -->
<script type="text/javascript">
$(document).ready(function(){
$(".exemple7").jRating({
step:true,
length : 20,
canRateAgain : true,
nbRates : 3
});
});
</script>
');
?>
</pre>
</div>
<div class="datasSent">
Datas sent to the server :
<p></p>
</div>
<div class="serverResponse">
Server response :
<p></p>
</div>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript" src="jquery/jRating.jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.basic').jRating();
$('.exemple2').jRating({
type:'small',
length : 40,
decimalLength : 1,
});
$('.exemple3').jRating({
step:true,
length : 20
});
$('.exemple4').jRating({
isDisabled : true
});
$('.exemple5').jRating({
length:10,
decimalLength:1,
onSuccess : function(){
alert('Success : your rate has been saved :)');
},
onError : function(){
alert('Error : please retry');
}
});
$(".exemple6").jRating({
length:10,
decimalLength:1,
showRateInfo:false
});
$('.exemple7').jRating({
step:true,
length : 20,
canRateAgain : true,
nbRates : 3
});
});
</script>
</body>
</html>