1jQuery(function ($) { 2 // jQuery based code here 3 const updated = new Date(wm.privacy_policy_effective_date).toUTCString(); 4 5 (() => { 6 let policyUpdated = "wm-privacy-policy-updated" + "="; 7 let name = "wm-privacy-policy" + "="; 8 9 let decodedCookie = decodeURIComponent(document.cookie); 10 let ca = decodedCookie.split(';'); 11 12 let accepted = false; 13 let policyDated = null; 14 15 for (let i = 0; i < ca.length; i++) { 16 let c = ca[i]; 17 18 while (c.charAt(0) == ' ') { 19 c = c.substring(1); 20 } 21 22 if (c.indexOf(name) == 0) { 23 accepted = c.substring(name.length, c.length); 24 } 25 26 if (c.indexOf(policyUpdated) == 0) { 27 policyDated = c.substring(policyUpdated.length, c.length); 28 } 29 } 30 31 if (accepted) { 32 if (Date.parse(policyDated) == Date.parse(updated)) { 33 document.getElementById("PrivacyPolicyFooter").classList.add("d-none"); 34 } 35 } 36 })(); 37 38 $("#privacy-policy-close-btn").on("click", function (e) { 39 e.preventDefault(); 40 const d = new Date(); 41 d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); 42 let expires = "expires=" + d.toUTCString(); 43 document.cookie = "wm-privacy-policy-updated" + "=" + updated + ";" + expires + ";path=/"; 44 document.cookie = "wm-privacy-policy" + "=" + "true" + ";" + expires + ";path=/"; 45 document.getElementById("PrivacyPolicyFooter").classList.add("d-none"); 46 }); 47 48 // Service Area Selection 49 $("select#service-area-select").on("change", function (e) { 50 e.preventDefault(); 51 52 const selectedOption = e.target.options[e.target.selectedIndex]; 53 54 if (selectedOption.dataset?.serviceArea == 'page') { 55 window.location.href = e.target.value; 56 } 57 58 if (selectedOption.dataset?.serviceArea == 'modal') { 59 fetch(wm.ajax_url, { 60 method: "POST", 61 headers: { 62 "Content-Type": "application/x-www-form-urlencoded", 63 }, 64 body: new URLSearchParams({ 65 action: "fetch_bc_sa", 66 id: e.target.value, 67 nonce: wm.nonce 68 }), 69 }) 70 .then(response => response.json()) 71 .then(res => { 72 if (res.success) { 73 let modalBody = document.querySelector("#bcServiceAreaModal .modal-body"); 74 modalBody.innerHTML = res.data.content; 75 let modal = new bootstrap.Modal(document.getElementById("bcServiceAreaModal")); 76 modal.show(); 77 } 78 }) 79 .catch(error => console.error("Error fetching posts:", error)); 80 } 81 82 $("select#service-area-select").prop("selectedIndex", 0); 83 }); 84 85 // BC Service Area Modal 86 $("a.bc-sa").on("click", function (e) { 87 e.preventDefault(); 88 89 fetch(wm.ajax_url, { 90 method: "POST", 91 headers: { 92 "Content-Type": "application/x-www-form-urlencoded", 93 }, 94 body: new URLSearchParams({ 95 action: "fetch_bc_sa_segment", 96 segment: e.currentTarget.getAttribute("data-sa"), 97 nonce: wm.nonce 98 }), 99 }) 100 .then(response => response.json()) 101 .then(res => { 102 console.log(res); 103 if (res.success) { 104 let modalBody = document.querySelector("#bcServiceAreaModal .modal-body"); 105 modalBody.innerHTML = res.data.content; 106 let modal = new bootstrap.Modal(document.getElementById("bcServiceAreaModal")); 107 modal.show(); 108 } 109 }) 110 .catch(error => console.error("Error fetching posts:", error)); 111 }); 112 113 // Print modal content 114 $(document).on("click", ".print-modal-body", function () { 115 let modalBody = $(this).closest(".modal-content").find(".modal-body").html(); // Get closest modal body content 116 117 let printWindow = window.open("", "_blank"); 118 printWindow.document.write(` 119 <html> 120 <head> 121 <title>Print</title> 122 <style> 123 body { font-family: Arial, sans-serif; padding: 20px; } 124 </style> 125 </head> 126 <body> 127 ${modalBody} 128 </body> 129 </html> 130 `); 131 printWindow.document.close(); 132 printWindow.focus(); 133 printWindow.print(); 134 printWindow.close(); 135 }); 136 137 // OneTrust Cookie Consent 138 $("a#one_trust").on("click", function (e) { 139 e.preventDefault(); 140 window.OneTrust?.ToggleInfoDisplay(); 141 }); 142});
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.