Server IP : 104.21.14.48 / Your IP : 3.17.179.193 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/mu-plugins/object-cache-pro/resources/js/ |
Upload File : |
window.addEventListener('load', function () { window.objectcache.options.init(); }); jQuery.extend(window.objectcache, { options: { init: function () { document.querySelector('#objectcache\\:options input[name="submit"]') .addEventListener('click', window.objectcache.options.submit); }, submit: function (event) { event.preventDefault(); event.target.disabled = true; window.objectcache.options.dismissAdminNotice(); var form = document.querySelector('#objectcache\\:options'); jQuery .ajax({ type: 'POST', url: objectcache.rest.url + 'objectcache/v1/options', data: new FormData(form), processData: false, contentType: false, beforeSend: function (xhr) { xhr.setRequestHeader('X-WP-Nonce', objectcache.rest.nonce); }, }) .done(function (data, status, xhr) { objectcache.rest.nonce = xhr.getResponseHeader('X-WP-Nonce') ?? objectcache.rest.nonce; window.objectcache.options.addAdminNotice({ message: 'Settings saved.', class: 'notice-success', }); }) .fail(function (error) { var message = 'Request failed (' + error.status + ').'; if (error.responseJSON && error.responseJSON.message) { message = error.responseJSON.message; // Use `error.responseJSON.additional_errors` as well? } window.objectcache.options.addAdminNotice({ message: message, class: 'notice-error', }); }) .always(function () { event.target.disabled = false; }); }, addAdminNotice: function (data) { data.id = 'objectcache:options-notice'; data.className = data.class + ' settings-error is-dismissible'; var noticeHtml = wp.template('objectcache-options-notice')(data); var $notice = jQuery('#objectcache\\:options-notice'); if ($notice.length) { $notice.replaceWith(noticeHtml); } else { jQuery('.wrap > h1').after(noticeHtml); } jQuery(document).trigger('wp-updates-notice-added'); }, dismissAdminNotice: function () { jQuery('#objectcache\\:options-notice .notice-dismiss').click(); }, }, });