PageSourceSearch

https://www.sklepwinternecie.pl/wp-content/plugins/yet-another-stars-rating/js/yasr-front.js?ver=1.0.0

js sklepwinternecie.pl collected 2026-09-26 18:42:47 UTC 8,651 bytes, 312 lines download raw bytes

1/****** Yasr shortcode page ******/
2
3    function yasrVisitorsVotes (tooltipValues, postid, ajaxurl, size, loggedUser, voteIfUserAlredyRated, loaderHtml, nonceVisitor) {
4
5        jQuery('#yasr_rateit_visitor_votes_' + postid).bind('over', function (event, value) { jQuery(this).attr('title', tooltipValues[value-1]); });
6
7        //Should be useless from version 0.7.9, just to be safe
8        if (voteIfUserAlredyRated == "0" ) {
9            voteIfUserAlredyRated = false;
10        }
11
12        jQuery('#yasr_rateit_visitor_votes_' + postid).on('rated', function() {
13
14            var el = jQuery(this);
15            var value = el.rateit('value');
16            var value = value.toFixed(1); //
17
18            if (value < 1) {
19                jQuery('#yasr_visitor_votes_' + postid).html('You can\'t vote 0');
20            } 
21
22            else {
23
24                jQuery('#yasr_visitor_votes_' + postid).html(loaderHtml);
25
26                //If loggedin user and has already rated for a post/page update the vote
27                if (loggedUser && voteIfUserAlredyRated) {
28
29                    var data = {
30                        action: 'yasr_update_visitor_rating',
31                        rating: value,
32                        post_id: postid,
33                        size: size,
34                        nonce_visitor: nonceVisitor
35                    };
36
37                }
38
39                //else is a new vote
40                else {
41
42                    var data = {
43                        action: 'yasr_send_visitor_rating',
44                        rating: value,
45                        post_id: postid,
46                        size: size,
47                        nonce_visitor: nonceVisitor
48                    };
49
50                }
51
52                //Send value to the Server
53                jQuery.post(ajaxurl, data, function(response) {
54                    //response
55                    jQuery('#yasr_visitor_votes_' + postid).html(response); 
56                    jQuery('.rateit').rateit();
57
58                }) ;      
59
60            } //End else value <1
61
62        });//End function insert/update vote
63
64    } //End function yasr visitor votes
65   
66    
67    function yasrVisitorsMultiSet (postId, setType, ajaxurl, nonce) {
68
69        //will have field id and vote
70        var ratingObject = "";
71
72        //an array with all the ratingonjects
73        var ratingArray = new Array();
74
75        jQuery('.yasr-visitor-multi-'+postId+'-'+setType).on('rated', function() { 
76            var el = jQuery(this);
77            var value = el.rateit('value');
78            var value = value.toFixed(1); 
79            var idField = el.attr('id');
80
81            ratingObject = {
82
83                field: idField,
84                rating: value
85
86            };
87
88            //creating rating array
89            ratingArray.push(ratingObject);
90
91        });
92
93        jQuery('#yasr-send-visitor-multiset-'+postId+'-'+setType).on('click', function() {
94
95            jQuery('#yasr-send-visitor-multiset-'+postId+'-'+setType).hide();
96
97            var cookiename = "yasr_multi_visitor_vote_" + postId+'_'+setType;
98
99            jQuery('#yasr-loader-multiset-visitor-'+postId+'-'+setType).show();
100
101            var data = {
102
103                action: 'yasr_visitor_multiset_field_vote',
104                nonce: nonce, 
105                post_id: postId,
106                rating: ratingArray,
107                set_type: setType
108
109            }
110
111            //Send value to the Server
112            jQuery.post(ajaxurl, data, function(response) {
113                jQuery('#yasr-loader-multiset-visitor-'+postId+'-'+setType).text(response);
114            });
115
116        });
117
118    } //End function 
119
120
121    function yasrMostOrHighestRatedChart (ajaxurl) {
122
123        //By default, hide the highest rated chart
124        jQuery('#yasr-highest-rated-posts').hide();
125
126        //On click on highest, hide most and show highest
127        jQuery('#yasr_multi_chart_highest').on("click", function () {
128
129            jQuery('#yasr-most-rated-posts').hide();
130
131            jQuery('#yasr-highest-rated-posts').show();
132
133            return false; // prevent default click action from happening!
134
135        });
136
137        //Vice versa
138        jQuery('#yasr_multi_chart_most').on("click", function () {
139
140            jQuery('#yasr-highest-rated-posts').hide();
141
142            jQuery('#yasr-most-rated-posts').show();
143
144            return false; // prevent default click action from happening!
145
146        });
147
148    }
149
150
151/****** End Yasr shortcode page  ******/
152
153
154/****** Tooltip function ******/
155
156    //used in ajax page
157    function yasrDrawProgressBars (valueProgressbar, postId) {
158
159        var i = null;
160
161        var j = 0; //This is for the array
162
163        for (i=5; i>0; i--) {
164
165            jQuery( "#yasr-progress-bar-postid-"+postId+"-progress-bar-" + i).progressbar({
166                value: valueProgressbar[j]
167            });
168
169            j=j+1;
170
171        }
172        
173    }
174
175    //used in shortcode page and ajax page
176    function yasrDrawTipsProgress(postid, ajaxurl) {
177
178        var varTipsContent = null;
179
180        jQuery('#yasr-total-average-dashicon-' + postid).tooltip({
181
182            position: { my: 'center bottom' , at: 'center top-10' },
183            tooltipClass: "yasr-visitors-stats-tooltip",
184            content: function(tipsContent) {
185
186                if (!varTipsContent) {
187
188                    var data = {
189                        action: 'yasr_stats_visitors_votes',
190                        post_id: postid
191                    }
192
193                    jQuery.post(ajaxurl, data, function(response) {
194                        varTipsContent = response;
195                        tipsContent(response);
196                    });
197
198                } 
199
200                else {
201                    return varTipsContent;
202                }
203
204            },
205            disabled: true,
206            close: function( event, ui ) { 
207                jQuery(this).tooltip('disable'); 
208            }
209
210        });
211
212        jQuery('#yasr-total-average-dashicon-' + postid).on("hover", function(){
213            jQuery(this).tooltip('enable').tooltip('open');
214            jQuery('.ui-helper-hidden-accessible').children(':first').removeAttr('style');
215            jQuery('.ui-helper-hidden-accessible').children(':last', this).remove();
216        });
217
218    }
219
220
221
222/****** End tooltipfunction ******/
223
224
225/****** draw progress bar for yasr_pro_comment_reviews_summary ******/
226
227    function yasrDrawProgressBarsReviewsSummery (valueProgressbar, postId) {
228
229            var i = null;
230
231            var j = 0; //This is for the array
232
233            for (i=5; i>0; i--) {
234
235                jQuery( "#yasr-pro-reviews-summary-postid-"+postId+"-progress-bar-" + i).progressbar({
236                    value: valueProgressbar[j]
237                });
238
239                j=j+1;
240
241            }
242            
243        }
244
245/****** End progressbar function *******/
246
247
248/****** Yasr pro shortcode page ******/
249
250    function yasrProMostOrHighestRatedChart (view) {
251
252        if (view != 'highest') {
253
254            //By default, hide the highest rated chart
255            jQuery('#yasr-pro-highest-rated-posts').hide();
256
257            //On click on highest, hide most and show highest
258            jQuery('#yasr-pro-multi-chart-highest').on("click", function () {
259
260                jQuery('#yasr-pro-most-rated-posts').hide();
261
262                jQuery('#yasr-pro-highest-rated-posts').show();
263
264                return false; // prevent default click action from happening!
265
266            });
267
268            //Vice versa
269            jQuery('#yasr-pro-multi-chart-most').on("click", function () {
270
271                jQuery('#yasr-pro-highest-rated-posts').hide();
272
273                jQuery('#yasr-pro-most-rated-posts').show();
274
275                return false; // prevent default click action from happening!
276
277            });
278
279        }
280
281        else {
282
283            //By default, hide the most rated chart
284            jQuery('#yasr-pro-most-rated-posts').hide();
285
286            //On click on most, hide highest and show most
287            jQuery('#yasr-pro-multi-chart-most').on("click", function () {
288
289                jQuery('#yasr-pro-highest-rated-posts').hide();
290
291                jQuery('#yasr-pro-most-rated-posts').show();
292
293                return false; // prevent default click action from happening!
294
295            });
296
297            //Vice versa
298            jQuery('#yasr-pro-multi-chart-highest').on("click", function () {
299
300                jQuery('#yasr-pro-most-rated-posts').hide();
301
302                jQuery('#yasr-pro-highest-rated-posts').show();
303
304                return false; // prevent default click action from happening!
305
306            });
307
308        }
309
310    }
311
312/****** End Yasr pro shortcode page ******/

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.