PageSourceSearch

https://smi24.net/plugins/s29_ratings/js/ratings.js

js smi24.net collected 2026-09-26 05:00:34 UTC 1,988 bytes, 74 lines download raw bytes

1
2$(function() {
3	
4	function disableVoted(votedBlocks)
5	{
6		votedBlocks.find('.s29RatingVoted').show();
7		votedBlocks.find('.s29RatingArea input').rating('readOnly', true);
8		votedBlocks.find('.s29RatingArea').attr('title', 'Вы уже участвовали в голосовании за эту страницу');
9		votedBlocks.find('.s29RatingArea').find('*').removeAttr('title');	
10	}
11	
12	
13	function getBlocksById(pageId)
14	{
15		return $('.s29RatingBlock input[name="pageId"][value=' + pageId + ']').parents('.s29RatingBlock');
16	}
17	
18	
19	function ratingClick(value, link)
20	{
21		var votedPageId = $(this).parents('.s29RatingBlock').find('input[name="pageId"]').attr('value');
22		
23		getBlocksById(votedPageId).find('.s29RatingArea input').rating('readOnly', true);
24		
25		var data = {};
26		data.pageid = votedPageId;
27		data.rating = value;
28		data.x = ratingSourceKey;
29		$.get(window.location.protocol + '//' + window.location.host + '/' + $('input[name="city"]').val() + '/plug.php?r=s29_ratings', data, reseiveRating);
30	}
31	
32	
33	function reseiveRating(xml)
34	{
35		var pageId = $('pageid', xml).text();
36		var rating = $('rating', xml).text();
37		var ratingRounded = $('ratingrounded', xml).text();
38		
39		var votedBlocks = getBlocksById(pageId);
40		
41		votedBlocks.find('.s29RatingArea input').rating('readOnly', false);
42		votedBlocks.find('.s29RatingArea input').rating('select', ratingRounded, false);
43		
44		votedBlocks.find('input[name="voted"]').attr('value', 'yes');
45		disableVoted(votedBlocks);
46	}
47	
48	
49	// enabling starrating
50	
51	var params = {
52		split:2,
53		starWidth:14,
54		required:true,
55		callback:ratingClick
56	};
57	
58	$('.s29RatingArea input').rating(params);
59	
60	$('.s29NoRating .s29RatingPicture').removeClass('s29RatingPicture');
61	$('.s29NoRating .s29RatingArea').removeClass('s29RatingArea');
62	
63	$('.s29RatingPicture').hide();
64	$('.s29RatingArea').show();
65	
66	var votedBlocks = $('.s29RatingBlock input[name="voted"][value="yes"]').parents('.s29RatingBlock');
67	disableVoted(votedBlocks);
68});
69
70
71
72
73
74

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.