1document.addEventListener("DOMContentLoaded", function () { 2 const containers = document.querySelectorAll(".blogty-feedback"); 3 4 containers.forEach(container => { 5 const postId = container.dataset.postId; 6 const ajaxUrl = blogtyFeedbackData.ajaxUrl; 7 const nonce = blogtyFeedbackData.nonce; 8 9 container.querySelectorAll(".feedback-button").forEach(btn => { 10 btn.addEventListener("click", () => { 11 const type = btn.dataset.type; 12 const cnt = btn.querySelector(".count"); 13 cnt.textContent = (parseInt(cnt.textContent || "0", 10) + 1).toString(); 14 15 fetch(ajaxUrl, { 16 method: "POST", 17 headers: { "Content-Type": "application/x-www-form-urlencoded" }, 18 body: new URLSearchParams({ 19 action: "feedback_vote", 20 post_id: postId, 21 type: type, 22 nonce: nonce 23 }) 24 }) 25 .then(r => r.json()) 26 .then(data => { 27 if (data.success && data.counts) applyCounts(container, data.counts); 28 }) 29 .catch(() => {}); 30 }); 31 }); 32 }); 33 34 function applyCounts(container, counts) { 35 for (const k in counts) { 36 const el = container.querySelector(`.feedback-button[data-type="${k}"] .count`); 37 if (el) el.textContent = counts[k]; 38 } 39 } 40});
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.