1 line
834 B
JavaScript
1 line
834 B
JavaScript
!function(){"use strict";!function(){const n=()=>document.getElementById("hostinger-reach-connection-notice"),e=e=>{const t=new FormData;t.append("action",hostinger_reach_connection_notice_data.action),t.append("nonce",hostinger_reach_connection_notice_data.nonce),t.append("choice",e),fetch(hostinger_reach_connection_notice_data.ajaxurl,{method:"POST",body:t}).then(n=>n.json()).then(e=>{e.success&&e.data.redirect_url&&(window.location.href=e.data.redirect_url);const t=n().querySelector(".notice-dismiss");t&&t.click(),notice.style.display="none"})};document.addEventListener("DOMContentLoaded",()=>{const t=n();if(!t||!hostinger_reach_connection_notice_data)return;const c=t.querySelectorAll(".hostinger-reach-action-button");c?.length&&c.forEach(n=>{n.addEventListener("click",function(n){e(n.target.dataset.action)})})})}()}(); |