1function onXHRClick(id, type, e) { 2 let xhr = new XMLHttpRequest(); 3 xhr.open('GET', `/post/gz/${id}/${type}`); 4 xhr.setRequestHeader("X-Requested-With", "xmlhttprequest"); 5 xhr.responseType = 'json'; 6 xhr.send(); 7 xhr.onload = function() { 8 let responseObj = xhr.response; 9 if (responseObj.result == 0) { 10 var oGZ = document.querySelectorAll("#oGZBadge"); 11 oGZ.forEach(element => {setBadgeCount(element, responseObj.oGZCount);}); 12 13 var cGZ = document.querySelectorAll("#cGZBadge"); 14 cGZ.forEach(element => {setBadgeCount(element, responseObj.cGZCount);}); 15 16 e.parentElement.parentElement.innerHTML = responseObj.menu; 17 toastr.success('СÑаÑÑÑ ÐРобновлен', '', {timeOut: 3000}) 18 } else { 19 toastr.error('ÐÑибка Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ ÑÑаÑÑÑа ÐÐ Ñ Ð¿Ð¾ÑÑа', '', {timeOut: 3000}) 20 } 21 }; 22 23 xhr.onerror = function() { 24 console.log("ÐапÑÐ¾Ñ Ð½Ðµ ÑдалÑÑ"); 25 }; 26} 27 28function onTlXHRClick(id, type, e) { 29 let xhr = new XMLHttpRequest(); 30 xhr.open('GET', `/post/tl/${id}/${type}`); 31 xhr.setRequestHeader("X-Requested-With", "xmlhttprequest"); 32 xhr.responseType = 'json'; 33 xhr.send(); 34 xhr.onload = function() { 35 let responseObj = xhr.response; 36 if (responseObj.result == 0) { 37 e.parentElement.parentElement.innerHTML = responseObj.menu; 38 toastr.success('ТемаÑиÑеÑÐºÐ°Ñ Ð»Ð¸Ð½Ð¸Ñ Ñ Ð¿Ð¾ÑÑа обновлен', '', {timeOut: 3000}) 39 } else { 40 toastr.error('ÐÑибка Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¢ÐµÐ¼Ð°ÑиÑеÑкой линии Ñ Ð¿Ð¾ÑÑа', '', {timeOut: 3000}) 41 } 42 }; 43 44 xhr.onerror = function() { 45 console.log("ÐапÑÐ¾Ñ Ð½Ðµ ÑдалÑÑ"); 46 }; 47} 48 49function setBadgeCount(element, count) { 50 if (element.innerHTML != count) { 51 element.innerText = count; 52 element.style.backgroundColor = "#fc8b01"; 53 setTimeout(function(){element.style.backgroundColor = "#777";},3000) 54 } 55}
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.