PageSourceSearch

https://www.edukation.com.ua/js/ajaxstarrater/rating.js

js edukation.com.ua collected 2026-10-02 11:55:11 UTC 2,405 bytes, 80 lines download raw bytes

1	$(function(){
2		initAjaxStarRating();
3	});
4	
5	function initAjaxStarRating(){
6		var video_divs = $("div.video:has(embed)");
7		video_divs.each(function(){								 
8			var $curr_video_div = $(this);
9			var id 				= $curr_video_div.attr("id").split("_");
10			$.ajax({			// $.getJSON(				
11					url: "/ajax.php?module=AjaxStarRater&method=getRatingForOneObject&xml",
12					type: "POST",
13					dataType: 'xml',
14					timeout: 3000,
15					error: function(){				
16						alert('error');
17						//alert("Ошибка при передаче данных! Попробуйте снова");
18					},					
19					success: function( xml ) {
20						var error = $('error', xml).text();
21						var html = $('html', xml).text();						
22						
23						if( error==0 ) {
24							$curr_video_div.append(html);
25							ratingAction( /*$('a.rater', html)*/ );
26						} else {
27							alert(html);
28						}					
29					},				
30					// Parametrs
31					data: {'id':id[1]}
32			});
33		});
34	}
35	
36	function ratingAction(){
37			$('a.rater').livequery('click',function(){
38				var parameterString = this.href.replace(/.*\?(.*)/, "$1"); // onclick="sndReq('j=1&q=2&t=127.0.0.1&c=5');
39				var parameterTokens = parameterString.split("&"); // onclick="sndReq('j=1,q=2,t=127.0.0.1,c=5');
40				var parameterList = new Array();			
41	
42				for (j = 0; j < parameterTokens.length; j++) {
43					var parameterName = parameterTokens[j].replace(/(.*)=.*/, "$1"); // j
44					var parameterValue = parameterTokens[j].replace(/.*=(.*)/, "$1"); // 1
45					parameterList[parameterName] = parameterValue;
46				}			
47				senndRequest(parameterList['vote'], parameterList['id_num']); 
48				
49				return false;
50			});
51	}
52	
53	function senndRequest(vote,id_num,units){
54		
55		$('#unit_ul'+id_num).html('<div class="loading"></div>');
56		
57		$.ajax({			// $.getJSON(				
58			url: "/ajax.php?module=AjaxStarRater&method=addVote&xml",
59			type: "GET",
60			dataType: 'xml',
61			timeout: 3000,
62			error: function(){				
63				alert('error');
64			},					
65			success: function( xml ) {
66				var error 	= $('error', xml).text();
67				var id 	= $('id', xml).text();
68				var html 	= $('html', xml).text();						
69						
70				if( error==0 ) {
71            		// Замена
72					$('#unit_long'+id).parent().after(html).remove();				
73				} else {
74					alert(html);
75				}					
76			},				
77			// Parametrs
78			data: {'vote':vote, 'id_num':id_num}
79		});
80	}

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.