Yasr – Yet Another Stars Rating - Version 1.8.0

Version Description

  • This is a very important release. A lot of code has been cleaned up/rewritten. Images are not png anymore, but svg. Everthing is now fresher and even more lightweight then before. If you customized your stars set, check it again in the settings.
Download this release

Release Info

Developer Dudo
Plugin Icon 128x128 Yasr – Yet Another Stars Rating
Version 1.8.0
Comparing to
See all releases

Code changes from version 1.7.4 to 1.8.0

Files changed (45) hide show
  1. css/yasr-admin.css +13 -150
  2. css/yasr.css +1 -203
  3. freemius/languages/freemius-it_IT.mo +0 -0
  4. freemius/languages/freemius-it_IT.po +11 -13
  5. img/Yasr-Stylish.png +0 -0
  6. img/create-ranking.png +0 -0
  7. img/dark-multi-set.png +0 -0
  8. img/delete.gif +0 -0
  9. img/star.png +0 -0
  10. img/stars24.png +0 -0
  11. img/stars32.png +0 -0
  12. img/stars_16_flat.png +0 -0
  13. img/stars_24_flat.png +0 -0
  14. img/stars_32_flat.png +0 -0
  15. img/stars_rater.png +0 -0
  16. img/stars_rater_yasr.png +0 -0
  17. img/yasr-pro-stars.png +0 -0
  18. img/yasr-stars-large.png +0 -0
  19. img/yasr-stars-medium.png +0 -0
  20. img/yasr-stars-small.png +0 -0
  21. img/yasr-stylish-stars.png +0 -0
  22. img/yasr-user-reviews.png +0 -0
  23. img/yasr_review.png +0 -0
  24. js/jquery.rateit.min.js +0 -5
  25. js/jquery.rateit.min.js.map +0 -1
  26. js/yasr-admin.js +134 -230
  27. js/yasr-front.js +40 -330
  28. languages/yet-another-stars-rating-it_IT.mo +0 -0
  29. languages/yet-another-stars-rating-it_IT.po +559 -541
  30. languages/yet-another-stars-rating.pot +941 -486
  31. lib/settings/yasr-settings-functions-misc.php +194 -0
  32. lib/settings/yasr-settings-functions-multiset.php +828 -0
  33. lib/settings/yasr-settings-functions-style.php +123 -0
  34. lib/settings/yasr-settings-functions.php +650 -0
  35. lib/yasr-admin-actions.php +9 -34
  36. lib/yasr-ajax-functions.php +19 -211
  37. lib/yasr-db-functions.php +108 -23
  38. lib/yasr-functions.php +45 -83
  39. lib/yasr-settings-functions.php +0 -1829
  40. lib/yasr-shortcode-functions.php +46 -144
  41. readme.txt +10 -6
  42. yasr-metabox-multiple-rating.php +32 -31
  43. yasr-metabox-top-right.php +3 -15
  44. yasr-settings-page.php +1 -1
  45. yet-another-stars-rating.php +9 -34
css/yasr-admin.css CHANGED
@@ -44,156 +44,6 @@
44
}
45
46
47
-
48
-
49
- /****** Rate it rules *****/
50
-
51
- .rateit {
52
- display: -moz-inline-box;
53
- display: inline-block;
54
- position: relative;
55
- -webkit-user-select: none;
56
- -khtml-user-select: none;
57
- -moz-user-select: none;
58
- -o-user-select: none;
59
- -ms-user-select: none;
60
- user-select: none;
61
- -webkit-touch-callout: none;
62
- }
63
-
64
- .rateit .rateit-range
65
- {
66
- position: relative;
67
- display: -moz-inline-box;
68
- display: inline-block;
69
- height: 16px;
70
- outline: none;
71
- }
72
-
73
- .rateit .rateit-range * {
74
- display:block;
75
- }
76
-
77
- /* for IE 6 */
78
- * html .rateit, * html .rateit .rateit-range
79
- {
80
- display: inline;
81
- }
82
-
83
- /* for IE 7 */
84
- * + html .rateit, * + html .rateit .rateit-range
85
- {
86
- display: inline;
87
- }
88
-
89
- .rateit .rateit-hover, .rateit .rateit-selected
90
- {
91
- position: absolute;
92
- left: 0px;
93
- }
94
-
95
- .rateit .rateit-hover-rtl, .rateit .rateit-selected-rtl
96
- {
97
- left: auto;
98
- right: 0px;
99
- }
100
-
101
-
102
- .rateit .rateit-hover-rtl
103
- {
104
- background-position: right -16px;
105
- }
106
-
107
- .rateit .rateit-selected-rtl
108
- {
109
- background-position: right -32px;
110
- }
111
-
112
- .rateit .rateit-preset
113
- {
114
- background: url('../img/star.png') left -48px;
115
- }
116
-
117
- .rateit .rateit-preset-rtl
118
- {
119
- background: url('../img/star.png') left -48px;
120
- }
121
-
122
- .rateit button.rateit-reset
123
- {
124
- background: url('../img/delete.gif') 0 0;
125
- width: 16px;
126
- height: 16px;
127
- display: -moz-inline-box;
128
- display: inline-block;
129
- float: left;
130
- outline: none;
131
- border:none;
132
- padding: 0;
133
- }
134
-
135
- .rateit button.rateit-reset:hover, .rateit button.rateit-reset:focus
136
- {
137
- background-position: 0 -16px;
138
- }
139
-
140
- .yasr_settings_fields_content {
141
- background-color: #F7F7F7;
142
- }
143
-
144
-
145
- /* Creating set 24px image . */
146
-
147
- div.medium .rateit-range
148
- {
149
- /*White*/
150
- width: 24px;
151
- height: 24px;
152
- }
153
-
154
- div.medium .rateit-hover
155
- {
156
- /*Red*/
157
- width: 24px;
158
- height: 24px;
159
- display: none
160
-
161
- }
162
-
163
- div.medium .rateit-selected
164
- {
165
- /*Yellow*/
166
- width: 24px;
167
- height: 24px;
168
- }
169
-
170
- /* Creating set 32 */
171
-
172
- div.bigstars .rateit-range
173
- {
174
- /*White*/
175
- width: 32px;
176
- height: 32px;
177
- }
178
-
179
- div.bigstars .rateit-hover
180
- {
181
- /*red*/
182
- width: 32px;
183
- height: 32px;
184
- display: none
185
- }
186
-
187
- div.bigstars .rateit-selected
188
- {
189
- /*Gold*/
190
- width: 32px;
191
- height: 32px;
192
- }
193
-
194
- /*************** End rateit rules ***************/
195
-
196
-
197
/********** Edit post / page rules **********/
198
199
/*** Metabox top right ***/
@@ -231,6 +81,19 @@ div.bigstars .rateit-selected
231
display: block;
232
}
233
234
/**************** Settings page *******************/
235
236
/*** Top menu navigation ***/
44
}
45
46
47
/********** Edit post / page rules **********/
48
49
/*** Metabox top right ***/
81
display: block;
82
}
83
84
+ /**** Metabox multi ****/
85
+ #yasr-multi-set-admin-choose-text {
86
+ display:none;
87
+ margin-bottom: 15px;
88
+ margin-top: 10px;
89
+ }
90
+
91
+ #yasr-multi-set-admin-explain {
92
+ display: none;
93
+ margin-top: 20px;
94
+ margin-left: 20px;
95
+ }
96
+
97
/**************** Settings page *******************/
98
99
/*** Top menu navigation ***/
css/yasr.css CHANGED
@@ -2,7 +2,6 @@
2
width: 0;
3
position: relative;
4
display:inline-block;
5
- background-image: url(../img/star_2.svg);
6
background-position: 0 0;
7
background-repeat: repeat-x;
8
}
@@ -39,204 +38,9 @@
39
position: absolute;
40
height: 100%;
41
width: 100%;
42
- background: url('../img/star_3.svg') ;
43
background-repeat: repeat-x;
44
}
45
46
-
47
-
48
-
49
- /****** Rate it rules *****/
50
-
51
- .rateit {
52
- display: -moz-inline-box;
53
- display: inline-block;
54
- position: relative;
55
- -webkit-user-select: none;
56
- -khtml-user-select: none;
57
- -moz-user-select: none;
58
- -o-user-select: none;
59
- -ms-user-select: none;
60
- user-select: none;
61
- -webkit-touch-callout: none;
62
- }
63
-
64
-
65
- /*.rateit .rateit-range * {
66
- display:block;
67
- }*/
68
-
69
- /* for IE 6 */
70
- * html .rateit, * html .rateit .rateit-range
71
- {
72
- display: inline;
73
- }
74
-
75
- /* for IE 7 */
76
- * + html .rateit, * + html .rateit .rateit-range
77
- {
78
- display: inline;
79
- }
80
-
81
- .rateit .rateit-hover, .rateit .rateit-selected
82
- {
83
- position: absolute;
84
- left: 0px;
85
- }
86
-
87
- .rateit .rateit-range
88
- {
89
- position: relative;
90
- display: -moz-inline-box;
91
- display: inline-block;
92
- height: 16px;
93
- outline: none;
94
- vertical-align: -5px;
95
- }
96
-
97
-
98
- /* Creating set 24px image . */
99
-
100
- div.medium .rateit-range
101
- {
102
- /*White*/
103
- width: 24px;
104
- height: 24px;
105
- }
106
-
107
- div.medium .rateit-hover
108
- {
109
- /*Red*/
110
- width: 24px;
111
- height: 24px;
112
- display: none
113
-
114
- }
115
-
116
- div.medium .rateit-selected
117
- {
118
- /*Yellow*/
119
- width: 24px;
120
- height: 24px;
121
- }
122
-
123
- /* Creating set 32 */
124
-
125
- div.bigstars .rateit-range
126
- {
127
- /*White*/
128
- width: 32px;
129
- height: 32px;
130
- }
131
-
132
- div.bigstars .rateit-hover
133
- {
134
- /*red*/
135
- width: 32px;
136
- height: 32px;
137
- display: none
138
- }
139
-
140
- div.bigstars .rateit-selected
141
- {
142
- /*Gold*/
143
- width: 32px;
144
- height: 32px;
145
- }
146
-
147
-
148
- .rateit button.rateit-reset
149
- {
150
- background: url('../img/delete.gif') 0 0;
151
- width: 16px;
152
- height: 16px;
153
- display: -moz-inline-box;
154
- display: inline-block;
155
- float: left;
156
- outline: none;
157
- border:none;
158
- padding: 0;
159
- }
160
-
161
- .rateit button.rateit-reset:hover, .rateit button.rateit-reset:focus
162
- {
163
- background-position: 0 -16px;
164
- }
165
-
166
-
167
- /*** Rate it font ***/
168
-
169
- .rateit-font {
170
- font-size: 24px;
171
- line-height: 1em;
172
- }
173
-
174
- .rateit-font .rateit-range {
175
- background: none;
176
- height: auto;
177
- }
178
-
179
- .rateit-font .rateit-empty {
180
- color: #ccc;
181
- }
182
-
183
- .rateit-font .rateit-range > div {
184
- background: none;
185
- overflow: hidden;
186
- cursor: default;
187
- }
188
-
189
- .rateit.rateit-font .rateit-reset {
190
- font-size: inherit;
191
- background: none;
192
- width: 0.6em;
193
- height: 0.6em;
194
- margin-top: 0.2em;
195
- background: gray;
196
- border-radius: 50%;
197
- position: relative;
198
- }
199
-
200
- .rateit.rateit-font .rateit-reset span {
201
- display: block;
202
- font-weight: bold;
203
- color: white;
204
- height: calc(50% - 0.045em);
205
- top: 0;
206
- position: absolute;
207
- border-bottom: 0.09em solid white;
208
- width: 72%;
209
- margin-left: 14%;
210
- }
211
-
212
-
213
- .rateit.rateit-font .rateit-reset:hover, .rateit.rateit-font button.rateit-reset:focus {
214
- background: #e6574b; /* Old browsers */
215
- background: radial-gradient(ellipse at center, #e6574b 55%,#f6836b 77%,#f9d3cc 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
216
- background-position: 0 0;
217
- }
218
-
219
- /*** RTL RULES, thank's to Arik Numlock ***/
220
-
221
- .rateit .rateit-hover.rateit-hover-rtl, .rateit .rateit-selected.rateit-selected-rtl {
222
-
223
- -moz-transform: scaleX(-1);
224
- -o-transform: scaleX(-1);
225
-
226
- -webkit-transform: scaleX(-1);
227
- transform: scaleX(-1);
228
- filter: FlipH;
229
- -ms-filter: "FlipH";
230
- right: 0;
231
- left: auto;
232
-
233
- }
234
-
235
- /****** End rateit rules ******/
236
-
237
-
238
-
239
-
240
/****** NON ADMIN RULES ******/
241
242
.yasr_schema{
@@ -278,6 +82,7 @@ div.bigstars .rateit-selected
278
vertical-align: bottom !important;
279
text-decoration: none;
280
cursor: pointer;
281
}
282
283
.yasr-total-average-text-medium {
@@ -310,21 +115,15 @@ div.bigstars .rateit-selected
310
/*** Widgets ***/
311
312
.yasr-widget-recent-ratings-table {
313
-
314
border: none;
315
-
316
}
317
318
.yasr-widget-recent-ratings-td {
319
-
320
border: none;
321
-
322
}
323
324
.yasr-widget-recent-ratings-text {
325
-
326
font-weight: bold;
327
-
328
}
329
330
@@ -403,7 +202,6 @@ yasr_pro_comment_reviews_stats shortcode too***/
403
404
/*** Tooltip ***/
405
406
-
407
.yasr-w3-container:after,.yasr-w3-container:before{content:"";display:table;clear:both}
408
.yasr-w3-border-0{border:0!important}.yasr-w3-border{border:1px solid #ccc!important; background: linear-gradient(to bottom,#eee,#f6f6f6);}
409
.yasr-w3-border-top{border-top:1px solid #ccc!important}.yasr-w3-border-bottom{border-bottom:1px solid #ccc!important}
2
width: 0;
3
position: relative;
4
display:inline-block;
5
background-position: 0 0;
6
background-repeat: repeat-x;
7
}
38
position: absolute;
39
height: 100%;
40
width: 100%;
41
background-repeat: repeat-x;
42
}
43
44
/****** NON ADMIN RULES ******/
45
46
.yasr_schema{
82
vertical-align: bottom !important;
83
text-decoration: none;
84
cursor: pointer;
85
+ height: 25px;
86
}
87
88
.yasr-total-average-text-medium {
115
/*** Widgets ***/
116
117
.yasr-widget-recent-ratings-table {
118
border: none;
119
}
120
121
.yasr-widget-recent-ratings-td {
122
border: none;
123
}
124
125
.yasr-widget-recent-ratings-text {
126
font-weight: bold;
127
}
128
129
202
203
/*** Tooltip ***/
204
205
.yasr-w3-container:after,.yasr-w3-container:before{content:"";display:table;clear:both}
206
.yasr-w3-border-0{border:0!important}.yasr-w3-border{border:1px solid #ccc!important; background: linear-gradient(to bottom,#eee,#f6f6f6);}
207
.yasr-w3-border-top{border-top:1px solid #ccc!important}.yasr-w3-border-bottom{border-bottom:1px solid #ccc!important}
freemius/languages/freemius-it_IT.mo CHANGED
Binary file
freemius/languages/freemius-it_IT.po CHANGED
@@ -10,7 +10,7 @@ msgstr ""
10
"Project-Id-Version: WordPress SDK\n"
11
"Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
12
"POT-Creation-Date: \n"
13
- "PO-Revision-Date: 2018-11-25 07:22+0000\n"
14
"Last-Translator: Vova Feldman <vova@freemius.com>\n"
15
"Language: it_IT\n"
16
"Language-Team: Italian (Italy) (http://www.transifex.com/freemius/wordpress-sdk/language/it_IT/)\n"
@@ -20,9 +20,10 @@ msgstr ""
20
"MIME-Version: 1.0\n"
21
"X-Poedit-Basepath: ..\n"
22
"X-Poedit-KeywordsList: get_text_inline;fs_text_inline;fs_echo_inline;fs_esc_js_inline;fs_esc_attr_inline;fs_esc_attr_echo_inline;fs_esc_html_inline;fs_esc_html_echo_inline;get_text_x_inline:1,2c;fs_text_x_inline:1,2c;fs_echo_x_inline:1,2c;fs_esc_attr_x_inline:1,2c;fs_esc_js_x_inline:1,2c;fs_esc_js_echo_x_inline:1,2c;fs_esc_html_x_inline:1,2c;fs_esc_html_echo_x_inline:1,2c\n"
23
"X-Poedit-SearchPath-0: .\n"
24
"X-Poedit-SearchPathExcluded-0: *.js\n"
25
- "X-Poedit-SourceCharset: UTF-8\n"
26
27
#: includes/class-freemius.php:1602
28
msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
@@ -180,7 +181,7 @@ msgstr "Errore API inaspettato. Contatta l'autore di %s con il seguente errore."
180
181
#: includes/class-freemius.php:5006
182
msgid "Premium %s version was successfully activated."
183
- msgstr "La versione 1%s Permium è stata attivata con successo."
184
185
#: includes/class-freemius.php5018, includes/class-freemius.php:6862
186
msgctxt ""
@@ -251,8 +252,7 @@ msgstr "L'aggiornamento di %s è stato completato con successo."
251
252
#: includes/class-freemius.php8705, includes/class-fs-plugin-updater.php882,
253
#: includes/class-fs-plugin-updater.php1077,
254
- #: includes/class-fs-plugin-updater.php1084,
255
- #: templates/auto-installation.php:32
256
msgid "Add-On"
257
msgstr "Add-on"
258
@@ -285,12 +285,12 @@ msgstr "Account in attesa di attivazione."
285
#: includes/class-freemius.php11653,
286
#: templates/forms/premium-versions-upgrade-handler.php:47
287
msgid "Buy a license now"
288
- msgstr "Buy a license now"
289
290
#: includes/class-freemius.php11665,
291
#: templates/forms/premium-versions-upgrade-handler.php:46
292
msgid "Renew your license now"
293
- msgstr "Renew your license now"
294
295
#: includes/class-freemius.php:11669
296
msgid "%s to access version %s security & feature updates, and support."
@@ -980,14 +980,12 @@ msgstr "Licenze illimitate"
980
msgid "Up to %s Sites"
981
msgstr "Fino a %s siti"
982
983
- #: includes/fs-plugin-info-dialog.php792,
984
- #: templates/plugin-info/features.php:82
985
msgctxt "as monthly period"
986
msgid "mo"
987
msgstr "mese"
988
989
- #: includes/fs-plugin-info-dialog.php799,
990
- #: templates/plugin-info/features.php:80
991
msgctxt "as annual period"
992
msgid "year"
993
msgstr "anno"
@@ -1912,8 +1910,8 @@ msgstr "Nome della compagnia"
1912
msgid "Tax / VAT ID"
1913
msgstr "Numero Partita Iva o VAT"
1914
1915
- #: templates/account/billing.php48, templates/account/billing.php48,
1916
- #: templates/account/billing.php49, templates/account/billing.php:49
1917
msgid "Address Line %d"
1918
msgstr "Riga indirizzo %d"
1919
10
"Project-Id-Version: WordPress SDK\n"
11
"Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
12
"POT-Creation-Date: \n"
13
+ "PO-Revision-Date: 2018-12-23 14:32+0100\n"
14
"Last-Translator: Vova Feldman <vova@freemius.com>\n"
15
"Language: it_IT\n"
16
"Language-Team: Italian (Italy) (http://www.transifex.com/freemius/wordpress-sdk/language/it_IT/)\n"
20
"MIME-Version: 1.0\n"
21
"X-Poedit-Basepath: ..\n"
22
"X-Poedit-KeywordsList: get_text_inline;fs_text_inline;fs_echo_inline;fs_esc_js_inline;fs_esc_attr_inline;fs_esc_attr_echo_inline;fs_esc_html_inline;fs_esc_html_echo_inline;get_text_x_inline:1,2c;fs_text_x_inline:1,2c;fs_echo_x_inline:1,2c;fs_esc_attr_x_inline:1,2c;fs_esc_js_x_inline:1,2c;fs_esc_js_echo_x_inline:1,2c;fs_esc_html_x_inline:1,2c;fs_esc_html_echo_x_inline:1,2c\n"
23
+ "X-Poedit-SourceCharset: UTF-8\n"
24
+ "X-Generator: Poedit 2.0.6\n"
25
"X-Poedit-SearchPath-0: .\n"
26
"X-Poedit-SearchPathExcluded-0: *.js\n"
27
28
#: includes/class-freemius.php:1602
29
msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
181
182
#: includes/class-freemius.php:5006
183
msgid "Premium %s version was successfully activated."
184
+ msgstr "La versione %s Permium è stata attivata con successo."
185
186
#: includes/class-freemius.php5018, includes/class-freemius.php:6862
187
msgctxt ""
252
253
#: includes/class-freemius.php8705, includes/class-fs-plugin-updater.php882,
254
#: includes/class-fs-plugin-updater.php1077,
255
+ #: includes/class-fs-plugin-updater.php1084, templates/auto-installation.php:32
256
msgid "Add-On"
257
msgstr "Add-on"
258
285
#: includes/class-freemius.php11653,
286
#: templates/forms/premium-versions-upgrade-handler.php:47
287
msgid "Buy a license now"
288
+ msgstr "Compra una licenza ora"
289
290
#: includes/class-freemius.php11665,
291
#: templates/forms/premium-versions-upgrade-handler.php:46
292
msgid "Renew your license now"
293
+ msgstr "Rinnova la tua licenza ora"
294
295
#: includes/class-freemius.php:11669
296
msgid "%s to access version %s security & feature updates, and support."
980
msgid "Up to %s Sites"
981
msgstr "Fino a %s siti"
982
983
+ #: includes/fs-plugin-info-dialog.php792, templates/plugin-info/features.php:82
984
msgctxt "as monthly period"
985
msgid "mo"
986
msgstr "mese"
987
988
+ #: includes/fs-plugin-info-dialog.php799, templates/plugin-info/features.php:80
989
msgctxt "as annual period"
990
msgid "year"
991
msgstr "anno"
1910
msgid "Tax / VAT ID"
1911
msgstr "Numero Partita Iva o VAT"
1912
1913
+ #: templates/account/billing.php48, templates/account/billing.php49,
1914
+ #: templates/account/billing.php:49
1915
msgid "Address Line %d"
1916
msgstr "Riga indirizzo %d"
1917
img/Yasr-Stylish.png CHANGED
Binary file
img/create-ranking.png CHANGED
Binary file
img/dark-multi-set.png CHANGED
Binary file
img/delete.gif DELETED
Binary file
img/star.png DELETED
Binary file
img/stars24.png DELETED
Binary file
img/stars32.png DELETED
Binary file
img/stars_16_flat.png DELETED
Binary file
img/stars_24_flat.png DELETED
Binary file
img/stars_32_flat.png DELETED
Binary file
img/stars_rater.png ADDED
Binary file
img/stars_rater_yasr.png ADDED
Binary file
img/yasr-pro-stars.png ADDED
Binary file
img/yasr-stars-large.png CHANGED
Binary file
img/yasr-stars-medium.png CHANGED
Binary file
img/yasr-stars-small.png CHANGED
Binary file
img/yasr-stylish-stars.png DELETED
Binary file
img/yasr-user-reviews.png CHANGED
Binary file
img/yasr_review.png CHANGED
Binary file
js/jquery.rateit.min.js DELETED
@@ -1,5 +0,0 @@
1
- /*! RateIt | v1.1.0 / 10/20/2016
2
- https://github.com/gjunge/rateit.js | Twitter: @gjunge
3
- */
4
- !function(e){function t(e){var t=e.originalEvent.changedTouches,a=t[0],i="";switch(e.type){case"touchmove":i="mousemove";break;case"touchend":i="mouseup";break;default:return}var r=document.createEvent("MouseEvent");r.initMouseEvent(i,!0,!0,window,1,a.screenX,a.screenY,a.clientX,a.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(r),e.preventDefault()}e.rateit={aria:{resetLabel:"reset rating",ratingLabel:"rating"}},e.fn.rateit=function(a,i){var r=1,n={},s="init",d=function(e){return e.charAt(0).toUpperCase()+e.substr(1)};if(0===this.length)return this;var l=e.type(a);if("object"==l||void 0===a||null===a)n=e.extend({},e.fn.rateit.defaults,a);else{if("string"==l&&"reset"!==a&&void 0===i)return this.data("rateit"+d(a));"string"==l&&(s="setvalue")}return this.each(function(){var l=e(this),o=function(e,t){if(null!=t){var a="aria-value"+("value"==e?"now":e),i=l.find(".rateit-range");void 0!=i.attr(a)&&i.attr(a,t)}return arguments[0]="rateit"+d(e),l.data.apply(l,arguments)};if("reset"==a){var u=o("init");for(var v in u)l.data(v,u[v]);if(o("backingfld")){var m=e(o("backingfld"));"SELECT"==m[0].nodeName&&"index"===m[0].getAttribute("data-rateit-valuesrc")?m.prop("selectedIndex",o("value")):m.val(o("value")),m.trigger("change"),m[0].min&&(m[0].min=o("min")),m[0].max&&(m[0].max=o("max")),m[0].step&&(m[0].step=o("step"))}l.trigger("reset")}l.hasClass("rateit")||l.addClass("rateit");var h="rtl"!=l.css("direction");if("setvalue"==s){if(!o("init"))throw"Can't set value before init";if("readonly"!=a||1!=i||o("readonly")||(l.find(".rateit-range").unbind(),o("wired",!1)),"value"==a&&(i=null==i?o("min"):Math.max(o("min"),Math.min(o("max"),i))),o("backingfld")){var m=e(o("backingfld"));"SELECT"==m[0].nodeName&&"index"===m[0].getAttribute("data-rateit-valuesrc")?"value"==a&&m.prop("selectedIndex",i):"value"==a&&m.val(i),"min"==a&&m[0].min&&(m[0].min=i),"max"==a&&m[0].max&&(m[0].max=i),"step"==a&&m[0].step&&(m[0].step=i)}o(a,i)}if(!o("init")){if(o("mode",o("mode")||n.mode),o("icon",o("icon")||n.icon),o("min",isNaN(o("min"))?n.min:o("min")),o("max",isNaN(o("max"))?n.max:o("max")),o("step",o("step")||n.step),o("readonly",void 0!==o("readonly")?o("readonly"):n.readonly),o("resetable",void 0!==o("resetable")?o("resetable"):n.resetable),o("backingfld",o("backingfld")||n.backingfld),o("starwidth",o("starwidth")||n.starwidth),o("starheight",o("starheight")||n.starheight),o("value",Math.max(o("min"),Math.min(o("max"),isNaN(o("value"))?isNaN(n.value)?n.min:n.value:o("value")))),o("ispreset",void 0!==o("ispreset")?o("ispreset"):n.ispreset),o("backingfld")){var m=e(o("backingfld")).hide();if((m.attr("disabled")||m.attr("readonly"))&&o("readonly",!0),"INPUT"==m[0].nodeName&&("range"!=m[0].type&&"text"!=m[0].type||(o("min",parseInt(m.attr("min"))||o("min")),o("max",parseInt(m.attr("max"))||o("max")),o("step",parseInt(m.attr("step"))||o("step")))),"SELECT"==m[0].nodeName&&m[0].options.length>1){"index"===m[0].getAttribute("data-rateit-valuesrc")?(o("min",isNaN(o("min"))?Number(m[0].options[0].index):o("min")),o("max",Number(m[0].options[m[0].length-1].index)),o("step",Number(m[0].options[1].index)-Number(m[0].options[0].index))):(o("min",isNaN(o("min"))?Number(m[0].options[0].value):o("min")),o("max",Number(m[0].options[m[0].length-1].value)),o("step",Number(m[0].options[1].value)-Number(m[0].options[0].value)));var c=m.find("option[selected]");1==c.length&&("index"===m[0].getAttribute("data-rateit-valuesrc")?o("value",c[0].index):o("value",c.val()))}else o("value",m.val())}var g="DIV"==l[0].nodeName?"div":"span";r++;var f='<button id="rateit-reset-{{index}}" type="button" data-role="none" class="rateit-reset" aria-label="'+e.rateit.aria.resetLabel+'" aria-controls="rateit-range-{{index}}"><span></span></button><{{element}} id="rateit-range-{{index}}" class="rateit-range" tabindex="0" role="slider" aria-label="'+e.rateit.aria.ratingLabel+'" aria-owns="rateit-reset-{{index}}" aria-valuemin="'+o("min")+'" aria-valuemax="'+o("max")+'" aria-valuenow="'+o("value")+'"><{{element}} class="rateit-empty"></{{element}}><{{element}} class="rateit-selected"></{{element}}><{{element}} class="rateit-hover"></{{element}}></{{element}}>';l.append(f.replace(/{{index}}/gi,r).replace(/{{element}}/gi,g)),h||(l.find(".rateit-reset").css("float","right"),l.find(".rateit-selected").addClass("rateit-selected-rtl"),l.find(".rateit-hover").addClass("rateit-hover-rtl")),"font"==o("mode")?l.addClass("rateit-font").removeClass("rateit-bg"):l.addClass("rateit-bg").removeClass("rateit-font"),o("init",JSON.parse(JSON.stringify(l.data())))}var p="font"==o("mode");p||l.find(".rateit-selected, .rateit-hover").height(o("starheight"));var b=l.find(".rateit-range");if(p){for(var x=o("icon"),w=o("max")-o("min"),N="",y=0;y<w;y++)N+=x;b.find("> *").text(N),o("starwidth",b.width()/(o("max")-o("min")))}else b.width(o("starwidth")*(o("max")-o("min"))).height(o("starheight"));var C="rateit-preset"+(h?"":"-rtl");if(o("ispreset")?l.find(".rateit-selected").addClass(C):l.find(".rateit-selected").removeClass(C),null!=o("value")){var k=(o("value")-o("min"))*o("starwidth");l.find(".rateit-selected").width(k)}var E=l.find(".rateit-reset");E.data("wired")!==!0&&E.bind("click",function(t){t.preventDefault(),E.blur();var a=e.Event("beforereset");return l.trigger(a),!a.isDefaultPrevented()&&(l.rateit("value",null),void l.trigger("reset"))}).data("wired",!0);var M=function(t,a){var i=a.changedTouches?a.changedTouches[0].pageX:a.pageX,r=i-e(t).offset().left;return h||(r=b.width()-r),r>b.width()&&(r=b.width()),r<0&&(r=0),k=Math.ceil(r/o("starwidth")*(1/o("step")))},I=function(e){var t=e*o("starwidth")*o("step"),a=b.find(".rateit-hover");if(a.data("width")!=t){b.find(".rateit-selected").hide(),a.width(t).show().data("width",t);var i=[e*o("step")+o("min")];l.trigger("hover",i).trigger("over",i)}},L=function(t){var a=e.Event("beforerated");return l.trigger(a,[t]),!a.isDefaultPrevented()&&(o("value",t),o("backingfld")&&("SELECT"==m[0].nodeName&&"index"===m[0].getAttribute("data-rateit-valuesrc")?e(o("backingfld")).prop("selectedIndex",t).trigger("change"):e(o("backingfld")).val(t).trigger("change")),o("ispreset")&&(b.find(".rateit-selected").removeClass(C),o("ispreset",!1)),b.find(".rateit-hover").hide(),b.find(".rateit-selected").width(t*o("starwidth")-o("min")*o("starwidth")).show(),l.trigger("hover",[null]).trigger("over",[null]).trigger("rated",[t]),!0)};o("readonly")?E.hide():(o("resetable")||E.hide(),o("wired")||(b.bind("touchmove touchend",t),b.mousemove(function(e){var t=M(this,e);I(t)}),b.mouseleave(function(e){b.find(".rateit-hover").hide().width(0).data("width",""),l.trigger("hover",[null]).trigger("over",[null]),b.find(".rateit-selected").show()}),b.mouseup(function(e){var t=M(this,e),a=t*o("step")+o("min");L(a),b.blur()}),b.keyup(function(e){38!=e.which&&e.which!=(h?39:37)||L(Math.min(o("value")+o("step"),o("max"))),40!=e.which&&e.which!=(h?37:39)||L(Math.max(o("value")-o("step"),o("min")))}),o("wired",!0)),o("resetable")&&E.show()),b.attr("aria-readonly",o("readonly"))})},e.fn.rateit.defaults={min:0,max:5,step:.5,mode:"bg",icon:"★",starwidth:16,starheight:16,readonly:!1,resetable:!0,ispreset:!1},e(function(){e("div.rateit, span.rateit").rateit()})}(jQuery);
5
- //# sourceMappingURL=jquery.rateit.min.js.map
js/jquery.rateit.min.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["jquery.rateit.js"],"names":["quot;,"touchHandler","event","touches","originalEvent","changedTouches","first","type","simulatedEvent","document","createEvent","initMouseEvent","window","screenX","screenY","clientX","clientY","target","dispatchEvent","preventDefault","rateit","aria","resetLabel","ratingLabel","fn","p1","p2","index","options","mode","capitaliseFirstLetter","string","charAt","toUpperCase","substr","this","length","tp1","undefined","extend","defaults","data","each","item","itemdata","key","value","ariakey","range","find","attr","arguments","apply","setup","prop","fld","nodeName","getAttribute","val","trigger","min","max","step","hasClass","addClass","ltr","css","unbind","Math","icon","isNaN","readonly","resetable","backingfld","starwidth","starheight","ispreset","hide","parseInt","Number","selectedOption","element","html","append","replace","removeClass","JSON","parse","stringify","isfont","height","stars","txt","i","text","width","presetclass","score","resetbtn","bind","e","blur","Event","isDefaultPrevented","calcRawScore","pageX","offsetx","offset","left","ceil","setHover","w","h","show","setSelection","mousemove","mouseleave","mouseup","keyup","which","jQuery"],"mappings":";;;CAGA,SAAWA,GA6XP,QAASC,GAAaC,GAElB,GAAIC,GAAUD,EAAME,cAAcC,eAC1BC,EAAQH,EAAQ,GAChBI,EAAO,EACf,QAAQL,EAAMK,MACV,IAAK,YAAaA,EAAO,WAAa,M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aria: {\r\n resetLabel: 'reset rating',\r\n ratingLabel: 'rating'\r\n }\r\n };\r\n\r\n $.fn.rateit = function (p1, p2) {\r\n //quick way out.\r\n var index = 1;\r\n var options = {}; var mode = 'init';\r\n var capitaliseFirstLetter = function (string) {\r\n return string.charAt(0).toUpperCase() + string.substr(1);\r\n };\r\n\r\n if (this.length === 0) { return this; }\r\n\r\n\r\n var tp1 = $.type(p1);\r\n if (tp1 == 'object' || p1 === undefined || p1 === null) {\r\n options = $.extend({}, $.fn.rateit.defaults, p1); //wants to init new rateit plugin(s).\r\n }\r\n else if (tp1 == 'string' && p1 !== 'reset' && p2 === undefined) {\r\n return this.data('rateit' + capitaliseFirstLetter(p1)); //wants to get a value.\r\n }\r\n else if (tp1 == 'string') {\r\n mode = 'setvalue';\r\n }\r\n\r\n return this.each(function () {\r\n var item = $(this);\r\n\r\n\r\n //shorten all the item.data('rateit-XXX'), will save space in closure compiler, will be like item.data('XXX') will become x('XXX')\r\n var itemdata = function (key, value) {\r\n\r\n if (value != null) {\r\n //update aria values\r\n var ariakey = 'aria-value' + ((key == 'value') ? 'now' : key);\r\n var range = item.find('.rateit-range');\r\n if (range.attr(ariakey) != undefined) {\r\n range.attr(ariakey, value);\r\n }\r\n\r\n }\r\n\r\n arguments[0] = 'rateit' + capitaliseFirstLetter(key);\r\n return item.data.apply(item, arguments); ////Fix for WI: 523\r\n };\r\n\r\n //handle programmatic reset\r\n if (p1 == 'reset') {\r\n var setup = itemdata('init'); //get initial value\r\n for (var prop in setup) {\r\n item.data(prop, setup[prop]);\r\n }\r\n\r\n if (itemdata('backingfld')) { //reset also backingfield\r\n var fld = $(itemdata('backingfld'));\r\n // If backing field is a select box with valuesrc option set to \"index\", reset its selectedIndex property; otherwise, reset its value.\r\n if (fld[0].nodeName == 'SELECT' && fld[0].getAttribute('data-rateit-valuesrc') === 'index') {\r\n fld.prop('selectedIndex', itemdata('value'));\r\n }\r\n else {\r\n fld.val(itemdata('value'));\r\n }\r\n fld.trigger('change');\r\n if (fld[0].min) { fld[0].min = itemdata('min'); }\r\n if (fld[0].max) { fld[0].max = itemdata('max'); }\r\n if (fld[0].step) { fld[0].step = itemdata('step'); }\r\n }\r\n item.trigger('reset');\r\n }\r\n\r\n //add the rate it class.\r\n if (!item.hasClass('rateit')) { item.addClass('rateit'); }\r\n\r\n var ltr = item.css('direction') != 'rtl';\r\n\r\n // set value mode\r\n if (mode == 'setvalue') {\r\n if (!itemdata('init')) { throw 'Can\\'t set value before init'; }\r\n\r\n\r\n //if readonly now and it wasn't readonly, remove the eventhandlers.\r\n if (p1 == 'readonly' && p2 == true && !itemdata('readonly')) {\r\n item.find('.rateit-range').unbind();\r\n itemdata('wired', false);\r\n }\r\n //when we receive a null value, reset the score to its min value.\r\n if (p1 == 'value') {\r\n p2 = (p2 == null) ? itemdata('min') : Math.max(itemdata('min'), Math.min(itemdata('max'), p2));\r\n }\r\n if (itemdata('backingfld')) {\r\n //if we have a backing field, check which fields we should update. \r\n //In case of input[type=range], although we did read its attributes even in browsers that don't support it (using fld.attr())\r\n //we only update it in browser that support it (&& fld[0].min only works in supporting browsers), not only does it save us from checking if it is range input type, it also is unnecessary.\r\n var fld = $(itemdata('backingfld'));\r\n // If backing field is a select box with valuesrc option set to \"index\", update its selectedIndex property; otherwise, update its value.\r\n if (fld[0].nodeName == 'SELECT' && fld[0].getAttribute('data-rateit-valuesrc') === 'index') {\r\n if (p1 == 'value') { fld.prop('selectedIndex', p2); }\r\n }\r\n else {\r\n if (p1 == 'value') { fld.val(p2); }\r\n }\r\n if (p1 == 'min' && fld[0].min) { fld[0].min = p2; }\r\n if (p1 == 'max' && fld[0].max) { fld[0].max = p2;}\r\n if (p1 == 'step' && fld[0].step) { fld[0].step = p2; }\r\n }\r\n\r\n itemdata(p1, p2);\r\n }\r\n\r\n\r\n //init rateit plugin\r\n if (!itemdata('init')) {\r\n\r\n //get our values, either from the data-* html5 attribute or from the options.\r\n itemdata('mode', itemdata('mode') || options.mode)\r\n itemdata('icon', itemdata('icon') || options.icon)\r\n itemdata('min', isNaN(itemdata('min')) ? options.min : itemdata('min'));\r\n itemdata('max', isNaN(itemdata('max')) ? options.max : itemdata('max'));\r\n itemdata('step', itemdata('step') || options.step);\r\n itemdata('readonly', itemdata('readonly') !== undefined ? itemdata('readonly') : options.readonly);\r\n itemdata('resetable', itemdata('resetable') !== undefined ? itemdata('resetable') : options.resetable);\r\n itemdata('backingfld', itemdata('backingfld') || options.backingfld);\r\n itemdata('starwidth', itemdata('starwidth') || options.starwidth);\r\n itemdata('starheight', itemdata('starheight') || options.starheight);\r\n itemdata('value', Math.max(itemdata('min'), Math.min(itemdata('max'), (!isNaN(itemdata('value')) ? itemdata('value') : (!isNaN(options.value) ? options.value : options.min)))));\r\n itemdata('ispreset', itemdata('ispreset') !== undefined ? itemdata('ispreset') : options.ispreset);\r\n //are we LTR or RTL?\r\n\r\n if (itemdata('backingfld')) {\r\n //if we have a backing field, hide it, override defaults if range or select.\r\n var fld = $(itemdata('backingfld')).hide();\r\n\r\n if (fld.attr('disabled') || fld.attr('readonly')) {\r\n itemdata('readonly', true); //http://rateit.codeplex.com/discussions/362055 , if a backing field is disabled or readonly at instantiation, make rateit readonly.\r\n }\r\n\r\n if (fld[0].nodeName == 'INPUT') {\r\n if (fld[0].type == 'range' || fld[0].type == 'text') { //in browsers not support the range type, it defaults to text\r\n\r\n itemdata('min', parseInt(fld.attr('min')) || itemdata('min')); //if we would have done fld[0].min it wouldn't have worked in browsers not supporting the range type.\r\n itemdata('max', parseInt(fld.attr('max')) || itemdata('max'));\r\n itemdata('step', parseInt(fld.attr('step')) || itemdata('step'));\r\n }\r\n }\r\n if (fld[0].nodeName == 'SELECT' && fld[0].options.length > 1) {\r\n // If backing field is a select box with valuesrc option set to \"index\", use the indexes of its options; otherwise, use the values.\r\n if (fld[0].getAttribute('data-rateit-valuesrc') === 'index') {\r\n itemdata('min', (!isNaN(itemdata('min')) ? itemdata('min') : Number(fld[0].options[0].index)));\r\n itemdata('max', Number(fld[0].options[fld[0].length - 1].index));\r\n itemdata('step', Number(fld[0].options[1].index) - Number(fld[0].options[0].index));\r\n }\r\n else {\r\n itemdata('min', (!isNaN(itemdata('min')) ? itemdata('min') : Number(fld[0].options[0].value)));\r\n itemdata('max', Number(fld[0].options[fld[0].length - 1].value));\r\n itemdata('step', Number(fld[0].options[1].value) - Number(fld[0].options[0].value));\r\n }\r\n //see if we have a option that as explicity been selected\r\n var selectedOption = fld.find('option[selected]');\r\n if (selectedOption.length == 1) {\r\n // If backing field is a select box with valuesrc option set to \"index\", use the index of selected option; otherwise, use the value.\r\n if (fld[0].getAttribute('data-rateit-valuesrc') === 'index') {\r\n itemdata('value', selectedOption[0].index);\r\n }\r\n else {\r\n itemdata('value', selectedOption.val());\r\n }\r\n }\r\n }\r\n else {\r\n //if it is not a select box, we can get's it's value using the val function. \r\n //If it is a selectbox, we always get a value (the first one of the list), even if it was not explicity set.\r\n itemdata('value', fld.val());\r\n }\r\n\r\n \r\n }\r\n\r\n \r\n\r\n //Create the necessary tags. For ARIA purposes we need to give the items an ID. So we use an internal index to create unique ids\r\n var element = item[0].nodeName == 'DIV' ? 'div' : 'span';\r\n index++;\r\n\r\n var html = '<button id=\"rateit-reset-{{index}}\" type=\"button\" data-role=\"none\" class=\"rateit-reset\" aria-label=\"' + $.rateit.aria.resetLabel + '\" aria-controls=\"rateit-range-{{index}}\"><span></span></button><{{element}} id=\"rateit-range-{{index}}\" class=\"rateit-range\" tabindex=\"0\" role=\"slider\" aria-label=\"' + $.rateit.aria.ratingLabel + '\" aria-owns=\"rateit-reset-{{index}}\" aria-valuemin=\"' + itemdata('min') + '\" aria-valuemax=\"' + itemdata('max') + '\" aria-valuenow=\"' + itemdata('value') + '\"><{{element}} class=\"rateit-empty\"></{{element}}><{{element}} class=\"rateit-selected\"></{{element}}><{{element}} class=\"rateit-hover\"></{{element}}></{{element}}>';\r\n item.append(html.replace(/{{index}}/gi, index).replace(/{{element}}/gi, element));\r\n\r\n //if we are in RTL mode, we have to change the float of the \"reset button\"\r\n if (!ltr) {\r\n item.find('.rateit-reset').css('float', 'right');\r\n item.find('.rateit-selected').addClass('rateit-selected-rtl');\r\n item.find('.rateit-hover').addClass('rateit-hover-rtl');\r\n }\r\n\r\n if (itemdata('mode') == 'font') {\r\n item.addClass('rateit-font').removeClass('rateit-bg');\r\n }\r\n else {\r\n item.addClass('rateit-bg').removeClass('rateit-font');\r\n }\r\n\r\n itemdata('init', JSON.parse(JSON.stringify(item.data()))); //cheap way to create a clone\r\n }\r\n\r\n var isfont = itemdata('mode') == 'font';\r\n\r\n \r\n\r\n\r\n //resize the height of all elements, \r\n if (!isfont) {\r\n item.find('.rateit-selected, .rateit-hover').height(itemdata('starheight'));\r\n }\r\n\r\n\r\n var range = item.find('.rateit-range');\r\n if (isfont) {\r\n //fill the ranges with the icons\r\n var icon = itemdata('icon');\r\n var stars = itemdata('max') - itemdata('min');\r\n\r\n var txt = '';\r\n for(var i = 0; i< stars; i++){\r\n txt += icon;\r\n }\r\n \r\n range.find('> *').text(txt);\r\n \r\n\r\n itemdata('starwidth', range.width() / (itemdata('max') - itemdata('min')))\r\n }\r\n else {\r\n //set the range element to fit all the stars.\r\n range.width(itemdata('starwidth') * (itemdata('max') - itemdata('min'))).height(itemdata('starheight'));\r\n }\r\n\r\n\r\n //add/remove the preset class\r\n var presetclass = 'rateit-preset' + ((ltr) ? '' : '-rtl');\r\n if (itemdata('ispreset')) {\r\n item.find('.rateit-selected').addClass(presetclass);\r\n }\r\n else {\r\n item.find('.rateit-selected').removeClass(presetclass);\r\n }\r\n\r\n //set the value if we have it.\r\n if (itemdata('value') != null) {\r\n var score = (itemdata('value') - itemdata('min')) * itemdata('starwidth');\r\n item.find('.rateit-selected').width(score);\r\n }\r\n\r\n //setup the reset button\r\n var resetbtn = item.find('.rateit-reset');\r\n if (resetbtn.data('wired') !== true) {\r\n resetbtn.bind('click', function (e) {\r\n e.preventDefault();\r\n\r\n resetbtn.blur();\r\n\r\n var event = $.Event('beforereset');\r\n item.trigger(event);\r\n if (event.isDefaultPrevented()) {\r\n return false;\r\n }\r\n\r\n item.rateit('value', null);\r\n item.trigger('reset');\r\n }).data('wired', true);\r\n\r\n }\r\n\r\n //this function calculates the score based on the current position of the mouse.\r\n var calcRawScore = function (element, event) {\r\n var pageX = (event.changedTouches) ? event.changedTouches[0].pageX : event.pageX;\r\n\r\n var offsetx = pageX - $(element).offset().left;\r\n if (!ltr) { offsetx = range.width() - offsetx };\r\n if (offsetx > range.width()) { offsetx = range.width(); }\r\n if (offsetx < 0) { offsetx = 0; }\r\n\r\n return score = Math.ceil(offsetx / itemdata('starwidth') * (1 / itemdata('step')));\r\n };\r\n\r\n //sets the hover element based on the score.\r\n var setHover = function (score) {\r\n var w = score * itemdata('starwidth') * itemdata('step');\r\n var h = range.find('.rateit-hover');\r\n if (h.data('width') != w) {\r\n range.find('.rateit-selected').hide();\r\n h.width(w).show().data('width', w);\r\n var data = [(score * itemdata('step')) + itemdata('min')];\r\n item.trigger('hover', data).trigger('over', data);\r\n }\r\n };\r\n\r\n var setSelection = function (value) {\r\n var event = $.Event('beforerated');\r\n item.trigger(event, [value]);\r\n if (event.isDefaultPrevented()) {\r\n return false;\r\n }\r\n\r\n itemdata('value', value);\r\n if (itemdata('backingfld')) {\r\n // If backing field is a select box with valuesrc option set to \"index\", update its selectedIndex property; otherwise, update its value.\r\n if (fld[0].nodeName == 'SELECT' && fld[0].getAttribute('data-rateit-valuesrc') === 'index') {\r\n $(itemdata('backingfld')).prop('selectedIndex', value).trigger('change');\r\n }\r\n else {\r\n $(itemdata('backingfld')).val(value).trigger('change');\r\n }\r\n }\r\n if (itemdata('ispreset')) { //if it was a preset value, unset that.\r\n range.find('.rateit-selected').removeClass(presetclass);\r\n itemdata('ispreset', false);\r\n }\r\n range.find('.rateit-hover').hide();\r\n range.find('.rateit-selected').width(value * itemdata('starwidth') - (itemdata('min') * itemdata('starwidth'))).show();\r\n item.trigger('hover', [null]).trigger('over', [null]).trigger('rated', [value]);\r\n return true;\r\n };\r\n\r\n if (!itemdata('readonly')) {\r\n //if we are not read only, add all the events\r\n\r\n //if we have a reset button, set the event handler.\r\n if (!itemdata('resetable')) {\r\n resetbtn.hide();\r\n }\r\n\r\n //when the mouse goes over the range element, we set the \"hover\" stars.\r\n if (!itemdata('wired')) {\r\n range.bind('touchmove touchend', touchHandler); //bind touch events\r\n range.mousemove(function (e) {\r\n var score = calcRawScore(this, e);\r\n setHover(score);\r\n });\r\n //when the mouse leaves the range, we have to hide the hover stars, and show the current value.\r\n range.mouseleave(function (e) {\r\n range.find('.rateit-hover').hide().width(0).data('width', '');\r\n item.trigger('hover', [null]).trigger('over', [null]);\r\n range.find('.rateit-selected').show();\r\n });\r\n //when we click on the range, we have to set the value, hide the hover.\r\n range.mouseup(function (e) {\r\n var score = calcRawScore(this, e);\r\n var value = (score * itemdata('step')) + itemdata('min');\r\n setSelection(value);\r\n range.blur();\r\n });\r\n\r\n //support key nav\r\n range.keyup(function (e) {\r\n if (e.which == 38 || e.which == (ltr ? 39 : 37)) {\r\n setSelection(Math.min(itemdata('value') + itemdata('step'), itemdata('max')));\r\n }\r\n if (e.which == 40 || e.which == (ltr ? 37 : 39)) {\r\n setSelection(Math.max(itemdata('value') - itemdata('step'), itemdata('min')));\r\n }\r\n });\r\n\r\n itemdata('wired', true);\r\n }\r\n if (itemdata('resetable')) {\r\n resetbtn.show();\r\n }\r\n }\r\n else {\r\n resetbtn.hide();\r\n }\r\n\r\n range.attr('aria-readonly', itemdata('readonly'));\r\n });\r\n };\r\n\r\n //touch converter http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/\r\n function touchHandler(event) {\r\n\r\n var touches = event.originalEvent.changedTouches,\r\n first = touches[0],\r\n type = \"\";\r\n switch (event.type) {\r\n case \"touchmove\": type = \"mousemove\"; break;\r\n case \"touchend\": type = \"mouseup\"; break;\r\n default: return;\r\n }\r\n\r\n var simulatedEvent = document.createEvent(\"MouseEvent\");\r\n simulatedEvent.initMouseEvent(type, true, true, window, 1,\r\n first.screenX, first.screenY,\r\n first.clientX, first.clientY, false,\r\n false, false, false, 0/*left*/, null);\r\n\r\n first.target.dispatchEvent(simulatedEvent);\r\n event.preventDefault();\r\n };\r\n\r\n //some default values.\r\n $.fn.rateit.defaults = { min: 0, max: 5, step: 0.5, mode: 'bg', icon: '★', starwidth: 16, starheight: 16, readonly: false, resetable: true, ispreset: false };\r\n\r\n //invoke it on all .rateit elements. This could be removed if not wanted.\r\n $(function () { $('div.rateit, span.rateit').rateit(); });\r\n\r\n})(jQuery);"]}
js/yasr-admin.js CHANGED
@@ -16,17 +16,24 @@ You should have received a copy of the GNU General Public License
16
along with this program. If not, see <http://www.gnu.org/licenses/>
17
*/
18
19
/****** Yasr Metabox overall rating ******/
20
21
- function yasrDisplayTopRightMetabox(defaultbox, postid, nonceOverall, nonceSnippet, overallRating, jqueryDisabled) {
22
23
- if (defaultbox == 'stars' ) {
24
25
- yasrPrintEventSendOverallWithStars(postid, nonceOverall, overallRating, jqueryDisabled);
26
27
} //end if if (defaultbox == 'stars' )
28
29
- else if (defaultbox == 'numbers') {
30
31
yasrPrintEventSendOverallWithNumbers(postid, nonceOverall);
32
@@ -36,94 +43,44 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
36
37
} //End function yasr_display_metabox
38
39
-
40
//This is for the stars
41
- function yasrPrintEventSendOverallWithStars(postid, nonce, overallRating, jqueryDisabled) {
42
-
43
- if (jqueryDisabled == 'yes') {
44
-
45
- //Convert string to number
46
- overallRating = parseFloat(overallRating);
47
-
48
- raterJs({
49
- starSize: 32,
50
- step: 0.1,
51
- showToolTip: false,
52
- rating: overallRating,
53
- readOnly: false,
54
- element: document.querySelector("#yasr-rater-overall"),
55
- rateCallback: function rateCallback(rating, done) {
56
57
- jQuery('#loader-overall-rating').show();
58
59
- var rating = rating.toFixed(1);
60
- var rating = parseFloat(rating);
61
- this.setRating(rating);
62
63
- var data = {
64
- action: 'yasr_send_overall_rating',
65
- nonce: nonce,
66
- rating: rating,
67
- post_id: postid
68
- };
69
-
70
- //Send value to the Server
71
- jQuery.post(ajaxurl, data, function(response) {
72
- jQuery('#loader-overall-rating').hide();
73
- jQuery('#yasr_rateit_overall_value').text(response);
74
- }) ;
75
-
76
- done();
77
- }
78
- });
79
-
80
- }
81
-
82
- else {
83
-
84
- /** This is for jquery rateit **/
85
- jQuery('#yasr_rateit_overall').on('rated', function () {
86
jQuery('#loader-overall-rating').show();
87
- var el = jQuery(this);
88
- var value = el.rateit('value');
89
- var value = value.toFixed(1); //
90
-
91
- var data = {
92
- action: 'yasr_send_overall_rating',
93
- nonce: nonce,
94
- rating: value,
95
- post_id: postid
96
- };
97
-
98
- //Send value to the Server
99
- jQuery.post(ajaxurl, data, function (response) {
100
- jQuery('#loader-overall-rating').hide();
101
- jQuery('#yasr_rateit_overall_value').text(response);
102
- });
103
-
104
- });
105
106
- jQuery('#yasr_rateit_overall').on('reset', function () {
107
- jQuery('#loader-overall-rating').show();
108
- var el = jQuery(this);
109
- var value = '-1';
110
111
var data = {
112
action: 'yasr_send_overall_rating',
113
nonce: nonce,
114
- rating: value,
115
post_id: postid
116
};
117
118
//Send value to the Server
119
- jQuery.post(ajaxurl, data, function (response) {
120
jQuery('#loader-overall-rating').hide();
121
jQuery('#yasr_rateit_overall_value').text(response);
122
- });
123
124
- });
125
126
- }
127
128
}
129
@@ -208,154 +165,147 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
208
209
/****** Yasr Metabox Multiple Rating ******/
210
211
- function yasrDisplayMultiMetabox (nMultiSet, postid, nonceMulti, setId) {
212
213
- // --------------IF multiple set are found -------------------
214
215
- if (nMultiSet > 1) {
216
217
- jQuery('#yasr-button-select-set').on("click", function() {
218
219
- //get the multi data
220
- var data_id = {
221
- action: 'yasr_send_id_nameset',
222
- set_id: jQuery('#select_set').val(),
223
- post_id: postid
224
- }
225
226
- jQuery("#yasr-loader-select-multi-set").show();
227
228
- //Send value to the Server
229
- jQuery.post(ajaxurl, data_id, function(response) {
230
- jQuery("#yasr-loader-select-multi-set").hide();
231
- jQuery('#yasr_rateit_multi_rating').html(response);
232
- jQuery('.rateit').rateit();
233
-
234
- jQuery('.multi').on('rated', function() {
235
- var el = jQuery(this);
236
- var value = el.rateit('value');
237
- var value = value.toFixed(1);
238
- var idField = el.attr('id');
239
- var setType = jQuery('#select_set').val();
240
-
241
- jQuery("#yasr-loader-multi-set-field-"+idField).show();
242
-
243
- var data = {
244
- action: 'yasr_send_id_field_with_vote',
245
- nonce: nonceMulti,
246
- rating: value,
247
- post_id: postid,
248
- id_field: idField,
249
- set_type: setType
250
- };
251
-
252
- //Send value to the Server
253
- jQuery.post(ajaxurl, data, function() {
254
- jQuery("#yasr-loader-multi-set-field-"+idField).hide();
255
- });
256
- });
257
258
259
- jQuery('.multi').on('reset', function() {
260
- var el = jQuery(this);
261
- var value = '0';
262
- var idField = el.attr('id');
263
- var setType = jQuery('#select_set').val();
264
265
- jQuery("#yasr-loader-multi-set-field-"+idField).show();
266
267
- var data = {
268
- action: 'yasr_send_id_field_with_vote',
269
- nonce: nonceMulti,
270
- rating: value,
271
- post_id: postid,
272
- id_field: idField,
273
- set_type: setType
274
- };
275
276
- //Send value to the Server
277
- jQuery.post(ajaxurl, data, function() {
278
- jQuery("#yasr-loader-multi-set-field-"+idField).hide();
279
- });
280
- });
281
282
- });
283
284
- return false; // prevent default click action from happening!
285
286
- });
287
288
}
289
290
- else if (nMultiSet == 1) {
291
292
- // --------------IF we're using just 1 set -------------------
293
294
- var data_id = {
295
- action: 'yasr_send_id_nameset',
296
- set_id: setId,
297
- post_id: postid
298
- }
299
300
- //Send value to the Server
301
- jQuery.post(ajaxurl, data_id, function(response) {
302
- jQuery('#yasr_rateit_multi_rating').html(response);
303
- jQuery('.rateit').rateit();
304
305
- jQuery('.multi').on('rated', function() {
306
- var el = jQuery(this);
307
- var value = el.rateit('value');
308
- var value = value.toFixed(1);
309
- var idField = el.attr('id');
310
311
- jQuery("#yasr-loader-multi-set-field-"+idField).show();
312
313
- var data = {
314
- action: 'yasr_send_id_field_with_vote',
315
- nonce: nonceMulti,
316
- rating: value,
317
- post_id: postid,
318
- id_field: idField,
319
- set_type: setId
320
- };
321
322
- //Send value to the Server
323
- jQuery.post(ajaxurl, data, function() {
324
- jQuery("#yasr-loader-multi-set-field-"+idField).hide();
325
- });
326
327
- });
328
329
- jQuery('.multi').on('reset', function() {
330
- var el = jQuery(this);
331
- var value = '0';
332
- var idField = el.attr('id');
333
- var setType = setId
334
335
- jQuery("#yasr-loader-multi-set-field-"+idField).show();
336
337
var data = {
338
action: 'yasr_send_id_field_with_vote',
339
nonce: nonceMulti,
340
- rating: value,
341
post_id: postid,
342
id_field: idField,
343
- set_type: setType
344
};
345
346
- //Send value to the Server
347
- jQuery.post(ajaxurl, data, function() {
348
- jQuery("#yasr-loader-multi-set-field-"+idField).hide();
349
});
350
351
- });
352
353
});
354
355
- } //End if set == 1
356
357
358
- } //end function yasrDisplayMultiMetabox
359
360
/****** End Yasr Metabox Multple Rating ******/
361
@@ -366,7 +316,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
366
367
//-------------------General Settings Code---------------------
368
369
- if (activeTab == 'general_settings') {
370
371
if (autoInsertEnabled == 0) {
372
jQuery('.yasr-auto-insert-options-class').prop('disabled', true);
@@ -459,57 +409,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
459
460
});*/
461
462
-
463
-
464
- //Second div code
465
-
466
- //On click show proceed button
467
- jQuery('#import-gdstar').on('click', function() {
468
- jQuery('#yasr-import-gdstar-div').toggle();
469
- });
470
-
471
- //On click begin step1
472
- jQuery('#import-button').on('click', function() {
473
-
474
- jQuery('#yasr-loader-importer').show();
475
-
476
- var data = {
477
- action : 'yasr_import_step1'
478
- };
479
-
480
- jQuery.post(ajaxurl, data, function(response) {
481
- jQuery('#yasr-loader-importer').hide();
482
- jQuery('#result-import').html(response);
483
- });
484
-
485
- }); //End step1
486
-
487
- jQuery('#result-import').on('click', '.yasr-result-step-1', function() {
488
- //Now we are going to prepare another ajax call to check if multiple set exists
489
-
490
- jQuery('#yasr-loader-importer2').show();
491
-
492
- var data = {
493
- action: 'yasr_import_multi_set'
494
- };
495
-
496
- jQuery.post(ajaxurl, data, function(response) {
497
- jQuery('#yasr-loader-importer2').hide();
498
- jQuery('#result-import').append(response);
499
- });
500
-
501
- }); //End second ajax call */
502
-
503
- //Reload page after importing is done
504
- jQuery('#result-import').on('click', '.yasr-result-step-2', function() {
505
- location.reload(true);
506
- });
507
-
508
} //End if general settings
509
510
//--------------Multi Sets Page ------------------
511
512
- if (activeTab == 'manage_multi') {
513
514
jQuery('#yasr-multi-set-doc-link').on('click', function() {
515
jQuery('#yasr-multi-set-doc-box').toggle("slow");
@@ -598,7 +502,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
598
} //end if active_tab=='manage_multi'
599
600
601
- if (activeTab == 'style_options') {
602
603
jQuery('#yasr-color-scheme-preview-link').on('click', function () {
604
jQuery('#yasr-color-scheme-preview').toggle('slow');
@@ -878,7 +782,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
878
879
} //End if
880
881
- else if (nMultiSet==1) {
882
883
//Add shortcode for single set (if only 1 are found)
884
jQuery('#yasr-single-set').on("click", function(){
16
along with this program. If not, see <http://www.gnu.org/licenses/>
17
*/
18
19
+
20
+ /*** Constant used by yasr
21
+
22
+ yasrCommonDataAdmin (loaderHtml)
23
+
24
+ ***/
25
+
26
/****** Yasr Metabox overall rating ******/
27
28
+ function yasrDisplayTopRightMetabox(defaultbox, postid, nonceOverall, nonceSnippet, overallRating) {
29
30
+ if (defaultbox === 'stars' ) {
31
32
+ yasrPrintEventSendOverallWithStars(postid, nonceOverall, overallRating);
33
34
} //end if if (defaultbox == 'stars' )
35
36
+ else if (defaultbox === 'numbers') {
37
38
yasrPrintEventSendOverallWithNumbers(postid, nonceOverall);
39
43
44
} //End function yasr_display_metabox
45
46
//This is for the stars
47
+ function yasrPrintEventSendOverallWithStars(postid, nonce, overallRating) {
48
49
+ //Convert string to number
50
+ overallRating = parseFloat(overallRating);
51
52
+ raterJs({
53
+ starSize: 32,
54
+ step: 0.1,
55
+ showToolTip: false,
56
+ rating: overallRating,
57
+ readOnly: false,
58
+ element: document.getElementById("yasr-rater-overall"),
59
+ rateCallback: function rateCallback(rating, done) {
60
61
jQuery('#loader-overall-rating').show();
62
63
+ var rating = rating.toFixed(1);
64
+ var rating = parseFloat(rating);
65
+ this.setRating(rating);
66
67
var data = {
68
action: 'yasr_send_overall_rating',
69
nonce: nonce,
70
+ rating: rating,
71
post_id: postid
72
};
73
74
//Send value to the Server
75
+ jQuery.post(ajaxurl, data, function(response) {
76
jQuery('#loader-overall-rating').hide();
77
jQuery('#yasr_rateit_overall_value').text(response);
78
+ }) ;
79
80
+ done();
81
+ }
82
+ });
83
84
85
}
86
165
166
/****** Yasr Metabox Multiple Rating ******/
167
168
+ function yasrAdminMultiSet(nMultiSet, postid, setId, nonceMulti){
169
170
+ nMultiSet = parseInt(nMultiSet);
171
172
+ if (nMultiSet === 1) {
173
174
+ yasrPrintAdminMultiSet(setId, postid, nonceMulti);
175
176
+ }
177
178
+ else {
179
180
+ jQuery('#yasr-button-select-set').on("click", function () {
181
182
+ //get the multi data
183
+ var setId = jQuery('#select_set').val();
184
185
+ jQuery("#yasr-loader-select-multi-set").show();
186
187
+ yasrPrintAdminMultiSet(setId, postid, nonceMulti);
188
189
+ });
190
191
+ }
192
193
+ }
194
195
+ //print the table
196
+ function yasrPrintAdminMultiSet (setId, postid, nonceMulti) {
197
198
+ var data_id = {
199
+ action: 'yasr_send_id_nameset',
200
+ set_id: setId,
201
+ post_id: postid
202
+ };
203
+
204
+ jQuery.post(ajaxurl, data_id, function(response) {
205
+
206
+ //Hide the loader near the select
207
+ document.getElementById('yasr-loader-select-multi-set').style.display='none';
208
+
209
+ var yasrMultiSetValue = JSON.parse(response);
210
+
211
+ var content = '';
212
+
213
+ for (var i = 0; i < yasrMultiSetValue.length; i++) {
214
+
215
+ var valueName = yasrMultiSetValue[i]['value_name'];
216
+ var valueRating = yasrMultiSetValue[i]['value_rating'];
217
+ var valueID = yasrMultiSetValue[i]['value_id'];
218
+
219
+ content += '<tr>';
220
+ content += '<td>' + valueName + '</td>';
221
+ content += '<td><div class="yasr-multiset-admin" id="yasr-multiset-admin-' + valueID + '" data-rating="' + valueRating + '" data-multi-idfield="'+valueID+'"></div>';
222
+ content += '<span id="yasr-loader-multi-set-field-' + valueID + '" style="display: none">';
223
+ content += '<img src="'+yasrCommonDataAdmin.loaderHtml+'"></span>';
224
+ content += '</span>';
225
+ content += '</td>';
226
+ content += '</tr>';
227
+
228
+ var table = document.getElementById('yasr-table-multi-set-admin');
229
+
230
+ table.innerHTML = content;
231
232
}
233
234
+ //Show the text "Choose a vote"
235
+ document.getElementById('yasr-multi-set-admin-choose-text').style.display='block';
236
237
+ //Set rater for divs
238
+ yasrSetRaterAdminMulti (postid, setId, nonceMulti);
239
240
+ //Show shortcode
241
+ document.getElementById('yasr-multi-set-admin-explain').style.display='block';
242
243
+ document.getElementById('yasr-multi-set-admin-explain-with-id-readonly').innerHTML = '<strong>[yasr_multiset setid='+setId+']</strong>';
244
+ document.getElementById('yasr-multi-set-admin-explain-with-id-visitor').innerHTML = '<strong>[yasr_visitor_multiset setid='+setId+']</strong>';
245
246
+ });
247
248
+ return false; // prevent default click action from happening!
249
250
+ }
251
252
+ //Rater for multiset
253
+ function yasrSetRaterAdminMulti (postid, setId, nonceMulti) {
254
255
+ var yasrMultiSetAdmin = document.getElementsByClassName('yasr-multiset-admin');
256
+
257
+ for (var i=0; i<yasrMultiSetAdmin.length; i++) {
258
+
259
+ (function(i) {
260
261
+ var htmlId = yasrMultiSetAdmin.item(i).id;
262
+ var idField = yasrMultiSetAdmin.item(i).getAttribute('data-multi-idfield');
263
264
+ var elem = document.getElementById(htmlId);
265
+
266
+ raterJs({
267
+ starSize: 32,
268
+ step: 0.5,
269
+ showToolTip: false,
270
+ readOnly: false,
271
+ element: elem,
272
+
273
+ rateCallback: function rateCallback(rating, done) {
274
+
275
+ rating = rating.toFixed(1);
276
+ //Be sure is a number and not a string
277
+ rating = parseFloat(rating);
278
+ this.setRating(rating) //Set the rating
279
+
280
+ document.getElementById("yasr-loader-multi-set-field-" + idField).style.display = '';
281
+
282
+ jQuery("#yasr-loader-multi-set-field-" + idField).show();
283
284
var data = {
285
action: 'yasr_send_id_field_with_vote',
286
nonce: nonceMulti,
287
+ rating: rating,
288
post_id: postid,
289
id_field: idField,
290
+ set_type: setId
291
};
292
293
+ //Send value to the Server
294
+ jQuery.post(ajaxurl, data, function () {
295
+ document.getElementById("yasr-loader-multi-set-field-" + idField).style.display = 'none';
296
});
297
298
+ done();
299
+
300
+ }
301
302
});
303
304
+ })(i);
305
306
+ } //End for
307
308
+ }//End function
309
310
/****** End Yasr Metabox Multple Rating ******/
311
316
317
//-------------------General Settings Code---------------------
318
319
+ if (activeTab === 'general_settings') {
320
321
if (autoInsertEnabled == 0) {
322
jQuery('.yasr-auto-insert-options-class').prop('disabled', true);
409
410
});*/
411
412
} //End if general settings
413
414
//--------------Multi Sets Page ------------------
415
416
+ if (activeTab === 'manage_multi') {
417
418
jQuery('#yasr-multi-set-doc-link').on('click', function() {
419
jQuery('#yasr-multi-set-doc-box').toggle("slow");
502
} //end if active_tab=='manage_multi'
503
504
505
+ if (activeTab === 'style_options') {
506
507
jQuery('#yasr-color-scheme-preview-link').on('click', function () {
508
jQuery('#yasr-color-scheme-preview').toggle('slow');
782
783
} //End if
784
785
+ else if (nMultiSet == 1) {
786
787
//Add shortcode for single set (if only 1 are found)
788
jQuery('#yasr-single-set').on("click", function(){
js/yasr-front.js CHANGED
@@ -1,7 +1,7 @@
1
2
/*** Constant used by yasr
3
4
- yasrCommonData (postid, ajaxurl, loggedUser, visitorStatsEnabled, loaderHtml, tooltipValues, jquery_disabled')
5
6
yasrMultiSetData (setType, nonce)
7
@@ -12,48 +12,36 @@ yasrMultiSetData (setType, nonce)
12
/****** Do this actions on document load ******/
13
document.addEventListener('DOMContentLoaded', function(event) {
14
15
- //Functions on load for rater, only if enabled
16
17
- if (yasrCommonData.jquery_disabled === 'yes') {
18
19
- //At pageload, check if there is some shortcode with class yasr-rater-stars
20
- var yasrRaterInDom = document.getElementsByClassName('yasr-rater-stars');
21
- //If so, call the function to set the rating
22
- if (yasrRaterInDom.length > 0) {
23
-
24
- //load this on everypageload
25
- yasrSetRatingOnLoad(yasrRaterInDom);
26
-
27
- }
28
-
29
- //check if shortcode yasr_visitor_votes is used
30
- var yasrRaterVVInDom = document.getElementsByClassName('yasr-rater-stars-visitor-votes');
31
32
- if (yasrRaterVVInDom.length > 0) {
33
- yasrVisitorVotesFront(yasrRaterVVInDom);
34
- }
35
36
- /*var yasrMultiSetVisitorInDom = document.getElementsByClassName('yasr-multiset-visitors-rater');
37
38
- if (yasrMultiSetVisitorInDom.length > 0) {
39
40
- yasrRaterVisitorsMultiSet (yasrMultiSetVisitorInDom)
41
42
- }*/
43
44
}
45
46
- //if is defined yasrVisitorsVotesData means that the shortcode is used
47
- if (typeof yasrVisitorsVotesData !== 'undefined') {
48
-
49
- yasrVisitorsVotes ();
50
-
51
- }
52
53
//Check to draw tooltips
54
- if (yasrRaterVVInDom || typeof yasrVisitorsVotesData !== 'undefined') {
55
56
- if (yasrCommonData.visitorStatsEnabled == 'yes') {
57
58
var yasrStatsInDom = document.getElementsByClassName('yasr-dashicons-visitor-stats');
59
@@ -65,10 +53,6 @@ document.addEventListener('DOMContentLoaded', function(event) {
65
66
}
67
68
- if (typeof yasrMultiSetData !== 'undefined') {
69
- yasrVisitorsMultiSet ();
70
- }
71
-
72
if (typeof yasrMostHighestRanking !== 'undefined') {
73
74
//By default, hide the highest rated chart
@@ -79,113 +63,6 @@ document.addEventListener('DOMContentLoaded', function(event) {
79
});
80
81
82
-
83
- /***** Functions for rateit shortcode *****/
84
-
85
- /*** Yasr visitor Votes ***/
86
-
87
- function yasrVisitorsVotes () {
88
-
89
- jQuery('.rateit').bind('over', function (event, value) { jQuery(this).attr('title', yasrCommonData.tooltipValues[value-1]); });
90
-
91
- //on vote...
92
- jQuery('.yasr_visitor_votes_stars_div').on('rated', function() {
93
-
94
- var el = jQuery(this);
95
- var value = el.rateit('value');
96
- var value = value.toFixed(1); //
97
-
98
- var postid = jQuery( this ).data('postid');
99
- var classSize = jQuery( this ).attr('class');
100
-
101
- var voteIfUserAlredyRated = jQuery('#yasr-user-vote-'+postid).data('yasr-already-voted');
102
-
103
- if (value < 1) {
104
- jQuery('#yasr_visitor_votes_' + postid).html('You can\'t vote 0');
105
- }
106
-
107
- else {
108
-
109
- jQuery('#yasr_visitor_votes_' + postid).html(yasrCommonData.loaderHtml);
110
-
111
- var data = {
112
- action: 'yasr_send_visitor_rating',
113
- rating: value,
114
- post_id: postid,
115
- size: classSize,
116
- nonce_visitor: yasrVisitorsVotesData.nonceVisitor
117
- };
118
-
119
- //Send value to the Server
120
- jQuery.post(yasrCommonData.ajaxurl, data, function(response) {
121
- //response
122
- jQuery('#yasr_visitor_votes_' + postid).html(response);
123
- jQuery('.rateit').rateit();
124
-
125
- }) ;
126
-
127
- } //End else value <1
128
-
129
- });//End function insert/update vote
130
-
131
-
132
- }
133
- /*** End Yasr Visitor Votes ***/
134
-
135
- function yasrVisitorsMultiSet () {
136
-
137
- //will have field id and vote
138
- var ratingObject = "";
139
-
140
- //an array with all the ratingonjects
141
- var ratingArray = [];
142
-
143
- var postId = yasrCommonData.postid;
144
- var setType = yasrMultiSetData.setType;
145
- var nonce = yasrMultiSetData.nonceVisitor;
146
-
147
- jQuery('.yasr-visitor-multi-'+postId+'-'+setType).on('rated', function() {
148
- var el = jQuery(this);
149
- var value = el.rateit('value');
150
- var value = value.toFixed(1);
151
- var idField = el.attr('id');
152
-
153
- ratingObject = {
154
- field: idField,
155
- rating: value
156
- };
157
-
158
- //creating rating array
159
- ratingArray.push(ratingObject);
160
-
161
- });
162
-
163
- jQuery('#yasr-send-visitor-multiset-'+postId+'-'+setType).on('click', function() {
164
-
165
- jQuery('#yasr-send-visitor-multiset-'+postId+'-'+setType).hide();
166
-
167
- jQuery('#yasr-loader-multiset-visitor-'+postId+'-'+setType).show();
168
-
169
- var data = {
170
-
171
- action: 'yasr_visitor_multiset_field_vote',
172
- nonce: nonce,
173
- post_id: postId,
174
- rating: ratingArray,
175
- set_type: setType
176
-
177
- };
178
-
179
- //Send value to the Server
180
- jQuery.post(yasrCommonData.ajaxurl, data, function(response) {
181
- jQuery('#yasr-loader-multiset-visitor-'+postId+'-'+setType).text(response);
182
- });
183
-
184
- });
185
-
186
- } //End function
187
-
188
-
189
//This work on top10 ranking chart, show the highest rated and hide most rated
190
function yasrShowHighest () {
191
@@ -258,64 +135,6 @@ function yasrDrawTipsProgress (yasrStatsInDom) {
258
259
});
260
261
- /**** This code works but not with IE ****/
262
-
263
- /*const state = {
264
- isFetching: false,
265
- canFetch: true
266
- }
267
-
268
- //Create a new request
269
- var yasrVVAjaxCall = new Request(yasrCommonData.ajaxurl, {
270
- method: 'post',
271
- headers: new Headers({
272
- "Content-Type": "application/x-www-form-urlencoded"
273
- }),
274
- body: dataToSend
275
- });
276
-
277
- tippy(this, {
278
- content: initialContent,
279
- theme: 'yasr',
280
-
281
-
282
- onShow(tip) {
283
- if (state.isFetching || !state.canFetch) return
284
-
285
- state.isFetching = true
286
- state.canFetch = false
287
-
288
- if (htmlId !== htmlIdChecked) {
289
-
290
- try {
291
- fetch(yasrVVAjaxCall)
292
- .then(checkResponse)
293
- .then(function (response) {
294
- //return the new average rating
295
- return response.json();
296
- })
297
-
298
- .then(function (data) {
299
- tip.setContent(data);
300
- })
301
- .catch(function (err) {
302
- console.log('Error with ajax call', err);
303
- });
304
- }
305
- catch (e) {
306
- tip.setContent("Fetch failed. ${e}")
307
- } finally {
308
- state.isFetching = false
309
- }
310
- }
311
-
312
- },
313
- onHidden(tip) {
314
- state.canFetch = true
315
- htmlIdChecked = htmlId;
316
- }
317
- })*/
318
-
319
})(i);
320
321
}
@@ -327,15 +146,6 @@ function yasrDrawTipsProgress (yasrStatsInDom) {
327
/****** End tooltipfunction ******/
328
329
330
- // this should give support for all plugin that add content with ajax
331
- jQuery( document ).ajaxComplete(function() {
332
-
333
- jQuery('.rateit').rateit();
334
-
335
- });
336
-
337
-
338
-
339
/**** ****/
340
341
//this is the function that print the overall rating shortcode, get overall rating and starsize
@@ -394,7 +204,7 @@ function yasrVisitorVotesFront (yasrRaterVVInDom) {
394
rateCallback: function rateCallback(rating, done) {
395
396
//show the loader
397
- document.getElementById('yasr_visitor_votes_' + postId).innerHTML = yasrCommonData.loaderHtml;
398
399
//Just leave 1 number after the .
400
rating = rating.toFixed(1);
@@ -406,69 +216,22 @@ function yasrVisitorVotesFront (yasrRaterVVInDom) {
406
action: 'yasr_send_visitor_rating',
407
rating: rating,
408
post_id: postId,
409
- size: starSize,
410
nonce_visitor: nonce
411
};
412
413
//Send value to the Server
414
jQuery.post(yasrCommonData.ajaxurl, data, function (response) {
415
//decode json
416
response = JSON.parse(response);
417
- document.getElementById('yasr_visitor_votes_' + postId).innerHTML = response;
418
- raterJs({
419
- starSize: starSize,
420
- step: 1,
421
- showToolTip: false,
422
- rating: rating,
423
- readOnly: true,
424
- element: document.getElementById(htmlId)
425
- });
426
427
});
428
429
done();
430
431
- /* This code is working, but doesn't support IE
432
-
433
- //Convert in a string
434
- var dataToSend = jsObject_to_URLEncoded(data);
435
-
436
- //Create a new request
437
- var yasrVVAjaxCall = new Request(yasrCommonData.ajaxurl, {
438
- method: 'post',
439
- headers: new Headers({
440
- "Content-Type": "application/x-www-form-urlencoded"
441
- }),
442
- body: dataToSend
443
- });
444
-
445
- //Do the ajax call
446
- fetch(yasrVVAjaxCall)
447
- .then(checkResponse)
448
- .then(function (response) {
449
- //return the new average rating
450
- return response.json();
451
- })
452
-
453
- .then(function (data) {
454
-
455
- document.getElementById('yasr_visitor_votes_' + postId).innerHTML = data;
456
-
457
- raterJs({
458
- starSize: starSize,
459
- step: 1,
460
- showToolTip: false,
461
- rating: rating,
462
- readOnly: true,
463
- element: document.getElementById(htmlId)
464
- });
465
-
466
- })
467
- .then(done)
468
- .catch(function (err) {
469
- console.log('Error with ajax call', err);
470
- });*/
471
-
472
}
473
474
});
@@ -479,9 +242,7 @@ function yasrVisitorVotesFront (yasrRaterVVInDom) {
479
480
}
481
482
- /*function yasrRaterVisitorsMultiSet (yasrMultiSetVisitorInDom) {
483
-
484
- var sendButton = [];
485
486
//will have field id and vote
487
var ratingObject = "";
@@ -494,15 +255,8 @@ function yasrVisitorVotesFront (yasrRaterVVInDom) {
494
495
(function (i) {
496
497
- var postId = parseInt(yasrMultiSetVisitorInDom.item(i).getAttribute('data-rater-postid'));
498
var htmlId = yasrMultiSetVisitorInDom.item(i).id;
499
var readonly = yasrMultiSetVisitorInDom.item(i).getAttribute('data-rater-readonly');
500
- var setId = parseInt(yasrMultiSetVisitorInDom.item(i).getAttribute('data-rater-setid'));
501
-
502
- //create an array for the id of the send buttons
503
- if (!sendButton.includes('yasr-send-visitor-multiset-' + postId + '-' + setId)) {
504
- sendButton.push('yasr-send-visitor-multiset-' + postId + '-' + setId);
505
- }
506
507
readonly = yasrReadonlyConvertion(readonly);
508
@@ -525,13 +279,7 @@ function yasrVisitorVotesFront (yasrRaterVVInDom) {
525
526
this.setRating(vote); //set the new rating
527
528
- /*if (!ratingArray.includes(postId)) {
529
- ratingArray.push([postId]);
530
- }*/
531
-
532
- /*
533
ratingObject = {
534
- post_ID: postId,
535
field: setIdField,
536
rating: vote
537
};
@@ -539,8 +287,6 @@ function yasrVisitorVotesFront (yasrRaterVVInDom) {
539
//creating rating array
540
ratingArray.push(ratingObject);
541
542
- console.log(ratingArray);
543
-
544
done();
545
546
}
@@ -551,64 +297,28 @@ function yasrVisitorVotesFront (yasrRaterVVInDom) {
551
552
}
553
554
- for (var j=0; j < sendButton.length; j++) {
555
-
556
- (function (j) {
557
558
- var yasrButtonVisitorVotes = document.getElementById(sendButton[j]);
559
560
- yasrButtonVisitorVotes.addEventListener('click', function () {
561
-
562
- console.log(sendButton[j]);
563
-
564
- //show the loader
565
- //document.getElementById(sendButton[j]).innerHTML = '<strong>test</strong>';
566
-
567
- /*var data = {
568
-
569
- action: 'yasr_visitor_multiset_field_vote',
570
- nonce: nonce,
571
- post_id: postId,
572
- rating: ratingArray,
573
- set_type: setType
574
-
575
- };*/
576
-
577
- /*
578
- //Send value to the Server
579
- jQuery.post(yasrCommonData.ajaxurl, data, function(response) {
580
- jQuery('#yasr-loader-multiset-visitor-'+postId+'-'+setType).text(response);
581
- });*/
582
-
583
- /*});
584
585
- })(j);
586
587
- }
588
589
- } //End function */
590
-
591
- /***** Function to convert js object (literal object) to string used for ajax calls in vanilla js ****/
592
- function jsObject_to_URLEncoded(element, key, list){
593
- var list = list || [];
594
- if(typeof(element)=='object'){
595
- for (var idx in element)
596
- jsObject_to_URLEncoded(element[idx],key?key+'['+idx+']':idx,list);
597
- } else {
598
- list.push(key+'='+encodeURIComponent(element));
599
- }
600
- return list.join('&');
601
- }
602
-
603
-
604
- /**** function to check ajax response *****/
605
- function checkResponse(res) {
606
- if (res.status >= 400 && res.status < 600) {
607
- throw new Error("Failed with status ${res.status}");
608
- }
609
610
- return res;
611
- }
612
613
function yasrReadonlyConvertion(readonly) {
614
1
2
/*** Constant used by yasr
3
4
+ yasrCommonData (postid, ajaxurl, loggedUser, visitorStatsEnabled, loaderHtml, tooltipValues')
5
6
yasrMultiSetData (setType, nonce)
7
12
/****** Do this actions on document load ******/
13
document.addEventListener('DOMContentLoaded', function(event) {
14
15
+ //At pageload, check if there is some shortcode with class yasr-rater-stars
16
+ var yasrRaterInDom = document.getElementsByClassName('yasr-rater-stars');
17
+ //If so, call the function to set the rating
18
+ if (yasrRaterInDom.length > 0) {
19
20
+ //load this on everypageload
21
+ yasrSetRatingOnLoad(yasrRaterInDom);
22
23
+ }
24
25
+ //check if shortcode yasr_visitor_votes is used
26
+ var yasrRaterVVInDom = document.getElementsByClassName('yasr-rater-stars-visitor-votes');
27
28
+ if (yasrRaterVVInDom.length > 0) {
29
+ yasrVisitorVotesFront(yasrRaterVVInDom);
30
+ }
31
32
+ var yasrMultiSetVisitorInDom = document.getElementsByClassName('yasr-multiset-visitors-rater');
33
34
+ if (yasrMultiSetVisitorInDom.length > 0) {
35
36
+ yasrRaterVisitorsMultiSet(yasrMultiSetVisitorInDom)
37
38
}
39
40
41
//Check to draw tooltips
42
+ if (yasrRaterVVInDom) {
43
44
+ if (yasrCommonData.visitorStatsEnabled === 'yes') {
45
46
var yasrStatsInDom = document.getElementsByClassName('yasr-dashicons-visitor-stats');
47
53
54
}
55
56
if (typeof yasrMostHighestRanking !== 'undefined') {
57
58
//By default, hide the highest rated chart
63
});
64
65
66
//This work on top10 ranking chart, show the highest rated and hide most rated
67
function yasrShowHighest () {
68
135
136
});
137
138
})(i);
139
140
}
146
/****** End tooltipfunction ******/
147
148
149
/**** ****/
150
151
//this is the function that print the overall rating shortcode, get overall rating and starsize
204
rateCallback: function rateCallback(rating, done) {
205
206
//show the loader
207
+ document.getElementById('yasr-visitor-votes-container-after-stars-' + postId).innerHTML = yasrCommonData.loaderHtml;
208
209
//Just leave 1 number after the .
210
rating = rating.toFixed(1);
216
action: 'yasr_send_visitor_rating',
217
rating: rating,
218
post_id: postId,
219
nonce_visitor: nonce
220
};
221
222
+ this.setRating(rating);
223
+ this.disable();
224
+
225
//Send value to the Server
226
jQuery.post(yasrCommonData.ajaxurl, data, function (response) {
227
//decode json
228
response = JSON.parse(response);
229
+ document.getElementById('yasr-visitor-votes-container-after-stars-' + postId).innerHTML = response;
230
231
});
232
233
done();
234
235
}
236
237
});
242
243
}
244
245
+ function yasrRaterVisitorsMultiSet (yasrMultiSetVisitorInDom) {
246
247
//will have field id and vote
248
var ratingObject = "";
255
256
(function (i) {
257
258
var htmlId = yasrMultiSetVisitorInDom.item(i).id;
259
var readonly = yasrMultiSetVisitorInDom.item(i).getAttribute('data-rater-readonly');
260
261
readonly = yasrReadonlyConvertion(readonly);
262
279
280
this.setRating(vote); //set the new rating
281
282
ratingObject = {
283
field: setIdField,
284
rating: vote
285
};
287
//creating rating array
288
ratingArray.push(ratingObject);
289
290
done();
291
292
}
297
298
}
299
300
+ jQuery('#yasr-send-visitor-multiset-'+yasrCommonData.postid+'-'+yasrMultiSetData.setType).on('click', function() {
301
302
+ jQuery('#yasr-send-visitor-multiset-'+yasrCommonData.postid+'-'+yasrMultiSetData.setType).hide();
303
+ jQuery('#yasr-loader-multiset-visitor-'+yasrCommonData.postid+'-'+yasrMultiSetData.setType).show();
304
305
+ var data = {
306
+ action: 'yasr_visitor_multiset_field_vote',
307
+ nonce: yasrMultiSetData.nonceVisitor,
308
+ post_id: yasrCommonData.postid,
309
+ rating: ratingArray,
310
+ set_type: yasrMultiSetData.setType
311
+ };
312
313
+ //Send value to the Server
314
+ jQuery.post(yasrCommonData.ajaxurl, data, function(response) {
315
+ jQuery('#yasr-loader-multiset-visitor-'+yasrCommonData.postid+'-'+yasrMultiSetData.setType).text(response);
316
+ });
317
318
+ });
319
320
+ } //End function
321
322
323
function yasrReadonlyConvertion(readonly) {
324
languages/yet-another-stars-rating-it_IT.mo CHANGED
Binary file
languages/yet-another-stars-rating-it_IT.po CHANGED
@@ -1,8 +1,8 @@
1
msgid ""
2
msgstr ""
3
"Project-Id-Version: Yasr Translation\n"
4
- "POT-Creation-Date: 2018-11-25 15:01+0100\n"
5
- "PO-Revision-Date: 2018-11-25 15:09+0100\n"
6
"Last-Translator: Dario <thedudoworld@gmail.com>\n"
7
"Language-Team: \n"
8
"Language: it_IT\n"
@@ -95,429 +95,397 @@ msgstr ""
95
msgid "Select All"
96
msgstr ""
97
98
- #: lib/yasr-admin-actions.php:45
99
- msgid "Choose Stars Set"
100
- msgstr "Scegli Set Stelle"
101
-
102
- #: lib/yasr-admin-actions.php:98
103
- msgid "Looking for more?"
104
- msgstr "Ne vuoi altre?"
105
-
106
- #: lib/yasr-admin-actions.php:100
107
- #, php-format
108
- msgid "Upgrade to %s"
109
- msgstr "Passa a %s"
110
111
- #: lib/yasr-ajax-functions.php:45 lib/yasr-ajax-functions.php:117
112
- #: lib/yasr-ajax-functions.php:185 lib/yasr-ajax-functions.php:343
113
- #: lib/yasr-ajax-functions.php:624 lib/yasr-ajax-functions.php:938
114
- #: lib/yasr-functions.php:255 lib/yasr-functions.php:266
115
- #: yasr-settings-page.php:24 yasr-stats-page.php:24
116
- msgid "You do not have sufficient permissions to access this page."
117
- msgstr "Non hai permessi sufficienti per accedere a questa pagina."
118
119
- #: lib/yasr-ajax-functions.php:83
120
- msgid "You've rated it "
121
- msgstr "Hai votato "
122
123
- #: lib/yasr-ajax-functions.php:87
124
- msgid "You've reset the vote"
125
- msgstr "Hai resettato il voto"
126
127
- #: lib/yasr-ajax-functions.php:161
128
- msgid "Type Saved"
129
- msgstr "Tipo Salvato"
130
131
- #: lib/yasr-ajax-functions.php:200
132
- msgid "Choose a vote for each element"
133
- msgstr "Scegli un voto per ogni elemento"
134
135
- #: lib/yasr-ajax-functions.php:263 lib/yasr-ajax-functions.php:307
136
- msgid "If you want to insert this multiset, paste this shortcode "
137
- msgstr "Se vuoi inserire questo Set Multiplo, incolla questo shortcode "
138
139
- #: lib/yasr-ajax-functions.php:265 lib/yasr-ajax-functions.php:309
140
msgid ""
141
- "If, instead, you want allow your visitor to vote on this multiset, use this "
142
- "shortcode"
143
msgstr ""
144
- "Se, invece, vuoi permettere al visitatore di votare su questo multiset, usa "
145
- "questo shortcode"
146
-
147
- #: lib/yasr-ajax-functions.php:274
148
- msgid "Choose a vote for every element"
149
- msgstr "Scegli un voto per ogni elemento"
150
-
151
- #: lib/yasr-ajax-functions.php:450
152
- msgid "Main"
153
- msgstr "Principale"
154
-
155
- #: lib/yasr-ajax-functions.php:451
156
- msgid "Charts"
157
- msgstr "Classifiche"
158
-
159
- #: lib/yasr-ajax-functions.php:454
160
- msgid "Read the doc"
161
- msgstr "Leggi la documentazione"
162
-
163
- #: lib/yasr-ajax-functions.php:463
164
- msgid "Overall Rating / Review"
165
- msgstr "Voto Complessivo"
166
-
167
- #: lib/yasr-ajax-functions.php:465
168
- msgid "Insert Overall Rating"
169
- msgstr "Inserisci Voto Complessivo"
170
-
171
- #: lib/yasr-ajax-functions.php:466
172
- msgid "Insert Overall Rating / Review for this post"
173
- msgstr "Inserisci Voto Complessivo / Recensione per questo post"
174
-
175
- #: lib/yasr-ajax-functions.php:469 lib/yasr-ajax-functions.php:487
176
- msgid "Choose Size"
177
- msgstr "Scegli la grandezza"
178
-
179
- #: lib/yasr-ajax-functions.php:471 lib/yasr-ajax-functions.php:489
180
- #: lib/yasr-settings-functions.php:169
181
- msgid "Small"
182
- msgstr "Piccolo"
183
-
184
- #: lib/yasr-ajax-functions.php:472 lib/yasr-ajax-functions.php:490
185
- #: lib/yasr-settings-functions.php:174
186
- msgid "Medium"
187
- msgstr "Medio"
188
-
189
- #: lib/yasr-ajax-functions.php:473 lib/yasr-ajax-functions.php:491
190
- #: lib/yasr-settings-functions.php:179
191
- msgid "Large"
192
- msgstr "Grande"
193
194
- #: lib/yasr-ajax-functions.php:481 lib/yasr-settings-functions.php:137
195
- msgid "Visitor Votes"
196
- msgstr "Voto Utenti"
197
198
- #: lib/yasr-ajax-functions.php:483
199
- msgid "Insert Visitor Votes"
200
- msgstr "Inserisci Voti Utenti"
201
202
- #: lib/yasr-ajax-functions.php:484
203
- msgid "Insert the ability for your visitor to vote"
204
- msgstr "Permetti ai tuoi visitatori di votare"
205
206
- #: lib/yasr-ajax-functions.php:501
207
- msgid "If you want to insert a Multi Set, pick one:"
208
- msgstr "Se vuoi inserire un Set Multiplo, scegline uno:"
209
210
- #: lib/yasr-ajax-functions.php:507
211
- msgid "Choose wich set you want to insert."
212
- msgstr "Scegli quale Set Multiplo inserire."
213
214
- #: lib/yasr-ajax-functions.php:510 lib/yasr-ajax-functions.php:533
215
- msgid "Readonly?"
216
- msgstr "Sola lettura?"
217
218
- #: lib/yasr-ajax-functions.php:513 lib/yasr-ajax-functions.php:536
219
msgid ""
220
- "If Readonly is checked, only you can insert the votes (in the box above the "
221
- "editor)"
222
msgstr ""
223
- "Se selezioni sola lettura, solo tu puoi inserire i voti (nel box sotto "
224
- "l'editor)"
225
-
226
- #: lib/yasr-ajax-functions.php:516 lib/yasr-ajax-functions.php:539
227
- msgid "Hide Average?"
228
- msgstr "Nascondere la media?"
229
-
230
- #: lib/yasr-ajax-functions.php:520
231
- msgid "Insert Multi Set"
232
- msgstr "Inserisci Set Multiplo"
233
-
234
- #: lib/yasr-ajax-functions.php:530
235
- msgid "Insert Multiset:"
236
- msgstr "Inserisci Set Multiplo:"
237
-
238
- #: lib/yasr-ajax-functions.php:544
239
- msgid "Insert Multiple Set"
240
- msgstr "Inserisci Set Multiplo"
241
-
242
- #: lib/yasr-ajax-functions.php:560
243
- msgid "Ranking reviews"
244
- msgstr "Classifica recensioni"
245
-
246
- #: lib/yasr-ajax-functions.php:561
247
- msgid "Insert Ranking reviews"
248
- msgstr "Inserisci classifica recensioni"
249
250
- #: lib/yasr-ajax-functions.php:562
251
- msgid "Insert Top 10 ranking for [yasr_overall_rating] shortcode"
252
- msgstr "Inserisci la classifica top 10 per lo shortcode [yasr_overall_rating]"
253
254
- #: lib/yasr-ajax-functions.php:566
255
- msgid "Users' ranking"
256
- msgstr "Classifica degli utenti"
257
258
- #: lib/yasr-ajax-functions.php:567
259
- msgid "Insert Users ranking"
260
- msgstr "Inserisci Classifica Utenti"
261
262
- #: lib/yasr-ajax-functions.php:568
263
- msgid "Insert Top 10 ranking for [yasr_visitor_votes] shortcode"
264
- msgstr "Inserisci la classifica top 10 per lo shortcode [yasr_visitor_votes]"
265
266
- #: lib/yasr-ajax-functions.php:572
267
- msgid "Most active reviewers"
268
- msgstr "Recensori più attivi"
269
270
- #: lib/yasr-ajax-functions.php:573
271
- msgid "Insert Most Active Reviewers"
272
- msgstr "Inserisci i 5 recensori più attivi"
273
274
- #: lib/yasr-ajax-functions.php:574
275
- msgid "Insert Top 5 active reviewers"
276
- msgstr "Inserisci i 5 recensori più attivi"
277
278
- #: lib/yasr-ajax-functions.php:578
279
- msgid "Most Active Users"
280
- msgstr "Utenti più attivi"
281
282
- #: lib/yasr-ajax-functions.php:579
283
- msgid "Insert Most Active Users"
284
- msgstr "Inserisci i 10 utenti più attivi"
285
286
- #: lib/yasr-ajax-functions.php:580
287
- msgid "Insert Top 10 voters [yasr_visitor_votes] shortcode"
288
- msgstr "Inserisci i 10 utenti più attivi in [yasr_visitor_votes]"
289
290
- #: lib/yasr-ajax-functions.php:647 lib/yasr-ajax-functions.php:806
291
- msgid "No Recenet votes yet"
292
- msgstr "Ancora nessun voto recente"
293
294
- #: lib/yasr-ajax-functions.php:660 lib/yasr-db-functions.php:447
295
- #: lib/yasr-stats-functions.php:186 lib/yasr-widgets.php:449
296
- msgid "anonymous"
297
- msgstr "anonimo"
298
299
- #: lib/yasr-ajax-functions.php:669
300
- #, php-format
301
- msgid "Vote %d from %s on"
302
- msgstr "Voto %d da %s su"
303
304
- #: lib/yasr-ajax-functions.php:685 lib/yasr-ajax-functions.php:834
305
- #: lib/yasr-db-functions.php:478
306
- msgid "Ip address"
307
- msgstr "Indirizzo Ip"
308
309
- #: lib/yasr-ajax-functions.php:703 lib/yasr-ajax-functions.php:853
310
- #: lib/yasr-db-functions.php:499 lib/yasr-db-functions.php:629
311
- msgid "Pages"
312
- msgstr "Pagine"
313
314
- #: lib/yasr-ajax-functions.php:818 lib/yasr-db-functions.php:594
315
- #, php-format
316
- msgid "You rated %s on "
317
- msgstr "Hai votato %s su "
318
319
- #: lib/yasr-ajax-functions.php:1019
320
- msgid "Error: you can't vote 0"
321
- msgstr "Errore: non puoi votare 0"
322
323
- #: lib/yasr-ajax-functions.php:1156 lib/yasr-ajax-functions.php:1167
324
- #: lib/yasr-shortcode-functions.php:310
325
- msgid "Total: "
326
- msgstr "Totale: "
327
328
- #: lib/yasr-ajax-functions.php:1156 lib/yasr-ajax-functions.php:1167
329
- msgid "Average:"
330
- msgstr "Media:"
331
332
- #: lib/yasr-ajax-functions.php:1157 lib/yasr-ajax-functions.php:1168
333
- msgid "Vote Saved"
334
- msgstr "Voto Salvato"
335
336
- #: lib/yasr-ajax-functions.php:1322
337
- msgid "Rating saved!"
338
- msgstr "Voto salvato!"
339
340
- #: lib/yasr-ajax-functions.php:1328
341
- msgid "Rating not saved. Please Try again"
342
- msgstr "Voto non salvato. Per favore riprova"
343
344
- #: lib/yasr-ajax-functions.php:1439
345
- msgid "out of 5 stars"
346
msgstr ""
347
348
- #: lib/yasr-ajax-functions.php:1456
349
- msgid "stars"
350
- msgstr "stelle"
351
352
- #: lib/yasr-ajax-functions.php:1461
353
- msgid "star"
354
- msgstr "stella"
355
356
- #: lib/yasr-db-functions.php:432 lib/yasr-db-functions.php:580
357
- msgid "No recenet votes yet"
358
- msgstr "Ancora nessun voto recente"
359
360
- #: lib/yasr-db-functions.php:456
361
- #, php-format
362
- msgid "Vote %d from %s on "
363
- msgstr "Voto %d from %s on "
364
365
- #: lib/yasr-db-functions.php:595
366
- msgid "Date:"
367
- msgstr ""
368
369
- #: lib/yasr-functions.php:69 lib/yasr-shortcode-functions.php:551
370
- #: yasr-metabox-top-right.php:90
371
- msgid "Loading, please wait"
372
- msgstr "Caricamento, attendere prego"
373
374
- #: lib/yasr-functions.php:71
375
- msgid "bad, poor, ok, good, super"
376
- msgstr "pessimo, scarso, ok, buono, super"
377
378
- #: lib/yasr-functions.php:226
379
- msgid "Yet Another Stars Rating: settings"
380
- msgstr "Yet Another Stars Rating: impostazioni"
381
382
- #: lib/yasr-functions.php:227
383
- msgid "Yet Another Stars Rating"
384
- msgstr "Yet Another Stars Rating"
385
386
- #: lib/yasr-functions.php:303
387
- msgid "Yet Another Stars Rating: Multiple set"
388
- msgstr "Yet Another Stars Rating: Set Multipli"
389
390
- #: lib/yasr-functions.php:314
391
- msgid "You don't have enought privileges to insert Overall Rating"
392
- msgstr "Non hai permessi sufficienti per inserire il Voto Complessivo"
393
394
- #: lib/yasr-functions.php:324
395
- msgid "You don't have enough privileges to insert a Multi Set"
396
- msgstr "Non hai abbastanza permessi per inserire un Multi Set"
397
398
- #: lib/yasr-functions.php:690
399
- msgid "Product, Place, Recipe, BlogPosting"
400
- msgstr "Product, Posto, Ricetta, BlogPosting"
401
402
- #: lib/yasr-settings-functions.php:29
403
msgid "General Settings"
404
msgstr "Impostazioni generali"
405
406
- #: lib/yasr-settings-functions.php:30
407
msgid "Multi Sets"
408
msgstr "Set Multipli"
409
410
- #: lib/yasr-settings-functions.php:31
411
msgid "Aspect & Styles"
412
msgstr "Aspetto & Stili"
413
414
- #: lib/yasr-settings-functions.php:92
415
msgid "General settings"
416
msgstr "Impostazioni Generali"
417
418
- #: lib/yasr-settings-functions.php:93
419
msgid "Auto insert options"
420
msgstr "Opzioni inserimento automatico"
421
422
- #: lib/yasr-settings-functions.php:94
423
msgid "Show \"Overall Rating\" in Archive Page?"
424
msgstr "Mostrare il \"Voto Complessivo\" nella Pagine Archivio?"
425
426
- #: lib/yasr-settings-functions.php:95
427
msgid "Show \"Visitor Votes\" in Archive Page?"
428
msgstr "Mostare il \"Voto Utenti\" nelle Pagine Archivio?"
429
430
- #: lib/yasr-settings-functions.php:96
431
msgid "Insert custom text to show before / after stars"
432
msgstr "Inserisci testo personalizzato da mostrare prima / dopo le stelle"
433
434
- #: lib/yasr-settings-functions.php:97
435
msgid "Do you want show stats for visitors votes?"
436
msgstr "Vuoi mostrare le statistiche per i voti utenti?"
437
438
- #: lib/yasr-settings-functions.php:98
439
msgid "Allow only logged in user to vote?"
440
msgstr "Permettere la votazione ai soli utenti loggati?"
441
442
- #: lib/yasr-settings-functions.php:99
443
msgid "Do you want to save ip address?"
444
msgstr "Vuoi salvare l'indirizzo IP?"
445
446
- #: lib/yasr-settings-functions.php:100
447
msgid "Rich snippet options"
448
msgstr "Opzioni Rich Snippet"
449
450
- #: lib/yasr-settings-functions.php:101
451
msgid "How do you want to rate \"Overall Rating\"?"
452
msgstr "Cosa vuoi usare per inserire il \"Voto Complessivo\"?"
453
454
- #: lib/yasr-settings-functions.php:102
455
- msgid "Do you want disable jQuery?"
456
- msgstr "Vuoi disabilitare jQuery?"
457
-
458
- #: lib/yasr-settings-functions.php:115
459
msgid "Use Auto Insert?"
460
msgstr "Usare l'inserimento automatico?"
461
462
- #: lib/yasr-settings-functions.php:128
463
msgid "What?"
464
msgstr "Cosa?"
465
466
- #: lib/yasr-settings-functions.php:133
467
msgid "Overall Rating / Author Rating"
468
msgstr "Voto Complessivo / Voto Autore"
469
470
- #: lib/yasr-settings-functions.php:141
471
msgid "Both"
472
msgstr "Entrambi"
473
474
- #: lib/yasr-settings-functions.php:147
475
msgid "Where?"
476
msgstr "Dove?"
477
478
- #: lib/yasr-settings-functions.php:152
479
msgid "Before the post"
480
msgstr "Prima del contenuto"
481
482
- #: lib/yasr-settings-functions.php:156
483
msgid "After the post"
484
msgstr "Dopo il contenuto"
485
486
- #: lib/yasr-settings-functions.php:163
487
msgid "Size"
488
msgstr "Grandezza"
489
490
- #: lib/yasr-settings-functions.php:186
491
msgid "Exclude Pages?"
492
msgstr "Escludere pagine?"
493
494
- #: lib/yasr-settings-functions.php:190 lib/yasr-settings-functions.php:210
495
msgid "Yes"
496
msgstr "Si"
497
498
- #: lib/yasr-settings-functions.php:195 lib/yasr-settings-functions.php:215
499
msgid "No"
500
msgstr "No"
501
502
- #: lib/yasr-settings-functions.php:207
503
msgid "Use only in custom post types?"
504
msgstr "Usare solo nei custom post type?"
505
506
- #: lib/yasr-settings-functions.php:219
507
msgid "You see this because you use custom post types."
508
msgstr "Vedi questo perché usi i custom post type."
509
510
- #: lib/yasr-settings-functions.php:221
511
msgid "If you want to use auto insert only in custom post types, choose Yes"
512
msgstr ""
513
"Se vuoi usare l'inserimento automatico solo nei custom post type, spunta Si"
514
515
- #: lib/yasr-settings-functions.php:245 lib/yasr-settings-functions.php:365
516
#: yasr-settings-page.php:89
517
msgid "Save Settings"
518
msgstr "Salva Impostazioni"
519
520
- #: lib/yasr-settings-functions.php:266
521
msgid ""
522
"If you enable this, \"Overall Rating\" will be showed not only in the single "
523
"article or page, but also in pages like Home Page, category pages or "
@@ -527,7 +495,7 @@ msgstr ""
527
"articolo o nella singola pagina, ma anche in pagine come l' Home Page, "
528
"categorie o archivi."
529
530
- #: lib/yasr-settings-functions.php:293
531
msgid ""
532
"If you enable this, \"Visitor Votes\" will be showed not only in the single "
533
"article or page, but also in pages like Home Page, category pages or "
@@ -537,28 +505,28 @@ msgstr ""
537
"articolo o nella singola pagina, ma anche in pagine come l' Home Page, "
538
"categorie o archivi."
539
540
- #: lib/yasr-settings-functions.php:328
541
msgid "Custom text to display before Overall Rating"
542
msgstr "Testo personalizzato da visualizzare prima del Voto Complessivo"
543
544
- #: lib/yasr-settings-functions.php:333
545
msgid "Custom text to display BEFORE Visitor Rating"