1var intervalTraffic; 2var intervalTrafficPeriod = 60000; 3var intervalTrafficAdd; 4var intervalTrafficAddPeriod = 1000; 5 6var intervalLive; 7var intervalLivePeriod = 60000; 8var intervalLiveAdd; 9var intervalLiveAddPeriod = 1000; 10var over = false; 11var global_data; 12 13$(document).ready(function(){ 14 $('.traffic_generators.updating').hover(function() { 15 over = true; 16 }, 17 function () { 18 over = false; 19 addTraffic(global_data); 20 }); 21 22}); 23 24function genTraffic() { 25 clearTimeout(intervalTraffic); 26 27 var url = location.protocol +"//"+ location.host + Drupal.settings.basePath + "amodule/traffic.json"; 28 $.ajax({ 29 url: url, 30 dataType: 'json', 31 async: false, 32 success: function(data){ 33 var item = data['data']; 34 35 if (typeof item !== "undefined" && item !== null) { 36 clearTimeout(intervalTrafficAdd); 37 addTraffic(item); 38 } 39 }, 40 complete: function(data){ 41 //intervalTraffic = setTimeout(function(){genTraffic()}, intervalTrafficPeriod); 42 }, 43 _end: true 44 }); 45} 46 47function genTrafficOff(){ 48 clearTimeout(intervalTrafficAdd); 49 $.cookie('amodule_latest_off', 1); 50} 51function genTrafficOn(){ 52 genTraffic(); 53 $.cookie('amodule_latest_off', null); 54} 55 56// подгÑÑзка в пÑÑмой ÑÑÐ¸Ñ 57function genLive(){ 58 var url = location.protocol +"//"+ location.host + Drupal.settings.basePath + "amodule/live.json"; 59 $.ajax({ 60 url: url, 61 dataType: 'json', 62 async: false, 63 success: function(data){ 64 var item = data['data']; 65 66 if (typeof item !== "undefined" && item !== null) { 67 clearTimeout(intervalLiveAdd); 68 addLive(item); 69 } 70 }, 71 complete: function(data){ 72 //intervalLive = setTimeout(function(){genLive()}, intervalLivePeriod); 73 }, 74 _end: true 75 }); 76} 77 78function addLive(data) { 79 if (typeof addLive.counter == 'undefined' ) { 80 // It has not... perform the initilization 81 addLive.counter = 0; 82 } 83 if (typeof data[addLive.counter] !== "undefined" && data[addLive.counter] !== null) { 84 $(".pulse_belnet.updating").find("ul").prepend("<li class='newstr'></li>") 85 $(".pulse_belnet.updating").find("ul>li:first.newstr").animate({height: '22px'}) 86 $(".pulse_belnet.updating").find("ul>li:first.newstr").prepend('<a href="'+data[addLive.counter].url+'">'+data[addLive.counter].title+'</a>'); 87 $(".pulse_belnet.updating").find("ul>li:first.newstr").fadeTo(150, 1, function(){$(".pulse_belnet.updating").find("ul>li:first.newstr").removeClass("newstr")}); 88 } 89 addLive.counter++; 90 if (addLive.counter == data.length) { 91 clearTimeout(intervalLiveAdd); 92 addLive.counter = 0; 93 genLive(); 94 } else { 95 intervalLiveAdd = setTimeout(function(){addLive(data)}, intervalLiveAddPeriod); 96 } 97} 98 99function addTraffic(data) { 100 if (typeof addTraffic.counter == 'undefined' ) { 101 // It has not... perform the initilization 102 addTraffic.counter = 0; 103 } 104 105 if (!over) { 106 if (typeof data[addTraffic.counter] !== "undefined" && data[addTraffic.counter] !== null) { 107 $(".traffic_generators.updating").find("ul").prepend("<li class='newstr'></li>") 108 $(".traffic_generators.updating").find("ul>li:first.newstr").animate({height: '22px'}) 109 $(".traffic_generators.updating").find("ul>li:first.newstr").prepend('<p><img width="16" height="16" src="//favicon.yandex.net/favicon/'+data[addTraffic.counter]['from_host']+'"><a href="'+data[addTraffic.counter]['from_url']+'" target="_blank" rel="nofollow">'+data[addTraffic.counter]['text']+'</a></p><p class="rate_site"><a href="'+data[addTraffic.counter]['to_url']+'" target="_blank" rel="nofollow"><img width="16" height="16" src="//favicon.yandex.net/favicon/'+data[addTraffic.counter]['to_host']+'">'+data[addTraffic.counter]['to_host']+'</a></p>'); 110 $(".traffic_generators.updating").find("ul>li:first.newstr").fadeTo(150, 1, function(){$(".traffic_generators.updating").find("ul>li:first.newstr").removeClass("newstr")}); 111 } 112 addTraffic.counter++; 113 if (addTraffic.counter == data.length) { 114 clearTimeout(intervalTrafficAdd); 115 addTraffic.counter = 0; 116 genTraffic(); 117 } else { 118 intervalTrafficAdd = setTimeout(function(){addTraffic(data)}, intervalTrafficAddPeriod); 119 } 120 } else { 121 global_data = data; 122 } 123} 124 125genLive(); 126 127$(document).ready(function () { 128 129 // подгÑÑзка в акÑÑалÑнÑе инÑеÑеÑÑ 130 if( $.cookie("amodule_latest_off") == 1) { 131 genTrafficOff(); 132 } 133 else { 134 genTrafficOn(); 135 } 136 137 $(".traffic_generators.updating .lrbut .right").click(function(){ 138 genTrafficOff(); 139 }) 140 $(".traffic_generators.updating .lrbut .left").click(function(){ 141 genTrafficOn(); 142 }) 143 144 $(".pulse_belnet.updating .lrbut .right").click(function(){ 145 clearTimeout(intervalLiveAdd); 146 }) 147 $(".pulse_belnet.updating .lrbut .left").click(function(){ 148 genLive(); 149 }); 150});
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.