1$(document).ready(function() { 2 var timeout; 3 var isBegin = true; 4 5 function getData(term) { 6 7 if (term) { 8 9 document.getElementById('content').innerHTML = ''; 10 $('#content').append('<div style="position: absolute; left: calc(50% - 77px); top: 100px; font-weight: 500; font-size: 15px;">ÐагÑÑзка...</div>'); 11 12 $.getJSON("https://mediametrics.ru/radio/_export/search.php?search=" + term + "", function(data) { 13 if (data == null) { 14 document.getElementById('content').innerHTML = ''; 15 $('#content').append('<div style="position: absolute; left: calc(50% - 77px); top: 100px; font-weight: 500; font-size: 15px;">ÐиÑего не найдено</div>'); 16 return; 17 } 18 for (var i = 0; i < data.length; i++) { 19 if (i > 0) { 20 if (data[i].id == data[i - 1].id) { 21 continue; 22 } else { 23 renderRow(data[i], true); 24 } 25 } else { 26 renderRow(data[i], true); 27 } 28 } 29 }); 30 } 31 } 32 $('input[name=search]').keyup(function() { 33 var val = $(this).val(); 34 if (val == '' && !isBegin) { 35 clearTimeout(timeout); 36 document.getElementById('content').innerHTML = ''; 37 getData(false); 38 isBegin = true; 39 return; 40 } 41 if (val.length < 2) { 42 isBegin = false; 43 return; 44 } 45 clearTimeout(timeout); 46 timeout = setTimeout(function() { 47 document.getElementById('content').innerHTML = ''; 48 getData(val); 49 }, 800); 50 }); 51 52 function renderRow(item, isSearch) { 53 if (item.presenter_image == "/radio/authors/") { 54 return; 55 } 56 if (item.about == "") { 57 if (item.maintext) { 58 item.about = item.maintext; 59 } 60 } 61 var time = ''; 62 if (isSearch) { 63 time = parseTime(item.time); 64 } 65 item.presenter_name = item.guest_name; 66 item.presenter_image = item.guest_image; 67 var specName = ''; 68 var specImage = ''; 69 var specText = ''; 70 if (!isSearch) { 71 specName = 'spec-name-css'; 72 specImage = 'spec-image-css'; 73 specText = 'spec-article-text-css' 74 } 75 //var html = '<div class="result result-sm clearFix" id="row-' + item.id + '" style="height: 18px;">' + '<div class="article-text ' + specText + '"><a target="_blank" href="' + item.link + '">' + item.about + '</a></div>' + '<div class="result-logo"><a class="c-guest-pic ' + specImage + '" target="_blank" href="' + item.link + '" title="' + item.guest_name + '"><img class="guest-pic" src="' + item.presenter_image + '" width="16" height="16" border="0"></a></div>' + '<div class="result-num" id="visitors_193327043" title="подÑобнее">' + time + '</div><div class="result-link ' + specName + '"><a target="_blank" href="' + item.link + '">' + item.presenter_name + '</a></div></div>' 76 var html = '<div class="result result-sm clearFix" id="row-' + 77 item.id + '" style="height: 18px;">' + '<div class="article-text ' + 78 specText + '"><a href="view.html?id=' + item.id + '">' + item.about + '</a></div>' + 79 '<div class="result-logo"><a class="c-guest-pic ' + specImage + '" href="view.html?id=' + item.id + 80 '" title="' + item.guest_name + '"><img class="guest-pic" src="' + item.presenter_image + 81 '" width="16" height="16" border="0"></a></div>' + '<div class="result-num" id="visitors_193327043" title="подÑобнее">' + 82 time + '</div><div class="result-link ' + specName + '"><a href="view.html#' + item.id + '">' + 83 item.presenter_name + '</a></div></div>' 84 85 $('.center').append(html); 86 } 87 parseTime = function(timestamp) { 88 var date = new Date(parseInt(timestamp) * 1000); 89 var h = date.getHours(); 90 if (h < 10) { 91 h = '0' + h; 92 } 93 var m = date.getMinutes(); 94 if (m < 10) { 95 m = '0' + m; 96 } 97 var d = date.getDate(); 98 if (d < 10) { 99 d = '0' + d; 100 } 101 var mon = date.getMonth() + 1; 102 if (mon < 10) { 103 mon = '0' + mon; 104 } 105 return h + ':' + m + ' ' + d + '.' + mon; 106 } 107 getData(); 108});
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.