![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mets.corals.io/wp-content/plugins/wp-smushit/_src/js/ |
import '../scss/common.scss'; /* global ajaxurl */ document.addEventListener('DOMContentLoaded', function () { const dismissNoticeButton = document.querySelectorAll( '.smush-dismissible-notice .smush-dismiss-notice-button' ); dismissNoticeButton.forEach((button) => { button.addEventListener('click', dismissNotice); }); function dismissNotice(event) { event.preventDefault(); const button = event.target; const notice = button.closest('.smush-dismissible-notice'); const key = notice.getAttribute('data-key'); const xhr = new XMLHttpRequest(); xhr.open( 'POST', ajaxurl + '?action=smush_dismiss_notice&key=' + key + '&_ajax_nonce=' + smush_global.nonce, true ); xhr.onload = () => { if (notice) { notice.querySelector('button.notice-dismiss').dispatchEvent(new MouseEvent('click', { view: window, bubbles: true, cancelable: true })); } }; xhr.send(); } });