PageSourceSearch

https://www.jogoremoto.pt/site/wp-content/themes/businessfinder/design/js/rating.js?ver=5.9

js jogoremoto.pt collected 2026-09-24 19:14:55 UTC 3,042 bytes, 70 lines download raw bytes

1jQuery(document).ready(function($) {
2
3	var themeUrl = $('body').data('themeurl');
4	var postId = $('#ait-rating-system').data('post-id');
5	var star = $('#ait-rating-system .rating-send-form .star');
6	var sendForm = $('#ait-rating-system button.send-rating');
7	
8	// invield labels
9	if ($.fn.inFieldLabels) {
10		$('#ait-rating-system label').inFieldLabels();
11	}
12
13	// hover effect
14	$(document).on("mouseenter", "#ait-rating-system .rating-send-form .star", function() {
15		var id = parseInt($(this).data('star-id'));
16		$(this).parent().find('> div').slice(0,id).css("background","url('"+themeUrl+"/design/img/star-active.png') no-repeat 0 0");
17	});
18	$(document).on("mouseleave", "#ait-rating-system .rating-send-form .star", function() {
19		var rating = $(this).parent().parent();
20		var mean = parseInt(rating.data('rated-value'));
21		$(this).parent().find('> div').css("background","url('"+themeUrl+"/design/img/star-white-default.png') no-repeat 0 0");
22		$(this).parent().find('> div').slice(0,mean).css("background","url('"+themeUrl+"/design/img/star-active.png') no-repeat 0 0");
23	});
24
25	// rating
26	$(document).on("click", "#ait-rating-system .rating-send-form .star", function(event) {
27		var rating = $(this).parent().parent();
28		var ratingId = rating.data('rating-id');
29		var id = parseInt($(this).data('star-id'));
30		$(this).parent().find('> div').slice(0,id).css("background","url('"+themeUrl+"/design/img/star-active.png') no-repeat 0 0");
31		rating.data('rated-value',id).addClass('already');		
32	});
33
34	// send via ajax
35	$(document).on("click", "#ait-rating-system button.send-rating", function(event) {
36		var values = {};
37		var validator = true;
38		$('#ait-rating-system .rating-send-form .rating').each(function(event) {
39			if($(this).data('rated-value') == '0'){
40				validator = false;
41			}
42			values[$(this).data('rating-id')] = $(this).data('rated-value');
43		});
44		if(!$('#ait-rating-system #rating-name').val()) { validator = false };
45
46		if(validator) {
47			$.post(MyAjax.ajaxurl, { action: 'ait_rate_item', nonce: MyAjax.ajaxnonce, post_id: postId, rating_name: $('#ait-rating-system #rating-name').val(), rating_description: $('#ait-rating-system #rating-description').val(), rating_values: values }, function(data, textStatus, xhr) {
48				if(data != "nonce" && data != "already" && data != "nonce"){
49					$('#ait-rating-system').replaceWith(data);
50					if ($.fn.inFieldLabels) {
51						$('#ait-rating-system label').inFieldLabels();
52					}
53				}
54			});
55		} else {
56			// show error message
57			$('#ait-rating-system .rating-send-form .message.success').hide();
58			$('#ait-rating-system .rating-send-form .message.error').show();
59		}
60	});
61
62	// user ratings details
63	$(document).on("mouseover", "#ait-rating-system .user-details .value", function(event) {
64		$(this).parent().parent().find('.user-values').show();
65	});
66	$(document).on("mouseout", "#ait-rating-system .user-details .value", function(event) {
67		$(this).parent().parent().find('.user-values').hide();
68	});
69
70});

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.