1const WPF_Subscribe = {}; 2document.addEventListener("DOMContentLoaded", () => { 3 const subscribe_btn = document.querySelector(".crgs-resend-newsletter-email-subscribe"); 4 const resent_success_message = document.querySelector(".crgs-resent-subscription-message"); 5 if(resent_success_message){ 6 resent_success_message.style.display = 'none'; 7 } 8 if (subscribe_btn) { 9 subscribe_btn.addEventListener("click", function (e) { 10 e.preventDefault(); 11 WPF_Subscribe.resendNewsletterSubscribeEmail(); 12 return false; 13 }); 14 } 15}); 16 17WPF_Subscribe.resendNewsletterSubscribeEmail = async function () { 18 let url = l36ca_newsman_subscribe.ajax_url; 19 url += '?' + (new URLSearchParams({ 20 'action': 'resend_subscribe_email', 21 'e': new URLSearchParams(window.location.search).get('your-email'), 22 '_ajax_nonce': l36ca_newsman_subscribe.nonce, 23 })).toString(); 24 25 try { 26 const response = await fetch(url, { 27 method: 'GET', 28 headers: { 29 Accept: 'application/json', 30 'Content-Type': 'application/json' 31 }, 32 } 33 ); 34 if (!response.ok) { 35 throw new Error(__("Newsletter subscribe email resend error: ") + response.status); 36 } 37 38 const json_resp = await response.json(); 39 console.log(json_resp); 40 if (!json_resp.success) { 41 throw new Error(json_resp.data[0].message); 42 } 43 44 const resent_success_message = document.querySelector(".crgs-resent-subscription-message"); 45 const crgs_spam_message = document.querySelector(".crgs-spam-message"); 46 const crgs_resend_link = document.querySelector(".crgs-resend-newsletter-email-subscribe"); 47 if(resent_success_message){ 48 resent_success_message.style.display = 'flex'; 49 crgs_spam_message.style.display = 'none'; 50 crgs_resend_link.style.display = 'none'; 51 } 52 53 } catch (error) { 54 console.error(error.message); 55 // response_el.innerHTML = `<h4 class="newsman-resubscribe-error">${error.message}</h4>`; 56 } 57 58 59 return false; 60}
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.