1document.addEventListener("DOMContentLoaded", function() { 2 const thumbsUpButtons = document.querySelectorAll(".thumb.thumbup"); 3 const thumbsDownButtons = document.querySelectorAll(".thumb.thumbdown"); 4 5 let isVotingAllowed = true; 6 7 function submitRating(surveyID, voteType) { 8 if (!isVotingAllowed) return; 9 10 isVotingAllowed = false; 11 12 const request = new XMLHttpRequest(); 13 request.open("POST", "https://www.localconditions.com/wxrate.php", true); 14 request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 15 16 request.onreadystatechange = function() { 17 if (request.readyState == 4 && request.status == 200) { 18 const response = JSON.parse(request.responseText); 19 const surveyDiv = document.getElementById(surveyID); 20 21 if (response.error) { 22 alert(response.error); 23 setTimeout(() => { 24 surveyDiv.classList.remove("rateDisabled"); 25 }, 1000); 26 }else if (response.success) { 27 const upCount = document.getElementById(`up-count-${surveyID}`); 28 const downCount = document.getElementById(`down-count-${surveyID}`); 29 30 upCount.textContent = response.up; 31 downCount.textContent = response.down; 32 33 upCount.disabled = false; 34 surveyDiv.classList.remove("rateDisabled"); 35 } 36 setTimeout(() => { 37 isVotingAllowed = true; 38 }, 500); // 0.5 second cooldown 39 } 40 }; 41 42 request.send(`surveyID=${surveyID}&voteType=${voteType}`); 43 } 44 45 thumbsUpButtons.forEach(button => { 46 button.addEventListener("click", function() { 47 const surveyID = this.getAttribute("data-id"); 48 const surveyDiv = document.getElementById(surveyID); 49 if (surveyDiv) { 50 surveyDiv.classList.add("rateDisabled"); 51 } 52 submitRating(surveyID, 'up'); 53 }); 54 }); 55 56 thumbsDownButtons.forEach(button => { 57 button.addEventListener("click", function() { 58 const surveyID = this.getAttribute("data-id"); 59 const surveyDiv = document.getElementById(surveyID); 60 if (surveyDiv) { 61 surveyDiv.classList.add("rateDisabled"); 62 } 63 submitRating(surveyID, 'down'); 64 }); 65 }); 66});
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.