2 lines
1.1 KiB
JavaScript
2 lines
1.1 KiB
JavaScript
!function(){"use strict";document.addEventListener("DOMContentLoaded",(function(){function s(s){s.preventDefault();var i=s.target.closest(".smush-dismissible-notice");e(i.getAttribute("data-key"),i)}function e(s,e){var i=new XMLHttpRequest;i.open("POST",ajaxurl+"?action=smush_dismiss_notice&key="+s+"&_ajax_nonce="+smush_global.nonce,!0),i.onload=function(){e&&e.querySelector("button.notice-dismiss").dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))},i.send()}document.querySelectorAll(".smush-dismissible-notice .smush-dismiss-notice-button").forEach((function(e){e.addEventListener("click",s)}));!function(){var s=document.querySelector(".wp-smush-dismissible-header-notice");if(s&&s.id){var i=s.dataset,t=i.dismissKey,n=i.message;if(t&&n){s.onclick=function(s){var i=s.target.classList;i&&(i.contains("sui-icon-check")||i.contains("sui-button-icon"))&&e(t)};var o={type:"warning",icon:"info",dismiss:{show:!0,label:wp_smush_msgs.noticeDismiss,tooltip:wp_smush_msgs.noticeDismissTooltip}};window.SUI.openNotice(s.id,n,o)}}}()}))}();
|
|
//# sourceMappingURL=smush-global.min.js.map
|